From 27b6f931dbb7bfa7b72d0eefaad53ed20a6186c0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 08:06:48 +0000 Subject: import libvirt-3.9.0-14.el7_5.2 --- diff --git a/SOURCES/libvirt-conf-Check-for-user-aliases-duplicates-only.patch b/SOURCES/libvirt-conf-Check-for-user-aliases-duplicates-only.patch new file mode 100644 index 0000000..b73c661 --- /dev/null +++ b/SOURCES/libvirt-conf-Check-for-user-aliases-duplicates-only.patch @@ -0,0 +1,40 @@ +From 3860c41885fc2365dd10559dbc6c721265673a36 Mon Sep 17 00:00:00 2001 +Message-Id: <3860c41885fc2365dd10559dbc6c721265673a36@dist-git> +From: Michal Privoznik +Date: Wed, 14 Mar 2018 08:18:44 +0100 +Subject: [PATCH] conf: Check for user aliases duplicates only + +RHEL-7.6: https://bugzilla.redhat.com/show_bug.cgi?id=1553162 +RHEL-7.5.z: https://bugzilla.redhat.com/show_bug.cgi?id=1554962 + +When validating a device XML config we check if user provided +alias is unique. We do this by maintaining a hash table of device +aliases as we iterated over all devices defined for the domain. +However, it may happen that what appears as two devices in domain +XML is in fact just one interface in hypervisor. We can assume +libvirt generated aliases to be unique and thus really check user +provided ones only. + +Signed-off-by: Michal Privoznik +(cherry picked from commit e43263601fe27feb8d005668528f35f75428b8c6) +Signed-off-by: Michal Privoznik +--- + src/conf/domain_conf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index c746ab19cd..a0c0702a6c 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -5560,7 +5560,7 @@ virDomainDeviceDefValidateAliasesIterator(virDomainDefPtr def, + struct virDomainDefValidateAliasesData *data = opaque; + const char *alias = info->alias; + +- if (!alias) ++ if (!alias || !virDomainDeviceAliasIsUserAlias(alias)) + return 0; + + /* Some crazy backcompat for consoles. */ +-- +2.16.2 + diff --git a/SOURCES/libvirt-virDomainDeviceDefValidateAliasesIterator-Ignore-some-hostdevs.patch b/SOURCES/libvirt-virDomainDeviceDefValidateAliasesIterator-Ignore-some-hostdevs.patch new file mode 100644 index 0000000..85cd1d5 --- /dev/null +++ b/SOURCES/libvirt-virDomainDeviceDefValidateAliasesIterator-Ignore-some-hostdevs.patch @@ -0,0 +1,47 @@ +From 91bf4656fec73b8a083d7dae0a98490196f6dcbe Mon Sep 17 00:00:00 2001 +Message-Id: <91bf4656fec73b8a083d7dae0a98490196f6dcbe@dist-git> +From: Michal Privoznik +Date: Fri, 16 Mar 2018 12:33:12 +0100 +Subject: [PATCH] virDomainDeviceDefValidateAliasesIterator: Ignore some + hostdevs + +https://bugzilla.redhat.com/show_bug.cgi?id=1556828 + +When defining a domain that has our +parser creates two entries in virDomainDef: one for +and one for . However, some info is shared between the +two which makes user alias validation fail because alias belongs +to the set of shared info. + +Signed-off-by: Michal Privoznik +Reviewed-by: Jiri Denemark +(cherry picked from commit 630c6e34957666f20a66167c7a512e65fc711aa0) + +https://bugzilla.redhat.com/show_bug.cgi?id=1558655 + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index a0c0702a6c..031d4b8e55 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -5571,6 +5571,13 @@ virDomainDeviceDefValidateAliasesIterator(virDomainDefPtr def, + virDomainChrEquals(def->serials[0], dev->data.chr)) + return 0; + ++ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV && ++ dev->data.hostdev->parent.type == VIR_DOMAIN_DEVICE_NET) { ++ /* This hostdev is a copy of some previous interface. ++ * Aliases are duplicated. */ ++ return 0; ++ } ++ + if (virHashLookup(data->aliases, alias)) { + virReportError(VIR_ERR_XML_ERROR, + _("non unique alias detected: %s"), +-- +2.16.2 + diff --git a/SOURCES/libvirt-virDomainDeviceValidateAliasForHotplug-Use-correct-domain-defintion.patch b/SOURCES/libvirt-virDomainDeviceValidateAliasForHotplug-Use-correct-domain-defintion.patch new file mode 100644 index 0000000..bf45bd8 --- /dev/null +++ b/SOURCES/libvirt-virDomainDeviceValidateAliasForHotplug-Use-correct-domain-defintion.patch @@ -0,0 +1,43 @@ +From 9c5bfad7725766860abf41d47a55f6fbdd9130bb Mon Sep 17 00:00:00 2001 +Message-Id: <9c5bfad7725766860abf41d47a55f6fbdd9130bb@dist-git> +From: Michal Privoznik +Date: Wed, 14 Mar 2018 08:18:43 +0100 +Subject: [PATCH] virDomainDeviceValidateAliasForHotplug: Use correct domain + defintion + +RHEL-7.6: https://bugzilla.redhat.com/show_bug.cgi?id=1543775 +RHEL-7.5.z: https://bugzilla.redhat.com/show_bug.cgi?id=1554928 + +For some weird reason this function is getting live and +persistent def for domain but then accesses vm->def and +vm->newDef directly. This is rather unsafe as we can be +accessing NULL pointer. + +Signed-off-by: Michal Privoznik +(cherry picked from commit e5673ed44465edcfccdd906158136ad8dcb94b9b) +Signed-off-by: Michal Privoznik +--- + src/conf/domain_conf.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 1a3db4a7be..c746ab19cd 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -5666,11 +5666,11 @@ virDomainDeviceValidateAliasForHotplug(virDomainObjPtr vm, + return -1; + + if (persDef && +- virDomainDeviceValidateAliasImpl(vm->def, dev) < 0) ++ virDomainDeviceValidateAliasImpl(persDef, dev) < 0) + return -1; + + if (liveDef && +- virDomainDeviceValidateAliasImpl(vm->newDef, dev) < 0) ++ virDomainDeviceValidateAliasImpl(liveDef, dev) < 0) + return -1; + + return 0; +-- +2.16.2 + diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec index 0da1b6e..ebe7b59 100644 --- a/SPECS/libvirt.spec +++ b/SPECS/libvirt.spec @@ -240,7 +240,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 3.9.0 -Release: 14%{?dist}%{?extra_release} +Release: 14%{?dist}.2%{?extra_release} License: LGPLv2+ Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -438,6 +438,9 @@ Patch184: libvirt-qemu-Remove-unused-cpuhalted-argument-from-qemuDomainHelperGet Patch185: libvirt-qemu-domain-Store-vcpu-halted-state-as-a-tristate.patch Patch186: libvirt-qemu-Limit-refresh-of-CPU-halted-state-to-s390.patch Patch187: libvirt-conf-move-generated-member-from-virMacAddr-to-virDomainNetDef.patch +Patch188: libvirt-virDomainDeviceValidateAliasForHotplug-Use-correct-domain-defintion.patch +Patch189: libvirt-conf-Check-for-user-aliases-duplicates-only.patch +Patch190: libvirt-virDomainDeviceDefValidateAliasesIterator-Ignore-some-hostdevs.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -2351,6 +2354,13 @@ exit 0 %changelog +* Tue Mar 20 2018 Jiri Denemark - 3.9.0-14.el7_5.2 +- virDomainDeviceDefValidateAliasesIterator: Ignore some hostdevs (rhbz#1558655) + +* Wed Mar 14 2018 Jiri Denemark - 3.9.0-14.el7_5.1 +- virDomainDeviceValidateAliasForHotplug: Use correct domain defintion (rhbz#1554928) +- conf: Check for user aliases duplicates only (rhbz#1554962) + * Wed Mar 7 2018 Jiri Denemark - 3.9.0-14 - conf: move 'generated' member from virMacAddr to virDomainNetDef (rhbz#1529338)