Update to 1.2.16 release
This commit is contained in:
parent
19dcb913e6
commit
c81949046d
@ -1,225 +0,0 @@
|
||||
From 31479ae566d887ce4b864ef84fee99305041aaf1 Mon Sep 17 00:00:00 2001
|
||||
From: Cole Robinson <crobinso@redhat.com>
|
||||
Date: Wed, 6 May 2015 18:59:46 -0400
|
||||
Subject: [PATCH] caps: Don't default to i686 of KVM on x86_64
|
||||
|
||||
My commit 747761a79 (v1.2.15 only) dropped this bit of logic when filling
|
||||
in a default arch in the XML:
|
||||
|
||||
- /* First try to find one matching host arch */
|
||||
- for (i = 0; i < caps->nguests; i++) {
|
||||
- if (caps->guests[i]->ostype == ostype) {
|
||||
- for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
|
||||
- if (caps->guests[i]->arch.domains[j]->type == domain &&
|
||||
- caps->guests[i]->arch.id == caps->host.arch)
|
||||
- return caps->guests[i]->arch.id;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
|
||||
That attempt to match host.arch is important, otherwise we end up
|
||||
defaulting to i686 on x86_64 host for KVM, which is not intended.
|
||||
Duplicate it in the centralized CapsLookup function.
|
||||
|
||||
Additionally add some testcases that would have caught this.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1219191
|
||||
(cherry picked from commit 67b3c04b139d697e4aab01c0f676e356bbef5c52)
|
||||
---
|
||||
src/conf/capabilities.c | 63 +++++++++++++++-------
|
||||
.../qemuxml2argv-default-kvm-host-arch.args | 4 ++
|
||||
.../qemuxml2argv-default-kvm-host-arch.xml | 11 ++++
|
||||
tests/qemuxml2argvtest.c | 1 +
|
||||
.../qemuxml2xmlout-default-kvm-host-arch.xml | 21 ++++++++
|
||||
tests/qemuxml2xmltest.c | 1 +
|
||||
tests/testutilsqemu.c | 12 +++++
|
||||
7 files changed, 94 insertions(+), 19 deletions(-)
|
||||
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.args
|
||||
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.xml
|
||||
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-default-kvm-host-arch.xml
|
||||
|
||||
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
|
||||
index 922741f..c43bfb3 100644
|
||||
--- a/src/conf/capabilities.c
|
||||
+++ b/src/conf/capabilities.c
|
||||
@@ -607,25 +607,13 @@ virCapsDomainDataCompare(virCapsGuestPtr guest,
|
||||
return true;
|
||||
}
|
||||
|
||||
-/**
|
||||
- * virCapabilitiesDomainDataLookup:
|
||||
- * @caps: capabilities to query
|
||||
- * @ostype: guest operating system type, of enum VIR_DOMAIN_OSTYPE
|
||||
- * @arch: Architecture to search for
|
||||
- * @domaintype: domain type to search for, of enum VIR_DOMAIN_VIRT
|
||||
- * @emulator: Emulator path to search for
|
||||
- * @machinetype: Machine type to search for
|
||||
- *
|
||||
- * Search capabilities for the passed values, and if found return
|
||||
- * virCapabilitiesDomainDataLookup filled in with the default values
|
||||
- */
|
||||
-virCapsDomainDataPtr
|
||||
-virCapabilitiesDomainDataLookup(virCapsPtr caps,
|
||||
- int ostype,
|
||||
- virArch arch,
|
||||
- int domaintype,
|
||||
- const char *emulator,
|
||||
- const char *machinetype)
|
||||
+static virCapsDomainDataPtr
|
||||
+virCapabilitiesDomainDataLookupInternal(virCapsPtr caps,
|
||||
+ int ostype,
|
||||
+ virArch arch,
|
||||
+ int domaintype,
|
||||
+ const char *emulator,
|
||||
+ const char *machinetype)
|
||||
{
|
||||
virCapsGuestPtr foundguest = NULL;
|
||||
virCapsGuestDomainPtr founddomain = NULL;
|
||||
@@ -730,6 +718,43 @@ virCapabilitiesDomainDataLookup(virCapsPtr caps,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * virCapabilitiesDomainDataLookup:
|
||||
+ * @caps: capabilities to query
|
||||
+ * @ostype: guest operating system type, of enum VIR_DOMAIN_OSTYPE
|
||||
+ * @arch: Architecture to search for
|
||||
+ * @domaintype: domain type to search for, of enum VIR_DOMAIN_VIRT
|
||||
+ * @emulator: Emulator path to search for
|
||||
+ * @machinetype: Machine type to search for
|
||||
+ *
|
||||
+ * Search capabilities for the passed values, and if found return
|
||||
+ * virCapabilitiesDomainDataLookup filled in with the default values
|
||||
+ */
|
||||
+virCapsDomainDataPtr
|
||||
+virCapabilitiesDomainDataLookup(virCapsPtr caps,
|
||||
+ int ostype,
|
||||
+ virArch arch,
|
||||
+ int domaintype,
|
||||
+ const char *emulator,
|
||||
+ const char *machinetype)
|
||||
+{
|
||||
+ virCapsDomainDataPtr ret;
|
||||
+
|
||||
+ if (arch == VIR_ARCH_NONE) {
|
||||
+ /* Prefer host arch if its available */
|
||||
+ ret = virCapabilitiesDomainDataLookupInternal(caps, ostype,
|
||||
+ caps->host.arch,
|
||||
+ domaintype,
|
||||
+ emulator, machinetype);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return virCapabilitiesDomainDataLookupInternal(caps, ostype,
|
||||
+ arch, domaintype,
|
||||
+ emulator, machinetype);
|
||||
+}
|
||||
+
|
||||
static int
|
||||
virCapabilitiesFormatNUMATopology(virBufferPtr buf,
|
||||
size_t ncells,
|
||||
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.args b/tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.args
|
||||
new file mode 100644
|
||||
index 0000000..102691f
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.args
|
||||
@@ -0,0 +1,4 @@
|
||||
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
||||
+/usr/bin/kvm -S -machine pc,accel=kvm -m 4096 -smp 4 -nographic \
|
||||
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -net none \
|
||||
+-serial none -parallel none
|
||||
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.xml b/tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.xml
|
||||
new file mode 100644
|
||||
index 0000000..66dead0
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.xml
|
||||
@@ -0,0 +1,11 @@
|
||||
+<domain type='kvm'>
|
||||
+ <name>kvm</name>
|
||||
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
|
||||
+ <memory unit='KiB'>4194304</memory>
|
||||
+ <currentMemory unit='KiB'>4194304</currentMemory>
|
||||
+ <vcpu placement='static'>4</vcpu>
|
||||
+ <os>
|
||||
+ <type>hvm</type>
|
||||
+ <boot dev='hd'/>
|
||||
+ </os>
|
||||
+</domain>
|
||||
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
|
||||
index 4acaa11..df4c9f5 100644
|
||||
--- a/tests/qemuxml2argvtest.c
|
||||
+++ b/tests/qemuxml2argvtest.c
|
||||
@@ -595,6 +595,7 @@ mymain(void)
|
||||
DO_TEST("machine-usb-opt", QEMU_CAPS_MACHINE_OPT,
|
||||
QEMU_CAPS_MACHINE_USB_OPT);
|
||||
DO_TEST("kvm", QEMU_CAPS_MACHINE_OPT);
|
||||
+ DO_TEST("default-kvm-host-arch", QEMU_CAPS_MACHINE_OPT);
|
||||
DO_TEST("boot-cdrom", NONE);
|
||||
DO_TEST("boot-network", NONE);
|
||||
DO_TEST("boot-floppy", NONE);
|
||||
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-default-kvm-host-arch.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-default-kvm-host-arch.xml
|
||||
new file mode 100644
|
||||
index 0000000..30fa66d
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-default-kvm-host-arch.xml
|
||||
@@ -0,0 +1,21 @@
|
||||
+<domain type='kvm'>
|
||||
+ <name>kvm</name>
|
||||
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
|
||||
+ <memory unit='KiB'>4194304</memory>
|
||||
+ <currentMemory unit='KiB'>4194304</currentMemory>
|
||||
+ <vcpu placement='static'>4</vcpu>
|
||||
+ <os>
|
||||
+ <type arch='x86_64' machine='pc'>hvm</type>
|
||||
+ <boot dev='hd'/>
|
||||
+ </os>
|
||||
+ <clock offset='utc'/>
|
||||
+ <on_poweroff>destroy</on_poweroff>
|
||||
+ <on_reboot>restart</on_reboot>
|
||||
+ <on_crash>destroy</on_crash>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/kvm</emulator>
|
||||
+ <controller type='usb' index='0'/>
|
||||
+ <controller type='pci' index='0' model='pci-root'/>
|
||||
+ <memballoon model='virtio'/>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
|
||||
index b611afd..a21a299 100644
|
||||
--- a/tests/qemuxml2xmltest.c
|
||||
+++ b/tests/qemuxml2xmltest.c
|
||||
@@ -346,6 +346,7 @@ mymain(void)
|
||||
DO_TEST("minimal");
|
||||
DO_TEST("machine-core-on");
|
||||
DO_TEST("machine-core-off");
|
||||
+ DO_TEST_DIFFERENT("default-kvm-host-arch");
|
||||
DO_TEST("boot-cdrom");
|
||||
DO_TEST("boot-network");
|
||||
DO_TEST("boot-floppy");
|
||||
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
|
||||
index 14743be..d067bca 100644
|
||||
--- a/tests/testutilsqemu.c
|
||||
+++ b/tests/testutilsqemu.c
|
||||
@@ -354,6 +354,18 @@ virCapsPtr testQemuCapsInit(void)
|
||||
NULL) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
+ if ((machines = testQemuAllocMachines(&nmachines)) == NULL)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ if (virCapabilitiesAddGuestDomain(guest,
|
||||
+ VIR_DOMAIN_VIRT_KVM,
|
||||
+ "/usr/bin/qemu-kvm",
|
||||
+ NULL,
|
||||
+ nmachines,
|
||||
+ machines) == NULL)
|
||||
+ goto cleanup;
|
||||
+ machines = NULL;
|
||||
+
|
||||
if ((machines = testQemuAllocNewerMachines(&nmachines)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
--
|
||||
2.3.1
|
||||
|
31
libvirt.spec
31
libvirt.spec
@ -377,8 +377,8 @@
|
||||
|
||||
Summary: Library providing a simple virtualization API
|
||||
Name: libvirt
|
||||
Version: 1.2.15
|
||||
Release: 2%{?dist}%{?extra_release}
|
||||
Version: 1.2.16
|
||||
Release: 1%{?dist}%{?extra_release}
|
||||
License: LGPLv2+
|
||||
Group: Development/Libraries
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
@ -389,8 +389,6 @@ URL: http://libvirt.org/
|
||||
%endif
|
||||
Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz
|
||||
|
||||
Patch1: 0001-caps-Don-t-default-to-i686-of-KVM-on-x86_64.patch
|
||||
|
||||
%if %{with_libvirtd}
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
%if %{with_network}
|
||||
@ -1603,6 +1601,7 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
|
||||
%endif
|
||||
%if ! %{with_libxl}
|
||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libxl.conf
|
||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_libxl.aug
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
|
||||
%endif
|
||||
@ -1647,9 +1646,9 @@ then
|
||||
fi
|
||||
|
||||
%if %{with_libvirtd}
|
||||
%pre daemon
|
||||
%if ! %{with_driver_modules}
|
||||
%if %{with_qemu}
|
||||
%pre daemon
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||
# We want soft static allocation of well-known ids, as disk images
|
||||
# are commonly shared across NFS mounts by id rather than name; see
|
||||
@ -1663,10 +1662,20 @@ if ! getent passwd qemu >/dev/null; then
|
||||
useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if %{with_polkit}
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||
# 'libvirt' group is just to allow password-less polkit access to
|
||||
# libvirtd. The uid number is irrelevant, so we use dynamic allocation
|
||||
# described at the above link.
|
||||
getent group libvirt >/dev/null || groupadd -r libvirt
|
||||
%endif
|
||||
%endif
|
||||
|
||||
exit 0
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%post daemon
|
||||
|
||||
@ -1941,6 +1950,7 @@ exit 0
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
|
||||
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
|
||||
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
|
||||
%else
|
||||
%{_datadir}/PolicyKit/policy/org.libvirt.unix.policy
|
||||
%endif
|
||||
@ -2009,6 +2019,7 @@ exit 0
|
||||
%endif
|
||||
%if %{with_libxl}
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
|
||||
%ghost %dir %{_localstatedir}/run/libvirt/libxl/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
|
||||
@ -2131,6 +2142,7 @@ exit 0
|
||||
%files daemon-driver-libxl
|
||||
%defattr(-, root, root)
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
|
||||
%{_datadir}/augeas/lenses/libvirtd_libxl.aug
|
||||
@ -2307,6 +2319,9 @@ exit 0
|
||||
%doc examples/systemtap
|
||||
|
||||
%changelog
|
||||
* Mon Jun 01 2015 Daniel P. Berrange <berrange@redhat.com> - 1.2.16-1
|
||||
- Update to 1.2.16 release
|
||||
|
||||
* Thu May 07 2015 Richard W.M. Jones <rjones@redhat.com> - 1.2.15-2
|
||||
- Add Cole Robinson's patch to fix arch selection (bz# 1219198, bz#1219191)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user