From 7cf89a9d505a56b5f32b130c475c9b16f69a41d7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 15 2015 11:42:56 +0000 Subject: import libvirt-1.2.8-16.el7_1.4 --- diff --git a/SOURCES/libvirt-Really-fix-XML-formatting-flags-in-SaveImageUpdateDef.patch b/SOURCES/libvirt-Really-fix-XML-formatting-flags-in-SaveImageUpdateDef.patch new file mode 100644 index 0000000..7490665 --- /dev/null +++ b/SOURCES/libvirt-Really-fix-XML-formatting-flags-in-SaveImageUpdateDef.patch @@ -0,0 +1,38 @@ +From c6b02db1183324ffd5e5f458d7922fb2e082f4ae Mon Sep 17 00:00:00 2001 +Message-Id: +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Fri, 21 Aug 2015 10:50:57 -0700 +Subject: [PATCH] Really fix XML formatting flags in SaveImageUpdateDef + +Commit cf2d4c6 used a logical or instead of bitwise or, +effectively passing 1, that is VIR_DOMAIN_XML_INACTIVE. + +This was caught by a warning when building with clang. + +https://bugzilla.redhat.com/show_bug.cgi?id=1183869 [7.2.0] +https://bugzilla.redhat.com/show_bug.cgi?id=1254164 [7.2.0] +https://bugzilla.redhat.com/show_bug.cgi?id=1255859 [7.1.z] + +(cherry picked from commit c75f42f3318463b0555edac333c8f20d54b4d5dc) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 299cf7b..b6ce10c 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -5856,7 +5856,7 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, + + if (!(newdef_migr = qemuDomainDefCopy(driver, + newdef, +- QEMU_DOMAIN_FORMAT_LIVE_FLAGS || ++ QEMU_DOMAIN_FORMAT_LIVE_FLAGS | + VIR_DOMAIN_XML_MIGRATABLE))) + goto cleanup; + +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Use-correct-flags-for-ABI-stability-check-in-SaveImageUpdateDef.patch b/SOURCES/libvirt-qemu-Use-correct-flags-for-ABI-stability-check-in-SaveImageUpdateDef.patch new file mode 100644 index 0000000..68a06b6 --- /dev/null +++ b/SOURCES/libvirt-qemu-Use-correct-flags-for-ABI-stability-check-in-SaveImageUpdateDef.patch @@ -0,0 +1,69 @@ +From b90b606deb02320044248c8ce6727dc6ddb0a939 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Michal Privoznik +Date: Fri, 21 Aug 2015 10:50:56 -0700 +Subject: [PATCH] qemu: Use correct flags for ABI stability check in + SaveImageUpdateDef + +https://bugzilla.redhat.com/show_bug.cgi?id=1183869 [7.2.0] +https://bugzilla.redhat.com/show_bug.cgi?id=1254164 [7.2.0] +https://bugzilla.redhat.com/show_bug.cgi?id=1255859 [7.1.z] + +Soo. you've successfully started yourself a domain. And since you want +to use it on your host exclusively you are confident enough to +passthrough the host CPU model, like this: + + + +Then, after a while, you want to save the domain into a file (e.g. +virsh save dom dom.save). And here comes the trouble. The file consist +of two parts: Libvirt header (containing domain XML among other +things), and qemu migration data. Now, the domain XML in the header is +formatted using special flags (VIR_DOMAIN_XML_SECURE | +VIR_DOMAIN_XML_UPDATE_CPU | VIR_DOMAIN_XML_INACTIVE | +VIR_DOMAIN_XML_MIGRATABLE). + +Then, on your way back from the bar, you think of changing something +in the XML in the saved file (we have a command for it after all), say +listen address for graphics console. So you successfully type in the +command: + + virsh save-image-edit dom.save + +Change all the bits, and exit the editor. But instead of success +you're left with sad error message: + + error: unsupported configuration: Target CPU model does not + match source Pentium Pro + +Sigh. Digging into the code you see lines, where we check for ABI +stability. The new XML you've produced is compared with the old one +from the saved file to see if qemu ABI will break or not. Wait, what? +We are using different flags to parse the XML you've provided so we +were just lucky it worked in some cases? Yep, that's right. + +Signed-off-by: Michal Privoznik +(cherry picked from commit cf2d4c603c37a58c7c6cacc87f0e78b45903ae7c) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 425cf90..299cf7b 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -5856,8 +5856,8 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, + + if (!(newdef_migr = qemuDomainDefCopy(driver, + newdef, +- VIR_DOMAIN_XML_MIGRATABLE | +- VIR_DOMAIN_XML_SECURE))) ++ QEMU_DOMAIN_FORMAT_LIVE_FLAGS || ++ VIR_DOMAIN_XML_MIGRATABLE))) + goto cleanup; + + if (!virDomainDefCheckABIStability(def, newdef_migr)) { +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-fix-cannot-set-graphic-passwd-via-qemuDomainSaveImageDefineXML.patch b/SOURCES/libvirt-qemu-fix-cannot-set-graphic-passwd-via-qemuDomainSaveImageDefineXML.patch new file mode 100644 index 0000000..2ec35c2 --- /dev/null +++ b/SOURCES/libvirt-qemu-fix-cannot-set-graphic-passwd-via-qemuDomainSaveImageDefineXML.patch @@ -0,0 +1,42 @@ +From ee6247cad53bf0af3a681de82931a5da67868881 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Luyao Huang +Date: Fri, 21 Aug 2015 10:50:55 -0700 +Subject: [PATCH] qemu: fix cannot set graphic passwd via + qemuDomainSaveImageDefineXML + +https://bugzilla.redhat.com/show_bug.cgi?id=1183890 [7.2.0] +https://bugzilla.redhat.com/show_bug.cgi?id=1254164 [7.2.0] +https://bugzilla.redhat.com/show_bug.cgi?id=1255859 [7.1.z] + +When we try to update a xml to a image file, we will clear the +graphics passwd settings, because we do not pass VIR_DOMAIN_XML_SECURE +to qemuDomainDefCopy, qemuDomainDefFormatBuf won't format the passwd. + +Add VIR_DOMAIN_XML_SECURE flag when we call qemuDomainDefCopy +in qemuDomainSaveImageUpdateDef. + +Signed-off-by: Luyao Huang +(cherry picked from commit f76df311e8896957b92d0e0c5251ee3e6754d9ac) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 5f7fedc..425cf90 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -5856,7 +5856,8 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, + + if (!(newdef_migr = qemuDomainDefCopy(driver, + newdef, +- VIR_DOMAIN_XML_MIGRATABLE))) ++ VIR_DOMAIN_XML_MIGRATABLE | ++ VIR_DOMAIN_XML_SECURE))) + goto cleanup; + + if (!virDomainDefCheckABIStability(def, newdef_migr)) { +-- +2.5.0 + diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec index 8977943..f70cff3 100644 --- a/SPECS/libvirt.spec +++ b/SPECS/libvirt.spec @@ -367,7 +367,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 1.2.8 -Release: 16%{?dist}.3%{?extra_release} +Release: 16%{?dist}.4%{?extra_release} License: LGPLv2+ Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -729,6 +729,9 @@ Patch348: libvirt-qemu-read-backing-chain-names-from-qemu.patch Patch349: libvirt-qemu-processBlockJob-Don-t-unlock-vm-twice.patch Patch350: libvirt-qemu-Extract-internals-of-processBlockJobEvent-into-a-helper.patch Patch351: libvirt-qemu-blockjob-Synchronously-update-backing-chain-in-XML-on-ABORT-PIVOT.patch +Patch352: libvirt-qemu-fix-cannot-set-graphic-passwd-via-qemuDomainSaveImageDefineXML.patch +Patch353: libvirt-qemu-Use-correct-flags-for-ABI-stability-check-in-SaveImageUpdateDef.patch +Patch354: libvirt-Really-fix-XML-formatting-flags-in-SaveImageUpdateDef.patch %if %{with_libvirtd} @@ -2597,6 +2600,11 @@ exit 0 %doc examples/systemtap %changelog +* Sun Aug 30 2015 Jiri Denemark - 1.2.8-16.el7_1.4 +- qemu: fix cannot set graphic passwd via qemuDomainSaveImageDefineXML (rhbz#1255859) +- qemu: Use correct flags for ABI stability check in SaveImageUpdateDef (rhbz#1255859) +- Really fix XML formatting flags in SaveImageUpdateDef (rhbz#1255859) + * Thu Apr 2 2015 Jiri Denemark - 1.2.8-16.el7_1.3 - qemu: processBlockJob: Don't unlock @vm twice (rhbz#1208021) - qemu: Extract internals of processBlockJobEvent into a helper (rhbz#1208021)