-- All of the target types support configuring the guest-visible device
-+ Most target types support configuring the guest-visible device
- address as documented above; more
- specifically, acceptable address types are isa (for
- isa-serial), usb (for usb-serial),
- pci (for pci-serial) and spapr-vio
-- (for spapr-vio-serial).
-+ (for spapr-vio-serial). The system-serial
-+ target type doesn't support specifying an address.
-
-@@ -6472,7 +6474,9 @@ qemu-kvm -net nic,model=? /dev/null
- isa-serial (usable with the isa-serial target
- type); usb-serial (usable with the usb-serial
- target type); pci-serial
-- (usable with the pci-serial target type).
-+ (usable with the pci-serial target type);
-+ spapr-vty (usable with the spapr-vio-serial
-+ target type).
-
-
-
-@@ -6484,8 +6488,9 @@ qemu-kvm -net nic,model=? /dev/null
- All of the target types support configuring the guest-visible device
- address as documented above; more
- specifically, acceptable address types are isa (for
-- isa-serial), usb (for usb-serial)
-- and pci (for pci-serial).
-+ isa-serial), usb (for usb-serial),
-+ pci (for pci-serial) and spapr-vio
-+ (for spapr-vio-serial).
-
-
-
-diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
-index 3630e539e6..027d9ae7a1 100644
---- a/docs/schemas/domaincommon.rng
-+++ b/docs/schemas/domaincommon.rng
-@@ -3571,6 +3571,7 @@
- isa-serial
- usb-serial
- pci-serial
-+ spapr-vio-serial
-
-
-
-@@ -3582,6 +3583,7 @@
- isa-serial
- usb-serial
- pci-serial
-+ spapr-vty
-
-
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 692b9d9414..97c7a66b5b 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -444,7 +444,9 @@ VIR_ENUM_IMPL(virDomainChrSerialTarget,
- "none",
- "isa-serial",
- "usb-serial",
-- "pci-serial")
-+ "pci-serial",
-+ "spapr-vio-serial",
-+);
-
- VIR_ENUM_IMPL(virDomainChrChannelTarget,
- VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST,
-@@ -471,6 +473,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel,
- "isa-serial",
- "usb-serial",
- "pci-serial",
-+ "spapr-vty",
- );
-
- VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST,
-@@ -4059,6 +4062,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def)
-
- switch ((virDomainChrSerialTargetType) def->serials[0]->targetType) {
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: {
-
- /* Create a stub console to match the serial port.
-diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
-index 9dfe9388cd..979e8cca00 100644
---- a/src/conf/domain_conf.h
-+++ b/src/conf/domain_conf.h
-@@ -1077,6 +1077,7 @@ typedef enum {
- VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA,
- VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB,
- VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI,
-+ VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO,
-
- VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST
- } virDomainChrSerialTargetType;
-@@ -1109,6 +1110,7 @@ typedef enum {
- VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL,
- VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL,
- VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL,
-+ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY,
-
- VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST
- } virDomainChrSerialTargetModel;
-diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
-index f8d5d317cd..91083dc73d 100644
---- a/src/qemu/qemu_command.c
-+++ b/src/qemu/qemu_command.c
-@@ -9227,6 +9227,8 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel)
- return QEMU_CAPS_DEVICE_USB_SERIAL;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL:
- return QEMU_CAPS_DEVICE_PCI_SERIAL;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY:
-+ return QEMU_CAPS_DEVICE_SPAPR_VTY;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST:
-@@ -10354,52 +10356,39 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
- virBuffer cmd = VIR_BUFFER_INITIALIZER;
- virQEMUCapsFlags caps;
-
-- if (qemuDomainIsPSeries(def)) {
-- if (serial->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
-- serial->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) {
-- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPAPR_VTY)) {
-- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-- _("spapr-vty not supported in this QEMU binary"));
-- goto error;
-- }
-+ switch ((virDomainChrSerialTargetModel) serial->targetModel) {
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY:
-
-- virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s",
-- serial->info.alias);
-- }
-- } else {
-- switch ((virDomainChrSerialTargetModel) serial->targetModel) {
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL:
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL:
-+ caps = qemuChrSerialTargetModelToCaps(serial->targetModel);
-
-- caps = qemuChrSerialTargetModelToCaps(serial->targetModel);
--
-- if (caps && !virQEMUCapsGet(qemuCaps, caps)) {
-- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-- _("'%s' is not supported in this QEMU binary"),
-- virDomainChrSerialTargetModelTypeToString(serial->targetModel));
-- goto error;
-- }
-- break;
--
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL:
-- break;
--
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE:
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST:
-- /* Except from _LAST, which is just a guard value and will never
-- * be used, all of the above are platform devices, which means
-- * qemuBuildSerialCommandLine() will have taken the appropriate
-- * branch and we will not have ended up here. */
-- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-- _("Invalid target model for serial device"));
-+ if (caps && !virQEMUCapsGet(qemuCaps, caps)) {
-+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-+ _("'%s' is not supported in this QEMU binary"),
-+ virDomainChrSerialTargetModelTypeToString(serial->targetModel));
- goto error;
- }
-+ break;
-
-- virBufferAsprintf(&cmd, "%s,chardev=char%s,id=%s",
-- virDomainChrSerialTargetModelTypeToString(serial->targetModel),
-- serial->info.alias, serial->info.alias);
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL:
-+ break;
-+
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST:
-+ /* Except from _LAST, which is just a guard value and will never
-+ * be used, all of the above are platform devices, which means
-+ * qemuBuildSerialCommandLine() will have taken the appropriate
-+ * branch and we will not have ended up here. */
-+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-+ _("Invalid target model for serial device"));
-+ goto error;
- }
-
-+ virBufferAsprintf(&cmd, "%s,chardev=char%s,id=%s",
-+ virDomainChrSerialTargetModelTypeToString(serial->targetModel),
-+ serial->info.alias, serial->info.alias);
-+
- if (qemuBuildDeviceAddressStr(&cmd, def, &serial->info, qemuCaps) < 0)
- goto error;
-
-diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
-index 7b5bc97de6..17c898896d 100644
---- a/src/qemu/qemu_domain.c
-+++ b/src/qemu/qemu_domain.c
-@@ -3466,6 +3466,8 @@ qemuDomainChrSerialTargetTypeToAddressType(int targetType)
- return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
- return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO:
-+ return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
- break;
-@@ -3485,6 +3487,8 @@ qemuDomainChrSerialTargetModelToTargetType(int targetModel)
- return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL:
- return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY:
-+ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST:
- break;
-@@ -3495,8 +3499,7 @@ qemuDomainChrSerialTargetModelToTargetType(int targetModel)
-
-
- static int
--qemuDomainChrTargetDefValidate(const virDomainDef *def,
-- const virDomainChrDef *chr)
-+qemuDomainChrTargetDefValidate(const virDomainChrDef *chr)
- {
- int expected;
-
-@@ -3508,11 +3511,7 @@ qemuDomainChrTargetDefValidate(const virDomainDef *def,
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
--
-- /* Hack required until we have a proper type for pSeries
-- * serial consoles */
-- if (qemuDomainIsPSeries(def))
-- return 0;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO:
-
- expected = qemuDomainChrSerialTargetTypeToAddressType(chr->targetType);
-
-@@ -3536,6 +3535,7 @@ qemuDomainChrTargetDefValidate(const virDomainDef *def,
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY:
-
- expected = qemuDomainChrSerialTargetModelToTargetType(chr->targetModel);
-
-@@ -3573,7 +3573,7 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev,
- if (qemuDomainChrSourceDefValidate(dev->source) < 0)
- return -1;
-
-- if (qemuDomainChrTargetDefValidate(def, dev) < 0)
-+ if (qemuDomainChrTargetDefValidate(dev) < 0)
- return -1;
-
- if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL &&
-@@ -3583,6 +3583,26 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev,
- return -1;
- }
-
-+ if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) {
-+ bool isCompatible = true;
-+
-+ if (!qemuDomainIsPSeries(def) &&
-+ (dev->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO ||
-+ dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY)) {
-+ isCompatible = false;
-+ }
-+
-+ if (!isCompatible) {
-+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-+ _("Serial device with target type '%s' and "
-+ "target model '%s' not compatible with guest "
-+ "architecture or machine type"),
-+ virDomainChrSerialTargetTypeToString(dev->targetType),
-+ virDomainChrSerialTargetModelTypeToString(dev->targetModel));
-+ return -1;
-+ }
-+ }
-+
- return 0;
- }
-
-@@ -4222,10 +4242,7 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr,
- if (ARCH_IS_X86(def->os.arch)) {
- chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA;
- } else if (qemuDomainIsPSeries(def)) {
-- /* Setting TYPE_ISA here is just a temporary hack to reduce test
-- * suite churn. Later on we will have a proper serial type for
-- * pSeries and this line will be updated accordingly. */
-- chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA;
-+ chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO;
- }
- }
-
-@@ -4242,6 +4259,9 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr,
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
- chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL;
- break;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO:
-+ chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY;
-+ break;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
- /* Nothing to do */
-@@ -5147,6 +5167,31 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver,
- goto cleanup;
- }
-
-+ for (i = 0; i < def->nserials; i++) {
-+ virDomainChrDefPtr serial = def->serials[i];
-+
-+ /* Historically, the native console type for some machine types
-+ * was not set at all, which means it defaulted to ISA even
-+ * though that was not even remotely accurate. To ensure migration
-+ * towards older libvirt versions works for such guests, we switch
-+ * it back to the default here */
-+ if (flags & VIR_DOMAIN_XML_MIGRATABLE) {
-+ switch ((virDomainChrSerialTargetType) serial->targetType) {
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO:
-+ serial->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE;
-+ serial->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE;
-+ break;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
-+ /* Nothing to do */
-+ break;
-+ }
-+ }
-+ }
-+
- /* Replace the CPU definition updated according to QEMU with the one
- * used for starting the domain. The updated def will be sent
- * separately for backward compatibility.
-diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
-index 989c0e6c93..2319e503eb 100644
---- a/src/qemu/qemu_domain_address.c
-+++ b/src/qemu/qemu_domain_address.c
-@@ -782,6 +782,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
-
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
- return 0;
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args
-index 97a7057ba0..789d9f679e 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args
-@@ -20,4 +20,4 @@ server,nowait \
- -boot c \
- -usb \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args
-new file mode 120000
-index 0000000000..d6c830ecdf
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args
-@@ -0,0 +1 @@
-+qemuxml2argv-pseries-serial-native.args
-\ No newline at end of file
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml
-new file mode 100644
-index 0000000000..9f37bf0dec
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml
-@@ -0,0 +1,17 @@
-+
-+ guest
-+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7
-+ 524288
-+ 1
-+
-+ hvm
-+
-+
-+ /usr/bin/qemu-system-ppc64
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args
-new file mode 100644
-index 0000000000..343018fb3e
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args
-@@ -0,0 +1,23 @@
-+LC_ALL=C \
-+PATH=/bin \
-+HOME=/home/test \
-+USER=test \
-+LOGNAME=test \
-+QEMU_AUDIO_DRV=none \
-+/usr/bin/qemu-system-ppc64 \
-+-name guest \
-+-S \
-+-M pseries \
-+-m 512 \
-+-smp 1,sockets=1,cores=1,threads=1 \
-+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
-+-nographic \
-+-nodefconfig \
-+-nodefaults \
-+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\
-+server,nowait \
-+-mon chardev=charmonitor,id=monitor,mode=readline \
-+-boot c \
-+-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x1 \
-+-chardev pty,id=charconsole0 \
-+-device virtconsole,chardev=charconsole0,id=console0
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml
-new file mode 100644
-index 0000000000..0190ab63ac
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml
-@@ -0,0 +1,19 @@
-+
-+ guest
-+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7
-+ 524288
-+ 1
-+
-+ hvm
-+
-+
-+ /usr/bin/qemu-system-ppc64
-+
-+
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args
-index af93d63dc9..9bb375aeba 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args
-@@ -21,4 +21,4 @@ server,nowait \
- -boot c \
- -usb \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
-index 7740e2f5a9..5174aa760e 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
-@@ -21,4 +21,4 @@ server,nowait \
- -boot c \
- -usb \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args
-index d2c99a7fa3..3790deca8c 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args
-@@ -21,4 +21,4 @@ server,nowait \
- -boot c \
- -usb \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args
-index 97a7057ba0..789d9f679e 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args
-@@ -20,4 +20,4 @@ server,nowait \
- -boot c \
- -usb \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args
-index 97a7057ba0..789d9f679e 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args
-@@ -20,4 +20,4 @@ server,nowait \
- -boot c \
- -usb \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args
-index 97a7057ba0..789d9f679e 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args
-@@ -20,4 +20,4 @@ server,nowait \
- -boot c \
- -usb \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.args
-new file mode 120000
-index 0000000000..d6c830ecdf
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.args
-@@ -0,0 +1 @@
-+qemuxml2argv-pseries-serial-native.args
-\ No newline at end of file
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.xml
-new file mode 100644
-index 0000000000..2733baa980
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.xml
-@@ -0,0 +1,18 @@
-+
-+ guest
-+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7
-+ 524288
-+ 1
-+
-+ hvm
-+
-+
-+ /usr/bin/qemu-system-ppc64
-+
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args
-new file mode 120000
-index 0000000000..d6c830ecdf
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args
-@@ -0,0 +1 @@
-+qemuxml2argv-pseries-serial-native.args
-\ No newline at end of file
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml
-new file mode 100644
-index 0000000000..2e182edbd0
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml
-@@ -0,0 +1,19 @@
-+
-+ guest
-+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7
-+ 524288
-+ 1
-+
-+ hvm
-+
-+
-+ /usr/bin/qemu-system-ppc64
-+
-+
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machine.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machine.xml
-new file mode 100644
-index 0000000000..5482146a57
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machine.xml
-@@ -0,0 +1,19 @@
-+
-+ guest
-+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7
-+ 524288
-+ 1
-+
-+ hvm
-+
-+
-+ /usr/bin/qemu-system-x86_64
-+
-+
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args
-new file mode 100644
-index 0000000000..f72b8b6259
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args
-@@ -0,0 +1,22 @@
-+LC_ALL=C \
-+PATH=/bin \
-+HOME=/home/test \
-+USER=test \
-+LOGNAME=test \
-+QEMU_AUDIO_DRV=none \
-+/usr/bin/qemu-system-ppc64 \
-+-name guest \
-+-S \
-+-M pseries \
-+-m 512 \
-+-smp 1,sockets=1,cores=1,threads=1 \
-+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
-+-nographic \
-+-nodefconfig \
-+-nodefaults \
-+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\
-+server,nowait \
-+-mon chardev=charmonitor,id=monitor,mode=readline \
-+-boot c \
-+-chardev pty,id=charserial0 \
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml
-new file mode 100644
-index 0000000000..6cec4bc9d3
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml
-@@ -0,0 +1,16 @@
-+
-+ guest
-+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7
-+ 524288
-+ 1
-+
-+ hvm
-+
-+
-+ /usr/bin/qemu-system-ppc64
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
-index a92b1e01b1..37c0594032 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
-@@ -20,4 +20,4 @@ server,nowait \
- -boot c \
- -device pci-ohci,id=usb,bus=pci.0,addr=0x1 \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
-index caaccdbb8e..838b80453a 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
-@@ -20,5 +20,5 @@ server,nowait \
- -boot c \
- -device pci-ohci,id=usb,bus=pci.0,addr=0x1 \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000 \
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \
- -device usb-kbd,id=input0,bus=usb.0,port=1
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args
-index b9bd905a5d..56bc1d67ef 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args
-@@ -21,4 +21,4 @@ server,nowait \
- -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1 \
- -device pci-ohci,id=usb1,bus=pci.0,addr=0x2 \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args
-index 63cf3c1830..0fcfbe3796 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args
-@@ -25,6 +25,6 @@ server,nowait \
- -device scsi-disk,bus=scsi1.0,channel=0,scsi-id=0,lun=0,\
- drive=drive-scsi1-0-0-0,id=scsi1-0-0-0 \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x20000000 \
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x20000000 \
- -chardev pty,id=charserial1 \
---device spapr-vty,chardev=charserial1,reg=0x30001000
-+-device spapr-vty,chardev=charserial1,id=serial1,reg=0x30001000
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args
-index 0294067bc8..8a9bdcc4cd 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args
-@@ -25,6 +25,6 @@ server,nowait \
- -device scsi-disk,bus=scsi1.0,channel=0,scsi-id=0,lun=0,\
- drive=drive-scsi1-0-0-0,id=scsi1-0-0-0 \
- -chardev pty,id=charserial0 \
---device spapr-vty,chardev=charserial0,reg=0x30000000 \
-+-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \
- -chardev pty,id=charserial1 \
---device spapr-vty,chardev=charserial1,reg=0x30001000
-+-device spapr-vty,chardev=charserial1,id=serial1,reg=0x30001000
-diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
-index 747ad24663..4b63dd141d 100644
---- a/tests/qemuxml2argvtest.c
-+++ b/tests/qemuxml2argvtest.c
-@@ -1875,6 +1875,22 @@ mymain(void)
- QEMU_CAPS_MACHINE_OPT,
- QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
-
-+ DO_TEST("pseries-serial-native",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY);
-+ DO_TEST("pseries-serial+console-native",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY);
-+ DO_TEST("pseries-serial-compat",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY);
-+ DO_TEST("pseries-console-native",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY);
-+ DO_TEST("pseries-console-virtio",
-+ QEMU_CAPS_NODEFCONFIG);
-+ DO_TEST_PARSE_ERROR("pseries-serial-invalid-machine", NONE);
-+
- DO_TEST("disk-ide-drive-split",
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_IDE_CD);
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml
-index 496df0696c..484fe4cfa6 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml
-@@ -22,8 +22,8 @@
-
-
-
--
--
-+
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml
-new file mode 120000
-index 0000000000..b0e645fc03
---- /dev/null
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml
-@@ -0,0 +1 @@
-+qemuxml2xmlout-pseries-serial-native.xml
-\ No newline at end of file
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml
-new file mode 100644
-index 0000000000..48760f2824
---- /dev/null
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml
-@@ -0,0 +1,31 @@
-+
-+ guest
-+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7
-+ 524288
-+ 524288
-+ 1
-+
-+ hvm
-+
-+
-+
-+ destroy
-+ restart
-+ destroy
-+
-+ /usr/bin/qemu-system-ppc64
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml
-index 9d4c5efe67..404bb0c768 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml
-@@ -25,8 +25,8 @@
-
-
-
--
--
-+
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml
-index 6059859abd..1891fa5f48 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml
-@@ -25,8 +25,8 @@
-
-
-
--
--
-+
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml
-index f3216523ed..f08f3e005f 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml
-@@ -26,8 +26,8 @@
-
-
-
--
--
-+
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml
-index 496df0696c..484fe4cfa6 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml
-@@ -22,8 +22,8 @@
-
-
-
--
--
-+
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml
-index 496df0696c..484fe4cfa6 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml
-@@ -22,8 +22,8 @@
-
-
-
--
--
-+
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console-native.xml
-new file mode 120000
-index 0000000000..b0e645fc03
---- /dev/null
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console-native.xml
-@@ -0,0 +1 @@
-+qemuxml2xmlout-pseries-serial-native.xml
-\ No newline at end of file
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml
-new file mode 120000
-index 0000000000..b0e645fc03
---- /dev/null
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml
-@@ -0,0 +1 @@
-+qemuxml2xmlout-pseries-serial-native.xml
-\ No newline at end of file
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml
-new file mode 100644
-index 0000000000..fae7c54d5b
---- /dev/null
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml
-@@ -0,0 +1,35 @@
-+
-+ guest
-+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7
-+ 524288
-+ 524288
-+ 1
-+
-+ hvm
-+
-+
-+
-+ destroy
-+ restart
-+ destroy
-+
-+ /usr/bin/qemu-system-ppc64
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
-index 6687997900..ad429ead4d 100644
---- a/tests/qemuxml2xmltest.c
-+++ b/tests/qemuxml2xmltest.c
-@@ -766,6 +766,21 @@ mymain(void)
- QEMU_CAPS_MACHINE_OPT,
- QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
-
-+ DO_TEST("pseries-serial-native",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY);
-+ DO_TEST("pseries-serial+console-native",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY);
-+ DO_TEST("pseries-serial-compat",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY);
-+ DO_TEST("pseries-console-native",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY);
-+ DO_TEST("pseries-console-virtio",
-+ QEMU_CAPS_NODEFCONFIG);
-+
- DO_TEST("balloon-device-auto", NONE);
- DO_TEST("balloon-device-period", NONE);
- DO_TEST("channel-virtio-auto", NONE);
---
-2.15.1
-
diff --git a/SOURCES/libvirt-conf-Check-for-user-aliases-duplicates-only.patch b/SOURCES/libvirt-conf-Check-for-user-aliases-duplicates-only.patch
deleted file mode 100644
index b73c661..0000000
--- a/SOURCES/libvirt-conf-Check-for-user-aliases-duplicates-only.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-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-conf-Check-virDomainChrSourceDefFormat-return-value.patch b/SOURCES/libvirt-conf-Check-virDomainChrSourceDefFormat-return-value.patch
deleted file mode 100644
index 0193671..0000000
--- a/SOURCES/libvirt-conf-Check-virDomainChrSourceDefFormat-return-value.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From 73650fdd9de90d6f5a6f4a3c6c19d60368411b07 Mon Sep 17 00:00:00 2001
-Message-Id: <73650fdd9de90d6f5a6f4a3c6c19d60368411b07@dist-git>
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:23:02 +0100
-Subject: [PATCH] conf: Check virDomainChrSourceDefFormat() return value
-
-The function can fail, but none of the caller were accounting
-for that.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 2cd323e382b4abfffda52fe49d1b50a087716e01)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1449265
-https://bugzilla.redhat.com/show_bug.cgi?id=1511421
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-https://bugzilla.redhat.com/show_bug.cgi?id=1512934
-Signed-off-by: Jiri Denemark
----
- src/conf/domain_conf.c | 34 ++++++++++++++++++++++++----------
- 1 file changed, 24 insertions(+), 10 deletions(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index cf1bd030a0..346edaa6bd 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -24045,7 +24045,9 @@ virDomainChrDefFormat(virBufferPtr buf,
- if (virDomainChrAttrsDefFormat(buf, def->source, tty_compat) < 0)
- return -1;
- virBufferAddLit(buf, ">\n");
-- virDomainChrSourceDefFormat(buf, def->source, flags);
-+
-+ if (virDomainChrSourceDefFormat(buf, def->source, flags) < 0)
-+ return -1;
-
- if (virDomainChrTargetDefFormat(buf, def, flags) < 0)
- return -1;
-@@ -24066,13 +24068,14 @@ virDomainSmartcardDefFormat(virBufferPtr buf,
- const char *mode = virDomainSmartcardTypeToString(def->type);
- virBuffer childBuf = VIR_BUFFER_INITIALIZER;
- size_t i;
-+ int ret = -1;
-
- virBufferSetChildIndent(&childBuf, buf);
-
- if (!mode) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected smartcard type %d"), def->type);
-- return -1;
-+ goto cleanup;
- }
-
- switch (def->type) {
-@@ -24089,23 +24092,25 @@ virDomainSmartcardDefFormat(virBufferPtr buf,
- break;
-
- case VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH:
-- virDomainChrSourceDefFormat(&childBuf, def->data.passthru, flags);
-+ if (virDomainChrSourceDefFormat(&childBuf, def->data.passthru, flags) < 0)
-+ goto cleanup;
- break;
-
- default:
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected smartcard type %d"), def->type);
-- return -1;
-+ goto cleanup;
- }
- virDomainDeviceInfoFormat(&childBuf, &def->info, flags);
-
- if (virBufferCheckError(&childBuf) < 0)
-- return -1;
-+ goto cleanup;
-
- virBufferAsprintf(buf, "type == VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH &&
-- virDomainChrAttrsDefFormat(buf, def->data.passthru, false) < 0)
-- return -1;
-+ virDomainChrAttrsDefFormat(buf, def->data.passthru, false) < 0) {
-+ goto cleanup;
-+ }
-
- if (virBufferUse(&childBuf)) {
- virBufferAddLit(buf, ">\n");
-@@ -24114,7 +24119,12 @@ virDomainSmartcardDefFormat(virBufferPtr buf,
- } else {
- virBufferAddLit(buf, "/>\n");
- }
-- return 0;
-+
-+ ret = 0;
-+
-+ cleanup:
-+ virBufferFreeAndReset(&childBuf);
-+ return ret;
- }
-
- static int
-@@ -24416,7 +24426,8 @@ virDomainRNGDefFormat(virBufferPtr buf,
- return -1;
- virBufferAddLit(buf, ">\n");
- virBufferAdjustIndent(buf, 2);
-- virDomainChrSourceDefFormat(buf, def->source.chardev, flags);
-+ if (virDomainChrSourceDefFormat(buf, def->source.chardev, flags) < 0)
-+ return -1;
- virBufferAdjustIndent(buf, -2);
- virBufferAddLit(buf, "\n");
-
-@@ -25261,7 +25272,10 @@ virDomainRedirdevDefFormat(virBufferPtr buf,
- return -1;
- virBufferAddLit(buf, ">\n");
- virBufferAdjustIndent(buf, 2);
-- virDomainChrSourceDefFormat(buf, def->source, flags);
-+
-+ if (virDomainChrSourceDefFormat(buf, def->source, flags) < 0)
-+ return -1;
-+
- virDomainDeviceInfoFormat(buf, &def->info,
- flags | VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT);
- virBufferAdjustIndent(buf, -2);
---
-2.15.1
-
diff --git a/SOURCES/libvirt-conf-Don-t-inline-virDomainNetTypeSharesHostView.patch b/SOURCES/libvirt-conf-Don-t-inline-virDomainNetTypeSharesHostView.patch
deleted file mode 100644
index 76a771b..0000000
--- a/SOURCES/libvirt-conf-Don-t-inline-virDomainNetTypeSharesHostView.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-From 0597400171b44e0d180196b2c04da72f8b1f225f Mon Sep 17 00:00:00 2001
-Message-Id: <0597400171b44e0d180196b2c04da72f8b1f225f@dist-git>
-From: Jiri Denemark
-Date: Thu, 2 Nov 2017 19:58:00 +0100
-Subject: [PATCH] conf: Don't inline virDomainNetTypeSharesHostView
-
-When coverage build is enabled, gcc complains about it:
-
-In file included from qemu/qemu_agent.h:29:0,
- from qemu/qemu_driver.c:47:
-qemu/qemu_driver.c: In function 'qemuDomainSetInterfaceParameters':
-./conf/domain_conf.h:3397:1: error: inlining failed in call to
-'virDomainNetTypeSharesHostView': call is unlikely and code size would
-grow [-Werror=inline]
- virDomainNetTypeSharesHostView(const virDomainNetDef *net)
- ^
-
-Signed-off-by: Jiri Denemark
-(cherry picked from commit bce925dadaf8fe4693abee88fb68aa7ede9d209e)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1472263
-
-Signed-off-by: Jiri Denemark
----
- src/conf/domain_conf.c | 36 ++++++++++++++++++++++++++++++++++++
- src/conf/domain_conf.h | 37 +++----------------------------------
- src/libvirt_private.syms | 1 +
- 3 files changed, 40 insertions(+), 34 deletions(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 77c20c6972..394afb0d80 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -28082,3 +28082,39 @@ virDomainGenerateMachineName(const char *drivername,
- virBufferCheckError(&buf);
- return virBufferContentAndReset(&buf);
- }
-+
-+
-+/**
-+ * virDomainNetTypeSharesHostView:
-+ * @net: interface
-+ *
-+ * Some types of interfaces "share" the host view. For instance,
-+ * for macvtap interface, every domain RX is the host RX too. And
-+ * every domain TX is host TX too. IOW, for some types of
-+ * interfaces guest and host are on the same side of RX/TX
-+ * barrier. This is important so that we set up QoS correctly and
-+ * report proper stats.
-+ */
-+bool
-+virDomainNetTypeSharesHostView(const virDomainNetDef *net)
-+{
-+ virDomainNetType actualType = virDomainNetGetActualType(net);
-+ switch (actualType) {
-+ case VIR_DOMAIN_NET_TYPE_DIRECT:
-+ case VIR_DOMAIN_NET_TYPE_ETHERNET:
-+ return true;
-+ case VIR_DOMAIN_NET_TYPE_USER:
-+ case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
-+ case VIR_DOMAIN_NET_TYPE_SERVER:
-+ case VIR_DOMAIN_NET_TYPE_CLIENT:
-+ case VIR_DOMAIN_NET_TYPE_MCAST:
-+ case VIR_DOMAIN_NET_TYPE_NETWORK:
-+ case VIR_DOMAIN_NET_TYPE_BRIDGE:
-+ case VIR_DOMAIN_NET_TYPE_INTERNAL:
-+ case VIR_DOMAIN_NET_TYPE_HOSTDEV:
-+ case VIR_DOMAIN_NET_TYPE_UDP:
-+ case VIR_DOMAIN_NET_TYPE_LAST:
-+ break;
-+ }
-+ return false;
-+}
-diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
-index 38de70b154..171f340785 100644
---- a/src/conf/domain_conf.h
-+++ b/src/conf/domain_conf.h
-@@ -3382,40 +3382,9 @@ virDomainGenerateMachineName(const char *drivername,
- int id,
- const char *name,
- bool privileged);
--/**
-- * virDomainNetTypeSharesHostView:
-- * @net: interface
-- *
-- * Some types of interfaces "share" the host view. For instance,
-- * for macvtap interface, every domain RX is the host RX too. And
-- * every domain TX is host TX too. IOW, for some types of
-- * interfaces guest and host are on the same side of RX/TX
-- * barrier. This is important so that we set up QoS correctly and
-- * report proper stats.
-- */
--static inline bool
--virDomainNetTypeSharesHostView(const virDomainNetDef *net)
--{
-- virDomainNetType actualType = virDomainNetGetActualType(net);
-- switch (actualType) {
-- case VIR_DOMAIN_NET_TYPE_DIRECT:
-- case VIR_DOMAIN_NET_TYPE_ETHERNET:
-- return true;
-- case VIR_DOMAIN_NET_TYPE_USER:
-- case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
-- case VIR_DOMAIN_NET_TYPE_SERVER:
-- case VIR_DOMAIN_NET_TYPE_CLIENT:
-- case VIR_DOMAIN_NET_TYPE_MCAST:
-- case VIR_DOMAIN_NET_TYPE_NETWORK:
-- case VIR_DOMAIN_NET_TYPE_BRIDGE:
-- case VIR_DOMAIN_NET_TYPE_INTERNAL:
-- case VIR_DOMAIN_NET_TYPE_HOSTDEV:
-- case VIR_DOMAIN_NET_TYPE_UDP:
-- case VIR_DOMAIN_NET_TYPE_LAST:
-- break;
-- }
-- return false;
--}
-+
-+bool
-+virDomainNetTypeSharesHostView(const virDomainNetDef *net);
-
- bool
- virDomainDefLifecycleActionAllowed(virDomainLifecycle type,
-diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
-index 448d962b2d..811d9053e6 100644
---- a/src/libvirt_private.syms
-+++ b/src/libvirt_private.syms
-@@ -444,6 +444,7 @@ virDomainNetInsert;
- virDomainNetRemove;
- virDomainNetRemoveHostdev;
- virDomainNetTypeFromString;
-+virDomainNetTypeSharesHostView;
- virDomainNetTypeToString;
- virDomainNostateReasonTypeFromString;
- virDomainNostateReasonTypeToString;
---
-2.15.0
-
diff --git a/SOURCES/libvirt-conf-Drop-virDomainChrDeviceType.targetTypeAttr.patch b/SOURCES/libvirt-conf-Drop-virDomainChrDeviceType.targetTypeAttr.patch
deleted file mode 100644
index ecce040..0000000
--- a/SOURCES/libvirt-conf-Drop-virDomainChrDeviceType.targetTypeAttr.patch
+++ /dev/null
@@ -1,737 +0,0 @@
-From 77bc396146f85ba8f767fd51f0238037cb9784cc Mon Sep 17 00:00:00 2001
-Message-Id: <77bc396146f85ba8f767fd51f0238037cb9784cc@dist-git>
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:22:59 +0100
-Subject: [PATCH] conf: Drop virDomainChrDeviceType.targetTypeAttr
-
-This attribute was used to decide whether to format the type
-attribute of the element, but the logic didn't take into
-account all possible cases and as such could lead to unexpected
-results. Moreover, it's one more thing to keep track of, and can
-easily fall out of sync with other attributes.
-
-Now that we have VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE, we can
-use that value to signal that no specific target type has been
-configured for the serial device and as such the attribute should
-not be formatted at all. All other values are now formatted.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 4fb8ff9987b7e34d331c4af8f573db11579a0e88)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1449265
-https://bugzilla.redhat.com/show_bug.cgi?id=1511421
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-https://bugzilla.redhat.com/show_bug.cgi?id=1512934
-Signed-off-by: Jiri Denemark
----
- src/conf/domain_conf.c | 11 ++++-------
- src/conf/domain_conf.h | 1 -
- src/vz/vz_sdk.c | 3 +--
- tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml | 2 +-
- tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml | 2 +-
- tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml | 2 +-
- tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml | 4 ++--
- tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml | 2 +-
- tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml | 2 +-
- tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml | 2 +-
- tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml | 4 ++--
- tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml | 2 +-
- tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml | 2 +-
- .../qemuhotplug-console-compat-2-live+console-virtio.xml | 4 ++--
- .../qemuhotplug-console-compat-2-live.xml | 4 ++--
- .../qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml | 4 ++--
- tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml | 4 ++--
- .../qemuxml2xmlout-bios-nvram-os-interleave.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml | 4 ++--
- .../qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml | 2 +-
- .../qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml | 4 ++--
- tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml | 2 +-
- .../qemuxml2xmlout-pseries-cpu-compat-power9.xml | 2 +-
- .../qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml | 2 +-
- .../qemuxml2xmlout-pseries-panic-missing.xml | 2 +-
- .../qemuxml2xmlout-pseries-panic-no-address.xml | 2 +-
- .../qemuxml2xmlout-q35-virt-manager-basic.xml | 2 +-
- .../qemuxml2xmlout-serial-spiceport-nospice.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml | 2 +-
- .../qemuxml2xmlout-serial-target-port-auto.xml | 6 +++---
- .../qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml | 4 ++--
- .../qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml | 2 +-
- tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml | 2 +-
- 43 files changed, 56 insertions(+), 61 deletions(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 3a5ecd3a9d..586a840672 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -11499,8 +11499,7 @@ virDomainChrDefaultTargetType(int devtype)
- }
-
- static int
--virDomainChrTargetTypeFromString(virDomainChrDefPtr def,
-- int devtype,
-+virDomainChrTargetTypeFromString(int devtype,
- const char *targetType)
- {
- int ret = -1;
-@@ -11528,8 +11527,6 @@ virDomainChrTargetTypeFromString(virDomainChrDefPtr def,
- break;
- }
-
-- def->targetTypeAttr = true;
--
- return ret;
- }
-
-@@ -11546,7 +11543,7 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr def,
- char *stateStr = NULL;
-
- if ((def->targetType =
-- virDomainChrTargetTypeFromString(def, def->deviceType,
-+ virDomainChrTargetTypeFromString(def->deviceType,
- targetType)) < 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown target type '%s' specified for character device"),
-@@ -16466,7 +16463,7 @@ virDomainChrEquals(virDomainChrDefPtr src,
- break;
-
- case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
-- if (src->targetTypeAttr != tgt->targetTypeAttr)
-+ if (src->targetType != tgt->targetType)
- return false;
-
- ATTRIBUTE_FALLTHROUGH;
-@@ -24026,7 +24023,7 @@ virDomainChrDefFormat(virBufferPtr buf,
- break;
-
- case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
-- if (def->targetTypeAttr) {
-+ if (def->targetType != VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) {
- virBufferAsprintf(buf,
- "\n",
- virDomainChrTargetTypeToString(def->deviceType,
-diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
-index 9502573b34..bbb056cf21 100644
---- a/src/conf/domain_conf.h
-+++ b/src/conf/domain_conf.h
-@@ -1199,7 +1199,6 @@ struct _virDomainChrSourceDef {
- struct _virDomainChrDef {
- int deviceType; /* enum virDomainChrDeviceType */
-
-- bool targetTypeAttr;
- int targetType; /* enum virDomainChrConsoleTargetType ||
- enum virDomainChrChannelTargetType ||
- enum virDomainChrSerialTargetType according to deviceType */
-diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
-index 3910deeb3a..c8de1b9598 100644
---- a/src/vz/vz_sdk.c
-+++ b/src/vz/vz_sdk.c
-@@ -1191,7 +1191,6 @@ prlsdkGetSerialInfo(PRL_HANDLE serialPort, virDomainChrDefPtr chr)
- int ret = -1;
-
- chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL;
-- chr->targetTypeAttr = false;
- pret = PrlVmDev_GetIndex(serialPort, &serialPortIndex);
- prlsdkCheckRetGoto(pret, cleanup);
- chr->target.port = serialPortIndex;
-@@ -2864,7 +2863,7 @@ static int prlsdkCheckSerialUnsupportedParams(virDomainChrDefPtr chr)
- return -1;
- }
-
-- if (chr->targetTypeAttr) {
-+ if (chr->targetType != VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Specified character device target type is not "
- "supported by vz driver."));
-diff --git a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml b/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml
-index f512844427..7c106f145c 100644
---- a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml
-+++ b/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml
-@@ -28,7 +28,7 @@
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml
-index aac814d59f..e76d0211dc 100644
---- a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml
-+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml
-@@ -29,7 +29,7 @@
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml
-index 64819a48ae..ed67ada0d8 100644
---- a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml
-+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml
-@@ -29,7 +29,7 @@
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml
-index e00afe317f..420771dc9c 100644
---- a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml
-+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml
-@@ -28,11 +28,11 @@
-
-
-
--
-+
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml
-index f512844427..7c106f145c 100644
---- a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml
-+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml
-@@ -28,7 +28,7 @@
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml
-index c35a4ca73a..3fe61ffa05 100644
---- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml
-+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml
-@@ -30,7 +30,7 @@
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml
-index 0d218f5482..3fc9fd39b0 100644
---- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml
-+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml
-@@ -30,7 +30,7 @@
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml
-index f7069d541f..5b4af3fe95 100644
---- a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml
-+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml
-@@ -30,11 +30,11 @@
-
-
-
--
-+
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml
-index 14fc8fc7c9..6bb291ff7f 100644
---- a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml
-+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml
-@@ -29,7 +29,7 @@
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml
-index 95aa1c7b9b..41954fc85d 100644
---- a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml
-+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml
-@@ -28,7 +28,7 @@
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml
-index 4e1dd49c22..427f431cce 100644
---- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml
-+++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml
-@@ -72,13 +72,13 @@
-
-
-
--
-+
-
-
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml
-index c56d13ef4a..144f6eff7a 100644
---- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml
-+++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml
-@@ -72,13 +72,13 @@
-
-
-
--
-+
-
-
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml
-index a95e29ad8a..e6c4adb6f3 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml
-@@ -29,12 +29,12 @@
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
-index c760098fe0..f9724d320e 100644
---- a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
-@@ -110,10 +110,10 @@
-
-
-
--
-+
-
-
--
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml
-index 033e86d3a3..5ee73b527e 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml
-@@ -33,7 +33,7 @@
-
-
-
--
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml
-index 840bf69f61..ad77f62d9e 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml
-@@ -25,13 +25,13 @@
-
--
-+
-
-
-
--
-+
-
-
- \n");
-+ } else {
-+ virBufferAddLit(buf, "/>\n");
-+ }
-+
- break;
-
- case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL:
-diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
-index bbb056cf21..9dfe9388cd 100644
---- a/src/conf/domain_conf.h
-+++ b/src/conf/domain_conf.h
-@@ -1104,6 +1104,17 @@ typedef enum {
- VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST
- } virDomainChrConsoleTargetType;
-
-+typedef enum {
-+ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0,
-+ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL,
-+ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL,
-+ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL,
-+
-+ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST
-+} virDomainChrSerialTargetModel;
-+
-+VIR_ENUM_DECL(virDomainChrSerialTargetModel);
-+
- typedef enum {
- VIR_DOMAIN_CHR_TYPE_NULL,
- VIR_DOMAIN_CHR_TYPE_VC,
-@@ -1202,6 +1213,7 @@ struct _virDomainChrDef {
- int targetType; /* enum virDomainChrConsoleTargetType ||
- enum virDomainChrChannelTargetType ||
- enum virDomainChrSerialTargetType according to deviceType */
-+ int targetModel; /* enum virDomainChrSerialTargetModel */
-
- union {
- int port; /* parallel, serial, console */
---
-2.15.1
-
diff --git a/SOURCES/libvirt-conf-Properly-parse-backingStore.patch b/SOURCES/libvirt-conf-Properly-parse-backingStore.patch
deleted file mode 100644
index 5e9b08e..0000000
--- a/SOURCES/libvirt-conf-Properly-parse-backingStore.patch
+++ /dev/null
@@ -1,200 +0,0 @@
-From fee89d5de8520422225dc06fa95cc2dad66d7ebe Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Peter Krempa
-Date: Mon, 13 Nov 2017 13:25:01 +0100
-Subject: [PATCH] conf: Properly parse
-
-The terminator would not be parsed properly since the XPath selector was
-looking for an populated element, and also the code did not bother
-assigning the terminating virStorageSourcePtr to the backingStore
-property of the parent.
-
-Some tests would catch it if there wasn't bigger fallout from the change
-to backing store termination in a693fdba0111. Fix them properly now.
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1509110
-(cherry picked from commit 19448a2561699807c075e071a45df292efd01f6b)
-Signed-off-by: Jiri Denemark
----
- src/conf/domain_conf.c | 18 ++++++++----------
- ...base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml | 1 +
- .../qemuxml2xmlout-disk-active-commit.xml | 1 +
- .../qemuxml2xmlout-disk-backing-chains-active.xml | 3 +++
- .../qemuxml2xmlout-disk-mirror-active.xml | 4 ++++
- .../qemuxml2xmlout-disk-mirror-old.xml | 4 ++++
- .../qemuxml2xmlout-seclabel-static-labelskip.xml | 1 +
- 7 files changed, 22 insertions(+), 10 deletions(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 27cfecffda..3b337d1a64 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -8539,16 +8539,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt,
- char *idx = NULL;
- int ret = -1;
-
-- if (!(ctxt->node = virXPathNode("./backingStore[*]", ctxt))) {
-- ret = 0;
-- goto cleanup;
-- }
--
-- if (!(type = virXMLPropString(ctxt->node, "type"))) {
-- /* terminator does not have a type */
-- if (VIR_ALLOC(backingStore) < 0)
-- goto cleanup;
--
-+ if (!(ctxt->node = virXPathNode("./backingStore", ctxt))) {
- ret = 0;
- goto cleanup;
- }
-@@ -8556,6 +8547,13 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt,
- if (VIR_ALLOC(backingStore) < 0)
- goto cleanup;
-
-+ /* terminator does not have a type */
-+ if (!(type = virXMLPropString(ctxt->node, "type"))) {
-+ VIR_STEAL_PTR(src->backingStore, backingStore);
-+ ret = 0;
-+ goto cleanup;
-+ }
-+
- if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) &&
- (idx = virXMLPropString(ctxt->node, "index")) &&
- virStrToLong_uip(idx, NULL, 10, &backingStore->id) < 0) {
-diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml
-index 9482b6794a..16caeb3542 100644
---- a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml
-+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml
-@@ -22,6 +22,7 @@
-
-
-
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-active-commit.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-active-commit.xml
-index 5766e4aea8..cc26af1096 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-active-commit.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-active-commit.xml
-@@ -20,6 +20,7 @@
-
-
-
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-backing-chains-active.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-backing-chains-active.xml
-index 828defcc25..d1fd2442c3 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-backing-chains-active.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-backing-chains-active.xml
-@@ -49,6 +49,7 @@
-
-
-
-+
-
-
-
-@@ -63,6 +64,7 @@
-
-
-
-+
-
-
-
-@@ -79,6 +81,7 @@
-
-
-
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-active.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-active.xml
-index 252bde3389..c1e8a33ec1 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-active.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-active.xml
-@@ -16,6 +16,7 @@
- /usr/bin/qemu-system-i686
-
-
-+
-
-
-
-@@ -24,12 +25,14 @@
-
-
-
-+
-
-
-
-
-
-
-+
-
-
-
-@@ -39,6 +42,7 @@
-
-
-
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml
-index f4bd39a580..e390bc02f2 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml
-@@ -16,6 +16,7 @@
- /usr/bin/qemu-system-i686
-
-
-+
-
-
-
-@@ -24,12 +25,14 @@
-
-
-
-+
-
-
-
-
-
-
-+
-
-
-
-@@ -39,6 +42,7 @@
-
-
-
-+
-
-
-
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-static-labelskip.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-static-labelskip.xml
-index 91f573db7d..d37b950cbf 100644
---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-static-labelskip.xml
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-static-labelskip.xml
-@@ -18,6 +18,7 @@
-
-
-
-+
-
-
-
---
-2.15.0
-
diff --git a/SOURCES/libvirt-conf-Remove-ATTRIBUTE_FALLTHROUGH-from-virDomainChrTargetDefFormat.patch b/SOURCES/libvirt-conf-Remove-ATTRIBUTE_FALLTHROUGH-from-virDomainChrTargetDefFormat.patch
deleted file mode 100644
index c95b076..0000000
--- a/SOURCES/libvirt-conf-Remove-ATTRIBUTE_FALLTHROUGH-from-virDomainChrTargetDefFormat.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From d91de09fa0a626e200ac0db133a6af69a0706105 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:23:04 +0100
-Subject: [PATCH] conf: Remove ATTRIBUTE_FALLTHROUGH from
- virDomainChrTargetDefFormat()
-
-Formatting the element for serial devices will become a
-bit more complicated later on, and leaving the fallthrough behavior
-there would do nothing but complicate it further.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 7983068fa50ea5222e62b24ea912a529994276f0)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1449265
-https://bugzilla.redhat.com/show_bug.cgi?id=1511421
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-https://bugzilla.redhat.com/show_bug.cgi?id=1512934
-Signed-off-by: Jiri Denemark
----
- src/conf/domain_conf.c | 14 +++++++++-----
- 1 file changed, 9 insertions(+), 5 deletions(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 2489705d6b..44d9bbe01d 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -24010,14 +24010,18 @@ virDomainChrTargetDefFormat(virBufferPtr buf,
- return -1;
- }
-
-+ virBufferAddLit(buf, "targetType != VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) {
- virBufferAsprintf(buf,
-- "\n",
-- targetType,
-- def->target.port);
-- break;
-+ "type='%s' ",
-+ targetType);
- }
-- ATTRIBUTE_FALLTHROUGH;
-+
-+ virBufferAsprintf(buf,
-+ "port='%d'/>\n",
-+ def->target.port);
-+ break;
-
- case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL:
- virBufferAsprintf(buf, "\n",
---
-2.15.1
-
diff --git a/SOURCES/libvirt-conf-Replace-error-with-cleanup-in-virDomainHostdevDefParseXMLSubsys.patch b/SOURCES/libvirt-conf-Replace-error-with-cleanup-in-virDomainHostdevDefParseXMLSubsys.patch
new file mode 100644
index 0000000..dae569d
--- /dev/null
+++ b/SOURCES/libvirt-conf-Replace-error-with-cleanup-in-virDomainHostdevDefParseXMLSubsys.patch
@@ -0,0 +1,175 @@
+From 5f4b5ca1fe285fe7d920088b3cac57448777a7ec Mon Sep 17 00:00:00 2001
+Message-Id: <5f4b5ca1fe285fe7d920088b3cac57448777a7ec@dist-git>
+From: Erik Skultety
+Date: Thu, 19 Jul 2018 15:04:01 +0200
+Subject: [PATCH] conf: Replace 'error' with 'cleanup' in
+ virDomainHostdevDefParseXMLSubsys
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The exit path is the same for both success and failure, so the label
+should be called cleanup.
+
+Signed-off-by: Erik Skultety
+Reviewed-by: Ján Tomko
+(cherry picked from commit f1f6f4858260a77416ed5e0c86c4e0614aaf0a5e)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1475770
+Signed-off-by: Erik Skultety
+Reviewed-by: Ján Tomko
+---
+ src/conf/domain_conf.c | 38 +++++++++++++++++++-------------------
+ 1 file changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index 08654ab41d..72086f9e86 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -7690,18 +7690,18 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown host device source address type '%s'"),
+ type);
+- goto error;
++ goto cleanup;
+ }
+ } else {
+ virReportError(VIR_ERR_XML_ERROR,
+ "%s", _("missing source address type"));
+- goto error;
++ goto cleanup;
+ }
+
+ if (!(sourcenode = virXPathNode("./source", ctxt))) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("Missing element in hostdev device"));
+- goto error;
++ goto cleanup;
+ }
+
+ if (def->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB &&
+@@ -7709,20 +7709,20 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Setting startupPolicy is only allowed for USB"
+ " devices"));
+- goto error;
++ goto cleanup;
+ }
+
+ if (sgio) {
+ if (def->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("sgio is only supported for scsi host device"));
+- goto error;
++ goto cleanup;
+ }
+
+ if ((scsisrc->sgio = virDomainDeviceSGIOTypeFromString(sgio)) <= 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown sgio mode '%s'"), sgio);
+- goto error;
++ goto cleanup;
+ }
+ }
+
+@@ -7730,14 +7730,14 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
+ if (def->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("rawio is only supported for scsi host device"));
+- goto error;
++ goto cleanup;
+ }
+
+ if ((scsisrc->rawio = virTristateBoolTypeFromString(rawio)) <= 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("unknown hostdev rawio setting '%s'"),
+ rawio);
+- goto error;
++ goto cleanup;
+ }
+ }
+
+@@ -7746,28 +7746,28 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("'model' attribute in is only supported "
+ "when type='mdev'"));
+- goto error;
++ goto cleanup;
+ }
+ } else {
+ if (!model) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("Missing 'model' attribute in mediated device's "
+ " element"));
+- goto error;
++ goto cleanup;
+ }
+
+ if ((mdevsrc->model = virMediatedDeviceModelTypeFromString(model)) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("unknown hostdev model '%s'"),
+ model);
+- goto error;
++ goto cleanup;
+ }
+ }
+
+ switch (def->source.subsys.type) {
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
+ if (virDomainHostdevSubsysPCIDefParseXML(sourcenode, def, flags) < 0)
+- goto error;
++ goto cleanup;
+
+ backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT;
+ if ((backendStr = virXPathString("string(./driver/@name)", ctxt)) &&
+@@ -7776,7 +7776,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unknown PCI device "
+ "has been specified"), backendStr);
+- goto error;
++ goto cleanup;
+ }
+ pcisrc->backend = backend;
+
+@@ -7784,32 +7784,32 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
+
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
+ if (virDomainHostdevSubsysUSBDefParseXML(sourcenode, def) < 0)
+- goto error;
++ goto cleanup;
+ break;
+
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
+ if (virDomainHostdevSubsysSCSIDefParseXML(sourcenode, scsisrc, ctxt) < 0)
+- goto error;
++ goto cleanup;
+ break;
+
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
+ if (virDomainHostdevSubsysSCSIVHostDefParseXML(sourcenode, def) < 0)
+- goto error;
++ goto cleanup;
+ break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+ if (virDomainHostdevSubsysMediatedDevDefParseXML(def, ctxt) < 0)
+- goto error;
++ goto cleanup;
+ break;
+
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("address type='%s' not supported in hostdev interfaces"),
+ virDomainHostdevSubsysTypeToString(def->source.subsys.type));
+- goto error;
++ goto cleanup;
+ }
+
+ ret = 0;
+- error:
++ cleanup:
+ VIR_FREE(managed);
+ VIR_FREE(sgio);
+ VIR_FREE(rawio);
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-conf-Run-devicePostParse-again-for-the-first-serial-device.patch b/SOURCES/libvirt-conf-Run-devicePostParse-again-for-the-first-serial-device.patch
deleted file mode 100644
index baa288e..0000000
--- a/SOURCES/libvirt-conf-Run-devicePostParse-again-for-the-first-serial-device.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 0c9561ff6de749954395f562cbb8e3d12954566c Mon Sep 17 00:00:00 2001
-Message-Id: <0c9561ff6de749954395f562cbb8e3d12954566c@dist-git>
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:22:57 +0100
-Subject: [PATCH] conf: Run devicePostParse() again for the first serial device
-
-The devicePostParse() callback is invoked for all devices so that
-drivers have a chance to set their own specific values; however,
-virDomainDefAddImplicitDevices() runs *after* the devicePostParse()
-callbacks have been invoked and can add new devices, in which case
-the driver wouldn't have a chance to customize them.
-
-Work around the issue by invoking the devicePostParse() callback
-after virDomainDefAddImplicitDevices(), only for the first serial
-devices, which might have been added by it. The same was already
-happening for the first video device for the very same reason.
-
-This will become important later on, when we will change
-virDomainDefAddConsoleCompat() not to set a targetType for
-automatically added serial devices.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 2628afc143224d38e6ef8c06a8fbec1d0f69fb86)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1449265
-https://bugzilla.redhat.com/show_bug.cgi?id=1511421
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-https://bugzilla.redhat.com/show_bug.cgi?id=1512934
-Signed-off-by: Jiri Denemark
----
- src/conf/domain_conf.c | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 4b5e7c214f..41674a85af 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -4948,6 +4948,18 @@ virDomainDefPostParseCommon(virDomainDefPtr def,
- return -1;
- }
-
-+ if (def->nserials != 0) {
-+ virDomainDeviceDef device = {
-+ .type = VIR_DOMAIN_DEVICE_CHR,
-+ .data.chr = def->serials[0],
-+ };
-+
-+ /* serials[0] might have been added in AddImplicitDevices, after we've
-+ * done the per-device post-parse */
-+ if (virDomainDefPostParseDeviceIterator(def, &device, NULL, data) < 0)
-+ return -1;
-+ }
-+
- /* clean up possibly duplicated metadata entries */
- virXMLNodeSanitizeNamespaces(def->metadata);
-
---
-2.15.1
-
diff --git a/SOURCES/libvirt-conf-Sort-cache-banks-in-capabilities-XML.patch b/SOURCES/libvirt-conf-Sort-cache-banks-in-capabilities-XML.patch
deleted file mode 100644
index 571ab1d..0000000
--- a/SOURCES/libvirt-conf-Sort-cache-banks-in-capabilities-XML.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 6532e10f6ddec18ab70f58dc660062d369b82304 Mon Sep 17 00:00:00 2001
-Message-Id: <6532e10f6ddec18ab70f58dc660062d369b82304@dist-git>
-From: Martin Kletzander
-Date: Wed, 31 Jan 2018 16:32:17 +0100
-Subject: [PATCH] conf: Sort cache banks in capabilities XML
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1289368
-
-Because the cache banks are initialized based on the order in which their
-respective directories exist on the filesystem, they can appear in different
-order. This is here mainly for tests because the cache directory might have
-different order of children nodes and tests would fail otherwise. It should not
-be the case with sysfs, but one can never be sure. And this does not take
-almost any extra time, mainly because it gets initialized once per driver.
-
-Signed-off-by: Martin Kletzander
-Reviewed-by: John Ferlan
-(cherry picked from commit b4698edcb0a459332b24410f59698005af37eecb)
-Signed-off-by: Martin Kletzander
----
- src/conf/capabilities.c | 23 +++++++++++++++++++++++
- 1 file changed, 23 insertions(+)
-
-diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
-index 9920a675ac..1f7d8cdb31 100644
---- a/src/conf/capabilities.c
-+++ b/src/conf/capabilities.c
-@@ -1561,6 +1561,23 @@ virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr)
- VIR_FREE(ptr);
- }
-
-+
-+static int
-+virCapsHostCacheBankSorter(const void *a,
-+ const void *b)
-+{
-+ virCapsHostCacheBankPtr ca = *(virCapsHostCacheBankPtr *)a;
-+ virCapsHostCacheBankPtr cb = *(virCapsHostCacheBankPtr *)b;
-+
-+ if (ca->level < cb->level)
-+ return -1;
-+ if (ca->level > cb->level)
-+ return 1;
-+
-+ return ca->id - cb->id;
-+}
-+
-+
- int
- virCapabilitiesInitCaches(virCapsPtr caps)
- {
-@@ -1700,6 +1717,12 @@ virCapabilitiesInitCaches(virCapsPtr caps)
- goto cleanup;
- }
-
-+ /* Sort the array in order for the tests to be predictable. This way we can
-+ * still traverse the directory instead of guessing names (in case there is
-+ * 'index1' and 'index3' but no 'index2'). */
-+ qsort(caps->host.caches, caps->host.ncaches,
-+ sizeof(*caps->host.caches), virCapsHostCacheBankSorter);
-+
- ret = 0;
- cleanup:
- VIR_FREE(type);
---
-2.16.1
-
diff --git a/SOURCES/libvirt-conf-Use-virResctrlInfo-in-capabilities.patch b/SOURCES/libvirt-conf-Use-virResctrlInfo-in-capabilities.patch
deleted file mode 100644
index 3121e3d..0000000
--- a/SOURCES/libvirt-conf-Use-virResctrlInfo-in-capabilities.patch
+++ /dev/null
@@ -1,131 +0,0 @@
-From af86f99a7745f9d54c3f4e42f58130478e6aa9f5 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Martin Kletzander
-Date: Wed, 31 Jan 2018 16:32:26 +0100
-Subject: [PATCH] conf: Use virResctrlInfo in capabilities
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1289368
-
-Signed-off-by: Martin Kletzander
-(cherry picked from commit 3bbae43d8cc79ef1cd0b9a4ea2440203a0edc959)
-Signed-off-by: Martin Kletzander
----
- src/conf/capabilities.c | 53 ++++++++++++++++++++++++-------------------------
- src/conf/capabilities.h | 2 ++
- 2 files changed, 28 insertions(+), 27 deletions(-)
-
-diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
-index e93eaed2f0..edf9f54f77 100644
---- a/src/conf/capabilities.c
-+++ b/src/conf/capabilities.c
-@@ -245,6 +245,7 @@ virCapabilitiesDispose(void *object)
- VIR_FREE(caps->host.netprefix);
- VIR_FREE(caps->host.pagesSize);
- virCPUDefFree(caps->host.cpu);
-+ virObjectUnref(caps->host.resctrl);
- }
-
- /**
-@@ -1592,6 +1593,20 @@ virCapsHostCacheBankSorter(const void *a,
- }
-
-
-+static int
-+virCapabilitiesInitResctrl(virCapsPtr caps)
-+{
-+ if (caps->host.resctrl)
-+ return 0;
-+
-+ caps->host.resctrl = virResctrlInfoNew();
-+ if (!caps->host.resctrl)
-+ return -1;
-+
-+ return virResctrlGetInfo(caps->host.resctrl);
-+}
-+
-+
- int
- virCapabilitiesInitCaches(virCapsPtr caps)
- {
-@@ -1600,7 +1615,6 @@ virCapabilitiesInitCaches(virCapsPtr caps)
- ssize_t pos = -1;
- DIR *dirp = NULL;
- int ret = -1;
-- int typeret;
- char *path = NULL;
- char *type = NULL;
- struct dirent *ent = NULL;
-@@ -1611,6 +1625,9 @@ virCapabilitiesInitCaches(virCapsPtr caps)
- * lose information. */
- const int cache_min_level = 3;
-
-+ if (virCapabilitiesInitResctrl(caps) < 0)
-+ return -1;
-+
- /* offline CPUs don't provide cache info */
- if (virFileReadValueBitmap(&cpus, "%s/cpu/online", SYSFS_SYSTEM_PATH) < 0)
- return -1;
-@@ -1676,32 +1693,6 @@ virCapabilitiesInitCaches(virCapsPtr caps)
- SYSFS_SYSTEM_PATH, pos, ent->d_name) < 0)
- goto cleanup;
-
-- typeret = virResctrlGetCacheControlType(bank->level);
-- if (typeret < 0)
-- goto cleanup;
--
-- if (typeret == 1) {
-- if (virResctrlGetCacheInfo(bank->level,
-- bank->size,
-- VIR_CACHE_TYPE_BOTH,
-- &bank->controls,
-- &bank->ncontrols) < 0)
-- goto cleanup;
-- } else if (typeret == 2) {
-- if (virResctrlGetCacheInfo(bank->level,
-- bank->size,
-- VIR_CACHE_TYPE_CODE,
-- &bank->controls,
-- &bank->ncontrols) < 0)
-- goto cleanup;
-- if (virResctrlGetCacheInfo(bank->level,
-- bank->size,
-- VIR_CACHE_TYPE_DATA,
-- &bank->controls,
-- &bank->ncontrols) < 0)
-- goto cleanup;
-- }
--
- kernel_type = virCacheKernelTypeFromString(type);
- if (kernel_type < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
-@@ -1717,6 +1708,14 @@ virCapabilitiesInitCaches(virCapsPtr caps)
- break;
- }
- if (i == caps->host.ncaches) {
-+ /* If it is a new cache, then update its resctrl information. */
-+ if (virResctrlInfoGetCache(caps->host.resctrl,
-+ bank->level,
-+ bank->size,
-+ &bank->ncontrols,
-+ &bank->controls) < 0)
-+ goto cleanup;
-+
- if (VIR_APPEND_ELEMENT(caps->host.caches,
- caps->host.ncaches,
- bank) < 0) {
-diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
-index 27b88cb5ed..694a3590bf 100644
---- a/src/conf/capabilities.h
-+++ b/src/conf/capabilities.h
-@@ -170,6 +170,8 @@ struct _virCapsHost {
- size_t nnumaCell_max;
- virCapsHostNUMACellPtr *numaCell;
-
-+ virResctrlInfoPtr resctrl;
-+
- size_t ncaches;
- virCapsHostCacheBankPtr *caches;
-
---
-2.16.1
-
diff --git a/SOURCES/libvirt-conf-add-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP.patch b/SOURCES/libvirt-conf-add-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP.patch
deleted file mode 100644
index a1b7f82..0000000
--- a/SOURCES/libvirt-conf-add-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP.patch
+++ /dev/null
@@ -1,605 +0,0 @@
-From f93cc7753900a7ff80a32dae2fd3337939909b86 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Pino Toscano
-Date: Wed, 29 Nov 2017 16:23:15 +0100
-Subject: [PATCH] conf: add VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP
-
-Introduce specific a target types with two models for the console
-devices (sclp and sclplm) used in s390 and s390x guests, so isa-serial
-is no more used for them.
-
-This makes usable on s390 and s390x guests, with at most only
-a single sclpconsole and one sclplmconsole devices usable in a single
-guest (due to limitations in QEMU, which will enforce already at
-runtime).
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1449265
-
-Signed-off-by: Pino Toscano
-Reviewed-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 21332bf6587c23409fecb06ab81dbc14dd52c10b)
-Signed-off-by: Jiri Denemark
----
- docs/formatdomain.html.in | 19 ++++++++----
- docs/schemas/domaincommon.rng | 3 ++
- src/conf/domain_conf.c | 4 +++
- src/conf/domain_conf.h | 3 ++
- src/qemu/qemu_command.c | 6 ++++
- src/qemu/qemu_domain.c | 20 +++++++++++++
- src/qemu/qemu_domain_address.c | 1 +
- .../qemuxml2argv-s390-serial-2.args | 24 +++++++++++++++
- .../qemuxml2argv-s390-serial-2.xml | 19 ++++++++++++
- .../qemuxml2argv-s390-serial-console.args | 25 ++++++++++++++++
- .../qemuxml2argv-s390-serial-console.xml | 15 ++++++++++
- .../qemuxml2argvdata/qemuxml2argv-s390-serial.args | 22 ++++++++++++++
- .../qemuxml2argvdata/qemuxml2argv-s390-serial.xml | 14 +++++++++
- tests/qemuxml2argvtest.c | 16 ++++++++++
- .../qemuxml2xmlout-s390-serial-2.xml | 33 +++++++++++++++++++++
- .../qemuxml2xmlout-s390-serial-console.xml | 34 ++++++++++++++++++++++
- .../qemuxml2xmlout-s390-serial.xml | 28 ++++++++++++++++++
- tests/qemuxml2xmltest.c | 6 ++++
- 18 files changed, 286 insertions(+), 6 deletions(-)
- create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args
- create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml
- create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args
- create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml
- create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args
- create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml
- create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml
- create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml
- create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml
-
-diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
-index 87389f4e73..62dd6e1ec4 100644
---- a/docs/formatdomain.html.in
-+++ b/docs/formatdomain.html.in
-@@ -6463,8 +6463,9 @@ qemu-kvm -net nic,model=? /dev/null
- with x86 guests), usb-serial (usable whenever USB support
- is available) and pci-serial (usable whenever PCI support
- is available); since 3.10.0,
-- spapr-vio-serial (usable with ppc64/pseries guests) and
-- system-serial (usable with aarch64/virt guests) are
-+ spapr-vio-serial (usable with ppc64/pseries guests),
-+ system-serial (usable with aarch64/virt guests) and
-+ sclp-serial (usable with s390 and s390x guests) are
- available as well.
-
-
-@@ -6478,7 +6479,9 @@ qemu-kvm -net nic,model=? /dev/null
- (usable with the pci-serial target type);
- spapr-vty (usable with the spapr-vio-serial
- target type); pl011 (usable with the
-- system-serial target type).
-+ system-serial target type); sclpconsole and
-+ sclplmconsole (usable with the sclp-serial
-+ target type).
-
-
-
-@@ -6493,7 +6496,8 @@ qemu-kvm -net nic,model=? /dev/null
- isa-serial), usb (for usb-serial),
- pci (for pci-serial) and spapr-vio
- (for spapr-vio-serial). The system-serial
-- target type doesn't support specifying an address.
-+ and sclp-serial target types don't support specifying an
-+ address.
-
-
-
-@@ -6541,8 +6545,11 @@ qemu-kvm -net nic,model=? /dev/null
- virtio (usable whenever VirtIO support is available);
- xen, lxc, uml and
- openvz (available when the corresponding hypervisor is in
-- use); sclp and sclplm (usable for s390 and
-- s390x QEMU guests).
-+ use). sclp and sclplm (usable for s390 and
-+ s390x QEMU guests) are supported for compatibility reasons but should
-+ not be used for new guests: use the sclpconsole and
-+ sclplmconsole target models, respectively, with the
-+ serial element instead.
-
-
-
-diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
-index 957eae2832..5576128db5 100644
---- a/docs/schemas/domaincommon.rng
-+++ b/docs/schemas/domaincommon.rng
-@@ -3573,6 +3573,7 @@
- pci-serial
- spapr-vio-serial
- system-serial
-+ sclp-serial
-
-
-
-@@ -3586,6 +3587,8 @@
- pci-serial
- spapr-vty
- pl011
-+ sclpconsole
-+ sclplmconsole
-
-
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 32089df3c2..c58dae197c 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -447,6 +447,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTarget,
- "pci-serial",
- "spapr-vio-serial",
- "system-serial",
-+ "sclp-serial",
- );
-
- VIR_ENUM_IMPL(virDomainChrChannelTarget,
-@@ -476,6 +477,8 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel,
- "pci-serial",
- "spapr-vty",
- "pl011",
-+ "sclpconsole",
-+ "sclplmconsole",
- );
-
- VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST,
-@@ -4066,6 +4069,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def)
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: {
-
- /* Create a stub console to match the serial port.
-diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
-index d6febf3059..0e97f0437e 100644
---- a/src/conf/domain_conf.h
-+++ b/src/conf/domain_conf.h
-@@ -1079,6 +1079,7 @@ typedef enum {
- VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI,
- VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO,
- VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM,
-+ VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP,
-
- VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST
- } virDomainChrSerialTargetType;
-@@ -1113,6 +1114,8 @@ typedef enum {
- VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL,
- VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY,
- VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011,
-+ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE,
-+ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE,
-
- VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST
- } virDomainChrSerialTargetModel;
-diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
-index 483eee6056..a2cfb3d4a3 100644
---- a/src/qemu/qemu_command.c
-+++ b/src/qemu/qemu_command.c
-@@ -9229,6 +9229,10 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel)
- return QEMU_CAPS_DEVICE_PCI_SERIAL;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY:
- return QEMU_CAPS_DEVICE_SPAPR_VTY;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE:
-+ return QEMU_CAPS_DEVICE_SCLPCONSOLE;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE:
-+ return QEMU_CAPS_DEVICE_SCLPLMCONSOLE;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE:
-@@ -10355,6 +10359,8 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE:
-
- caps = qemuChrSerialTargetModelToCaps(serial->targetModel);
-
-diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
-index 2fc173fa45..91c0e163e1 100644
---- a/src/qemu/qemu_domain.c
-+++ b/src/qemu/qemu_domain.c
-@@ -3469,6 +3469,7 @@ qemuDomainChrSerialTargetTypeToAddressType(int targetType)
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO:
- return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
- break;
-@@ -3492,6 +3493,9 @@ qemuDomainChrSerialTargetModelToTargetType(int targetModel)
- return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011:
- return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE:
-+ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST:
- break;
-@@ -3529,6 +3533,7 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef *chr)
- break;
-
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP:
- if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Target type '%s' cannot have an "
-@@ -3550,6 +3555,8 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef *chr)
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE:
-
- expected = qemuDomainChrSerialTargetModelToTargetType(chr->targetModel);
-
-@@ -3612,6 +3619,13 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev,
- isCompatible = false;
- }
-
-+ if (!ARCH_IS_S390(def->os.arch) &&
-+ (dev->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP ||
-+ dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE ||
-+ dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE)) {
-+ isCompatible = false;
-+ }
-+
- if (!isCompatible) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Serial device with target type '%s' and "
-@@ -4265,6 +4279,8 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr,
- chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO;
- } else if (qemuDomainIsVirt(def)) {
- chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM;
-+ } else if (ARCH_IS_S390(def->os.arch)) {
-+ chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP;
- }
- }
-
-@@ -4287,6 +4303,9 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr,
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM:
- chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011;
- break;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP:
-+ chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE;
-+ break;
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
- /* Nothing to do */
-@@ -5210,6 +5229,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver,
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
- /* Nothing to do */
-diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
-index db9656a3a5..a40cdb3993 100644
---- a/src/qemu/qemu_domain_address.c
-+++ b/src/qemu/qemu_domain_address.c
-@@ -785,6 +785,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
- return 0;
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args
-new file mode 100644
-index 0000000000..346dcd16bb
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args
-@@ -0,0 +1,24 @@
-+LC_ALL=C \
-+PATH=/bin \
-+HOME=/home/test \
-+USER=test \
-+LOGNAME=test \
-+QEMU_AUDIO_DRV=none \
-+/usr/bin/qemu-system-s390x \
-+-name QEMUGuest1 \
-+-S \
-+-M s390-ccw-virtio \
-+-m 214 \
-+-smp 1,sockets=1,cores=1,threads=1 \
-+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-+-nographic \
-+-nodefconfig \
-+-nodefaults \
-+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-+server,nowait \
-+-mon chardev=charmonitor,id=monitor,mode=readline \
-+-boot c \
-+-chardev pty,id=charserial0 \
-+-device sclpconsole,chardev=charserial0,id=serial0 \
-+-chardev pty,id=charserial1 \
-+-device sclplmconsole,chardev=charserial1,id=serial1
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml
-new file mode 100644
-index 0000000000..b6eb377c98
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml
-@@ -0,0 +1,19 @@
-+
-+ QEMUGuest1
-+ c7a5fdbd-edaf-9455-926a-d65c16db1809
-+ 219100
-+ 1
-+
-+ hvm
-+
-+
-+ /usr/bin/qemu-system-s390x
-+
-+
-+
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args
-new file mode 100644
-index 0000000000..c405fb59ee
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args
-@@ -0,0 +1,25 @@
-+LC_ALL=C \
-+PATH=/bin \
-+HOME=/home/test \
-+USER=test \
-+LOGNAME=test \
-+QEMU_AUDIO_DRV=none \
-+/usr/bin/qemu-system-s390x \
-+-name QEMUGuest1 \
-+-S \
-+-M s390-ccw-virtio \
-+-m 214 \
-+-smp 1,sockets=1,cores=1,threads=1 \
-+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-+-nographic \
-+-nodefconfig \
-+-nodefaults \
-+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-+server,nowait \
-+-mon chardev=charmonitor,id=monitor,mode=readline \
-+-boot c \
-+-device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \
-+-chardev pty,id=charserial0 \
-+-device sclpconsole,chardev=charserial0,id=serial0 \
-+-chardev pty,id=charconsole1 \
-+-device virtconsole,chardev=charconsole1,id=console1
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml
-new file mode 100644
-index 0000000000..c841f1f245
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml
-@@ -0,0 +1,15 @@
-+
-+ QEMUGuest1
-+ c7a5fdbd-edaf-9455-926a-d65c16db1809
-+ 219100
-+ 1
-+
-+ hvm
-+
-+
-+ /usr/bin/qemu-system-s390x
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args
-new file mode 100644
-index 0000000000..20968f7945
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args
-@@ -0,0 +1,22 @@
-+LC_ALL=C \
-+PATH=/bin \
-+HOME=/home/test \
-+USER=test \
-+LOGNAME=test \
-+QEMU_AUDIO_DRV=none \
-+/usr/bin/qemu-system-s390x \
-+-name QEMUGuest1 \
-+-S \
-+-M s390-ccw-virtio \
-+-m 214 \
-+-smp 1,sockets=1,cores=1,threads=1 \
-+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-+-nographic \
-+-nodefconfig \
-+-nodefaults \
-+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-+server,nowait \
-+-mon chardev=charmonitor,id=monitor,mode=readline \
-+-boot c \
-+-chardev pty,id=charserial0 \
-+-device sclpconsole,chardev=charserial0,id=serial0
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml
-new file mode 100644
-index 0000000000..55b45bac00
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml
-@@ -0,0 +1,14 @@
-+
-+ QEMUGuest1
-+ c7a5fdbd-edaf-9455-926a-d65c16db1809
-+ 219100
-+ 1
-+
-+ hvm
-+
-+
-+ /usr/bin/qemu-system-s390x
-+
-+
-+
-+
-diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
-index 656b8c0995..852525e7b4 100644
---- a/tests/qemuxml2argvtest.c
-+++ b/tests/qemuxml2argvtest.c
-@@ -2049,6 +2049,22 @@ mymain(void)
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_VIRTIO_CCW,
- QEMU_CAPS_VIRTIO_S390);
-+ DO_TEST("s390-serial",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_VIRTIO_CCW,
-+ QEMU_CAPS_VIRTIO_S390,
-+ QEMU_CAPS_DEVICE_SCLPCONSOLE);
-+ DO_TEST("s390-serial-2",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_VIRTIO_CCW,
-+ QEMU_CAPS_VIRTIO_S390,
-+ QEMU_CAPS_DEVICE_SCLPCONSOLE,
-+ QEMU_CAPS_DEVICE_SCLPLMCONSOLE);
-+ DO_TEST("s390-serial-console",
-+ QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_VIRTIO_CCW,
-+ QEMU_CAPS_VIRTIO_S390,
-+ QEMU_CAPS_DEVICE_SCLPCONSOLE);
-
- DO_TEST("ppc-dtb",
- QEMU_CAPS_KVM,
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml
-new file mode 100644
-index 0000000000..bb9ca30f1d
---- /dev/null
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml
-@@ -0,0 +1,33 @@
-+
-+ QEMUGuest1
-+ c7a5fdbd-edaf-9455-926a-d65c16db1809
-+ 219100
-+ 219100
-+ 1
-+
-+ hvm
-+
-+
-+
-+ destroy
-+ restart
-+ destroy
-+
-+ /usr/bin/qemu-system-s390x
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml
-new file mode 100644
-index 0000000000..db3023b7a6
---- /dev/null
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml
-@@ -0,0 +1,34 @@
-+
-+ QEMUGuest1
-+ c7a5fdbd-edaf-9455-926a-d65c16db1809
-+ 219100
-+ 219100
-+ 1
-+
-+ hvm
-+
-+
-+
-+ destroy
-+ restart
-+ destroy
-+
-+ /usr/bin/qemu-system-s390x
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml
-new file mode 100644
-index 0000000000..9c9b4dd27a
---- /dev/null
-+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml
-@@ -0,0 +1,28 @@
-+
-+ QEMUGuest1
-+ c7a5fdbd-edaf-9455-926a-d65c16db1809
-+ 219100
-+ 219100
-+ 1
-+
-+ hvm
-+
-+
-+
-+ destroy
-+ restart
-+ destroy
-+
-+ /usr/bin/qemu-system-s390x
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
-index bd18507bb6..8766646738 100644
---- a/tests/qemuxml2xmltest.c
-+++ b/tests/qemuxml2xmltest.c
-@@ -1155,6 +1155,12 @@ mymain(void)
- QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
- DO_TEST("s390-panic-no-address",
- QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
-+ DO_TEST("s390-serial",
-+ QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
-+ DO_TEST("s390-serial-2",
-+ QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
-+ DO_TEST("s390-serial-console",
-+ QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
-
- DO_TEST("pcihole64", NONE);
- DO_TEST("pcihole64-gib", NONE);
---
-2.15.1
-
diff --git a/SOURCES/libvirt-conf-correct-false-boot-order-error-during-domain-parse.patch b/SOURCES/libvirt-conf-correct-false-boot-order-error-during-domain-parse.patch
new file mode 100644
index 0000000..23f2db5
--- /dev/null
+++ b/SOURCES/libvirt-conf-correct-false-boot-order-error-during-domain-parse.patch
@@ -0,0 +1,215 @@
+From 81b2604ee418dc5fd5158406d32868c8d15f3256 Mon Sep 17 00:00:00 2001
+Message-Id: <81b2604ee418dc5fd5158406d32868c8d15f3256@dist-git>
+From: Laine Stump
+Date: Wed, 12 Sep 2018 11:23:47 -0400
+Subject: [PATCH] conf: correct false boot order error during domain parse
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+virDomainDefCollectBootOrder() is called for every item on the list
+for each type of device. One of the checks it makes is to gather the
+order attributes from the element of all devices, and assure
+that no two devices have been given the same order.
+
+Since (internally to libvirt, *not* in the domain XML) an is on both the list of hostdev devices and the list of
+network devices, it will be counted twice, and the code that checks
+for multiple devices with the same boot order will give a false
+positive.
+
+To remedy this, we make sure to return early for hostdev devices that
+have a parent.type != NONE.
+
+This was introduced in commit 5b75a4, which was first in libvirt-4.4.0.
+
+Resolves: https://bugzilla.redhat.com/1601318
+
+Signed-off-by: Laine Stump
+Reviewed-by: Ján Tomko
+(cherry picked from commit 7ea7342996d74591e00bcbf14b1eb3995f77a199)
+Signed-off-by: Laine Stump
+Reviewed-by: Ján Tomko
+---
+ src/conf/domain_conf.c | 8 ++++
+ .../net-hostdev-bootorder.args | 27 ++++++++++++
+ .../net-hostdev-bootorder.xml | 36 ++++++++++++++++
+ tests/qemuxml2argvtest.c | 2 +
+ .../net-hostdev-bootorder.xml | 42 +++++++++++++++++++
+ tests/qemuxml2xmltest.c | 2 +
+ 6 files changed, 117 insertions(+)
+ create mode 100644 tests/qemuxml2argvdata/net-hostdev-bootorder.args
+ create mode 100644 tests/qemuxml2argvdata/net-hostdev-bootorder.xml
+ create mode 100644 tests/qemuxml2xmloutdata/net-hostdev-bootorder.xml
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index ed9687fde9..eb4e9ac523 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -5072,6 +5072,14 @@ virDomainDefCollectBootOrder(virDomainDefPtr def ATTRIBUTE_UNUSED,
+ if (info->bootIndex == 0)
+ return 0;
+
++ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
++ dev->data.hostdev->parent.type != VIR_DOMAIN_DEVICE_NONE) {
++ /* This hostdev is a child of a higher level device
++ * (e.g. interface), and thus already being counted on the
++ * list for the other device type.
++ */
++ return 0;
++ }
+ if (virAsprintf(&order, "%u", info->bootIndex) < 0)
+ goto cleanup;
+
+diff --git a/tests/qemuxml2argvdata/net-hostdev-bootorder.args b/tests/qemuxml2argvdata/net-hostdev-bootorder.args
+new file mode 100644
+index 0000000000..e632d9b195
+--- /dev/null
++++ b/tests/qemuxml2argvdata/net-hostdev-bootorder.args
+@@ -0,0 +1,27 @@
++LC_ALL=C \
++PATH=/bin \
++HOME=/home/test \
++USER=test \
++LOGNAME=test \
++QEMU_AUDIO_DRV=none \
++/usr/bin/qemu-system-i686 \
++-name QEMUGuest1 \
++-S \
++-machine pc,accel=tcg,usb=off,dump-guest-core=off \
++-m 214 \
++-smp 1,sockets=1,cores=1,threads=1 \
++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
++-display none \
++-no-user-config \
++-nodefaults \
++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
++server,nowait \
++-mon chardev=charmonitor,id=monitor,mode=control \
++-rtc base=utc \
++-no-shutdown \
++-no-acpi \
++-usb \
++-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
++-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,\
++bootindex=2 \
++-device pci-assign,host=03:07.1,id=hostdev0,bootindex=1,bus=pci.0,addr=0x3
+diff --git a/tests/qemuxml2argvdata/net-hostdev-bootorder.xml b/tests/qemuxml2argvdata/net-hostdev-bootorder.xml
+new file mode 100644
+index 0000000000..cd9f32b2f3
+--- /dev/null
++++ b/tests/qemuxml2argvdata/net-hostdev-bootorder.xml
+@@ -0,0 +1,36 @@
++
++ QEMUGuest1
++ c7a5fdbd-edaf-9455-926a-d65c16db1809
++ 219136
++ 219136
++ 1
++
++ hvm
++
++
++ destroy
++ restart
++ destroy
++
++ /usr/bin/qemu-system-i686
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
+index 02bb9889ee..d97dc0ea8d 100644
+--- a/tests/qemuxml2argvtest.c
++++ b/tests/qemuxml2argvtest.c
+@@ -1321,6 +1321,8 @@ mymain(void)
+ DO_TEST("net-mcast", NONE);
+ DO_TEST("net-udp", NONE);
+ DO_TEST("net-hostdev", NONE);
++ DO_TEST("net-hostdev-bootorder",
++ QEMU_CAPS_BOOTINDEX, QEMU_CAPS_PCI_BOOTINDEX);
+ DO_TEST("net-hostdev-multidomain", NONE);
+ DO_TEST("net-hostdev-vfio",
+ QEMU_CAPS_DEVICE_VFIO_PCI);
+diff --git a/tests/qemuxml2xmloutdata/net-hostdev-bootorder.xml b/tests/qemuxml2xmloutdata/net-hostdev-bootorder.xml
+new file mode 100644
+index 0000000000..d9ecf40cf0
+--- /dev/null
++++ b/tests/qemuxml2xmloutdata/net-hostdev-bootorder.xml
+@@ -0,0 +1,42 @@
++
++ QEMUGuest1
++ c7a5fdbd-edaf-9455-926a-d65c16db1809
++ 219136
++ 219136
++ 1
++
++ hvm
++
++
++ destroy
++ restart
++ destroy
++
++ /usr/bin/qemu-system-i686
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
+index b76410b2c1..5bd522e765 100644
+--- a/tests/qemuxml2xmltest.c
++++ b/tests/qemuxml2xmltest.c
+@@ -454,6 +454,8 @@ mymain(void)
+ DO_TEST("net-virtio-network-portgroup", NONE);
+ DO_TEST("net-virtio-rxtxqueuesize", NONE);
+ DO_TEST("net-hostdev", NONE);
++ DO_TEST("net-hostdev-bootorder",
++ QEMU_CAPS_BOOTINDEX, QEMU_CAPS_PCI_BOOTINDEX);
+ DO_TEST("net-hostdev-vfio", NONE);
+ DO_TEST("net-midonet", NONE);
+ DO_TEST("net-openvswitch", NONE);
+--
+2.19.0
+
diff --git a/SOURCES/libvirt-conf-fix-migratable-XML-for-graphics-if-socket-is-generated-based-on-config.patch b/SOURCES/libvirt-conf-fix-migratable-XML-for-graphics-if-socket-is-generated-based-on-config.patch
deleted file mode 100644
index 10cf184..0000000
--- a/SOURCES/libvirt-conf-fix-migratable-XML-for-graphics-if-socket-is-generated-based-on-config.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From a1c433306e79ec6b5c0ca4b3e3243875ccabdeb2 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Pavel Hrdina
-Date: Thu, 30 Nov 2017 17:56:41 +0100
-Subject: [PATCH] conf: fix migratable XML for graphics if socket is generated
- based on config
-
-The graphics code is complex and there are a lot of exceptions and
-backward compatible combinations. One of them is the possibility
-to configure "spice_auto_unix_socket" in qemu.conf which will convert
-all spice graphics with listen type "address" without any address
-specified to listen type "socket" when the guest is started.
-
-We don't format this generated socket into migratable XML to make
-migration work with older libvirt. However, spice has another
-exception that if autoport='no' and there is no port configured
-it is converted to listen type "none". Because of this we need
-to format autoport='yes' to make sure that the listen type will
-be the same as the offline XML.
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511407
-
-Reviewed-by: Jiri Denemark
-Signed-off-by: Pavel Hrdina
-(cherry picked from commit cb06ea57ad80a964028f22fb49d6ab96648ae741)
-Signed-off-by: Pavel Hrdina
-Signed-off-by: Jiri Denemark
----
- src/conf/domain_conf.c | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index c58dae197c..ec138ea861 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -25150,6 +25150,18 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
- break;
-
- case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET:
-+ /* If socket is auto-generated based on config option we don't
-+ * add any listen element into migratable XML because the original
-+ * listen type is "address".
-+ * We need to set autoport to make sure that libvirt on destination
-+ * will parse it as listen type "address", without autoport it is
-+ * parsed as listen type "none". */
-+ if ((flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) &&
-+ glisten->fromConfig) {
-+ virBufferAddStr(buf, " autoport='yes'");
-+ }
-+ break;
-+
- case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST:
- break;
- }
---
-2.15.1
-
diff --git a/SOURCES/libvirt-conf-honor-maxnames-in-nodeListDevices-API.patch b/SOURCES/libvirt-conf-honor-maxnames-in-nodeListDevices-API.patch
deleted file mode 100644
index f7b19a7..0000000
--- a/SOURCES/libvirt-conf-honor-maxnames-in-nodeListDevices-API.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From a64f825a244c77556c0ed7c5f425ba70b28cca70 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Pavel Hrdina
-Date: Tue, 2 Jan 2018 12:39:13 +0100
-Subject: [PATCH] conf: honor maxnames in nodeListDevices API
-
-Introduced by commit <4ae9dbea99c>.
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1528572
-
-Signed-off-by: Pavel Hrdina
-(cherry picked from commit bbf6573e94528ac8a8867855e6671b48e13f1cd1)
-Signed-off-by: Pavel Hrdina
-Reviewed-by: Erik Skultety
-Signed-off-by: Jiri Denemark
----
- src/conf/virnodedeviceobj.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
-index 872ec1fd4b..c4e3a40d3a 100644
---- a/src/conf/virnodedeviceobj.c
-+++ b/src/conf/virnodedeviceobj.c
-@@ -798,6 +798,9 @@ virNodeDeviceObjListGetNamesCallback(void *payload,
- if (data->error)
- return 0;
-
-+ if (data->nnames >= data->maxnames)
-+ return 0;
-+
- virObjectLock(obj);
- def = obj->def;
-
---
-2.15.1
-
diff --git a/SOURCES/libvirt-conf-include-x86-microcode-version-in-virsh-capabiltiies.patch b/SOURCES/libvirt-conf-include-x86-microcode-version-in-virsh-capabiltiies.patch
deleted file mode 100644
index edf12a0..0000000
--- a/SOURCES/libvirt-conf-include-x86-microcode-version-in-virsh-capabiltiies.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From 4f1684dd855d48517e04507edadba2fd454e4ada Mon Sep 17 00:00:00 2001
-Message-Id: <4f1684dd855d48517e04507edadba2fd454e4ada@dist-git>
-From: Paolo Bonzini
-Date: Tue, 12 Dec 2017 16:23:40 +0100
-Subject: [PATCH] conf: include x86 microcode version in virsh capabiltiies
-
-A microcode update can cause the CPUID bits to change; an example
-from the past was the update that disabled TSX on several Haswell and
-Broadwell machines.
-
-In order to track the x86 microcode version in the QEMU capabilities,
-we have to fetch it and store it in the host CPU. This also makes the
-version visible in "virsh capabilities", which is a nice side effect.
-
-CVE-2017-5715
-
-Signed-off-by: Paolo Bonzini
-Signed-off-by: Jiri Denemark
----
- src/conf/cpu_conf.c | 14 ++++++++++++++
- src/conf/cpu_conf.h | 1 +
- src/cpu/cpu_x86.c | 9 +++++++++
- 3 files changed, 24 insertions(+)
-
-diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
-index 669935acf8..7e00299c66 100644
---- a/src/conf/cpu_conf.c
-+++ b/src/conf/cpu_conf.c
-@@ -130,6 +130,7 @@ virCPUDefCopyModelFilter(virCPUDefPtr dst,
- VIR_STRDUP(dst->vendor_id, src->vendor_id) < 0 ||
- VIR_ALLOC_N(dst->features, src->nfeatures) < 0)
- return -1;
-+ dst->microcodeVersion = src->microcodeVersion;
- dst->nfeatures_max = src->nfeatures;
- dst->nfeatures = 0;
-
-@@ -181,6 +182,7 @@ virCPUDefStealModel(virCPUDefPtr dst,
-
- VIR_STEAL_PTR(dst->model, src->model);
- VIR_STEAL_PTR(dst->features, src->features);
-+ dst->microcodeVersion = src->microcodeVersion;
- dst->nfeatures_max = src->nfeatures_max;
- src->nfeatures_max = 0;
- dst->nfeatures = src->nfeatures;
-@@ -382,6 +384,14 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
- goto cleanup;
- }
- VIR_FREE(arch);
-+
-+ if (virXPathBoolean("boolean(./microcode[1]/@version)", ctxt) > 0 &&
-+ virXPathUInt("string(./microcode[1]/@version)", ctxt,
-+ &def->microcodeVersion) < 0) {
-+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-+ _("invalid microcode version"));
-+ goto cleanup;
-+ }
- }
-
- if (!(def->model = virXPathString("string(./model[1])", ctxt)) &&
-@@ -720,6 +730,10 @@ virCPUDefFormatBuf(virBufferPtr buf,
- if (formatModel && def->vendor)
- virBufferEscapeString(buf, "%s\n", def->vendor);
-
-+ if (def->type == VIR_CPU_TYPE_HOST && def->microcodeVersion)
-+ virBufferAsprintf(buf, "\n",
-+ def->microcodeVersion);
-+
- if (def->sockets && def->cores && def->threads) {
- virBufferAddLit(buf, "sockets);
-diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
-index d1983f5d4f..9f2e7ee264 100644
---- a/src/conf/cpu_conf.h
-+++ b/src/conf/cpu_conf.h
-@@ -133,6 +133,7 @@ struct _virCPUDef {
- char *vendor_id; /* vendor id returned by CPUID in the guest */
- int fallback; /* enum virCPUFallback */
- char *vendor;
-+ unsigned int microcodeVersion;
- unsigned int sockets;
- unsigned int cores;
- unsigned int threads;
-diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
-index 693e571a3d..ad35532fc1 100644
---- a/src/cpu/cpu_x86.c
-+++ b/src/cpu/cpu_x86.c
-@@ -33,6 +33,7 @@
- #include "virbuffer.h"
- #include "virendian.h"
- #include "virstring.h"
-+#include "virhostcpu.h"
-
- #define VIR_FROM_THIS VIR_FROM_CPU
-
-@@ -153,6 +154,8 @@ struct _virCPUx86Map {
- };
-
- static virCPUx86MapPtr cpuMap;
-+static unsigned int microcodeVersion;
-+
- int virCPUx86DriverOnceInit(void);
- VIR_ONCE_GLOBAL_INIT(virCPUx86Driver);
-
-@@ -1409,6 +1412,8 @@ virCPUx86DriverOnceInit(void)
- if (!(cpuMap = virCPUx86LoadMap()))
- return -1;
-
-+ microcodeVersion = virHostCPUGetMicrocodeVersion();
-+
- return 0;
- }
-
-@@ -2424,6 +2429,9 @@ virCPUx86GetHost(virCPUDefPtr cpu,
- virCPUDataPtr cpuData = NULL;
- int ret = -1;
-
-+ if (virCPUx86DriverInitialize() < 0)
-+ goto cleanup;
-+
- if (!(cpuData = virCPUDataNew(archs[0])))
- goto cleanup;
-
-@@ -2432,6 +2440,7 @@ virCPUx86GetHost(virCPUDefPtr cpu,
- goto cleanup;
-
- ret = x86DecodeCPUData(cpu, cpuData, models);
-+ cpu->microcodeVersion = microcodeVersion;
-
- cleanup:
- virCPUx86DataFree(cpuData);
---
-2.15.1
-
diff --git a/SOURCES/libvirt-conf-move-generated-member-from-virMacAddr-to-virDomainNetDef.patch b/SOURCES/libvirt-conf-move-generated-member-from-virMacAddr-to-virDomainNetDef.patch
deleted file mode 100644
index 32863e9..0000000
--- a/SOURCES/libvirt-conf-move-generated-member-from-virMacAddr-to-virDomainNetDef.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-From 5b225fe7ac882c8696b9759251c519c785f5407c Mon Sep 17 00:00:00 2001
-Message-Id: <5b225fe7ac882c8696b9759251c519c785f5407c@dist-git>
-From: Laine Stump
-Date: Tue, 6 Mar 2018 16:19:31 -0500
-Subject: [PATCH] conf: move 'generated' member from virMacAddr to
- virDomainNetDef
-
-Commit 7e62c4cd26d (first appearing in libvirt-3.9.0 as a resolution
-to rhbz #1343919) added a "generated" attribute to virMacAddr that was
-set whenever a mac address was auto-generated by libvirt. This
-knowledge was used in a single place - when trying to match a NetDef
-from the Domain to Delete with user-provided XML. Since the XML parser
-always auto-generates a MAC address for NetDefs when none is provided,
-it was previously impossible to make a search where the MAC address
-isn't significant, but the addition of the "generated" attribute made
-it possible for the search function to ignore auto-generated MACs.
-
-This implementation had a problem though - it was adding a field to a
-"low level" struct - virMacAddr - which is used in other places with
-the assumption that it contains exactly a 6 byte MAC address and
-nothing else. In particular, virNWFilterSnoopEthHdr uses virMacAddr as
-part of the definition of an ethernet packet header, whose layout must
-of course match an actual ethernet packet. Adding the extra bools into
-virNWFilterSnoopEthHdr caused the nwfilter driver's "IP discovery via
-DHCP packet snooping" functionality to mysteriously stop working.
-
-In order to fix that behavior, and prevent potential future similar
-odd behavior, this patch moves the "generated" member out of
-virMacAddr (so that it is again really is just a MAC address) into
-virDomainNetDef, and sets it only when virDomainNetGenerateMAC() is
-called from virDomainNetDefParseXML() (which is the only time we care
-about it).
-
-Resolves: https://bugzilla.redhat.com/1529338
-
-(It should also be applied to any maintenance branch that applies
-commit 7e62c4cd26 and friends to resolve
-https://bugzilla.redhat.com/1343919)
-
-Signed-off-by: Laine Stump
-(cherry picked from commit e62cb4a9b78c7f4499a206635fb4f06e6ac627e5)
----
- src/conf/domain_conf.c | 3 ++-
- src/conf/domain_conf.h | 1 +
- src/util/virmacaddr.c | 5 -----
- src/util/virmacaddr.h | 9 +++++++--
- tests/bhyveargv2xmlmock.c | 1 -
- 5 files changed, 10 insertions(+), 9 deletions(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 0af3dd5ab6..1a3db4a7be 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -10989,6 +10989,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
- }
- } else {
- virDomainNetGenerateMAC(xmlopt, &def->mac);
-+ def->mac_generated = true;
- }
-
- if (devaddr) {
-@@ -16205,7 +16206,7 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net)
- size_t i;
- int matchidx = -1;
- char mac[VIR_MAC_STRING_BUFLEN];
-- bool MACAddrSpecified = !net->mac.generated;
-+ bool MACAddrSpecified = !net->mac_generated;
- bool PCIAddrSpecified = virDomainDeviceAddressIsValid(&net->info,
- VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI);
-
-diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
-index ed7b587bed..3817887322 100644
---- a/src/conf/domain_conf.h
-+++ b/src/conf/domain_conf.h
-@@ -962,6 +962,7 @@ struct _virDomainActualNetDef {
- struct _virDomainNetDef {
- virDomainNetType type;
- virMacAddr mac;
-+ bool mac_generated; /* true if mac was *just now* auto-generated by libvirt */
- char *model;
- union {
- struct {
-diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c
-index 409fdc34d5..7afe032b9c 100644
---- a/src/util/virmacaddr.c
-+++ b/src/util/virmacaddr.c
-@@ -107,7 +107,6 @@ void
- virMacAddrSet(virMacAddrPtr dst, const virMacAddr *src)
- {
- memcpy(dst, src, sizeof(*src));
-- dst->generated = false;
- }
-
- /**
-@@ -121,7 +120,6 @@ void
- virMacAddrSetRaw(virMacAddrPtr dst, const unsigned char src[VIR_MAC_BUFLEN])
- {
- memcpy(dst->addr, src, VIR_MAC_BUFLEN);
-- dst->generated = false;
- }
-
- /**
-@@ -151,7 +149,6 @@ virMacAddrParse(const char* str, virMacAddrPtr addr)
- {
- size_t i;
-
-- addr->generated = false;
- errno = 0;
- for (i = 0; i < VIR_MAC_BUFLEN; i++) {
- char *end_ptr;
-@@ -220,7 +217,6 @@ virMacAddrParseHex(const char *str, virMacAddrPtr addr)
- str[VIR_MAC_HEXLEN])
- return -1;
-
-- addr->generated = false;
- for (i = 0; i < VIR_MAC_BUFLEN; i++)
- addr->addr[i] = (virHexToBin(str[2 * i]) << 4 |
- virHexToBin(str[2 * i + 1]));
-@@ -236,7 +232,6 @@ void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN],
- addr->addr[3] = virRandomBits(8);
- addr->addr[4] = virRandomBits(8);
- addr->addr[5] = virRandomBits(8);
-- addr->generated = true;
- }
-
- /* The low order bit of the first byte is the "multicast" bit. */
-diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h
-index ef4285d639..d0dd4a45c6 100644
---- a/src/util/virmacaddr.h
-+++ b/src/util/virmacaddr.h
-@@ -36,9 +36,14 @@ typedef virMacAddr *virMacAddrPtr;
-
- struct _virMacAddr {
- unsigned char addr[VIR_MAC_BUFLEN];
-- bool generated; /* True if MAC address was autogenerated,
-- false otherwise. */
- };
-+/* This struct is used as a part of a larger struct that is
-+ * overlaid on an ethernet packet captured with libpcap, so it
-+ * must not have any extra members added - it must remain exactly
-+ * 6 bytes in length.
-+ */
-+verify(sizeof(struct _virMacAddr) == 6);
-+
-
- int virMacAddrCompare(const char *mac1, const char *mac2);
- int virMacAddrCmp(const virMacAddr *mac1, const virMacAddr *mac2);
-diff --git a/tests/bhyveargv2xmlmock.c b/tests/bhyveargv2xmlmock.c
-index dd25f4e13a..1f08bebb7b 100644
---- a/tests/bhyveargv2xmlmock.c
-+++ b/tests/bhyveargv2xmlmock.c
-@@ -16,7 +16,6 @@ virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN],
- addr->addr[3] = 0;
- addr->addr[4] = 0;
- addr->addr[5] = 0;
-- addr->generated = true;
- }
-
- int
---
-2.16.2
-
diff --git a/SOURCES/libvirt-conf-qemu-Use-type-aware-switches-where-possible.patch b/SOURCES/libvirt-conf-qemu-Use-type-aware-switches-where-possible.patch
deleted file mode 100644
index 0af72f8..0000000
--- a/SOURCES/libvirt-conf-qemu-Use-type-aware-switches-where-possible.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 08c0c0562f8444859cc110e4fc2199d2c4254a53 Mon Sep 17 00:00:00 2001
-Message-Id: <08c0c0562f8444859cc110e4fc2199d2c4254a53@dist-git>
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:22:54 +0100
-Subject: [PATCH] conf, qemu: Use type-aware switches where possible
-
-The compiler can warn us if we add a value to the
-virDomainChrSerialTargetType enumeration but forget to handle
-it properly in the code. Let's take advantage of that.
-
-This commit is best viewed with 'git diff -w'.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 18dfc0014501c3811ee32669ea96583131dca9b3)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1449265
-https://bugzilla.redhat.com/show_bug.cgi?id=1511421
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-https://bugzilla.redhat.com/show_bug.cgi?id=1512934
-Signed-off-by: Jiri Denemark
----
- src/conf/domain_conf.c | 47 ++++++++++++++++++++++++++++++-----------------
- src/qemu/qemu_command.c | 7 ++++++-
- 2 files changed, 36 insertions(+), 18 deletions(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 530fae9d9d..4b5e7c214f 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -4046,26 +4046,39 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def)
- def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
- }
- } else if (def->os.type == VIR_DOMAIN_OSTYPE_HVM && def->nserials > 0 &&
-- def->serials[0]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
-- def->serials[0]->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA) {
-- /* Create a stub console to match the serial port.
-- * console[0] either does not exist
-- * or has a different type than SERIAL or NONE.
-- */
-- virDomainChrDefPtr chr;
-- if (!(chr = virDomainChrDefNew(NULL)))
-- return -1;
-+ def->serials[0]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) {
-
-- if (VIR_INSERT_ELEMENT(def->consoles,
-- 0,
-- def->nconsoles,
-- chr) < 0) {
-- virDomainChrDefFree(chr);
-- return -1;
-+ switch ((virDomainChrSerialTargetType) def->serials[0]->targetType) {
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: {
-+
-+ /* Create a stub console to match the serial port.
-+ * console[0] either does not exist
-+ * or has a different type than SERIAL or NONE.
-+ */
-+ virDomainChrDefPtr chr;
-+ if (!(chr = virDomainChrDefNew(NULL)))
-+ return -1;
-+
-+ if (VIR_INSERT_ELEMENT(def->consoles,
-+ 0,
-+ def->nconsoles,
-+ chr) < 0) {
-+ virDomainChrDefFree(chr);
-+ return -1;
-+ }
-+
-+ def->consoles[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
-+ def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
-+
-+ break;
- }
-
-- def->consoles[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
-- def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
-+ /* Nothing to do */
-+ break;
-+ }
- }
-
- return 0;
-diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
-index 19a819a3aa..3d970ed9d1 100644
---- a/src/qemu/qemu_command.c
-+++ b/src/qemu/qemu_command.c
-@@ -10338,7 +10338,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
- serial->info.alias);
- }
- } else {
-- switch (serial->targetType) {
-+ switch ((virDomainChrSerialTargetType) serial->targetType) {
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_SERIAL)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-@@ -10377,6 +10377,11 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
- goto error;
- }
- break;
-+
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
-+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-+ _("Invalid target type for serial device"));
-+ goto error;
- }
-
- virBufferAsprintf(&cmd, "%s,chardev=char%s,id=%s",
---
-2.15.1
-
diff --git a/SOURCES/libvirt-conf-s-virDomainObjGetShortName-virDomainDefGetShortName.patch b/SOURCES/libvirt-conf-s-virDomainObjGetShortName-virDomainDefGetShortName.patch
deleted file mode 100644
index 7e74c84..0000000
--- a/SOURCES/libvirt-conf-s-virDomainObjGetShortName-virDomainDefGetShortName.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-From db9daffe41e8804f9db0fb70678be99e02efc168 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Michal Privoznik
-Date: Thu, 9 Nov 2017 16:06:42 +0100
-Subject: [PATCH] conf: s/virDomainObjGetShortName/virDomainDefGetShortName/
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1461214
-
-This function works over domain definition and not domain object.
-Its name is thus misleading.
-
-Signed-off-by: Michal Privoznik
-Reviewed-by: John Ferlan
-(cherry picked from commit fe70fd0c106e7fbe4f7272e5c041324ea3633ce4)
-Signed-off-by: Michal Privoznik
-Signed-off-by: Jiri Denemark
----
- src/conf/domain_conf.c | 4 ++--
- src/conf/domain_conf.h | 2 +-
- src/libvirt_private.syms | 2 +-
- src/qemu/qemu_conf.c | 2 +-
- src/qemu/qemu_domain.c | 4 ++--
- src/qemu/qemu_driver.c | 2 +-
- 6 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 394afb0d80..27cfecffda 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -27871,14 +27871,14 @@ virDomainDefHasMemballoon(const virDomainDef *def)
- #define VIR_DOMAIN_SHORT_NAME_MAX 20
-
- /**
-- * virDomainObjGetShortName:
-+ * virDomainDefGetShortName:
- * @vm: Machine for which to get a name
- * @unique: Make sure the name is unique (use id as well)
- *
- * Shorten domain name to avoid possible path length limitations.
- */
- char *
--virDomainObjGetShortName(const virDomainDef *def)
-+virDomainDefGetShortName(const virDomainDef *def)
- {
- wchar_t wshortname[VIR_DOMAIN_SHORT_NAME_MAX + 1] = {0};
- size_t len = 0;
-diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
-index 171f340785..388fa92dda 100644
---- a/src/conf/domain_conf.h
-+++ b/src/conf/domain_conf.h
-@@ -3366,7 +3366,7 @@ int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
-
- bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
-
--char *virDomainObjGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
-+char *virDomainDefGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
-
- int
- virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def,
-diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
-index 811d9053e6..6653f95722 100644
---- a/src/libvirt_private.syms
-+++ b/src/libvirt_private.syms
-@@ -262,6 +262,7 @@ virDomainDefGetMemoryInitial;
- virDomainDefGetMemoryTotal;
- virDomainDefGetOnlineVcpumap;
- virDomainDefGetSecurityLabelDef;
-+virDomainDefGetShortName;
- virDomainDefGetVcpu;
- virDomainDefGetVcpuPinInfoHelper;
- virDomainDefGetVcpus;
-@@ -458,7 +459,6 @@ virDomainObjGetMetadata;
- virDomainObjGetOneDef;
- virDomainObjGetOneDefState;
- virDomainObjGetPersistentDef;
--virDomainObjGetShortName;
- virDomainObjGetState;
- virDomainObjNew;
- virDomainObjParseNode;
-diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
-index 4e5b33b788..66f9761eea 100644
---- a/src/qemu/qemu_conf.c
-+++ b/src/qemu/qemu_conf.c
-@@ -1676,7 +1676,7 @@ qemuGetDomainHugepagePath(const virDomainDef *def,
- virHugeTLBFSPtr hugepage)
- {
- char *base = qemuGetBaseHugepagePath(hugepage);
-- char *domPath = virDomainObjGetShortName(def);
-+ char *domPath = virDomainDefGetShortName(def);
- char *ret = NULL;
-
- if (base && domPath)
-diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
-index 81bfef946e..27117d83ef 100644
---- a/src/qemu/qemu_domain.c
-+++ b/src/qemu/qemu_domain.c
-@@ -1706,7 +1706,7 @@ qemuDomainSetPrivatePaths(virQEMUDriverPtr driver,
- {
- virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
- qemuDomainObjPrivatePtr priv = vm->privateData;
-- char *domname = virDomainObjGetShortName(vm->def);
-+ char *domname = virDomainDefGetShortName(vm->def);
- int ret = -1;
-
- if (!domname)
-@@ -8207,7 +8207,7 @@ qemuDomainGetPreservedMountPath(virQEMUDriverConfigPtr cfg,
- char *path = NULL;
- char *tmp;
- const char *suffix = mountpoint + strlen(DEVPREFIX);
-- char *domname = virDomainObjGetShortName(vm->def);
-+ char *domname = virDomainDefGetShortName(vm->def);
- size_t off;
-
- if (!domname)
-diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
-index 82c60e6ef1..5617c78997 100644
---- a/src/qemu/qemu_driver.c
-+++ b/src/qemu/qemu_driver.c
-@@ -4088,7 +4088,7 @@ getAutoDumpPath(virQEMUDriverPtr driver,
- virDomainObjPtr vm)
- {
- char *dumpfile = NULL;
-- char *domname = virDomainObjGetShortName(vm->def);
-+ char *domname = virDomainDefGetShortName(vm->def);
- char timestr[100];
- struct tm time_info;
- time_t curtime = time(NULL);
---
-2.15.0
-
diff --git a/SOURCES/libvirt-cpu-add-CPU-features-and-model-for-indirect-branch-prediction-protection.patch b/SOURCES/libvirt-cpu-add-CPU-features-and-model-for-indirect-branch-prediction-protection.patch
deleted file mode 100644
index a915513..0000000
--- a/SOURCES/libvirt-cpu-add-CPU-features-and-model-for-indirect-branch-prediction-protection.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-From 9df09ec5e1afef8659271c6cc4a5b741d5d06815 Mon Sep 17 00:00:00 2001
-Message-Id: <9df09ec5e1afef8659271c6cc4a5b741d5d06815@dist-git>
-From: Paolo Bonzini
-Date: Tue, 12 Dec 2017 16:23:42 +0100
-Subject: [PATCH] cpu: add CPU features and model for indirect branch
- prediction protection
-
-CVE-2017-5715
-
-Signed-off-by: Paolo Bonzini
-Signed-off-by: Jiri Denemark
----
- src/cpu/cpu_map.xml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 58 insertions(+)
-
-diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
-index 96f4ce60dd..a7888ec134 100644
---- a/src/cpu/cpu_map.xml
-+++ b/src/cpu/cpu_map.xml
-@@ -292,6 +292,15 @@
-
-
-
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
-
-
-@@ -420,6 +429,11 @@
-
-
-
-+
-+
-+
-+
-+
-
-
-
-@@ -866,6 +880,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
-@@ -903,6 +921,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
-@@ -946,6 +968,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
-@@ -995,6 +1021,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
-@@ -1048,6 +1078,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
-@@ -1103,6 +1137,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
-@@ -1160,6 +1198,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
-@@ -1219,6 +1261,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
-@@ -1287,6 +1333,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
-@@ -1362,6 +1412,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
-@@ -1700,6 +1754,10 @@
-
-
-
-+
-+
-+
-+
-
-
-
---
-2.15.1
-
diff --git a/SOURCES/libvirt-cpu-define-the-ssbd-CPUID-feature-bit-CVE-2018-3639.patch b/SOURCES/libvirt-cpu-define-the-ssbd-CPUID-feature-bit-CVE-2018-3639.patch
deleted file mode 100644
index 6a5d64a..0000000
--- a/SOURCES/libvirt-cpu-define-the-ssbd-CPUID-feature-bit-CVE-2018-3639.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From ff87044456775053ad487635804d7ab49d476cf7 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?=
-Date: Thu, 10 May 2018 09:06:15 +0200
-Subject: [PATCH] cpu: define the 'ssbd' CPUID feature bit (CVE-2018-3639)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-New microcode introduces the "Speculative Store Bypass Disable"
-CPUID feature bit. This needs to be exposed to guest OS to allow
-them to protect against CVE-2018-3639.
-
-Signed-off-by: Daniel P. Berrangé
-(no upstream commit yet)
-
-Conflicts:
- src/cpu/cpu_map.xml
- - stibp and arch-facilities features pushed for Spectre do
- not exist upstream
-
-Signed-off-by: Jiri Denemark
-Reviewed-by: Daniel P. Berrangé
----
- src/cpu/cpu_map.xml | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
-index 4d786f1e0a..cee3541d24 100644
---- a/src/cpu/cpu_map.xml
-+++ b/src/cpu/cpu_map.xml
-@@ -301,6 +301,9 @@
-
-
-
-+
-+
-+
-
-
-
---
-2.17.0
-
diff --git a/SOURCES/libvirt-cpu-define-the-virt-ssbd-CPUID-feature-bit-CVE-2018-3639.patch b/SOURCES/libvirt-cpu-define-the-virt-ssbd-CPUID-feature-bit-CVE-2018-3639.patch
deleted file mode 100644
index a04fd30..0000000
--- a/SOURCES/libvirt-cpu-define-the-virt-ssbd-CPUID-feature-bit-CVE-2018-3639.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 6fff75c304d9403ac7c36c436ddf53497f6417ef Mon Sep 17 00:00:00 2001
-Message-Id: <6fff75c304d9403ac7c36c436ddf53497f6417ef@dist-git>
-From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?=
-Date: Mon, 21 May 2018 23:05:08 +0100
-Subject: [PATCH] cpu: define the 'virt-ssbd' CPUID feature bit (CVE-2018-3639)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Some AMD processors only support a non-architectural means of
-enabling Speculative Store Bypass Disable. To allow simplified
-handling in virtual environments, hypervisors will expose an
-architectural definition through CPUID bit 0x80000008_EBX[25].
-This needs to be exposed to guest OS running on AMD x86 hosts to
-allow them to protect against CVE-2018-3639.
-
-Note that since this CPUID bit won't be present in the host CPUID
-results on physical hosts, it will not be enabled automatically
-in guests configured with "host-model" CPU unless using QEMU
-version >= 2.9.0. Thus for older versions of QEMU, this feature
-must be manually enabled using policy=force. Guests using the
-"host-passthrough" CPU mode do not need special handling.
-
-Signed-off-by: Daniel P. Berrangé
-Reviewed-by: Jiri Denemark
-(cherry picked from commit 9267342206ce17f6933d57a3128cdc504d5945c9)
-Signed-off-by: Jiri Denemark
-Reviewed-by: Erik Skultety
----
- src/cpu/cpu_map.xml | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
-index cee3541d24..e0c39bb690 100644
---- a/src/cpu/cpu_map.xml
-+++ b/src/cpu/cpu_map.xml
-@@ -436,6 +436,9 @@
-
-
-
-+
-+
-+
-
-
-
---
-2.17.1
-
diff --git a/SOURCES/libvirt-cpu_x86-Copy-CPU-signature-from-ancestor.patch b/SOURCES/libvirt-cpu_x86-Copy-CPU-signature-from-ancestor.patch
deleted file mode 100644
index b81e716..0000000
--- a/SOURCES/libvirt-cpu_x86-Copy-CPU-signature-from-ancestor.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 38b3d773dddd7f3cfe715b9cbabaa296c16c1290 Mon Sep 17 00:00:00 2001
-Message-Id: <38b3d773dddd7f3cfe715b9cbabaa296c16c1290@dist-git>
-From: Jiri Denemark
-Date: Fri, 5 Jan 2018 17:43:03 +0100
-Subject: [PATCH] cpu_x86: Copy CPU signature from ancestor
-
-When specifying a new CPU model in cpu_map.xml as an extension to an
-existing model, we forgot to copy the signature (family + model) from
-the original CPU model.
-
-We don't use this way of specifying CPU models, but it's still supported
-and it becomes useful when someone wants to quickly hack up a CPU model
-for testing or when creating additional variants of existing models to
-help with fixing some spectral issues.
-
-Signed-off-by: Jiri Denemark
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit b427cf4831d0ea7aac9dd1a3aa7682478356a483)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1533125
-
-The new -IBRS and -IBPB CPU models were defined via inheritance from
-their original models in RHEL. Thus when the host CPU matches the
-signature of the original model from cpu_map.xml, libvirt will detect
-the host CPU as the original model + the new feature rather than
-reporting it as the -IBRS/-IBPB variant.
-
-Signed-off-by: Jiri Denemark
----
- src/cpu/cpu_x86.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
-index ad35532fc1..001109f701 100644
---- a/src/cpu/cpu_x86.c
-+++ b/src/cpu/cpu_x86.c
-@@ -1227,6 +1227,7 @@ x86ModelParse(xmlXPathContextPtr ctxt,
- VIR_FREE(name);
-
- model->vendor = ancestor->vendor;
-+ model->signature = ancestor->signature;
- if (x86DataCopy(&model->data, &ancestor->data) < 0)
- goto error;
- }
---
-2.15.1
-
diff --git a/SOURCES/libvirt-cpu_x86-Rename-virCPUx86MapInitialize.patch b/SOURCES/libvirt-cpu_x86-Rename-virCPUx86MapInitialize.patch
deleted file mode 100644
index b757b16..0000000
--- a/SOURCES/libvirt-cpu_x86-Rename-virCPUx86MapInitialize.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From b200b9cbb5c6c7d3d3b1bb4f745a7371cc35a429 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Jiri Denemark
-Date: Wed, 13 Dec 2017 22:30:31 +0100
-Subject: [PATCH] cpu_x86: Rename virCPUx86MapInitialize
-
-The function will be used to initialize internal data of the x86 CPU
-driver (including the CPU map).
-
-CVE-2017-5715
-
-Signed-off-by: Jiri Denemark
----
- src/cpu/cpu_x86.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
-index a6cbd45766..693e571a3d 100644
---- a/src/cpu/cpu_x86.c
-+++ b/src/cpu/cpu_x86.c
-@@ -153,8 +153,8 @@ struct _virCPUx86Map {
- };
-
- static virCPUx86MapPtr cpuMap;
--int virCPUx86MapOnceInit(void);
--VIR_ONCE_GLOBAL_INIT(virCPUx86Map);
-+int virCPUx86DriverOnceInit(void);
-+VIR_ONCE_GLOBAL_INIT(virCPUx86Driver);
-
-
- typedef enum {
-@@ -1404,7 +1404,7 @@ virCPUx86LoadMap(void)
-
-
- int
--virCPUx86MapOnceInit(void)
-+virCPUx86DriverOnceInit(void)
- {
- if (!(cpuMap = virCPUx86LoadMap()))
- return -1;
-@@ -1416,7 +1416,7 @@ virCPUx86MapOnceInit(void)
- static virCPUx86MapPtr
- virCPUx86GetMap(void)
- {
-- if (virCPUx86MapInitialize() < 0)
-+ if (virCPUx86DriverInitialize() < 0)
- return NULL;
-
- return cpuMap;
---
-2.15.1
-
diff --git a/SOURCES/libvirt-daemon-fix-rpc-event-leak-on-error-path-in-remoteDispatchObjectEventSend.patch b/SOURCES/libvirt-daemon-fix-rpc-event-leak-on-error-path-in-remoteDispatchObjectEventSend.patch
deleted file mode 100644
index 281af2e..0000000
--- a/SOURCES/libvirt-daemon-fix-rpc-event-leak-on-error-path-in-remoteDispatchObjectEventSend.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From 22b8106dabd9bbcaa78e6bcdd08b1c376f1a824d Mon Sep 17 00:00:00 2001
-Message-Id: <22b8106dabd9bbcaa78e6bcdd08b1c376f1a824d@dist-git>
-From: Nikolay Shirokovskiy
-Date: Tue, 24 Jul 2018 15:52:39 -0400
-Subject: [PATCH] daemon: fix rpc event leak on error path in
- remoteDispatchObjectEventSend
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-RHEL 7.6: https://bugzilla.redhat.com/show_bug.cgi?id=1598032
-RHEL 7.5.z: https://bugzilla.redhat.com/show_bug.cgi?id=1607752
-
-Reviewed-by: Daniel P. Berrangé
-Signed-off-by: Nikolay Shirokovskiy
-(cherry picked from commit 8fafbf630fb366f54ed7478af46574be21a0e37c)
-
-NB: Some valgrind data from bz:
-
- ==00:00:32:56.936 16421== 1,638,500 bytes in 25 blocks are possibly lost in loss record 2,349 of 2,351
- ==00:00:32:56.936 16421== at 0x4C29B0D: malloc (vg_replace_malloc.c:298)
- ==00:00:32:56.936 16421== by 0x4C2BAD9: realloc (vg_replace_malloc.c:785)
- ==00:00:32:56.936 16421== by 0x54BB5AF: virReallocN (viralloc.c:245)
- ==00:00:32:56.936 16421== by 0x165AD3: virNetMessageEncodeHeader (virnetmessage.c:234)
- ==00:00:32:56.936 16421== by 0x125472: remoteDispatchObjectEventSend (remote.c:3996)
- ==00:00:32:56.936 16421== by 0x129A7F: remoteRelayDomainEventLifecycle (remote.c:329)
- ==00:00:32:56.936 16421== by 0x5599091: virDomainEventDispatchDefaultFunc (domain_event.c:1779)
- ==00:00:32:56.936 16421== by 0x55975A6: virObjectEventStateDispatchCallbacks (object_event.c:715)
- ==00:00:32:56.936 16421== by 0x55975A6: virObjectEventStateQueueDispatch (object_event.c:729)
- ==00:00:32:56.936 16421== by 0x55975A6: virObjectEventStateFlush (object_event.c:830)
- ==00:00:32:56.936 16421== by 0x55975A6: virObjectEventTimer (object_event.c:560)
- ==00:00:32:56.936 16421== by 0x54DCC68: virEventPollDispatchTimeouts (vireventpoll.c:457)
- ==00:00:32:56.936 16421== by 0x54DCC68: virEventPollRunOnce (vireventpoll.c:653)
- ==00:00:32:56.936 16421== by 0x54DB5C1: virEventRunDefaultImpl (virevent.c:327)
- ==00:00:32:56.936 16421== by 0x565991C: virNetDaemonRun (virnetdaemon.c:837)
- ==00:00:32:56.936 16421== by 0x1240AD: main (libvirtd.c:1494)
- ==00:00:32:56.936 16421==
- ==00:00:32:56.936 16421== 55,668,712 (90,792 direct, 55,577,920 indirect) bytes in 873 blocks are definitely lost in loss record 2,351 of 2,351
- ==00:00:32:56.936 16421== at 0x4C2B955: calloc (vg_replace_malloc.c:711)
- ==00:00:32:56.936 16421== by 0x54BB4B3: virAlloc (viralloc.c:144)
- ==00:00:32:56.936 16421== by 0x165425: virNetMessageNew (virnetmessage.c:42)
- ==00:00:32:56.936 16421== by 0x125433: remoteDispatchObjectEventSend (remote.c:3986)
- ==00:00:32:56.936 16421== by 0x129A7F: remoteRelayDomainEventLifecycle (remote.c:329)
- ==00:00:32:56.936 16421== by 0x5599091: virDomainEventDispatchDefaultFunc (domain_event.c:1779)
- ==00:00:32:56.936 16421== by 0x55975A6: virObjectEventStateDispatchCallbacks (object_event.c:715)
- ==00:00:32:56.936 16421== by 0x55975A6: virObjectEventStateQueueDispatch (object_event.c:729)
- ==00:00:32:56.936 16421== by 0x55975A6: virObjectEventStateFlush (object_event.c:830)
- ==00:00:32:56.936 16421== by 0x55975A6: virObjectEventTimer (object_event.c:560)
- ==00:00:32:56.936 16421== by 0x54DCC68: virEventPollDispatchTimeouts (vireventpoll.c:457)
- ==00:00:32:56.936 16421== by 0x54DCC68: virEventPollRunOnce (vireventpoll.c:653)
- ==00:00:32:56.936 16421== by 0x54DB5C1: virEventRunDefaultImpl (virevent.c:327)
- ==00:00:32:56.936 16421== by 0x565991C: virNetDaemonRun (virnetdaemon.c:837)
- ==00:00:32:56.936 16421== by 0x1240AD: main (libvirtd.c:1494)
- ==00:00:32:56.936 16421==
-
-Signed-off-by: John Ferlan
-Reviewed-by: Jiri Denemark
----
- daemon/remote.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/daemon/remote.c b/daemon/remote.c
-index 3f7d2d3440..806479e72d 100644
---- a/daemon/remote.c
-+++ b/daemon/remote.c
-@@ -4000,7 +4000,8 @@ remoteDispatchObjectEventSend(virNetServerClientPtr client,
- goto cleanup;
-
- VIR_DEBUG("Queue event %d %zu", procnr, msg->bufferLength);
-- virNetServerClientSendMessage(client, msg);
-+ if (virNetServerClientSendMessage(client, msg) < 0)
-+ goto cleanup;
-
- xdr_free(proc, data);
- return;
---
-2.18.0
-
diff --git a/SOURCES/libvirt-docs-Improve-documentation-for-serial-consoles.patch b/SOURCES/libvirt-docs-Improve-documentation-for-serial-consoles.patch
deleted file mode 100644
index 7467515..0000000
--- a/SOURCES/libvirt-docs-Improve-documentation-for-serial-consoles.patch
+++ /dev/null
@@ -1,294 +0,0 @@
-From 07ed5aa86d223b1e99ef716429be60c1823ce0f5 Mon Sep 17 00:00:00 2001
-Message-Id: <07ed5aa86d223b1e99ef716429be60c1823ce0f5@dist-git>
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:22:55 +0100
-Subject: [PATCH] docs: Improve documentation for serial consoles
-
-Our current documentation is missing some information and doesn't
-do a great job at explaining how the and elements
-are connected. Let's try to fix that.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 4567cecb372c48095fce23ce3040d1c687cc3640)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1449265
-https://bugzilla.redhat.com/show_bug.cgi?id=1511421
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-https://bugzilla.redhat.com/show_bug.cgi?id=1512934
-Signed-off-by: Jiri Denemark
----
- docs/formatdomain.html.in | 224 +++++++++++++++++++++++++++++++++-------------
- 1 file changed, 164 insertions(+), 60 deletions(-)
-
-diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
-index 4f28dce355..f57a124056 100644
---- a/docs/formatdomain.html.in
-+++ b/docs/formatdomain.html.in
-@@ -6434,77 +6434,68 @@ qemu-kvm -net nic,model=? /dev/null
-
-+...
-+<devices>
-+ <!-- USB serial port -->
-+ <serial type='pty'>
-+ <target type='usb-serial' port='0'/>
-+ <address type='usb' bus='0' port='1'/>
-+ </serial>
-+</devices>
- ...
-
-
-- target can have a port attribute, which
-- specifies the port number. Ports are numbered starting from 0. There are
-- usually 0, 1 or 2 serial ports. There is also an optional
-- type attribute since 1.0.2
-- which has three choices for its value, one is isa-serial,
-- then usb-serial and last one is pci-serial.
-- If type is missing, isa-serial will be used by
-- default. For usb-serial an optional sub-element
-- <address/> with type='usb' can tie the
-- device to a particular controller, documented above.
-- Similarly, pci-serial can be used to attach the device to
-- the pci bus (since 1.2.16). Again, it has
-- optional sub-element <address/> with
-- type='pci' to select desired location on the PCI bus.
-+ The target element can have an optional port
-+ attribute, which specifies the port number (starting from 0), and an
-+ optional type attribute: valid values are,
-+ since 1.0.2, isa-serial (usable
-+ with x86 guests), usb-serial (usable whenever USB support
-+ is available) and pci-serial (usable whenever PCI support
-+ is available).
-+
-+
-+
-+ If any of the attributes is not specified by the user, libvirt will
-+ choose a value suitable for most users.
-+
-+
-+
-+ All of the target types support configuring the guest-visible device
-+ address as documented above; more
-+ specifically, acceptable address types are isa (for
-+ isa-serial), usb (for usb-serial)
-+ and pci (for pci-serial).
-+
-+
-+
-+ For the relationship between serial ports and consoles,
-+ see below.
-
-- The console element is used to represent interactive consoles. Depending
-- on the type of guest in use, the consoles might be paravirtualized devices,
-- or they might be a clone of a serial device, according to the following
-- rules:
--
--
--
--
If no targetType attribute is set, then the default
-- device type is according to the hypervisor's rules. The default
-- type will be added when re-querying the XML fed into libvirt.
-- For fully virtualized guests, the default device type will usually
-- be a serial port.
--
If the targetType attribute is serial,
-- then if no <serial> element exists, the console
-- element will be copied to the serial element. If a <serial>
-- element does already exist, the console element will be ignored.
--
If the targetType attribute is not serial,
-- it will be treated normally.
--
Only the first console element may use a targetType
-- of serial. Secondary consoles must all be paravirtualized.
--
--
On S390, the console element may use a
-- targetType of sclp or sclplm
-- (line mode). SCLP is the native console type for S390. There's no
-- controller associated to SCLP consoles.
-- Since 1.0.2
--
-+ The console element is used to represent interactive
-+ serial consoles. Depending on the type of guest in use and the specifics
-+ of the configuration, the console element might represent
-+ the same device as an existing serial element or a separate
-+ device.
-+
-+
-+
-+ A target subelement is supported and works the same
-+ way as with the serial element
-+ (see above for details).
-+ Valid values for the type attribute are:
-+ serial (described below);
-+ virtio (usable whenever VirtIO support is available);
-+ xen, lxc, uml and
-+ openvz (available when the corresponding hypervisor is in
-+ use); sclp and sclplm (usable for s390 and
-+ s390x QEMU guests).
-+
-+
-+
-+ Of the target types listed above, serial is special in
-+ that it doesn't represents a separate device, but rather the same
-+ device as the first serial element. Due to this, there can
-+ only be a single console element with target type
-+ serial per guest.
-+
-+ Due to hystorical reasons, the serial and
-+ console elements have partially overlapping scopes.
-+
-+
-+
-+ In general, both elements are used to configure one or more serial
-+ consoles to be used for interacting with the guest. The main difference
-+ between the two is that serial is used for emulated,
-+ usually native, serial consoles, whereas console is used
-+ for paravirtualized ones.
-+
-+
-+
-+ Both emulated and paravirtualized serial consoles have advantages and
-+ disadvantages:
-+
-+
-+
-+
-+ emulated serial consoles are usually initialized much earlier than
-+ paravirtualized ones, so they can be used to control the bootloader
-+ and display both firmware and early boot messages;
-+
-+
-+ on several platforms, there can only be a single emulated serial
-+ console per guest but paravirtualized consoles don't suffer from the
-+ same limitation.
-+
-- If the console is presented as a serial port, the target
-- element has the same attributes as for a serial port. There is usually
-- only 1 console.
-+ will work on any platform and will result in one emulated serial console
-+ for early boot logging / interactive / recovery use, and one
-+ paravirtualized serial console to be used eg. as a side channel. Most
-+ people will be fine with having just the first console
-+ element in their configuration.
-+
-+
-+
-+ Note that, due to the compatibility concerns mentioned earlier, all the
-+ following configurations:
-+
---
-2.15.1
-
diff --git a/SOURCES/libvirt-docs-Rephrase-the-mediated-devices-hostdev-section-a-bit.patch b/SOURCES/libvirt-docs-Rephrase-the-mediated-devices-hostdev-section-a-bit.patch
new file mode 100644
index 0000000..f2074b8
--- /dev/null
+++ b/SOURCES/libvirt-docs-Rephrase-the-mediated-devices-hostdev-section-a-bit.patch
@@ -0,0 +1,44 @@
+From 2cde7a2663e01123a88c5c6436a41e88d8a1f5c5 Mon Sep 17 00:00:00 2001
+Message-Id: <2cde7a2663e01123a88c5c6436a41e88d8a1f5c5@dist-git>
+From: Erik Skultety
+Date: Thu, 19 Jul 2018 15:04:04 +0200
+Subject: [PATCH] docs: Rephrase the mediated devices hostdev section a bit
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Currently it reads:
+Refer MDEV to create a mediated device on the host
+
+...even though it resembles English, it's not a proper English.
+
+Reviewed-by: Ján Tomko
+Signed-off-by: Erik Skultety
+(cherry picked from commit 32b52ed838dd393b4249ddcb9d4b17f1deafbc2b)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1475770
+Signed-off-by: Erik Skultety
+Reviewed-by: Ján Tomko
+---
+ docs/formatdomain.html.in | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
+index 3554c3dc30..0e8f0a125f 100644
+--- a/docs/formatdomain.html.in
++++ b/docs/formatdomain.html.in
+@@ -4509,8 +4509,9 @@
+ determines how the host's vfio driver will expose the device to the
+ guest. Currently, model='vfio-pci' and
+ model='vfio-ccw' (Since 4.4.0)
+- is supported. Refer MDEV to create
+- a mediated device on the host.
++ is supported. MDEV section
++ provides more information about mediated devices as well as how to
++ create mediated devices on the host.
+ Since 4.6.0 (QEMU 2.12) an optional
+ display attribute may be used to enable or disable
+ support for an accelerated remote desktop backed by a mediated
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-docs-domain-Fix-documentation-of-the-snapshot-attribute-for-disk.patch b/SOURCES/libvirt-docs-domain-Fix-documentation-of-the-snapshot-attribute-for-disk.patch
deleted file mode 100644
index b6944df..0000000
--- a/SOURCES/libvirt-docs-domain-Fix-documentation-of-the-snapshot-attribute-for-disk.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 60643d072a849ffbb01e8313124154f7aecc02ad Mon Sep 17 00:00:00 2001
-Message-Id: <60643d072a849ffbb01e8313124154f7aecc02ad@dist-git>
-From: Peter Krempa
-Date: Thu, 7 Dec 2017 14:36:06 +0100
-Subject: [PATCH] docs: domain: Fix documentation of the 'snapshot' attribute
- for
-
-Emphasise the valid values by wrapping them in and reword the
-last sentence so that the invalid value example can be dropped.
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1523070
-(cherry picked from commit 1e98d450f27ae0131ac2ac8aa1c1d7a254d22dd1)
-Signed-off-by: Jiri Denemark
----
- docs/formatdomain.html.in | 19 +++++++++----------
- 1 file changed, 9 insertions(+), 10 deletions(-)
-
-diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
-index 6807da5c6f..0cfbf051b7 100644
---- a/docs/formatdomain.html.in
-+++ b/docs/formatdomain.html.in
-@@ -2573,17 +2573,16 @@
-
snapshot
-
- Indicates the default behavior of the disk during disk snapshots:
-- "internal" requires a file format such as qcow2 that can store
-- both the snapshot and the data changes since the snapshot;
-- "external" will separate the snapshot from the live data; and
-- "no" means the disk will not participate in snapshots. Read-only
-- disks default to "no", while the default for other disks depends
-- on the hypervisor's capabilities. Some hypervisors allow a
-- per-snapshot choice as well, during
-+ "internal" requires a file format such as qcow2 that
-+ can store both the snapshot and the data changes since the snapshot;
-+ "external" will separate the snapshot from the live
-+ data; and "no" means the disk will not participate in
-+ snapshots. Read-only disks default to "no", while the
-+ default for other disks depends on the hypervisor's capabilities.
-+ Some hypervisors allow a per-snapshot choice as well, during
- domain snapshot creation.
-- Not all snapshot modes are supported; for example,
-- snapshot='yes' with a transient disk generally
-- does not make sense.
-+ Not all snapshot modes are supported; for example, enabling
-+ snapshots with a transient disk generally does not make sense.
- Since 0.9.5
-
-
---
-2.15.1
-
diff --git a/SOURCES/libvirt-docs-schema-Add-missing-alias-to-vsock-device.patch b/SOURCES/libvirt-docs-schema-Add-missing-alias-to-vsock-device.patch
new file mode 100644
index 0000000..efdd05a
--- /dev/null
+++ b/SOURCES/libvirt-docs-schema-Add-missing-alias-to-vsock-device.patch
@@ -0,0 +1,39 @@
+From b2f024a35876f242cfab304872f83ae069c45e2a Mon Sep 17 00:00:00 2001
+Message-Id:
+From: Han Han
+Date: Fri, 13 Jul 2018 13:08:27 +0200
+Subject: [PATCH] docs: schema: Add missing to vsock device
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1600345
+
+Signed-off-by: Han Han
+Reviewed-by: Erik Skultety
+(cherry picked from commit c03d36b91d62890b376a2ff8f9d65fac069dce42)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1600345
+Signed-off-by: Erik Skultety
+Reviewed-by: Ján Tomko
+---
+ docs/schemas/domaincommon.rng | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
+index bd687ce9d3..f24a56392a 100644
+--- a/docs/schemas/domaincommon.rng
++++ b/docs/schemas/domaincommon.rng
+@@ -4234,6 +4234,9 @@
+
+
+
++
++
++
+
+
+
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-domain_nwfilter-Return-early-if-net-has-no-name-in-virDomainConfNWFilterTeardownImpl.patch b/SOURCES/libvirt-domain_nwfilter-Return-early-if-net-has-no-name-in-virDomainConfNWFilterTeardownImpl.patch
new file mode 100644
index 0000000..05b09ac
--- /dev/null
+++ b/SOURCES/libvirt-domain_nwfilter-Return-early-if-net-has-no-name-in-virDomainConfNWFilterTeardownImpl.patch
@@ -0,0 +1,46 @@
+From 01d4d47593cc3e8c10c37a899b9edb70234c0547 Mon Sep 17 00:00:00 2001
+Message-Id: <01d4d47593cc3e8c10c37a899b9edb70234c0547@dist-git>
+From: Michal Privoznik
+Date: Wed, 25 Jul 2018 13:52:55 +0200
+Subject: [PATCH] domain_nwfilter: Return early if net has no name in
+ virDomainConfNWFilterTeardownImpl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1607831
+
+This function is called from various clean up paths (e.g.
+from qemuBuildInterfaceCommandLine). However, depending on the
+stage the interface creation process failed at, net->ifname might
+still be not filled in when control jumps to cleanup label. If
+that is the case return early (avoiding useless error message
+produced in virNWFilterBindingLookupByPortDev) as there is no
+NWFilter to tear down anyway.
+
+Signed-off-by: Michal Privoznik
+Reviewed-by: Erik Skultety
+(cherry picked from commit 3087b27cffdd46ad0e953e061d6f3c519aefd5d8)
+Signed-off-by: Michal Privoznik
+Reviewed-by: Ján Tomko
+---
+ src/conf/domain_nwfilter.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/conf/domain_nwfilter.c b/src/conf/domain_nwfilter.c
+index 24b5f42ddd..f39c8a1f9b 100644
+--- a/src/conf/domain_nwfilter.c
++++ b/src/conf/domain_nwfilter.c
+@@ -133,6 +133,9 @@ virDomainConfNWFilterTeardownImpl(virConnectPtr conn,
+ {
+ virNWFilterBindingPtr binding;
+
++ if (!net->ifname)
++ return;
++
+ binding = virNWFilterBindingLookupByPortDev(conn, net->ifname);
+ if (!binding)
+ return;
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-esx-storage-Fix-typo-lsilogic-lsiLogic.patch b/SOURCES/libvirt-esx-storage-Fix-typo-lsilogic-lsiLogic.patch
new file mode 100644
index 0000000..fa47c51
--- /dev/null
+++ b/SOURCES/libvirt-esx-storage-Fix-typo-lsilogic-lsiLogic.patch
@@ -0,0 +1,42 @@
+From 193f57411bcc3b67a331763f28d20b93c08b5191 Mon Sep 17 00:00:00 2001
+Message-Id: <193f57411bcc3b67a331763f28d20b93c08b5191@dist-git>
+From: Marcos Paulo de Souza
+Date: Wed, 25 Jul 2018 13:33:50 +0200
+Subject: [PATCH] esx storage: Fix typo lsilogic -> lsiLogic
+
+Commit 77298458d027db4d3e082213355e2d792f65158d changed the esx storage
+adapter from busLogic to lsilogic, introducing a typo. Changing it back
+to lsiLogic (with capital L) solves the issue. With this change, libvirt can now
+create volumes in ESX again.
+
+Thanks to Jaroslav Suchanek who figured out what was the issue in the
+first place.
+
+Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1571759
+Signed-off-by: Marcos Paulo de Souza
+(cherry picked from commit a1450d774f9412b6589418bf8bcafd12690d098a)
+Signed-off-by: Michal Privoznik
+Reviewed-by: Andrea Bolognani
+---
+ src/esx/esx_storage_backend_vmfs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/esx/esx_storage_backend_vmfs.c b/src/esx/esx_storage_backend_vmfs.c
+index 630a6aa8c9..bb2de4b69f 100644
+--- a/src/esx/esx_storage_backend_vmfs.c
++++ b/src/esx/esx_storage_backend_vmfs.c
+@@ -967,9 +967,9 @@ esxStorageVolCreateXML(virStoragePoolPtr pool,
+ /*
+ * FIXME: The adapter type is a required parameter, but there is no
+ * way to let the user specify it in the volume XML config. Therefore,
+- * default to 'lsilogic' here.
++ * default to 'lsiLogic' here.
+ */
+- virtualDiskSpec->adapterType = (char *)"lsilogic";
++ virtualDiskSpec->adapterType = (char *)"lsiLogic";
+
+ virtualDiskSpec->capacityKb->value =
+ VIR_DIV_UP(def->target.capacity, 1024); /* Scale from byte to kilobyte */
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-examples-Add-clean-traffic-gateway-into-nwfilters.patch b/SOURCES/libvirt-examples-Add-clean-traffic-gateway-into-nwfilters.patch
new file mode 100644
index 0000000..62be783
--- /dev/null
+++ b/SOURCES/libvirt-examples-Add-clean-traffic-gateway-into-nwfilters.patch
@@ -0,0 +1,77 @@
+From ceeba568bf66491826fdd2c16002890375790a4f Mon Sep 17 00:00:00 2001
+Message-Id:
+From: Ales Musil
+Date: Sun, 29 Jul 2018 16:56:18 +0200
+Subject: [PATCH] examples: Add clean-traffic-gateway into nwfilters
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The filter purpose is to simulate isolated private VLAN.
+
+The behavior can be achieved by limiting network traffic
+to traffic between VM and gateway. Because there is no
+concept of the PVLAN in the linux bridge.
+
+The filter also contains parts from clean-traffic
+to prevent VM from spoofing its IP and MAC address.
+
+To use this filter the user just needs to set
+the GATEWAY_MAC variable to gateway MAC address.
+
+Signed-off-by: Ales Musil
+Reviewed-by: Martin Kletzander
+(cherry picked from commit ac01fbc90b7eb4ccc7a6140d618d1a3859365155)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1603115
+
+Signed-off-by: Martin Kletzander
+Reviewed-by: Ján Tomko
+---
+ .../xml/nwfilter/clean-traffic-gateway.xml | 34 +++++++++++++++++++
+ 1 file changed, 34 insertions(+)
+ create mode 100644 examples/xml/nwfilter/clean-traffic-gateway.xml
+
+diff --git a/examples/xml/nwfilter/clean-traffic-gateway.xml b/examples/xml/nwfilter/clean-traffic-gateway.xml
+new file mode 100644
+index 0000000000..b8c204041a
+--- /dev/null
++++ b/examples/xml/nwfilter/clean-traffic-gateway.xml
+@@ -0,0 +1,34 @@
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-fixup_resctrlinfo.patch b/SOURCES/libvirt-fixup_resctrlinfo.patch
deleted file mode 100644
index 1c0125e..0000000
--- a/SOURCES/libvirt-fixup_resctrlinfo.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From ff96b6f60e7062da45f24366db871c3ce675892e Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Martin Kletzander
-Date: Wed, 31 Jan 2018 16:32:28 +0100
-Subject: [PATCH] fixup_resctrlinfo
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1289368
-
-Signed-off-by: Martin Kletzander
-(cherry picked from commit 434848d7dca9d1a7838ab53bbfdcf580ef7f2cc2)
-Signed-off-by: Martin Kletzander
----
- src/util/virresctrl.c | 29 +++++++++++++++++++----------
- 1 file changed, 19 insertions(+), 10 deletions(-)
-
-diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
-index f122af2050..d439e7792c 100644
---- a/src/util/virresctrl.c
-+++ b/src/util/virresctrl.c
-@@ -200,6 +200,8 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl)
- }
-
- while ((rv = virDirRead(dirp, &ent, SYSFS_RESCTRL_PATH "/info")) > 0) {
-+ VIR_DEBUG("Parsing info type '%s'", ent->d_name);
-+
- if (ent->d_type != DT_DIR)
- continue;
-
-@@ -207,16 +209,14 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl)
- continue;
-
- if (virStrToLong_uip(ent->d_name + 1, &endptr, 10, &level) < 0) {
-- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-- _("Cannot parse resctrl cache info level"));
-- goto cleanup;
-+ VIR_DEBUG("Cannot parse resctrl cache info level '%s'", ent->d_name + 1);
-+ continue;
- }
-
- type = virResctrlTypeFromString(endptr);
- if (type < 0) {
-- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-- _("Cannot parse resctrl cache info type"));
-- goto cleanup;
-+ VIR_DEBUG("Cannot parse resctrl cache info type '%s'", endptr);
-+ continue;
- }
-
- if (VIR_ALLOC(i_type) < 0)
-@@ -259,10 +259,19 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl)
- level - resctrl->nlevels + 1) < 0)
- goto cleanup;
-
-- if (!resctrl->levels[level] &&
-- (VIR_ALLOC(resctrl->levels[level]) < 0 ||
-- VIR_ALLOC_N(resctrl->levels[level]->types, VIR_CACHE_TYPE_LAST) < 0))
-- goto cleanup;
-+ if (!resctrl->levels[level]) {
-+ virResctrlInfoPerTypePtr *types = NULL;
-+
-+ if (VIR_ALLOC_N(types, VIR_CACHE_TYPE_LAST) < 0)
-+ goto cleanup;
-+
-+ if (VIR_ALLOC(resctrl->levels[level]) < 0) {
-+ VIR_FREE(types);
-+ goto cleanup;
-+ }
-+ resctrl->levels[level]->types = types;
-+ }
-+
- i_level = resctrl->levels[level];
-
- if (i_level->types[type]) {
---
-2.16.1
-
diff --git a/SOURCES/libvirt-internal-add-STRCASEPREFIX.patch b/SOURCES/libvirt-internal-add-STRCASEPREFIX.patch
deleted file mode 100644
index e196502..0000000
--- a/SOURCES/libvirt-internal-add-STRCASEPREFIX.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From d31ebaf3eb3c4ead397c054cbe1a7dbfe331aad5 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Pino Toscano
-Date: Thu, 12 Apr 2018 17:26:20 +0200
-Subject: [PATCH] internal: add STRCASEPREFIX
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Simple macro to check the prefix of a string in a case-insensitive way.
-
-Signed-off-by: Pino Toscano
-(cherry picked from commit e508e04b108709af0ca2c4d6728440b0edc3cc4b)
-
-https: //bugzilla.redhat.com/show_bug.cgi?id=1566524
-Signed-off-by: Pino Toscano
-Reviewed-by: Ján Tomko
----
- src/internal.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/internal.h b/src/internal.h
-index c29f20f022..f5e7a1886c 100644
---- a/src/internal.h
-+++ b/src/internal.h
-@@ -75,6 +75,7 @@
- # define STRNEQLEN(a, b, n) (strncmp(a, b, n) != 0)
- # define STRCASENEQLEN(a, b, n) (c_strncasecmp(a, b, n) != 0)
- # define STRPREFIX(a, b) (strncmp(a, b, strlen(b)) == 0)
-+# define STRCASEPREFIX(a, b) (c_strncasecmp(a, b, strlen(b)) == 0)
- # define STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL)
-
- # define STREQ_NULLABLE(a, b) \
---
-2.17.0
-
diff --git a/SOURCES/libvirt-logging-Don-t-inhibit-shutdown-in-system-daemon.patch b/SOURCES/libvirt-logging-Don-t-inhibit-shutdown-in-system-daemon.patch
deleted file mode 100644
index f391ec4..0000000
--- a/SOURCES/libvirt-logging-Don-t-inhibit-shutdown-in-system-daemon.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 601fbd22bbf812cb0ef60b039fc8214dadbdffaa Mon Sep 17 00:00:00 2001
-Message-Id: <601fbd22bbf812cb0ef60b039fc8214dadbdffaa@dist-git>
-From: Martin Kletzander
-Date: Tue, 1 May 2018 15:54:22 +0200
-Subject: [PATCH] logging: Don't inhibit shutdown in system daemon
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-That is a job of libvirtd and virtlogd has a dependency on it, so that will
-prevent it properly. Doing it one extra time in virtlogd might also cause AVC
-denials because it is not allowed to call that dbus method.
-
-Caused by commit df34363d58bb.
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1547250
-
-Signed-off-by: Martin Kletzander
-Reviewed-by: Daniel P. Berrangé
-(cherry picked from commit f94e5b215720c91c60219f1694783a603f0b619c)
-
-https: //bugzilla.redhat.com/show_bug.cgi?id=1573268
-Reviewed-by: Erik Skultety
----
- src/logging/log_daemon.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
-index 5a136c59d1..b00b37878a 100644
---- a/src/logging/log_daemon.c
-+++ b/src/logging/log_daemon.c
-@@ -129,6 +129,12 @@ virLogDaemonInhibitor(bool inhibit, void *opaque)
- {
- virLogDaemonPtr dmn = opaque;
-
-+ /* virtlogd uses inhibition only to stop session daemon being killed after
-+ * the specified timeout, for the system daemon this is taken care of by
-+ * libvirtd and the dependencies between the services. */
-+ if (virNetDaemonIsPrivileged(dmn->dmn))
-+ return;
-+
- if (inhibit)
- virNetDaemonAddShutdownInhibition(dmn->dmn);
- else
---
-2.17.1
-
diff --git a/SOURCES/libvirt-lxc-Drop-useless-check-in-live-device-update.patch b/SOURCES/libvirt-lxc-Drop-useless-check-in-live-device-update.patch
deleted file mode 100644
index 7b6e89c..0000000
--- a/SOURCES/libvirt-lxc-Drop-useless-check-in-live-device-update.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 442ccfef325b73b201332c89cc53421f8299998e Mon Sep 17 00:00:00 2001
-Message-Id: <442ccfef325b73b201332c89cc53421f8299998e@dist-git>
-From: Jiri Denemark
-Date: Thu, 22 Feb 2018 13:22:39 +0100
-Subject: [PATCH] lxc: Drop useless check in live device update
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Checking the new device definition makes little sense when lxc driver
-does not support live device update at all.
-
-Signed-off-by: Jiri Denemark
-(cherry picked from commit e3497f3fc895c427ce35188f3ddb2bb47a853be9)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1557922
-
-Signed-off-by: Jiri Denemark
-Reviewed-by: Ján Tomko
----
- src/lxc/lxc_driver.c | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
-index b3f6f064f3..7829ef8618 100644
---- a/src/lxc/lxc_driver.c
-+++ b/src/lxc/lxc_driver.c
-@@ -4910,9 +4910,6 @@ static int lxcDomainUpdateDeviceFlags(virDomainPtr dom,
- }
-
- if (flags & VIR_DOMAIN_AFFECT_LIVE) {
-- if (virDomainDefCompatibleDevice(vm->def, dev_copy) < 0)
-- goto endjob;
--
- virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
- _("Unable to modify live devices"));
-
---
-2.17.0
-
diff --git a/SOURCES/libvirt-migration.html-Clarify-configuration-file-handling-docs.patch b/SOURCES/libvirt-migration.html-Clarify-configuration-file-handling-docs.patch
deleted file mode 100644
index bf807c0..0000000
--- a/SOURCES/libvirt-migration.html-Clarify-configuration-file-handling-docs.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-From d52ae79470eb8725b63a6470e393149b48f508da Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Jiri Denemark
-Date: Fri, 8 Dec 2017 10:31:38 +0100
-Subject: [PATCH] migration.html: Clarify configuration file handling docs
-
-Migration never removes any configuration files on the destination host.
-Thus when the domain is already defined on the destination, it will stay
-persistent even after migration without --persist.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1514930
-
-Signed-off-by: Jiri Denemark
-(cherry picked from commit 2c01e4febcd161226ce707892d8e53f4e66f708f)
-Signed-off-by: Jiri Denemark
----
- docs/migration.html.in | 34 +++++++++++++++++-----------------
- 1 file changed, 17 insertions(+), 17 deletions(-)
-
-diff --git a/docs/migration.html.in b/docs/migration.html.in
-index de7d4def75..7c345b65b7 100644
---- a/docs/migration.html.in
-+++ b/docs/migration.html.in
-@@ -206,14 +206,14 @@
-
-- There are two types of virtual machine known to libvirt. A transient
-+ There are two types of virtual machines known to libvirt. A transient
- guest only exists while it is running, and has no configuration file stored
- on disk. A persistent guest maintains a configuration file on disk
- even when it is not running.
-
-
-
-- By default, a migration operation will not attempt to change any configuration
-+ By default, a migration operation will not attempt to modify any configuration
- files that may be stored on either the source or destination host. It is the
- administrator, or management application's, responsibility to manage distribution
- of configuration files (if desired). It is important to note that the /etc/libvirt
-@@ -230,14 +230,14 @@
- host and removed on the original.
-
-
Centralized configuration files outside libvirt, in a database. A data center
-- management application may not storage configuration files at all. Instead it
-+ management application may not store configuration files at all. Instead it
- may generate libvirt XML on the fly when a guest is booted. It will typically
- use transient guests, and thus not have to consider configuration files during
- migration.
-
-
Distributed configuration inside libvirt. The configuration file for each
- guest is copied to every host where the guest is able to run. Upon migration
-- the existing config merely needs to be updated with any changes
-+ the existing config merely needs to be updated with any changes.
-
-
Ad-hoc configuration management inside libvirt. Each guest is tied to a
- specific host and rarely migrated. When migration is required, the config
-@@ -246,7 +246,7 @@
-
-
-
-- As mentioned above, libvirt will not touch configuration files during
-+ As mentioned above, libvirt will not modify configuration files during
- migration by default. The virsh command has two flags to
- influence this behaviour. The --undefine-source flag
- will cause the configuration file to be removed on the source host
-@@ -265,12 +265,12 @@
-
After migration
-
-
--
Guest type
-+
Source type
-
Source config
-
Dest config
-
--undefine-source
-
--persist
--
Guest type
-+
Dest type
-
Source config
-
Dest config
-
-@@ -325,9 +325,9 @@
-
Y
-
N
-
N
--
Transient
--
N
-+
Persistent
-
N
-+
Y (unchanged dest config)
-
-
-
Transient
-@@ -335,9 +335,9 @@
-
Y
-
Y
-
N
--
Transient
--
N
-+
Persistent
-
N
-+
Y (unchanged dest config)
-
-
-
Transient
-@@ -347,7 +347,7 @@
-
Y
-
Persistent
-
N
--
Y
-+
Y (replaced with source)
-
-
-
Transient
-@@ -357,7 +357,7 @@
-
Y
-
Persistent
-
N
--
Y
-+
Y (replaced with source)
-
-
-
-@@ -411,7 +411,7 @@
-
N
-
Persistent
-
Y
--
Y
-+
Y (unchanged dest config)
-
-
-
Persistent
-@@ -421,7 +421,7 @@
-
N
-
Persistent
-
N
--
Y
-+
Y (unchanged dest config)
-
-
-
Persistent
-@@ -431,7 +431,7 @@
-
Y
-
Persistent
-
Y
--
Y
-+
Y (replaced with source)
-
-
-
Persistent
-@@ -441,7 +441,7 @@
-
Y
-
Persistent
-
N
--
Y
-+
Y (replaced with source)
-
-
-
---
-2.15.1
-
diff --git a/SOURCES/libvirt-networkGetDHCPLeases-Don-t-always-report-error-if-unable-to-read-leases-file.patch b/SOURCES/libvirt-networkGetDHCPLeases-Don-t-always-report-error-if-unable-to-read-leases-file.patch
new file mode 100644
index 0000000..73563b0
--- /dev/null
+++ b/SOURCES/libvirt-networkGetDHCPLeases-Don-t-always-report-error-if-unable-to-read-leases-file.patch
@@ -0,0 +1,59 @@
+From bc34e4669322664483b370f6c606a9caaaea4d5a Mon Sep 17 00:00:00 2001
+Message-Id:
+From: Michal Privoznik
+Date: Thu, 26 Jul 2018 11:41:09 +0200
+Subject: [PATCH] networkGetDHCPLeases: Don't always report error if unable to
+ read leases file
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1600468
+
+If we are unable to read leases file (no matter what the reason
+is), we return 0 - just like if there were no leases. However,
+because we use virFileReadAll() an error is printed into the log.
+Note that not all networks have leases file - only those for
+which we start dnsmasq.
+
+Signed-off-by: Michal Privoznik
+Reviewed-by: Erik Skultety
+(cherry picked from commit 142c4b10fd8f55b7d2e86f5a184608da70f2edd3)
+Signed-off-by: Michal Privoznik
+Reviewed-by: Erik Skultety
+---
+ src/network/bridge_driver.c | 21 ++++++++++++++-------
+ 1 file changed, 14 insertions(+), 7 deletions(-)
+
+diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
+index ac849581ec..1ad95d524c 100644
+--- a/src/network/bridge_driver.c
++++ b/src/network/bridge_driver.c
+@@ -4157,13 +4157,20 @@ networkGetDHCPLeases(virNetworkPtr net,
+ custom_lease_file = networkDnsmasqLeaseFileNameCustom(driver, def->bridge);
+
+ /* Read entire contents */
+- if ((custom_lease_file_len = virFileReadAll(custom_lease_file,
+- VIR_NETWORK_DHCP_LEASE_FILE_SIZE_MAX,
+- &lease_entries)) < 0) {
+- /* Even though src/network/leaseshelper.c guarantees the existence of
+- * leases file (even if no leases are present), and the control reaches
+- * here, instead of reporting error, return 0 leases */
+- rv = 0;
++ if ((custom_lease_file_len = virFileReadAllQuiet(custom_lease_file,
++ VIR_NETWORK_DHCP_LEASE_FILE_SIZE_MAX,
++ &lease_entries)) < 0) {
++ /* Not all networks are guaranteed to have leases file.
++ * Only those which run dnsmasq. Therefore, if we failed
++ * to read the leases file, don't report error. Return 0
++ * leases instead. */
++ if (errno == ENOENT) {
++ rv = 0;
++ } else {
++ virReportSystemError(errno,
++ _("Unable to read leases file: %s"),
++ custom_lease_file);
++ }
+ goto error;
+ }
+
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-nodedev-Restore-setting-of-privileged.patch b/SOURCES/libvirt-nodedev-Restore-setting-of-privileged.patch
deleted file mode 100644
index 94e6ada..0000000
--- a/SOURCES/libvirt-nodedev-Restore-setting-of-privileged.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From be8c0df9c361446003821c35af1531187d0080b9 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: John Ferlan
-Date: Fri, 24 Nov 2017 12:13:52 -0500
-Subject: [PATCH] nodedev: Restore setting of privileged
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1517372
-
-Commit id '36555364' removed the setting of the driver->privileged,
-which the udevProcessPCI would need in order to read the PCI device
-configs.
-
-Signed-off-by: John Ferlan
-(cherry picked from commit 9bfcf3ccdd2a0bb599dff27f97d5c1524cba1b79)
-Reviewed-by: Erik Skultety
-Signed-off-by: Jiri Denemark
----
- src/node_device/node_device_udev.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
-index d48334b857..ed012200f5 100644
---- a/src/node_device/node_device_udev.c
-+++ b/src/node_device/node_device_udev.c
-@@ -1933,6 +1933,8 @@ nodeStateInitialize(bool privileged,
- return -1;
- }
-
-+ driver->privileged = privileged;
-+
- if (!(driver->devs = virNodeDeviceObjListNew()) ||
- !(priv = udevEventDataNew()))
- goto cleanup;
---
-2.15.1
-
diff --git a/SOURCES/libvirt-numa-Introduce-virDomainNumaNodeDistanceIsUsingDefaults.patch b/SOURCES/libvirt-numa-Introduce-virDomainNumaNodeDistanceIsUsingDefaults.patch
deleted file mode 100644
index ee21082..0000000
--- a/SOURCES/libvirt-numa-Introduce-virDomainNumaNodeDistanceIsUsingDefaults.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 8af3d229190faed68beda2a1493badc1eb78e108 Mon Sep 17 00:00:00 2001
-Message-Id: <8af3d229190faed68beda2a1493badc1eb78e108@dist-git>
-From: Michal Privoznik
-Date: Mon, 4 Dec 2017 13:38:50 +0100
-Subject: [PATCH] numa: Introduce virDomainNumaNodeDistanceIsUsingDefaults
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1454889
-
-The function returns true/false depending on distance
-configuration being present in the domain XML.
-
-Signed-off-by: Michal Privoznik
-Reviewed-by: John Ferlan
-(cherry picked from commit ab9baab7290a4a009e4e8ddfb63a2ddd19bb8091)
-Signed-off-by: Michal Privoznik
-Signed-off-by: Jiri Denemark
----
- src/conf/numa_conf.c | 21 +++++++++++++++++++++
- src/conf/numa_conf.h | 4 ++++
- src/libvirt_private.syms | 1 +
- 3 files changed, 26 insertions(+)
-
-diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
-index c2f0d1ca8c..8fc3b0a196 100644
---- a/src/conf/numa_conf.c
-+++ b/src/conf/numa_conf.c
-@@ -1137,6 +1137,27 @@ virDomainNumaSetNodeCount(virDomainNumaPtr numa, size_t nmem_nodes)
- return numa->nmem_nodes;
- }
-
-+
-+bool
-+virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa,
-+ size_t node,
-+ size_t sibling)
-+{
-+ if (node >= numa->nmem_nodes ||
-+ sibling >= numa->nmem_nodes)
-+ return false;
-+
-+ if (!numa->mem_nodes[node].distances)
-+ return true;
-+
-+ if (numa->mem_nodes[node].distances[sibling].value == LOCAL_DISTANCE ||
-+ numa->mem_nodes[node].distances[sibling].value == REMOTE_DISTANCE)
-+ return true;
-+
-+ return false;
-+}
-+
-+
- size_t
- virDomainNumaGetNodeDistance(virDomainNumaPtr numa,
- size_t node,
-diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h
-index 4655de3aa7..7947fdb219 100644
---- a/src/conf/numa_conf.h
-+++ b/src/conf/numa_conf.h
-@@ -87,6 +87,10 @@ int virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune,
-
- size_t virDomainNumaGetNodeCount(virDomainNumaPtr numa);
-
-+bool virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa,
-+ size_t node,
-+ size_t sibling)
-+ ATTRIBUTE_NONNULL(1);
- size_t virDomainNumaGetNodeDistance(virDomainNumaPtr numa,
- size_t node,
- size_t sibling)
-diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
-index 19543e06ae..0449b0185f 100644
---- a/src/libvirt_private.syms
-+++ b/src/libvirt_private.syms
-@@ -727,6 +727,7 @@ virDomainNumaGetNodeDistance;
- virDomainNumaGetNodeMemoryAccessMode;
- virDomainNumaGetNodeMemorySize;
- virDomainNumaNew;
-+virDomainNumaNodeDistanceIsUsingDefaults;
- virDomainNumaSetNodeCount;
- virDomainNumaSetNodeCpumask;
- virDomainNumaSetNodeDistance;
---
-2.15.1
-
diff --git a/SOURCES/libvirt-numa-describe-siblings-distances-within-cells.patch b/SOURCES/libvirt-numa-describe-siblings-distances-within-cells.patch
deleted file mode 100644
index 5439b5d..0000000
--- a/SOURCES/libvirt-numa-describe-siblings-distances-within-cells.patch
+++ /dev/null
@@ -1,461 +0,0 @@
-From 2ff472bc2ac9d01181c1dbd522153934de79907f Mon Sep 17 00:00:00 2001
-Message-Id: <2ff472bc2ac9d01181c1dbd522153934de79907f@dist-git>
-From: Wim ten Have
-Date: Mon, 4 Dec 2017 13:38:47 +0100
-Subject: [PATCH] numa: describe siblings distances within cells
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1454889
-
-Add support for describing NUMA distances in a domain's
-XML description.
-
-Below is an example of a 4 node setup:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A defines a NUMA node. describes the NUMA distance
-from the to the other NUMA nodes (the s). For example,
-in above XML description, the distance between NUMA node0 and NUMA node2 is 31.
-
-Valid distance values are '10 <= value <= 255'. A distance value of 10
-represents the distance to the node itself. A distance value of 20
-represents the default value for remote nodes but other values are
-possible depending on the physical topology of the system.
-
-When distances are not fully described, any missing sibling distance
-values will default to 10 for local nodes and 20 for remote nodes.
-
-If distance is given for A -> B, then we default B -> A to the same
-value instead of 20.
-
-Signed-off-by: Wim ten Have
-Reviewed-by: Daniel P. Berrange
-Signed-off-by: Jim Fehlig
-(cherry picked from commit 74119a03f184b79dcad28aa1e6f4ede6dc444998)
-Signed-off-by: Michal Privoznik
-Signed-off-by: Jiri Denemark
----
- docs/formatdomain.html.in | 64 ++++++++++++++-
- docs/schemas/basictypes.rng | 7 ++
- docs/schemas/cputypes.rng | 18 +++++
- src/conf/numa_conf.c | 191 +++++++++++++++++++++++++++++++++++++++++++-
- 4 files changed, 276 insertions(+), 4 deletions(-)
-
-diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
-index 62dd6e1ec4..a5adf5d9aa 100644
---- a/docs/formatdomain.html.in
-+++ b/docs/formatdomain.html.in
-@@ -1529,7 +1529,69 @@
-
-
-
-- This guest NUMA specification is currently available only for QEMU/KVM.
-+ This guest NUMA specification is currently available only for
-+ QEMU/KVM and Xen.
-+
-+
-+
-+ A NUMA hardware architecture supports the notion of distances
-+ between NUMA cells. Since 3.10.0 it
-+ is possible to define the distance between NUMA cells using the
-+ distances element within a NUMA cell
-+ description. The sibling sub-element is used to
-+ specify the distance value between sibling NUMA cells. For more
-+ details, see the chapter explaining the system's SLIT (System
-+ Locality Information Table) within the ACPI (Advanced
-+ Configuration and Power Interface) specification.
-+
-+ Describing distances between NUMA cells is currently only supported
-+ by Xen. If no distances are given to describe
-+ the SLIT data between different cells, it will default to a scheme
-+ using 10 for local and 20 for remote distances.
-
-diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
-index 1ea667cdf6..1a18cd31b1 100644
---- a/docs/schemas/basictypes.rng
-+++ b/docs/schemas/basictypes.rng
-@@ -77,6 +77,13 @@
-
-
-
-+
-+
-+ 10
-+ 255
-+
-+
-+
-
-
-
-diff --git a/docs/schemas/cputypes.rng b/docs/schemas/cputypes.rng
-index 3eef16abce..c45b6dfb28 100644
---- a/docs/schemas/cputypes.rng
-+++ b/docs/schemas/cputypes.rng
-@@ -129,6 +129,24 @@
-
-
-
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
-
-
-diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
-index b71dc012c5..5fbcc72041 100644
---- a/src/conf/numa_conf.c
-+++ b/src/conf/numa_conf.c
-@@ -29,6 +29,15 @@
- #include "virnuma.h"
- #include "virstring.h"
-
-+/*
-+ * Distance definitions defined Conform ACPI 2.0 SLIT.
-+ * See include/linux/topology.h
-+ */
-+#define LOCAL_DISTANCE 10
-+#define REMOTE_DISTANCE 20
-+/* SLIT entry value is a one-byte unsigned integer. */
-+#define UNREACHABLE 255
-+
- #define VIR_FROM_THIS VIR_FROM_DOMAIN
-
- VIR_ENUM_IMPL(virDomainNumatuneMemMode,
-@@ -48,6 +57,8 @@ VIR_ENUM_IMPL(virDomainMemoryAccess, VIR_DOMAIN_MEMORY_ACCESS_LAST,
- "shared",
- "private")
-
-+typedef struct _virDomainNumaDistance virDomainNumaDistance;
-+typedef virDomainNumaDistance *virDomainNumaDistancePtr;
-
- typedef struct _virDomainNumaNode virDomainNumaNode;
- typedef virDomainNumaNode *virDomainNumaNodePtr;
-@@ -66,6 +77,12 @@ struct _virDomainNuma {
- virBitmapPtr nodeset; /* host memory nodes where this guest node resides */
- virDomainNumatuneMemMode mode; /* memory mode selection */
- virDomainMemoryAccess memAccess; /* shared memory access configuration */
-+
-+ struct _virDomainNumaDistance {
-+ unsigned int value; /* locality value for node i->j or j->i */
-+ unsigned int cellid;
-+ } *distances; /* remote node distances */
-+ size_t ndistances;
- } *mem_nodes; /* guest node configuration */
- size_t nmem_nodes;
-
-@@ -686,6 +703,144 @@ virDomainNumatuneNodesetIsAvailable(virDomainNumaPtr numatune,
- }
-
-
-+static int
-+virDomainNumaDefNodeDistanceParseXML(virDomainNumaPtr def,
-+ xmlXPathContextPtr ctxt,
-+ unsigned int cur_cell)
-+{
-+ int ret = -1;
-+ int sibling;
-+ char *tmp = NULL;
-+ xmlNodePtr *nodes = NULL;
-+ size_t i, ndistances = def->nmem_nodes;
-+
-+ if (!ndistances)
-+ return 0;
-+
-+ /* check if NUMA distances definition is present */
-+ if (!virXPathNode("./distances[1]", ctxt))
-+ return 0;
-+
-+ if ((sibling = virXPathNodeSet("./distances[1]/sibling", ctxt, &nodes)) <= 0) {
-+ virReportError(VIR_ERR_XML_ERROR, "%s",
-+ _("NUMA distances defined without siblings"));
-+ goto cleanup;
-+ }
-+
-+ for (i = 0; i < sibling; i++) {
-+ virDomainNumaDistancePtr ldist, rdist;
-+ unsigned int sibling_id, sibling_value;
-+
-+ /* siblings are in order of parsing or explicitly numbered */
-+ if (!(tmp = virXMLPropString(nodes[i], "id"))) {
-+ virReportError(VIR_ERR_XML_ERROR,
-+ _("Missing 'id' attribute in NUMA "
-+ "distances under 'cell id %d'"),
-+ cur_cell);
-+ goto cleanup;
-+ }
-+
-+ /* The "id" needs to be applicable */
-+ if (virStrToLong_uip(tmp, NULL, 10, &sibling_id) < 0) {
-+ virReportError(VIR_ERR_XML_ERROR,
-+ _("Invalid 'id' attribute in NUMA "
-+ "distances for sibling: '%s'"),
-+ tmp);
-+ goto cleanup;
-+ }
-+ VIR_FREE(tmp);
-+
-+ /* The "id" needs to be within numa/cell range */
-+ if (sibling_id >= ndistances) {
-+ virReportError(VIR_ERR_XML_ERROR,
-+ _("'sibling_id %d' does not refer to a "
-+ "valid cell within NUMA 'cell id %d'"),
-+ sibling_id, cur_cell);
-+ goto cleanup;
-+ }
-+
-+ /* We need a locality value. Check and correct
-+ * distance to local and distance to remote node.
-+ */
-+ if (!(tmp = virXMLPropString(nodes[i], "value"))) {
-+ virReportError(VIR_ERR_XML_ERROR,
-+ _("Missing 'value' attribute in NUMA distances "
-+ "under 'cell id %d' for 'sibling id %d'"),
-+ cur_cell, sibling_id);
-+ goto cleanup;
-+ }
-+
-+ /* The "value" needs to be applicable */
-+ if (virStrToLong_uip(tmp, NULL, 10, &sibling_value) < 0) {
-+ virReportError(VIR_ERR_XML_ERROR,
-+ _("'value %s' is invalid for "
-+ "'sibling id %d' under NUMA 'cell id %d'"),
-+ tmp, sibling_id, cur_cell);
-+ goto cleanup;
-+ }
-+ VIR_FREE(tmp);
-+
-+ /* Assure LOCAL_DISTANCE <= "value" <= UNREACHABLE
-+ * and correct LOCAL_DISTANCE setting if such applies.
-+ */
-+ if ((sibling_value < LOCAL_DISTANCE ||
-+ sibling_value > UNREACHABLE) ||
-+ (sibling_id == cur_cell &&
-+ sibling_value != LOCAL_DISTANCE) ||
-+ (sibling_id != cur_cell &&
-+ sibling_value == LOCAL_DISTANCE)) {
-+ virReportError(VIR_ERR_XML_ERROR,
-+ _("'value %d' is invalid for "
-+ "'sibling id %d' under NUMA 'cell id %d'"),
-+ sibling_value, sibling_id, cur_cell);
-+ goto cleanup;
-+ }
-+
-+ /* Apply the local / remote distance */
-+ ldist = def->mem_nodes[cur_cell].distances;
-+ if (!ldist) {
-+ if (VIR_ALLOC_N(ldist, ndistances) < 0)
-+ goto cleanup;
-+
-+ ldist[cur_cell].value = LOCAL_DISTANCE;
-+ ldist[cur_cell].cellid = cur_cell;
-+ def->mem_nodes[cur_cell].ndistances = ndistances;
-+ }
-+
-+ ldist[sibling_id].cellid = sibling_id;
-+ ldist[sibling_id].value = sibling_value;
-+ def->mem_nodes[cur_cell].distances = ldist;
-+
-+ /* Apply symmetry if none given */
-+ rdist = def->mem_nodes[sibling_id].distances;
-+ if (!rdist) {
-+ if (VIR_ALLOC_N(rdist, ndistances) < 0)
-+ goto cleanup;
-+
-+ rdist[sibling_id].value = LOCAL_DISTANCE;
-+ rdist[sibling_id].cellid = sibling_id;
-+ def->mem_nodes[sibling_id].ndistances = ndistances;
-+ }
-+
-+ rdist[cur_cell].cellid = cur_cell;
-+ if (!rdist[cur_cell].value)
-+ rdist[cur_cell].value = sibling_value;
-+ def->mem_nodes[sibling_id].distances = rdist;
-+ }
-+
-+ ret = 0;
-+
-+ cleanup:
-+ if (ret) {
-+ for (i = 0; i < ndistances; i++)
-+ VIR_FREE(def->mem_nodes[i].distances);
-+ }
-+ VIR_FREE(nodes);
-+ VIR_FREE(tmp);
-+
-+ return ret;
-+}
-+
- int
- virDomainNumaDefCPUParseXML(virDomainNumaPtr def,
- xmlXPathContextPtr ctxt)
-@@ -694,7 +849,7 @@ virDomainNumaDefCPUParseXML(virDomainNumaPtr def,
- xmlNodePtr oldNode = ctxt->node;
- char *tmp = NULL;
- int n;
-- size_t i;
-+ size_t i, j;
- int ret = -1;
-
- /* check if NUMA definition is present */
-@@ -712,7 +867,6 @@ virDomainNumaDefCPUParseXML(virDomainNumaPtr def,
- def->nmem_nodes = n;
-
- for (i = 0; i < n; i++) {
-- size_t j;
- int rc;
- unsigned int cur_cell = i;
-
-@@ -788,6 +942,10 @@ virDomainNumaDefCPUParseXML(virDomainNumaPtr def,
- def->mem_nodes[cur_cell].memAccess = rc;
- VIR_FREE(tmp);
- }
-+
-+ /* Parse NUMA distances info */
-+ if (virDomainNumaDefNodeDistanceParseXML(def, ctxt, cur_cell) < 0)
-+ goto cleanup;
- }
-
- ret = 0;
-@@ -815,6 +973,8 @@ virDomainNumaDefCPUFormatXML(virBufferPtr buf,
- virBufferAddLit(buf, "\n");
- virBufferAdjustIndent(buf, 2);
- for (i = 0; i < ncells; i++) {
-+ int ndistances;
-+
- memAccess = virDomainNumaGetNodeMemoryAccessMode(def, i);
-
- if (!(cpustr = virBitmapFormat(virDomainNumaGetNodeCpumask(def, i))))
-@@ -829,7 +989,32 @@ virDomainNumaDefCPUFormatXML(virBufferPtr buf,
- if (memAccess)
- virBufferAsprintf(buf, " memAccess='%s'",
- virDomainMemoryAccessTypeToString(memAccess));
-- virBufferAddLit(buf, "/>\n");
-+
-+ ndistances = def->mem_nodes[i].ndistances;
-+ if (!ndistances) {
-+ virBufferAddLit(buf, "/>\n");
-+ } else {
-+ size_t j;
-+ virDomainNumaDistancePtr distances = def->mem_nodes[i].distances;
-+
-+ virBufferAddLit(buf, ">\n");
-+ virBufferAdjustIndent(buf, 2);
-+ virBufferAddLit(buf, "\n");
-+ virBufferAdjustIndent(buf, 2);
-+ for (j = 0; j < ndistances; j++) {
-+ if (distances[j].value) {
-+ virBufferAddLit(buf, "\n");
-+ }
-+ }
-+ virBufferAdjustIndent(buf, -2);
-+ virBufferAddLit(buf, "\n");
-+ virBufferAdjustIndent(buf, -2);
-+ virBufferAddLit(buf, "\n");
-+ }
-+
- VIR_FREE(cpustr);
- }
- virBufferAdjustIndent(buf, -2);
---
-2.15.1
-
diff --git a/SOURCES/libvirt-nwfilter-Resolve-SEGV-for-NWFilter-Snoop-processing.patch b/SOURCES/libvirt-nwfilter-Resolve-SEGV-for-NWFilter-Snoop-processing.patch
new file mode 100644
index 0000000..08bb214
--- /dev/null
+++ b/SOURCES/libvirt-nwfilter-Resolve-SEGV-for-NWFilter-Snoop-processing.patch
@@ -0,0 +1,79 @@
+From 4f042ede2b84b5f6bdf8a36e0768462816f2c9b1 Mon Sep 17 00:00:00 2001
+Message-Id: <4f042ede2b84b5f6bdf8a36e0768462816f2c9b1@dist-git>
+From: John Ferlan
+Date: Thu, 26 Jul 2018 09:39:32 -0400
+Subject: [PATCH] nwfilter: Resolve SEGV for NWFilter Snoop processing
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1599973
+
+Commit id fca9afa08 changed the @req->ifname to use
+@req->binding->portdevname fillingin the @req->binding
+in a similar way that @req->ifname would have been
+filled in during virNWFilterDHCPSnoopReq processing.
+
+However, in doing so it did not take into account some
+code paths where the @req->binding should be checked
+instead of @req->binding->portdevname. These checks
+led to SEGVs in some cases during libvirtd reload
+processing in virNWFilterSnoopRemAllReqIter (for
+stop during nwfilterStateCleanup processing) and
+virNWFilterSnoopReqLeaseDel (for start during
+nwfilterStateInitialize processing).
+
+In particular, when reading the nwfilter.leases file
+a new @req is created, but the @req->binding is not
+filled in. That's left to virNWFilterDHCPSnoopReq
+processing which checks if the @req already exists
+in the @virNWFilterSnoopState.snoopReqs hash table
+after adding a virNWFilterSnoopState.ifnameToKey
+entry for the @req->binding->portdevname by a
+@ref->ikey value.
+
+NB: virNWFilterSnoopIPLeaseInstallRule and
+ virNWFilterDHCPSnoopThread do not need the
+ req->binding check since they can only be called
+ after the filter->binding is created/assigned.
+
+Signed-off-by: John Ferlan
+ACKed-by: Michal Privoznik
+(cherry picked from commit 5229494b01acf97dbc6f3028e9718667e9e1426a)
+Reviewed-by: Erik Skultety
+---
+ src/nwfilter/nwfilter_dhcpsnoop.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
+index 533c45f080..2ae134ed19 100644
+--- a/src/nwfilter/nwfilter_dhcpsnoop.c
++++ b/src/nwfilter/nwfilter_dhcpsnoop.c
+@@ -846,7 +846,7 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req,
+ int ret = 0;
+ virNWFilterSnoopIPLeasePtr ipl;
+ char *ipstr = NULL;
+- int ipAddrLeft;
++ int ipAddrLeft = 0;
+
+ /* protect req->start, req->ifname and the lease */
+ virNWFilterSnoopReqLock(req);
+@@ -867,7 +867,8 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req,
+ if (update_leasefile)
+ virNWFilterSnoopLeaseFileSave(ipl);
+
+- ipAddrLeft = virNWFilterIPAddrMapDelIPAddr(req->binding->portdevname, ipstr);
++ if (req->binding)
++ ipAddrLeft = virNWFilterIPAddrMapDelIPAddr(req->binding->portdevname, ipstr);
+
+ if (!req->threadkey || !instantiate)
+ goto skip_instantiate;
+@@ -2037,7 +2038,7 @@ virNWFilterSnoopRemAllReqIter(const void *payload,
+ /* protect req->binding->portdevname */
+ virNWFilterSnoopReqLock(req);
+
+- if (req->binding->portdevname) {
++ if (req->binding && req->binding->portdevname) {
+ ignore_value(virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey,
+ req->binding->portdevname));
+
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-nwfilter-don-t-crash-listing-filters-in-unprivileged-daemon.patch b/SOURCES/libvirt-nwfilter-don-t-crash-listing-filters-in-unprivileged-daemon.patch
deleted file mode 100644
index a41ed00..0000000
--- a/SOURCES/libvirt-nwfilter-don-t-crash-listing-filters-in-unprivileged-daemon.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 5bb56c9849bdef1f7108895a20a9f348107dbfb2 Mon Sep 17 00:00:00 2001
-Message-Id: <5bb56c9849bdef1f7108895a20a9f348107dbfb2@dist-git>
-From: "Daniel P. Berrange"
-Date: Wed, 6 Dec 2017 12:11:17 -0500
-Subject: [PATCH] nwfilter: don't crash listing filters in unprivileged daemon
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1522879
-
-The unprivileged libvirtd does not support nwfilter config, by leaves the
-driver active. It is supposed to result in all APIs being an effective
-no-op, but several APIs rely on driver->nwfilters being non-NULL, or they
-will reference a NULL pointer. Rather than adding checks for NULL in many
-places, just make sure driver->nwfilters is always initialized.
-
-Reviewed-by: John Ferlan
-Signed-off-by: Daniel P. Berrange
-(cherry picked from commit 7993554f70fd8d512dfde484490bcd1601b60b33)
-Signed-off-by: John Ferlan
-Reviewed-by: Daniel P. Berrange
-Signed-off-by: Jiri Denemark
----
- src/nwfilter/nwfilter_driver.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
-index 2f9a51c405..885dbcc282 100644
---- a/src/nwfilter/nwfilter_driver.c
-+++ b/src/nwfilter/nwfilter_driver.c
-@@ -189,6 +189,8 @@ nwfilterStateInitialize(bool privileged,
- /* remember that we are going to use firewalld */
- driver->watchingFirewallD = (sysbus != NULL);
- driver->privileged = privileged;
-+ if (!(driver->nwfilters = virNWFilterObjListNew()))
-+ goto error;
-
- if (!privileged)
- return 0;
-@@ -244,9 +246,6 @@ nwfilterStateInitialize(bool privileged,
- goto error;
- }
-
-- if (!(driver->nwfilters = virNWFilterObjListNew()))
-- goto error;
--
- if (virNWFilterObjListLoadAllConfigs(driver->nwfilters, driver->configDir) < 0)
- goto error;
-
-@@ -271,6 +270,7 @@ nwfilterStateInitialize(bool privileged,
- virNWFilterIPAddrMapShutdown();
-
- err_free_driverstate:
-+ virNWFilterObjListFree(driver->nwfilters);
- VIR_FREE(driver);
-
- return -1;
-@@ -349,13 +349,13 @@ nwfilterStateCleanup(void)
-
- nwfilterDriverRemoveDBusMatches();
-
-- /* free inactive nwfilters */
-- virNWFilterObjListFree(driver->nwfilters);
--
- VIR_FREE(driver->configDir);
- nwfilterDriverUnlock();
- }
-
-+ /* free inactive nwfilters */
-+ virNWFilterObjListFree(driver->nwfilters);
-+
- virMutexDestroy(&driver->lock);
- VIR_FREE(driver);
-
---
-2.15.1
-
diff --git a/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_ISA_SERIAL.patch b/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_ISA_SERIAL.patch
deleted file mode 100644
index 30a9a3f..0000000
--- a/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_ISA_SERIAL.patch
+++ /dev/null
@@ -1,361 +0,0 @@
-From 62fe4cb859c0e86460879bcf676f1107ccd93129 Mon Sep 17 00:00:00 2001
-Message-Id: <62fe4cb859c0e86460879bcf676f1107ccd93129@dist-git>
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:23:17 +0100
-Subject: [PATCH] qemu: Add QEMU_CAPS_DEVICE_ISA_SERIAL
-
-All serial devices shoule have an associated capability.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit b0f1c291a0d3cbf2881a308a39f3f390f1cabcf5)
-
- Conflicts:
- src/qemu/qemu_capabilities.c
- src/qemu/qemu_capabilities.h
- tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml
- tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml
- tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
- tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
- tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
- tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
-
- Insert the new capability in the right place, both in the
- declaration and in the caps.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_capabilities.c | 3 +++
- src/qemu/qemu_capabilities.h | 2 ++
- tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 +
- tests/qemuhelptest.c | 5 +++++
- 22 files changed, 29 insertions(+)
-
-diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
-index 322e0423d6..08c6653424 100644
---- a/src/qemu/qemu_capabilities.c
-+++ b/src/qemu/qemu_capabilities.c
-@@ -451,6 +451,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
- "sclplmconsole",
-
- "disk-share-rw",
-+
-+ "isa-serial",
- );
-
-
-@@ -1681,6 +1683,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
- { "spapr-pci-host-bridge", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE },
- { "spapr-vty", QEMU_CAPS_DEVICE_SPAPR_VTY },
- { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE },
-+ { "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL },
- };
-
- static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
-diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
-index c3a15948cf..f0bd88f897 100644
---- a/src/qemu/qemu_capabilities.h
-+++ b/src/qemu/qemu_capabilities.h
-@@ -438,6 +438,8 @@ typedef enum {
-
- QEMU_CAPS_DISK_SHARE_RW, /* share-rw=on for concurrent disk access */
-
-+ QEMU_CAPS_DEVICE_ISA_SERIAL, /* -device isa-serial */
-+
- QEMU_CAPS_LAST /* this must always be the last item */
- } virQEMUCapsFlags;
-
-diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml
-index 956284d5d3..d560811ab7 100644
---- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml
-@@ -109,6 +109,7 @@
-
-
-
-+
- 1002002
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml
-index 99384ce5e6..576475f7fa 100644
---- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml
-@@ -127,6 +127,7 @@
-
-
-
-+
- 1003001
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml
-index aea043c57d..0c271d3e41 100644
---- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml
-@@ -128,6 +128,7 @@
-
-
-
-+
- 1004002
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml
-index 6f860e4f25..5c667975bf 100644
---- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml
-@@ -140,6 +140,7 @@
-
-
-
-+
- 1005003
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml
-index e5dc8360de..8ae07a91db 100644
---- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml
-@@ -145,6 +145,7 @@
-
-
-
-+
- 1006000
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml
-index 86d87eaf0c..34bd6be1cd 100644
---- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml
-@@ -147,6 +147,7 @@
-
-
-
-+
- 1007000
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml
-index 2fa551b1a0..0d7c144ff7 100644
---- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml
-@@ -163,6 +163,7 @@
-
-
-
-+
- 2001001
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
-index c95025b41f..23356f4092 100644
---- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
-@@ -180,6 +180,7 @@
-
-
-
-+
- 2010000
- 0
- (v2.10.0)
-diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
-index 33db3e6674..e04e530b95 100644
---- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
-@@ -225,6 +225,7 @@
-
-
-
-+
- 2010000
- 0
- (v2.10.0)
-diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
-index f97e4cb813..5007523c1f 100644
---- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
-@@ -188,6 +188,7 @@
-
-
-
-+
- 2004000
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml
-index 2ba40fc494..a9ad292d01 100644
---- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml
-@@ -194,6 +194,7 @@
-
-
-
-+
- 2005000
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml
-index 0b34fa30d4..e699bdbafd 100644
---- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml
-@@ -172,6 +172,7 @@
-
-
-
-+
- 2006000
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml
-index d41d578c7e..f4c1de7e1d 100644
---- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml
-@@ -172,6 +172,7 @@
-
-
-
-+
- 2006000
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml
-index 5ff8598fc8..27d99bd937 100644
---- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml
-@@ -168,6 +168,7 @@
-
-
-
-+
- 2006000
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
-index bdf006f6be..97621612ab 100644
---- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
-@@ -204,6 +204,7 @@
-
-
-
-+
- 2006000
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml
-index 59adff6c97..e4ea9452c5 100644
---- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml
-@@ -208,6 +208,7 @@
-
-
-
-+
- 2007000
- 0
- (v2.7.0)
-diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml
-index 3165b2dee3..c6d3e21d5c 100644
---- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml
-@@ -210,6 +210,7 @@
-
-
-
-+
- 2008000
- 0
- (v2.8.0)
-diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
-index 3b70b1a407..f5cf0ba932 100644
---- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
-@@ -175,6 +175,7 @@
-
-
-
-+
- 2009000
- 0
- (v2.9.0)
-diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
-index 0ea9a2fce3..82cc4e79f4 100644
---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
-@@ -222,6 +222,7 @@
-
-
-
-+
- 2009000
- 0
- (v2.9.0)
-diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
-index 1a6e7092fd..0e05aa9d8a 100644
---- a/tests/qemuhelptest.c
-+++ b/tests/qemuhelptest.c
-@@ -174,6 +174,7 @@ mymain(void)
- QEMU_CAPS_DEVICE_USB_KBD,
- QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000,
-+ QEMU_CAPS_DEVICE_ISA_SERIAL,
- QEMU_CAPS_DEVICE_VIRTIO_NET);
- DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
- QEMU_CAPS_DRIVE_BOOT,
-@@ -210,6 +211,7 @@ mymain(void)
- QEMU_CAPS_DEVICE_USB_KBD,
- QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000,
-+ QEMU_CAPS_DEVICE_ISA_SERIAL,
- QEMU_CAPS_DEVICE_VIRTIO_NET);
- DO_TEST("qemu-kvm-0.13.0", 13000, 1, 0,
- QEMU_CAPS_DRIVE_BOOT,
-@@ -258,6 +260,7 @@ mymain(void)
- QEMU_CAPS_DEVICE_IVSHMEM,
- QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000,
-+ QEMU_CAPS_DEVICE_ISA_SERIAL,
- QEMU_CAPS_DEVICE_VIRTIO_NET);
- DO_TEST("qemu-1.0", 1000000, 0, 0,
- QEMU_CAPS_DRIVE_CACHE_UNSAFE,
-@@ -328,6 +331,7 @@ mymain(void)
- QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000,
- QEMU_CAPS_DEVICE_VIRTIO_NET,
-+ QEMU_CAPS_DEVICE_ISA_SERIAL,
- QEMU_CAPS_DISPLAY);
- DO_TEST("qemu-1.1.0", 1001000, 0, 0,
- QEMU_CAPS_DRIVE_CACHE_UNSAFE,
-@@ -411,6 +415,7 @@ mymain(void)
- QEMU_CAPS_DEVICE_RTL8139,
- QEMU_CAPS_DEVICE_E1000,
- QEMU_CAPS_DEVICE_VIRTIO_NET,
-+ QEMU_CAPS_DEVICE_ISA_SERIAL,
- QEMU_CAPS_DISPLAY);
- DO_TEST_FULL("qemu-1.2.0", 1002000, 0, 0, VIR_ERR_CONFIG_UNSUPPORTED,
- QEMU_CAPS_LAST);
---
-2.15.1
-
diff --git a/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_PL011.patch b/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_PL011.patch
deleted file mode 100644
index df40ba1..0000000
--- a/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_PL011.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 5b5832decc253ce95535c9a6cf1eee6b5ed475fc Mon Sep 17 00:00:00 2001
-Message-Id: <5b5832decc253ce95535c9a6cf1eee6b5ed475fc@dist-git>
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:23:19 +0100
-Subject: [PATCH] qemu: Add QEMU_CAPS_DEVICE_PL011
-
-All serial devices shoule have an associated capability.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit a45ecb7bf6b43a863ef0980156e822d414975994)
-
- Conflicts:
- tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml
- tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml
-
- These caps do not exists in the current version.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_capabilities.c | 4 ++++
- src/qemu/qemu_capabilities.h | 3 +++
- tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml | 1 +
- 4 files changed, 9 insertions(+)
-
-diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
-index 08c6653424..ae5448eaaa 100644
---- a/src/qemu/qemu_capabilities.c
-+++ b/src/qemu/qemu_capabilities.c
-@@ -453,6 +453,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
- "disk-share-rw",
-
- "isa-serial",
-+
-+ /* 280 */
-+ "pl011",
- );
-
-
-@@ -1684,6 +1687,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
- { "spapr-vty", QEMU_CAPS_DEVICE_SPAPR_VTY },
- { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE },
- { "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL },
-+ { "pl011", QEMU_CAPS_DEVICE_PL011 },
- };
-
- static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
-diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
-index f0bd88f897..c809f83404 100644
---- a/src/qemu/qemu_capabilities.h
-+++ b/src/qemu/qemu_capabilities.h
-@@ -440,6 +440,9 @@ typedef enum {
-
- QEMU_CAPS_DEVICE_ISA_SERIAL, /* -device isa-serial */
-
-+ /* 280 */
-+ QEMU_CAPS_DEVICE_PL011, /* -device pl011 (not user-instantiable) */
-+
- QEMU_CAPS_LAST /* this must always be the last item */
- } virQEMUCapsFlags;
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml
-index e699bdbafd..d3e2e18faa 100644
---- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml
-@@ -173,6 +173,7 @@
-
-
-
-+
- 2006000
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml
-index f4c1de7e1d..bc86d03537 100644
---- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml
-@@ -173,6 +173,7 @@
-
-
-
-+
- 2006000
- 0
-
---
-2.15.1
-
diff --git a/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_SPAPR_VTY.patch b/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_SPAPR_VTY.patch
deleted file mode 100644
index 7599fd4..0000000
--- a/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_SPAPR_VTY.patch
+++ /dev/null
@@ -1,195 +0,0 @@
-From a8befcda79640ae13c9787cb3be54ca2ee861077 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:22:51 +0100
-Subject: [PATCH] qemu: Add QEMU_CAPS_DEVICE_SPAPR_VTY
-
-Up until now we assumed the spapr-vty device would always be
-present, which is not very nice. Check for its availability before
-using it instead.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 87eabeb17d637b753dbb1e63e417e25bbd0f7d61)
-
- Conflicts:
- src/qemu/qemu_capabilities.c
- src/qemu/qemu_capabilities.h
- tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
- tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
-
- Insert the new capability in the right place, in both
- declarations and caps.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1449265
-https://bugzilla.redhat.com/show_bug.cgi?id=1511421
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-https://bugzilla.redhat.com/show_bug.cgi?id=1512934
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_capabilities.c | 3 ++-
- src/qemu/qemu_capabilities.h | 2 +-
- src/qemu/qemu_command.c | 6 ++++++
- tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 1 +
- tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 +
- tests/qemuxml2argvtest.c | 12 ++++++++++++
- 7 files changed, 24 insertions(+), 2 deletions(-)
-
-diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
-index 2f41e076cb..0defa9a3e4 100644
---- a/src/qemu/qemu_capabilities.c
-+++ b/src/qemu/qemu_capabilities.c
-@@ -445,7 +445,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
- "virtio-blk.num-queues",
- "machine.pseries.resize-hpt",
-
--
-+ "spapr-vty",
-
- /* 275 */
-
-@@ -1679,6 +1679,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
- { "pcie-root-port", QEMU_CAPS_DEVICE_PCIE_ROOT_PORT },
- { "qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI },
- { "spapr-pci-host-bridge", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE },
-+ { "spapr-vty", QEMU_CAPS_DEVICE_SPAPR_VTY },
- };
-
- static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
-diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
-index 60818daa1c..65b969a0ea 100644
---- a/src/qemu/qemu_capabilities.h
-+++ b/src/qemu/qemu_capabilities.h
-@@ -431,7 +431,7 @@ typedef enum {
- QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES, /* virtio-blk-*.num-queues */
- QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, /* -machine pseries,resize-hpt */
-
--
-+ QEMU_CAPS_DEVICE_SPAPR_VTY, /* -device spapr-vty */
-
- /* 275 */
-
-diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
-index fc7f54e81e..65b6a59d3f 100644
---- a/src/qemu/qemu_command.c
-+++ b/src/qemu/qemu_command.c
-@@ -10308,6 +10308,12 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
- if (qemuDomainIsPSeries(def)) {
- if (serial->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
- serial->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) {
-+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPAPR_VTY)) {
-+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-+ _("spapr-vty not supported in this QEMU binary"));
-+ goto error;
-+ }
-+
- virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s",
- serial->info.alias);
- }
-diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
-index c01777a5a3..c95025b41f 100644
---- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
-@@ -178,6 +178,7 @@
-
-
-
-+
-
- 2010000
- 0
-diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml
-index f1c9fc98a4..5ff8598fc8 100644
---- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml
-@@ -167,6 +167,7 @@
-
-
-
-+
- 2006000
- 0
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
-index e912211f40..3b70b1a407 100644
---- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
-@@ -173,6 +173,7 @@
-
-
-
-+
-
- 2009000
- 0
-diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
-index 4e981c9fab..70c72e4e64 100644
---- a/tests/qemuxml2argvtest.c
-+++ b/tests/qemuxml2argvtest.c
-@@ -1756,50 +1756,62 @@ mymain(void)
- DO_TEST_PARSE_ERROR("seclabel-device-duplicates", NONE);
-
- DO_TEST("pseries-basic",
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST("pseries-vio",
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST("pseries-usb-default",
- QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_PIIX3_USB_UHCI,
- QEMU_CAPS_PCI_OHCI,
- QEMU_CAPS_PCI_MULTIFUNCTION);
- DO_TEST("pseries-usb-multi",
- QEMU_CAPS_NODEFCONFIG,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_PIIX3_USB_UHCI,
- QEMU_CAPS_PCI_OHCI,
- QEMU_CAPS_PCI_MULTIFUNCTION);
- DO_TEST("pseries-vio-user-assigned",
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST_PARSE_ERROR("pseries-vio-address-clash",
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_NVRAM);
- DO_TEST("pseries-usb-kbd", QEMU_CAPS_PCI_OHCI,
- QEMU_CAPS_DEVICE_USB_KBD,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST("pseries-cpu-exact",
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST_PARSE_ERROR("pseries-no-parallel",
- QEMU_CAPS_NODEFCONFIG);
-
- qemuTestSetHostArch(driver.caps, VIR_ARCH_PPC64);
- DO_TEST("pseries-cpu-compat", QEMU_CAPS_KVM,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST("pseries-cpu-le", QEMU_CAPS_KVM,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST_FAILURE("pseries-cpu-compat-power9", QEMU_CAPS_KVM);
-
- qemuTestSetHostCPU(driver.caps, cpuPower9);
- DO_TEST("pseries-cpu-compat-power9",
- QEMU_CAPS_KVM,
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_NODEFCONFIG);
- qemuTestSetHostCPU(driver.caps, NULL);
-
- qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE);
-
- DO_TEST("pseries-panic-missing",
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST("pseries-panic-no-address",
-+ QEMU_CAPS_DEVICE_SPAPR_VTY,
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST_FAILURE("pseries-panic-address",
- QEMU_CAPS_NODEFCONFIG);
---
-2.15.1
-
diff --git a/SOURCES/libvirt-qemu-Add-capability-for-the-HTM-pSeries-feature.patch b/SOURCES/libvirt-qemu-Add-capability-for-the-HTM-pSeries-feature.patch
new file mode 100644
index 0000000..29b86ac
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Add-capability-for-the-HTM-pSeries-feature.patch
@@ -0,0 +1,80 @@
+From f3d851dfec29dabaf5c9ab9e889376bb6df2d93c Mon Sep 17 00:00:00 2001
+Message-Id:
+From: Andrea Bolognani
+Date: Tue, 3 Jul 2018 15:25:15 +0200
+Subject: [PATCH] qemu: Add capability for the HTM pSeries feature
+
+Signed-off-by: Andrea Bolognani
+Reviewed-by: John Ferlan
+
+(cherry picked from commit 755a5765accf8fe9b2b8ec3fb01c37ac91313c7c)
+https: //bugzilla.redhat.com/show_bug.cgi?id=1525599
+Signed-off-by: Andrea Bolognani
+Acked-by: David Gibson
+Reviewed-by: Jiri Denemark
+---
+ src/qemu/qemu_capabilities.c | 2 ++
+ src/qemu/qemu_capabilities.h | 1 +
+ tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
+ tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 +
+ 4 files changed, 5 insertions(+)
+
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index fc1cf53066..883ca5dab7 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -501,6 +501,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
+ /* 310 */
+ "sev-guest",
+ "machine.pseries.cap-hpt-max-page-size",
++ "machine.pseries.cap-htm",
+ );
+
+
+@@ -1432,6 +1433,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] =
+
+ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSPAPRMachine[] = {
+ { "cap-hpt-max-page-size", QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE },
++ { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM },
+ };
+
+ static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
+diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
+index df9bf49abb..a048a1cf02 100644
+--- a/src/qemu/qemu_capabilities.h
++++ b/src/qemu/qemu_capabilities.h
+@@ -485,6 +485,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
+ /* 310 */
+ QEMU_CAPS_SEV_GUEST, /* -object sev-guest,... */
+ QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, /* -machine pseries.cap-hpt-max-page-size */
++ QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, /* -machine pseries.cap-htm */
+
+ QEMU_CAPS_LAST /* this must always be the last item */
+ } virQEMUCapsFlags;
+diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
+index 2ee582f343..7139179304 100644
+--- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
++++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
+@@ -166,6 +166,7 @@
+
+
+
++
+ 2011090
+ 0
+ 428334
+diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml
+index 7e958b2efc..33cd00e613 100644
+--- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml
++++ b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml
+@@ -166,6 +166,7 @@
+
+
+
++
+ 2012050
+ 0
+ 446771
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-qemu-Add-support-for-resctrl.patch b/SOURCES/libvirt-qemu-Add-support-for-resctrl.patch
deleted file mode 100644
index 7ba1797..0000000
--- a/SOURCES/libvirt-qemu-Add-support-for-resctrl.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-From 72285626fa7b899ceb9c8d4358b4b1b3fa7081a4 Mon Sep 17 00:00:00 2001
-Message-Id: <72285626fa7b899ceb9c8d4358b4b1b3fa7081a4@dist-git>
-From: Martin Kletzander
-Date: Wed, 31 Jan 2018 16:32:32 +0100
-Subject: [PATCH] qemu: Add support for resctrl
-
-We've been building up to this. This adds support for cputune/cachetune
-settings for domains in the QEMU driver. The addition into
-qemuProcessSetupVcpu() automatically adds support for hotplug. For hot-unplug
-we need to remove the allocation only if all the vCPUs were unplugged. But
-since the threads are left running, we can't really do much about it now.
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1289368
-
-Signed-off-by: Martin Kletzander
-(cherry picked from commit 9a2fc2db8fe18da41c274d52b6e52316a4bbe52d)
-Signed-off-by: Martin Kletzander
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1289368
-Signed-off-by: Martin Kletzander
----
- src/qemu/qemu_process.c | 60 ++++++++++++++++++++++++++++++++++++++++++++-----
- 1 file changed, 55 insertions(+), 5 deletions(-)
-
-diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
-index c64088e4ca..57faf9cd79 100644
---- a/src/qemu/qemu_process.c
-+++ b/src/qemu/qemu_process.c
-@@ -2504,6 +2504,32 @@ qemuProcessSetupEmulator(virDomainObjPtr vm)
- }
-
-
-+static int
-+qemuProcessResctrlCreate(virQEMUDriverPtr driver,
-+ virDomainObjPtr vm)
-+{
-+ int ret = -1;
-+ size_t i = 0;
-+ virCapsPtr caps = virQEMUDriverGetCapabilities(driver, false);
-+ qemuDomainObjPrivatePtr priv = vm->privateData;
-+
-+ if (!caps)
-+ return -1;
-+
-+ for (i = 0; i < vm->def->ncachetunes; i++) {
-+ if (virResctrlAllocCreate(caps->host.resctrl,
-+ vm->def->cachetunes[i]->alloc,
-+ priv->machineName) < 0)
-+ goto cleanup;
-+ }
-+
-+ ret = 0;
-+ cleanup:
-+ virObjectUnref(caps);
-+ return ret;
-+}
-+
-+
- static int
- qemuProcessInitPasswords(virConnectPtr conn,
- virQEMUDriverPtr driver,
-@@ -5015,12 +5041,26 @@ qemuProcessSetupVcpu(virDomainObjPtr vm,
- {
- pid_t vcpupid = qemuDomainGetVcpuPid(vm, vcpuid);
- virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, vcpuid);
-+ size_t i = 0;
-
-- return qemuProcessSetupPid(vm, vcpupid, VIR_CGROUP_THREAD_VCPU,
-- vcpuid, vcpu->cpumask,
-- vm->def->cputune.period,
-- vm->def->cputune.quota,
-- &vcpu->sched);
-+ if (qemuProcessSetupPid(vm, vcpupid, VIR_CGROUP_THREAD_VCPU,
-+ vcpuid, vcpu->cpumask,
-+ vm->def->cputune.period,
-+ vm->def->cputune.quota,
-+ &vcpu->sched) < 0)
-+ return -1;
-+
-+ for (i = 0; i < vm->def->ncachetunes; i++) {
-+ virDomainCachetuneDefPtr ct = vm->def->cachetunes[i];
-+
-+ if (virBitmapIsBitSet(ct->vcpus, vcpuid)) {
-+ if (virResctrlAllocAddPID(ct->alloc, vcpupid) < 0)
-+ return -1;
-+ break;
-+ }
-+ }
-+
-+ return 0;
- }
-
-
-@@ -5892,6 +5932,10 @@ qemuProcessLaunch(virConnectPtr conn,
- if (qemuProcessSetupEmulator(vm) < 0)
- goto cleanup;
-
-+ VIR_DEBUG("Setting up resctrlfs");
-+ if (qemuProcessResctrlCreate(driver, vm) < 0)
-+ goto cleanup;
-+
- VIR_DEBUG("Setting domain security labels");
- if (qemuSecuritySetAllLabel(driver,
- vm,
-@@ -6540,6 +6584,12 @@ void qemuProcessStop(virQEMUDriverPtr driver,
- vm->def->name);
- }
-
-+ /* Remove resctrl allocation after cgroups are cleaned up which makes it
-+ * kind of safer (although removing the allocation should work even with
-+ * pids in tasks file */
-+ for (i = 0; i < vm->def->ncachetunes; i++)
-+ virResctrlAllocRemove(vm->def->cachetunes[i]->alloc);
-+
- qemuProcessRemoveDomainStatus(driver, vm);
-
- /* Remove VNC and Spice ports from port reservation bitmap, but only if
---
-2.16.1
-
diff --git a/SOURCES/libvirt-qemu-Avoid-comparing-size_t-with-1.patch b/SOURCES/libvirt-qemu-Avoid-comparing-size_t-with-1.patch
deleted file mode 100644
index 057aa65..0000000
--- a/SOURCES/libvirt-qemu-Avoid-comparing-size_t-with-1.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From a29ee6823d600aaf40c06c67e954233c36624774 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Jiri Denemark
-Date: Mon, 11 Dec 2017 14:34:20 +0100
-Subject: [PATCH] qemu: Avoid comparing size_t with -1
-
-ncpus would be -1 on error and the cleanup for loop would not be skipped
-in this case.
-
-Signed-off-by: Jiri Denemark
-Reviewed-by: John Ferlan
-(cherry picked from commit fd754cb69cb073d370d73b9eab65db8ce1400096)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1521202
-
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_capabilities.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
-index 4af1b6c662..165fdbc5ea 100644
---- a/src/qemu/qemu_capabilities.c
-+++ b/src/qemu/qemu_capabilities.c
-@@ -2965,7 +2965,7 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon)
- size_t i;
-
- if ((ncpus = qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0)
-- goto error;
-+ return NULL;
-
- if (!(models = virDomainCapsCPUModelsNew(ncpus)))
- goto error;
---
-2.15.1
-
diff --git a/SOURCES/libvirt-qemu-Destroy-whole-memory-tree.patch b/SOURCES/libvirt-qemu-Destroy-whole-memory-tree.patch
deleted file mode 100644
index 2e55cb3..0000000
--- a/SOURCES/libvirt-qemu-Destroy-whole-memory-tree.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 7207faf95b38811cbf0d19df02066cc06a138822 Mon Sep 17 00:00:00 2001
-Message-Id: <7207faf95b38811cbf0d19df02066cc06a138822@dist-git>
-From: Michal Privoznik
-Date: Thu, 9 Nov 2017 16:06:46 +0100
-Subject: [PATCH] qemu: Destroy whole memory tree
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1461214
-
-When removing path where huge pages are call virFileDeleteTree
-instead of plain rmdir(). The reason is that in the near future
-there's going to be more in the path than just files - some
-subdirs. Therefore plain rmdir() is not going to be enough.
-
-Signed-off-by: Michal Privoznik
-Reviewed-by: John Ferlan
-(cherry picked from commit bb3de478a66edafd130ecca9a45a4d506ca727a0)
-Signed-off-by: Michal Privoznik
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_process.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
-index 605f280d0c..3324cc61f1 100644
---- a/src/qemu/qemu_process.c
-+++ b/src/qemu/qemu_process.c
-@@ -3348,10 +3348,8 @@ qemuProcessBuildDestroyMemoryPathsImpl(virQEMUDriverPtr driver,
- return -1;
- }
- } else {
-- if (rmdir(path) < 0 &&
-- errno != ENOENT)
-- VIR_WARN("Unable to remove hugepage path: %s (errno=%d)",
-- path, errno);
-+ if (virFileDeleteTree(path) < 0)
-+ return -1;
- }
-
- return 0;
---
-2.15.0
-
diff --git a/SOURCES/libvirt-qemu-Disallow-pivot-of-shared-disks-to-unsupported-storage.patch b/SOURCES/libvirt-qemu-Disallow-pivot-of-shared-disks-to-unsupported-storage.patch
deleted file mode 100644
index c6a2dfd..0000000
--- a/SOURCES/libvirt-qemu-Disallow-pivot-of-shared-disks-to-unsupported-storage.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 9911807f7cf94ab328916fd9f00f20cc09a6455a Mon Sep 17 00:00:00 2001
-Message-Id: <9911807f7cf94ab328916fd9f00f20cc09a6455a@dist-git>
-From: Peter Krempa
-Date: Thu, 23 Nov 2017 19:02:21 +0100
-Subject: [PATCH] qemu: Disallow pivot of shared disks to unsupported storage
-
-Pivoting to a unsupported storage type might break the assumption that
-shared disks will not corrupt metadata.
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511480
-(cherry picked from commit 2b41c86294786c07f53afa633fe3dce703debc3c)
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_driver.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
-index 620028fe07..d0d29747cf 100644
---- a/src/qemu/qemu_driver.c
-+++ b/src/qemu/qemu_driver.c
-@@ -16509,6 +16509,16 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
- goto cleanup;
- }
-
-+ /* When pivoting to a shareable disk we need to make sure that the disk can
-+ * be safely shared, since block copy might have changed the format. */
-+ if (disk->src->shared && !disk->src->readonly &&
-+ !qemuBlockStorageSourceSupportsConcurrentAccess(disk->mirror)) {
-+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-+ _("can't pivot a shared disk to a storage volume not "
-+ "supporting sharing"));
-+ goto cleanup;
-+ }
-+
- /* For active commit, the mirror is part of the already labeled
- * chain. For blockcopy, we previously labeled only the top-level
- * image; but if the user is reusing an external image that
---
-2.15.0
-
diff --git a/SOURCES/libvirt-qemu-Don-t-initialize-struct-utsname.patch b/SOURCES/libvirt-qemu-Don-t-initialize-struct-utsname.patch
deleted file mode 100644
index 5ed49ef..0000000
--- a/SOURCES/libvirt-qemu-Don-t-initialize-struct-utsname.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 27e59af45b7e283b94617330e3327eff4bd91bdb Mon Sep 17 00:00:00 2001
-Message-Id: <27e59af45b7e283b94617330e3327eff4bd91bdb@dist-git>
-From: Jiri Denemark
-Date: Mon, 22 Jan 2018 14:51:11 +0100
-Subject: [PATCH] qemu: Don't initialize struct utsname
-
-It breaks the build and it is not really useful for anything.
-
-Signed-off-by: Jiri Denemark
-(cherry picked from commit ba9ea2ad7dd15d9a2e9c7a5b9a8a3e7066351015)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1525182
-
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_capabilities.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
-index af4875f82e..bd80edc978 100644
---- a/src/qemu/qemu_capabilities.c
-+++ b/src/qemu/qemu_capabilities.c
-@@ -5416,7 +5416,7 @@ virQEMUCapsCacheNew(const char *libDir,
- char *capsCacheDir = NULL;
- virFileCachePtr cache = NULL;
- virQEMUCapsCachePrivPtr priv = NULL;
-- struct utsname uts = { 0 };
-+ struct utsname uts;
-
- if (virAsprintf(&capsCacheDir, "%s/capabilities", cacheDir) < 0)
- goto error;
---
-2.16.1
-
diff --git a/SOURCES/libvirt-qemu-Enable-configuration-of-HPT-resizing-for-pSeries-guests.patch b/SOURCES/libvirt-qemu-Enable-configuration-of-HPT-resizing-for-pSeries-guests.patch
deleted file mode 100644
index e5a971b..0000000
--- a/SOURCES/libvirt-qemu-Enable-configuration-of-HPT-resizing-for-pSeries-guests.patch
+++ /dev/null
@@ -1,299 +0,0 @@
-From 6d24efd64d6de00d29f8bf2329940c427f5cc6f9 Mon Sep 17 00:00:00 2001
-Message-Id: <6d24efd64d6de00d29f8bf2329940c427f5cc6f9@dist-git>
-From: Andrea Bolognani
-Date: Wed, 15 Nov 2017 10:28:54 +0100
-Subject: [PATCH] qemu: Enable configuration of HPT resizing for pSeries guests
-
-Most of the time it's okay to leave this up to negotiation between
-the guest and the host, but in some situations it can be useful to
-manually decide the behavior, especially to enforce its availability.
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1308743
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: John Ferlan
-(cherry picked from commit 85b2ae96dfcf7dc324d6782f64c848fa412443e4)
-Signed-off-by: Andrea Bolognani
-Signed-off-by: Jiri Denemark
----
- docs/schemas/domaincommon.rng | 15 ++++++++
- src/conf/domain_conf.c | 46 +++++++++++++++++++++++-
- src/conf/domain_conf.h | 12 +++++++
- src/libvirt_private.syms | 1 +
- src/qemu/qemu_capabilities.c | 8 +++++
- src/qemu/qemu_capabilities.h | 1 +
- src/qemu/qemu_command.c | 20 +++++++++++
- src/qemu/qemu_domain.c | 8 +++++
- tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 +
- 9 files changed, 111 insertions(+), 1 deletion(-)
-
-diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
-index 710b3af7f7..367861c1ea 100644
---- a/docs/schemas/domaincommon.rng
-+++ b/docs/schemas/domaincommon.rng
-@@ -4722,6 +4722,9 @@
-
-
-
-+
-+
-+
-
-
-
-@@ -4910,6 +4913,18 @@
-
-
-
-+
-+
-+
-+
-+ enabled
-+ disabled
-+ required
-+
-+
-+
-+
-+
-
-
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index ca5d0bcc54..641a978f07 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -148,7 +148,9 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST,
- "vmport",
- "gic",
- "smm",
-- "ioapic")
-+ "ioapic",
-+ "hpt",
-+);
-
- VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST,
- "default",
-@@ -877,6 +879,13 @@ VIR_ENUM_IMPL(virDomainIOAPIC,
- "qemu",
- "kvm")
-
-+VIR_ENUM_IMPL(virDomainHPTResizing,
-+ VIR_DOMAIN_HPT_RESIZING_LAST,
-+ "enabled",
-+ "disabled",
-+ "required",
-+);
-+
- /* Internal mapping: subset of block job types that can be present in
- * XML (remaining types are not two-phase). */
- VIR_ENUM_DECL(virDomainBlockJob)
-@@ -18765,6 +18774,22 @@ virDomainDefParseXML(xmlDocPtr xml,
- }
- break;
-
-+ case VIR_DOMAIN_FEATURE_HPT:
-+ tmp = virXMLPropString(nodes[i], "resizing");
-+ if (tmp) {
-+ int value = virDomainHPTResizingTypeFromString(tmp);
-+ if (value < 0) {
-+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-+ _("Unknown HPT resizing setting: %s"),
-+ tmp);
-+ goto error;
-+ }
-+ def->hpt_resizing = value;
-+ def->features[val] = VIR_TRISTATE_SWITCH_ON;
-+ VIR_FREE(tmp);
-+ }
-+ break;
-+
- /* coverity[dead_error_begin] */
- case VIR_DOMAIN_FEATURE_LAST:
- break;
-@@ -20955,6 +20980,18 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
- return false;
- }
-
-+ /* HPT resizing */
-+ if (src->features[VIR_DOMAIN_FEATURE_HPT] == VIR_TRISTATE_SWITCH_ON) {
-+ if (src->hpt_resizing != dst->hpt_resizing) {
-+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-+ _("HPT resizing configuration differs: "
-+ "source: '%s', destination: '%s'"),
-+ virDomainHPTResizingTypeToString(src->hpt_resizing),
-+ virDomainHPTResizingTypeToString(dst->hpt_resizing));
-+ return false;
-+ }
-+ }
-+
- return true;
- }
-
-@@ -26204,6 +26241,13 @@ virDomainDefFormatInternal(virDomainDefPtr def,
- }
- break;
-
-+ case VIR_DOMAIN_FEATURE_HPT:
-+ if (def->features[i] == VIR_TRISTATE_SWITCH_ON) {
-+ virBufferAsprintf(buf, "\n",
-+ virDomainHPTResizingTypeToString(def->hpt_resizing));
-+ }
-+ break;
-+
- /* coverity[dead_error_begin] */
- case VIR_DOMAIN_FEATURE_LAST:
- break;
-diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
-index 388fa92dda..f967e603d1 100644
---- a/src/conf/domain_conf.h
-+++ b/src/conf/domain_conf.h
-@@ -1715,6 +1715,7 @@ typedef enum {
- VIR_DOMAIN_FEATURE_GIC,
- VIR_DOMAIN_FEATURE_SMM,
- VIR_DOMAIN_FEATURE_IOAPIC,
-+ VIR_DOMAIN_FEATURE_HPT,
-
- VIR_DOMAIN_FEATURE_LAST
- } virDomainFeature;
-@@ -1843,6 +1844,16 @@ typedef enum {
-
- VIR_ENUM_DECL(virDomainIOAPIC);
-
-+typedef enum {
-+ VIR_DOMAIN_HPT_RESIZING_ENABLED = 0,
-+ VIR_DOMAIN_HPT_RESIZING_DISABLED,
-+ VIR_DOMAIN_HPT_RESIZING_REQUIRED,
-+
-+ VIR_DOMAIN_HPT_RESIZING_LAST
-+} virDomainHPTResizing;
-+
-+VIR_ENUM_DECL(virDomainHPTResizing);
-+
- /* Operating system configuration data & machine / arch */
- typedef struct _virDomainOSEnv virDomainOSEnv;
- typedef virDomainOSEnv *virDomainOSEnvPtr;
-@@ -2315,6 +2326,7 @@ struct _virDomainDef {
- virGICVersion gic_version;
- char *hyperv_vendor_id;
- virDomainIOAPIC ioapic;
-+ virDomainHPTResizing hpt_resizing;
-
- /* These options are of type virTristateSwitch: ON = keep, OFF = drop */
- int caps_features[VIR_DOMAIN_CAPS_FEATURE_LAST];
-diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
-index 6653f95722..8d1d4a896b 100644
---- a/src/libvirt_private.syms
-+++ b/src/libvirt_private.syms
-@@ -385,6 +385,7 @@ virDomainHostdevModeTypeToString;
- virDomainHostdevRemove;
- virDomainHostdevSubsysPCIBackendTypeToString;
- virDomainHostdevSubsysTypeToString;
-+virDomainHPTResizingTypeToString;
- virDomainHubTypeFromString;
- virDomainHubTypeToString;
- virDomainHypervTypeFromString;
-diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
-index 37a58b3640..3793f16590 100644
---- a/src/qemu/qemu_capabilities.c
-+++ b/src/qemu/qemu_capabilities.c
-@@ -443,6 +443,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
- /* 270 */
- "vxhs",
- "virtio-blk.num-queues",
-+ "machine.pseries.resize-hpt",
- );
-
-
-@@ -4780,6 +4781,13 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
- if (qemuCaps->version >= 2006000)
- virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT);
-
-+ /* HPT resizing is supported since QEMU 2.10 on ppc64; unfortunately
-+ * there's no sane way to probe for it */
-+ if (qemuCaps->version >= 2010000 &&
-+ ARCH_IS_PPC64(qemuCaps->arch)) {
-+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
-+ }
-+
- if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0)
- goto cleanup;
-
-diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
-index cacc2b77ed..f0e2e9016f 100644
---- a/src/qemu/qemu_capabilities.h
-+++ b/src/qemu/qemu_capabilities.h
-@@ -429,6 +429,7 @@ typedef enum {
- /* 270 */
- QEMU_CAPS_VXHS, /* -drive file.driver=vxhs via query-qmp-schema */
- QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES, /* virtio-blk-*.num-queues */
-+ QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, /* -machine pseries,resize-hpt */
-
- QEMU_CAPS_LAST /* this must always be the last item */
- } virQEMUCapsFlags;
-diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
-index e60f93083f..aa7079229f 100644
---- a/src/qemu/qemu_command.c
-+++ b/src/qemu/qemu_command.c
-@@ -7566,6 +7566,26 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
- }
- }
-
-+ if (def->features[VIR_DOMAIN_FEATURE_HPT] == VIR_TRISTATE_SWITCH_ON) {
-+ const char *str;
-+
-+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT)) {
-+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-+ _("HTP resizing is not supported by this "
-+ "QEMU binary"));
-+ goto cleanup;
-+ }
-+
-+ str = virDomainHPTResizingTypeToString(def->hpt_resizing);
-+ if (!str) {
-+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-+ _("Invalid setting for HPT resizing"));
-+ goto cleanup;
-+ }
-+
-+ virBufferAsprintf(&buf, ",resize-hpt=%s", str);
-+ }
-+
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BOOTINDEX) &&
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_LOADPARM))
- qemuAppendLoadparmMachineParm(&buf, def);
-diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
-index 81f45516af..485e085cea 100644
---- a/src/qemu/qemu_domain.c
-+++ b/src/qemu/qemu_domain.c
-@@ -3109,6 +3109,14 @@ qemuDomainDefVerifyFeatures(const virDomainDef *def)
- return -1;
- }
-
-+ if (def->features[VIR_DOMAIN_FEATURE_HPT] == VIR_TRISTATE_SWITCH_ON &&
-+ !qemuDomainIsPSeries(def)) {
-+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-+ "%s",
-+ _("HPT tuning is only supported for pSeries guests"));
-+ return -1;
-+ }
-+
- return 0;
- }
-
-diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
-index 0dfa20726c..b0ee3f1523 100644
---- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
-+++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
-@@ -177,6 +177,7 @@
-
-
-
-+
- 2010000
- 0
- (v2.10.0)
---
-2.15.0
-
diff --git a/SOURCES/libvirt-qemu-Exempt-video-model-none-from-getting-a-PCI-address-on-Q35.patch b/SOURCES/libvirt-qemu-Exempt-video-model-none-from-getting-a-PCI-address-on-Q35.patch
new file mode 100644
index 0000000..abd3996
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Exempt-video-model-none-from-getting-a-PCI-address-on-Q35.patch
@@ -0,0 +1,45 @@
+From 80eaa9617c886a6955d4752d90c82b807b572dca Mon Sep 17 00:00:00 2001
+Message-Id: <80eaa9617c886a6955d4752d90c82b807b572dca@dist-git>
+From: Erik Skultety
+Date: Tue, 31 Jul 2018 10:38:54 +0200
+Subject: [PATCH] qemu: Exempt video model 'none' from getting a PCI address on
+ Q35
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Commit d48813e8 made sure we wouldn't get one for i440fx, but not for Q35
+machine type. If the primary video didn't get the assumed 0:0:1.0 PCI
+address, the evaluation then failed with: "Cannot automatically add a
+new PCI bus for a device with connect flags 00"
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1609087
+Signed-off-by: Erik Skultety
+(cherry picked from commit e9024b0cec3a66ac11784034bb62abe8ec7b46a1)
+Signed-off-by: Erik Skultety
+Reviewed-by: Ján Tomko
+---
+ src/qemu/qemu_domain_address.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
+index e6996934b8..0cb5af4a87 100644
+--- a/src/qemu/qemu_domain_address.c
++++ b/src/qemu/qemu_domain_address.c
+@@ -1723,10 +1723,11 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
+ goto cleanup;
+ }
+
+- if (def->nvideos > 0) {
++ if (def->nvideos > 0 &&
++ def->videos[0]->type != VIR_DOMAIN_VIDEO_TYPE_NONE) {
+ /* NB: unlike the pc machinetypes, on q35 machinetypes the
+ * integrated devices are at slot 0x1f, so when qemu looks for
+- * the first free lot for the first VGA, it will always be at
++ * the first free slot for the first VGA, it will always be at
+ * slot 1 (which was used up by the integrated PIIX3 devices
+ * on pc machinetypes).
+ */
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-qemu-Fetch-pr-helper-process-info-on-reconnect.patch b/SOURCES/libvirt-qemu-Fetch-pr-helper-process-info-on-reconnect.patch
new file mode 100644
index 0000000..5587410
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Fetch-pr-helper-process-info-on-reconnect.patch
@@ -0,0 +1,104 @@
+From 01aa947e223d82d4663270f1ac7ff2af3b31ccca Mon Sep 17 00:00:00 2001
+Message-Id: <01aa947e223d82d4663270f1ac7ff2af3b31ccca@dist-git>
+From: Michal Privoznik
+Date: Wed, 11 Jul 2018 17:27:28 +0200
+Subject: [PATCH] qemu: Fetch pr-helper process info on reconnect
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1470007
+
+If qemu-pr-helper process died while libvirtd was not running no
+event is emitted. Therefore, when reconnecting to the monitor we
+must check the qemu-pr-helper process status and act accordingly.
+
+Signed-off-by: Michal Privoznik
+(cherry picked from commit ab435a4be4673a9a38e0315864b9cf4f9bee03e7)
+Signed-off-by: Michal Privoznik
+Reviewed-by: Ján Tomko
+---
+ src/qemu/qemu_process.c | 60 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 60 insertions(+)
+
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index fbc8529f3b..c903a8e5c8 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -2071,6 +2071,63 @@ qemuRefreshVirtioChannelState(virQEMUDriverPtr driver,
+ return ret;
+ }
+
++
++static int
++qemuProcessRefreshPRManagerState(virDomainObjPtr vm,
++ virHashTablePtr info)
++{
++ qemuDomainObjPrivatePtr priv = vm->privateData;
++ qemuMonitorPRManagerInfoPtr prManagerInfo;
++ const char *managedAlias = qemuDomainGetManagedPRAlias();
++ int ret = -1;
++
++ if (!(prManagerInfo = virHashLookup(info, managedAlias))) {
++ virReportError(VIR_ERR_OPERATION_FAILED,
++ _("missing info on pr-manager %s"),
++ managedAlias);
++ goto cleanup;
++ }
++
++ priv->prDaemonRunning = prManagerInfo->connected;
++
++ if (!priv->prDaemonRunning &&
++ qemuProcessStartManagedPRDaemon(vm) < 0)
++ goto cleanup;
++
++ ret = 0;
++ cleanup:
++ return ret;
++}
++
++
++static int
++qemuRefreshPRManagerState(virQEMUDriverPtr driver,
++ virDomainObjPtr vm)
++{
++ qemuDomainObjPrivatePtr priv = vm->privateData;
++ virHashTablePtr info = NULL;
++ int ret = -1;
++
++ if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER) ||
++ !virDomainDefHasManagedPR(vm->def))
++ return 0;
++
++ qemuDomainObjEnterMonitor(driver, vm);
++ ret = qemuMonitorGetPRManagerInfo(priv->mon, &info);
++ if (qemuDomainObjExitMonitor(driver, vm) < 0)
++ ret = -1;
++
++ if (ret < 0)
++ goto cleanup;
++
++ ret = qemuProcessRefreshPRManagerState(vm, info);
++
++ cleanup:
++ virHashFree(info);
++ return ret;
++}
++
++
+ static void
+ qemuRefreshRTC(virQEMUDriverPtr driver,
+ virDomainObjPtr vm)
+@@ -7736,6 +7793,9 @@ qemuProcessReconnect(void *opaque)
+ if (qemuProcessUpdateDevices(driver, obj) < 0)
+ goto error;
+
++ if (qemuRefreshPRManagerState(driver, obj) < 0)
++ goto error;
++
+ qemuProcessReconnectCheckMemAliasOrderMismatch(obj);
+
+ if (qemuConnectAgent(driver, obj) < 0)
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-qemu-Fix-ATTRIBUTE_NONNULL-for-qemuMonitorAddObject.patch b/SOURCES/libvirt-qemu-Fix-ATTRIBUTE_NONNULL-for-qemuMonitorAddObject.patch
new file mode 100644
index 0000000..b8e31a9
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Fix-ATTRIBUTE_NONNULL-for-qemuMonitorAddObject.patch
@@ -0,0 +1,41 @@
+From 055b060ce71a1e173606e015d219158c945f0295 Mon Sep 17 00:00:00 2001
+Message-Id: <055b060ce71a1e173606e015d219158c945f0295@dist-git>
+From: John Ferlan
+Date: Fri, 13 Jul 2018 10:02:34 +0200
+Subject: [PATCH] qemu: Fix ATTRIBUTE_NONNULL for qemuMonitorAddObject
+
+Commit id fac0dacd was trying to make things more robust;
+however, the ATTRIBUTE_NONNULL(1) would be for the @mon,
+not the intended (2) and the @props argument as described
+in the commit message.
+
+Found by Coverity build.
+
+Signed-off-by: John Ferlan
+(cherry picked from commit 7406ab691ffe0fbe051f6ae57614737e193df6a5)
+
+The broken commit described in the original commit message was
+backported as 1d60f6832c8b14c9a
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1598015
+Reviewed-by: Jiri Denemark
+---
+ src/qemu/qemu_monitor.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
+index e3eb14bf06..e6d235b5ba 100644
+--- a/src/qemu/qemu_monitor.h
++++ b/src/qemu/qemu_monitor.h
+@@ -824,7 +824,7 @@ int qemuMonitorCreateObjectProps(virJSONValuePtr *propsret,
+ int qemuMonitorAddObject(qemuMonitorPtr mon,
+ virJSONValuePtr *props,
+ char **alias)
+- ATTRIBUTE_NONNULL(1);
++ ATTRIBUTE_NONNULL(2);
+
+ int qemuMonitorDelObject(qemuMonitorPtr mon,
+ const char *objalias);
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-qemu-Fix-crash-in-offline-migration.patch b/SOURCES/libvirt-qemu-Fix-crash-in-offline-migration.patch
deleted file mode 100644
index d2997ea..0000000
--- a/SOURCES/libvirt-qemu-Fix-crash-in-offline-migration.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From e41b2f83ca98fe352e9901d99b5cb9bf62d79845 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Jiri Denemark
-Date: Fri, 19 Jan 2018 14:33:16 +0100
-Subject: [PATCH] qemu: Fix crash in offline migration
-
-When migrating a shutoff domain (i.e., offline migration), we have no
-statistics to report and thus jobInfo will be NULL in
-qemuMigrationFinish.
-
-Broken by me in v3.10.0-183-ge8784e7868.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1536351
-
-Signed-off-by: Jiri Denemark
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit bcc5710708ec90146b71bdb00d8705cb4a9e0088)
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_migration.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
-index b814cc6608..a50bb7206c 100644
---- a/src/qemu/qemu_migration.c
-+++ b/src/qemu/qemu_migration.c
-@@ -5459,8 +5459,10 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
- }
-
- if (dom) {
-- VIR_STEAL_PTR(priv->job.completed, jobInfo);
-- priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED;
-+ if (jobInfo) {
-+ VIR_STEAL_PTR(priv->job.completed, jobInfo);
-+ priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED;
-+ }
-
- if (qemuMigrationBakeCookie(mig, driver, vm, cookieout, cookieoutlen,
- QEMU_MIGRATION_COOKIE_STATS) < 0)
---
-2.16.1
-
diff --git a/SOURCES/libvirt-qemu-Fix-probing-of-AMD-SEV-support.patch b/SOURCES/libvirt-qemu-Fix-probing-of-AMD-SEV-support.patch
new file mode 100644
index 0000000..beb94b5
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Fix-probing-of-AMD-SEV-support.patch
@@ -0,0 +1,143 @@
+From 03831cca9544d9b6489f09f0f87f94a2d676829c Mon Sep 17 00:00:00 2001
+Message-Id: <03831cca9544d9b6489f09f0f87f94a2d676829c@dist-git>
+From: Erik Skultety
+Date: Mon, 20 Aug 2018 17:18:52 +0200
+Subject: [PATCH] qemu: Fix probing of AMD SEV support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+So the procedure to detect SEV support works like this:
+1) we detect that sev-guest is among the QOM types and set the cap flag
+2) we probe the monitor for SEV support
+ - this is tricky, because QEMU with compiled SEV support will always
+ report -object sev-guest and query-sev-capabilities command, that
+ however doesn't mean SEV is supported
+3) depending on what the monitor returned, we either keep or clear the
+capability flag for SEV
+
+Commit a349c6c21c6 added an explicit check for "GenericError" in the
+monitor reply to prevent libvirtd to spam logs about missing
+'query-sev-capabilities' command. At the same time though, it returned
+success in this case which means that we didn't clear the capability
+flag afterwards and happily formatted SEV into qemuCaps. Therefore,
+adjust all the relevant callers to handle -1 on errors, 0 on SEV being
+unsupported and 1 on SEV being supported.
+
+Signed-off-by: Erik Skultety
+Acked-by: Peter Krempa
+(cherry picked from commit 764491c9dddf063292adf1433769ccccb1a50db6)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1612009
+https://bugzilla.redhat.com/show_bug.cgi?id=1619150
+
+Signed-off-by: Erik Skultety
+Reviewed-by: Ján Tomko
+---
+ src/qemu/qemu_capabilities.c | 15 ++++++++++----
+ src/qemu/qemu_monitor_json.c | 20 +++++++++++++++----
+ .../caps_3.0.0.x86_64.xml | 1 -
+ 3 files changed, 27 insertions(+), 9 deletions(-)
+
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index d1e4fafe7d..470f25a5a6 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -2696,18 +2696,20 @@ virQEMUCapsProbeQMPGICCapabilities(virQEMUCapsPtr qemuCaps,
+ }
+
+
++/* Returns -1 on error, 0 if SEV is not supported, 1 if SEV is supported */
+ static int
+ virQEMUCapsProbeQMPSEVCapabilities(virQEMUCapsPtr qemuCaps,
+ qemuMonitorPtr mon)
+ {
++ int rc = -1;
+ virSEVCapability *caps = NULL;
+
+- if (qemuMonitorGetSEVCapabilities(mon, &caps) < 0)
+- return -1;
++ if ((rc = qemuMonitorGetSEVCapabilities(mon, &caps)) <= 0)
++ return rc;
+
+ virSEVCapabilitiesFree(qemuCaps->sevCapabilities);
+ qemuCaps->sevCapabilities = caps;
+- return 0;
++ return rc;
+ }
+
+
+@@ -4120,7 +4122,12 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
+
+ /* Probe for SEV capabilities */
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEV_GUEST)) {
+- if (virQEMUCapsProbeQMPSEVCapabilities(qemuCaps, mon) < 0)
++ int rc = virQEMUCapsProbeQMPSEVCapabilities(qemuCaps, mon);
++
++ if (rc < 0)
++ goto cleanup;
++
++ if (rc == 0)
+ virQEMUCapsClear(qemuCaps, QEMU_CAPS_SEV_GUEST);
+ }
+
+diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
+index b226a47cc9..8970d95584 100644
+--- a/src/qemu/qemu_monitor_json.c
++++ b/src/qemu/qemu_monitor_json.c
+@@ -6562,6 +6562,20 @@ qemuMonitorJSONGetGICCapabilities(qemuMonitorPtr mon,
+ }
+
+
++/**
++ * qemuMonitorJSONGetSEVCapabilities:
++ * @mon: qemu monitor object
++ * @capabilities: pointer to pointer to a SEV capability structure to be filled
++ *
++ * This function queries and fills in AMD's SEV platform-specific data.
++ * Note that from QEMU's POV both -object sev-guest and query-sev-capabilities
++ * can be present even if SEV is not available, which basically leaves us with
++ * checking for JSON "GenericError" in order to differentiate between
++ * compiled-in support and actual SEV support on the platform.
++ *
++ * Returns -1 on error, 0 if SEV is not supported, and 1 if SEV is supported on
++ * the platform.
++ */
+ int
+ qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon,
+ virSEVCapability **capabilities)
+@@ -6583,8 +6597,7 @@ qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon,
+ if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
+ goto cleanup;
+
+- /* Both -object sev-guest and query-sev-capabilities can be present
+- * even if SEV is not available */
++ /* QEMU has only compiled-in support of SEV */
+ if (qemuMonitorJSONHasError(reply, "GenericError")) {
+ ret = 0;
+ goto cleanup;
+@@ -6636,8 +6649,7 @@ qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon,
+ capability->cbitpos = cbitpos;
+ capability->reduced_phys_bits = reduced_phys_bits;
+ VIR_STEAL_PTR(*capabilities, capability);
+- ret = 0;
+-
++ ret = 1;
+ cleanup:
+ virSEVCapabilitiesFree(capability);
+ virJSONValueFree(cmd);
+diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml
+index 4bc7cfeebc..8992d645e7 100644
+--- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml
++++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml
+@@ -212,7 +212,6 @@
+
+
+
+-
+
+
+
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-qemu-Fix-setting-global_period-cputune-element.patch b/SOURCES/libvirt-qemu-Fix-setting-global_period-cputune-element.patch
new file mode 100644
index 0000000..4819123
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Fix-setting-global_period-cputune-element.patch
@@ -0,0 +1,40 @@
+From 7bbe8d3560b3a5f2ef2cf8c833926bcc013897b0 Mon Sep 17 00:00:00 2001
+Message-Id: <7bbe8d3560b3a5f2ef2cf8c833926bcc013897b0@dist-git>
+From: Katerina Koukiou
+Date: Mon, 16 Jul 2018 15:45:17 +0200
+Subject: [PATCH] qemu: Fix setting global_period cputune element
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD is matched "cputune.global_period"
+should be updated and not "cputune.period".
+
+Signed-off-by: Katerina Koukiou
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1600427
+Reviewed-by: Ján Tomko
+Signed-off-by: Ján Tomko
+(cherry picked from commit 74b5634b77b388a454303a2be0b4d704e261305f)
+Signed-off-by: Katerina Koukiou
+Reviewed-by: Ján Tomko
+---
+ 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 4cb05bf81c..7094c80498 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -10568,7 +10568,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
+ }
+
+ if (persistentDef)
+- persistentDefCopy->cputune.period = value_ul;
++ persistentDefCopy->cputune.global_period = value_ul;
+
+ } else if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA)) {
+ SCHED_RANGE_CHECK(value_l, VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA,
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-qemu-Fix-type-of-a-completed-job.patch b/SOURCES/libvirt-qemu-Fix-type-of-a-completed-job.patch
deleted file mode 100644
index e473be6..0000000
--- a/SOURCES/libvirt-qemu-Fix-type-of-a-completed-job.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 92867e9b9ff1d9a163c6c166e710ba7c444be520 Mon Sep 17 00:00:00 2001
-Message-Id: <92867e9b9ff1d9a163c6c166e710ba7c444be520@dist-git>
-From: Jiri Denemark
-Date: Thu, 11 Jan 2018 20:47:50 +0100
-Subject: [PATCH] qemu: Fix type of a completed job
-
-Libvirt 3.7.0 and earlier libvirt reported a migration job as completed
-immediately after QEMU finished sending migration data at which point
-migration was not really complete yet. Commit v3.7.0-29-g3f2d6d829e
-fixed this, but caused a regression in reporting statistics for
-completed jobs which started reporting the job as still running. This
-happened because the completed job statistics including the job status
-are copied from the running job before we finally mark it as completed.
-
-Let's make sure QEMU_DOMAIN_JOB_STATUS_COMPLETED is always set in the
-completed job info even when the job has not finished yet.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1523036
-
-Signed-off-by: Jiri Denemark
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit e8784e7868d44a2ce796b376cf78f0f6c61c114a)
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_migration.c | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
-index af744661f4..b814cc6608 100644
---- a/src/qemu/qemu_migration.c
-+++ b/src/qemu/qemu_migration.c
-@@ -1623,8 +1623,10 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver,
- qemuDomainJobInfoUpdateTime(jobInfo);
- qemuDomainJobInfoUpdateDowntime(jobInfo);
- VIR_FREE(priv->job.completed);
-- if (VIR_ALLOC(priv->job.completed) == 0)
-+ if (VIR_ALLOC(priv->job.completed) == 0) {
- *priv->job.completed = *jobInfo;
-+ priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED;
-+ }
-
- if (asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT &&
- jobInfo->status == QEMU_DOMAIN_JOB_STATUS_QEMU_COMPLETED)
-@@ -5457,8 +5459,9 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
- }
-
- if (dom) {
-- priv->job.completed = jobInfo;
-- jobInfo = NULL;
-+ VIR_STEAL_PTR(priv->job.completed, jobInfo);
-+ priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED;
-+
- if (qemuMigrationBakeCookie(mig, driver, vm, cookieout, cookieoutlen,
- QEMU_MIGRATION_COOKIE_STATS) < 0)
- VIR_WARN("Unable to encode migration cookie");
---
-2.15.1
-
diff --git a/SOURCES/libvirt-qemu-Fix-updating-device-with-boot-order.patch b/SOURCES/libvirt-qemu-Fix-updating-device-with-boot-order.patch
deleted file mode 100644
index d554a0d..0000000
--- a/SOURCES/libvirt-qemu-Fix-updating-device-with-boot-order.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From b3bd3f499bcf2fa9b2d61b5291e0a50bc7e8e595 Mon Sep 17 00:00:00 2001
-Message-Id:
-From: Jiri Denemark
-Date: Thu, 22 Feb 2018 13:51:36 +0100
-Subject: [PATCH] qemu: Fix updating device with boot order
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Commit v3.7.0-14-gc57f3fd2f8 prevented adding a
-element to an inactive domain with global element.
-However, as a result of that change updating any device with boot order
-would fail with 'boot order X is already used by another device', where
-"another device" is in fact the device which is being updated.
-
-To fix this we have to ignore the device which we're about to update
-when checking for boot order conflicts.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1546971
-
-Signed-off-by: Jiri Denemark
-(cherry picked from commit edae027cfe02be4863dcef1e7f0ea0564766e312)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1557922
-
-Signed-off-by: Jiri Denemark
-Reviewed-by: Ján Tomko
----
- src/conf/domain_conf.c | 29 ++++++++++++++++++++++-------
- 1 file changed, 22 insertions(+), 7 deletions(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index e9bba70057..f21c776ccd 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -27166,18 +27166,30 @@ virDomainDeviceIsUSB(virDomainDeviceDefPtr dev)
- return false;
- }
-
-+
-+typedef struct _virDomainCompatibleDeviceData virDomainCompatibleDeviceData;
-+typedef virDomainCompatibleDeviceData *virDomainCompatibleDeviceDataPtr;
-+struct _virDomainCompatibleDeviceData {
-+ virDomainDeviceInfoPtr newInfo;
-+ virDomainDeviceInfoPtr oldInfo;
-+};
-+
- static int
- virDomainDeviceInfoCheckBootIndex(virDomainDefPtr def ATTRIBUTE_UNUSED,
- virDomainDeviceDefPtr device ATTRIBUTE_UNUSED,
- virDomainDeviceInfoPtr info,
- void *opaque)
- {
-- virDomainDeviceInfoPtr newinfo = opaque;
-+ virDomainCompatibleDeviceDataPtr data = opaque;
-
-- if (info->bootIndex == newinfo->bootIndex) {
-+ /* Ignore the device we're about to update */
-+ if (data->oldInfo == info)
-+ return 0;
-+
-+ if (info->bootIndex == data->newInfo->bootIndex) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("boot order %u is already used by another device"),
-- newinfo->bootIndex);
-+ data->newInfo->bootIndex);
- return -1;
- }
- return 0;
-@@ -27186,9 +27198,12 @@ virDomainDeviceInfoCheckBootIndex(virDomainDefPtr def ATTRIBUTE_UNUSED,
- int
- virDomainDefCompatibleDevice(virDomainDefPtr def,
- virDomainDeviceDefPtr dev,
-- virDomainDeviceDefPtr oldDev ATTRIBUTE_UNUSED)
-+ virDomainDeviceDefPtr oldDev)
- {
-- virDomainDeviceInfoPtr info = virDomainDeviceGetInfo(dev);
-+ virDomainCompatibleDeviceData data = {
-+ .newInfo = virDomainDeviceGetInfo(dev),
-+ .oldInfo = virDomainDeviceGetInfo(oldDev),
-+ };
-
- if (!virDomainDefHasUSB(def) &&
- def->os.type != VIR_DOMAIN_OSTYPE_EXE &&
-@@ -27199,7 +27214,7 @@ virDomainDefCompatibleDevice(virDomainDefPtr def,
- return -1;
- }
-
-- if (info && info->bootIndex > 0) {
-+ if (data.newInfo && data.newInfo->bootIndex > 0) {
- if (def->os.nBootDevs > 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("per-device boot elements cannot be used"
-@@ -27208,7 +27223,7 @@ virDomainDefCompatibleDevice(virDomainDefPtr def,
- }
- if (virDomainDeviceInfoIterate(def,
- virDomainDeviceInfoCheckBootIndex,
-- info) < 0)
-+ &data) < 0)
- return -1;
- }
-
---
-2.17.0
-
diff --git a/SOURCES/libvirt-qemu-Format-targetModel-for-serial-devices.patch b/SOURCES/libvirt-qemu-Format-targetModel-for-serial-devices.patch
deleted file mode 100644
index 4e3fa17..0000000
--- a/SOURCES/libvirt-qemu-Format-targetModel-for-serial-devices.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From 506c50ee610cae51d09bf7e26af850a395da0e1f Mon Sep 17 00:00:00 2001
-Message-Id: <506c50ee610cae51d09bf7e26af850a395da0e1f@dist-git>
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:23:10 +0100
-Subject: [PATCH] qemu: Format targetModel for serial devices
-
-Now that we've created a distinction between target type and target
-model, with the latter being the concrete device name, it's time to
-switch to formatting the model instead of the type.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 7c76c30465ff6038df3b7aa27b40a3348ec599c9)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1449265
-https://bugzilla.redhat.com/show_bug.cgi?id=1511421
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-https://bugzilla.redhat.com/show_bug.cgi?id=1512934
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_command.c | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
-index 8142834afd..7fd2afb1e0 100644
---- a/src/qemu/qemu_command.c
-+++ b/src/qemu/qemu_command.c
-@@ -10346,8 +10346,8 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
- serial->info.alias);
- }
- } else {
-- switch ((virDomainChrSerialTargetType) serial->targetType) {
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
-+ switch ((virDomainChrSerialTargetModel) serial->targetModel) {
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL:
- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_SERIAL)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("usb-serial is not supported in this QEMU binary"));
-@@ -10355,10 +10355,10 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
- }
- break;
-
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL:
- break;
-
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL:
- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCI_SERIAL)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("pci-serial is not supported with this QEMU binary"));
-@@ -10366,19 +10366,19 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
- }
- break;
-
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST:
- /* Except from _LAST, which is just a guard value and will never
- * be used, all of the above are platform devices, which means
- * qemuBuildSerialCommandLine() will have taken the appropriate
- * branch and we will not have ended up here. */
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-- _("Invalid target type for serial device"));
-+ _("Invalid target model for serial device"));
- goto error;
- }
-
- virBufferAsprintf(&cmd, "%s,chardev=char%s,id=%s",
-- virDomainChrSerialTargetTypeToString(serial->targetType),
-+ virDomainChrSerialTargetModelTypeToString(serial->targetModel),
- serial->info.alias, serial->info.alias);
- }
-
---
-2.15.1
-
diff --git a/SOURCES/libvirt-qemu-Format-the-HTM-pSeries-feature.patch b/SOURCES/libvirt-qemu-Format-the-HTM-pSeries-feature.patch
new file mode 100644
index 0000000..24ed628
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Format-the-HTM-pSeries-feature.patch
@@ -0,0 +1,102 @@
+From 1802d115cf79cf7d122d0864ec4add10eafc294d Mon Sep 17 00:00:00 2001
+Message-Id: <1802d115cf79cf7d122d0864ec4add10eafc294d@dist-git>
+From: Andrea Bolognani
+Date: Tue, 3 Jul 2018 15:25:17 +0200
+Subject: [PATCH] qemu: Format the HTM pSeries feature
+
+This makes the feature fully operational.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1525599
+
+Signed-off-by: Andrea Bolognani
+Reviewed-by: John Ferlan
+
+(cherry picked from commit d4c11171076edfb2e603804e79edf7ccc3cce5dc)
+Signed-off-by: Andrea Bolognani
+Acked-by: David Gibson
+Reviewed-by: Jiri Denemark
+---
+ src/qemu/qemu_command.c | 20 ++++++++++++++++++++
+ src/qemu/qemu_domain.c | 14 +++++++++++++-
+ tests/qemuxml2argvdata/pseries-features.args | 2 +-
+ 3 files changed, 34 insertions(+), 2 deletions(-)
+
+diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
+index c1eefca639..4120e4f983 100644
+--- a/src/qemu/qemu_command.c
++++ b/src/qemu/qemu_command.c
+@@ -7327,6 +7327,26 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
+ }
+ }
+
++ if (def->features[VIR_DOMAIN_FEATURE_HTM] != VIR_TRISTATE_SWITCH_ABSENT) {
++ const char *str;
++
++ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_HTM)) {
++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
++ _("HTM configuration is not supported by this "
++ "QEMU binary"));
++ goto cleanup;
++ }
++
++ str = virTristateSwitchTypeToString(def->features[VIR_DOMAIN_FEATURE_HTM]);
++ if (!str) {
++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
++ _("Invalid setting for HTM state"));
++ goto cleanup;
++ }
++
++ virBufferAsprintf(&buf, ",cap-htm=%s", str);
++ }
++
+ if (cpu && cpu->model &&
+ cpu->mode == VIR_CPU_MODE_HOST_MODEL &&
+ qemuDomainIsPSeries(def) &&
+diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
+index 0eacad1e44..3f3bb94685 100644
+--- a/src/qemu/qemu_domain.c
++++ b/src/qemu/qemu_domain.c
+@@ -3852,6 +3852,19 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
+ }
+ break;
+
++ case VIR_DOMAIN_FEATURE_HTM:
++ if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
++ !qemuDomainIsPSeries(def)) {
++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
++ _("The '%s' feature is not supported for "
++ "architecture '%s' or machine type '%s'"),
++ featureName,
++ virArchToString(def->os.arch),
++ def->os.machine);
++ return -1;
++ }
++ break;
++
+ case VIR_DOMAIN_FEATURE_ACPI:
+ case VIR_DOMAIN_FEATURE_APIC:
+ case VIR_DOMAIN_FEATURE_PAE:
+@@ -3865,7 +3878,6 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
+ case VIR_DOMAIN_FEATURE_PMU:
+ case VIR_DOMAIN_FEATURE_VMPORT:
+ case VIR_DOMAIN_FEATURE_VMCOREINFO:
+- case VIR_DOMAIN_FEATURE_HTM:
+ case VIR_DOMAIN_FEATURE_LAST:
+ break;
+ }
+diff --git a/tests/qemuxml2argvdata/pseries-features.args b/tests/qemuxml2argvdata/pseries-features.args
+index 12c14715c6..226d43df44 100644
+--- a/tests/qemuxml2argvdata/pseries-features.args
++++ b/tests/qemuxml2argvdata/pseries-features.args
+@@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \
+ -name guest \
+ -S \
+ -machine pseries,accel=tcg,usb=off,dump-guest-core=off,resize-hpt=required,\
+-cap-hpt-max-page-size=1048576k \
++cap-hpt-max-page-size=1048576k,cap-htm=on \
+ -m 512 \
+ -smp 1,sockets=1,cores=1,threads=1 \
+ -uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+--
+2.18.0
+
diff --git a/SOURCES/libvirt-qemu-Ignore-fallback-CPU-attribute-on-reconnect.patch b/SOURCES/libvirt-qemu-Ignore-fallback-CPU-attribute-on-reconnect.patch
deleted file mode 100644
index 650b157..0000000
--- a/SOURCES/libvirt-qemu-Ignore-fallback-CPU-attribute-on-reconnect.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 267d4074f4c6a543643e1fe8cd726953273a5bc6 Mon Sep 17 00:00:00 2001
-Message-Id: <267d4074f4c6a543643e1fe8cd726953273a5bc6@dist-git>
-From: Jiri Denemark
-Date: Wed, 10 Jan 2018 15:56:21 +0100
-Subject: [PATCH] qemu: Ignore fallback CPU attribute on reconnect
-
-When reconnecting to a running domain with host-model CPU started by old
-libvirt which did not store the actual CPU in the status XML, we need to
-ignore the fallback attribute to make sure we can translate the detected
-host CPU model to a model which is supported by the running QEMU.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1532980
-
-Signed-off-by: Jiri Denemark
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 237f045d9a9d84a52e645b490d14ad0b66e5b8ed)
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_process.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
-index 701528c42c..c64088e4ca 100644
---- a/src/qemu/qemu_process.c
-+++ b/src/qemu/qemu_process.c
-@@ -3884,6 +3884,11 @@ qemuProcessUpdateCPU(virQEMUDriverPtr driver,
- virDomainCapsCPUModelsPtr models = NULL;
- int ret = -1;
-
-+ /* The host CPU model comes from host caps rather than QEMU caps so
-+ * fallback must be allowed no matter what the user specified in the XML.
-+ */
-+ vm->def->cpu->fallback = VIR_CPU_FALLBACK_ALLOW;
-+
- if (qemuProcessFetchGuestCPU(driver, vm, asyncJob, &cpu, &disabled) < 0)
- goto cleanup;
-
---
-2.15.1
-
diff --git a/SOURCES/libvirt-qemu-Improve-qemuDomainChrTargetDefValidate.patch b/SOURCES/libvirt-qemu-Improve-qemuDomainChrTargetDefValidate.patch
deleted file mode 100644
index f14a292..0000000
--- a/SOURCES/libvirt-qemu-Improve-qemuDomainChrTargetDefValidate.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From 04e24e8cb39c0a3b3d3203985fa0ec824195d1ab Mon Sep 17 00:00:00 2001
-Message-Id: <04e24e8cb39c0a3b3d3203985fa0ec824195d1ab@dist-git>
-From: Andrea Bolognani
-Date: Wed, 29 Nov 2017 16:23:06 +0100
-Subject: [PATCH] qemu: Improve qemuDomainChrTargetDefValidate()
-
-Instead of validating each target type / address type combination
-separately, create a small helper to perform the matching and
-collapse all existing checks into a single one.
-
-Signed-off-by: Andrea Bolognani
-Reviewed-by: Pavel Hrdina
-(cherry picked from commit 9ae116eadf7578282d284635fa23a4265b8db734)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1449265
-https://bugzilla.redhat.com/show_bug.cgi?id=1511421
-https://bugzilla.redhat.com/show_bug.cgi?id=1512929
-https://bugzilla.redhat.com/show_bug.cgi?id=1512934
-Signed-off-by: Jiri Denemark
----
- src/qemu/qemu_domain.c | 50 ++++++++++++++++++++++++++++++--------------------
- 1 file changed, 30 insertions(+), 20 deletions(-)
-
-diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
-index 35eb19ca32..bb25255b94 100644
---- a/src/qemu/qemu_domain.c
-+++ b/src/qemu/qemu_domain.c
-@@ -3456,43 +3456,53 @@ qemuDomainChrSourceDefValidate(const virDomainChrSourceDef *def)
- }
-
-
-+static int
-+qemuDomainChrSerialTargetTypeToAddressType(int targetType)
-+{
-+ switch ((virDomainChrSerialTargetType) targetType) {
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
-+ return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
-+ return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
-+ return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
-+ break;
-+ }
-+
-+ return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE;
-+}
-+
-+
- static int
- qemuDomainChrTargetDefValidate(const virDomainDef *def,
- const virDomainChrDef *chr)
- {
-+ int expected;
-+
- switch ((virDomainChrDeviceType) chr->deviceType) {
- case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
-
- /* Validate target type */
- switch ((virDomainChrSerialTargetType) chr->targetType) {
- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
-+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
-+
- /* Hack required until we have a proper type for pSeries
- * serial consoles */
- if (qemuDomainIsPSeries(def))
- return 0;
-
-- if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
-- chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA) {
-- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-- _("isa-serial requires address of isa type"));
-- return -1;
-- }
-- break;
-+ expected = qemuDomainChrSerialTargetTypeToAddressType(chr->targetType);
-
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
- if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
-- chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB) {
-- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-- _("usb-serial requires address of usb type"));
-- return -1;
-- }
-- break;
--
-- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
-- if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
-- chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
-- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-- _("pci-serial requires address of pci type"));
-+ chr->info.type != expected) {
-+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-+ _("Target type '%s' requires address type '%s'"),
-+ virDomainChrSerialTargetTypeToString(chr->targetType),
-+ virDomainDeviceAddressTypeToString(expected));
- return -1;
- }
- break;
---
-2.15.1
-
diff --git a/SOURCES/libvirt-qemu-Introduce-a-new-graphics-display-type-headless.patch b/SOURCES/libvirt-qemu-Introduce-a-new-graphics-display-type-headless.patch
new file mode 100644
index 0000000..4b0c40e
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Introduce-a-new-graphics-display-type-headless.patch
@@ -0,0 +1,908 @@
+From 11219f42da3b15bd76b9215fda9d23d5435a1d3b Mon Sep 17 00:00:00 2001
+Message-Id: <11219f42da3b15bd76b9215fda9d23d5435a1d3b@dist-git>
+From: Erik Skultety
+Date: Thu, 19 Jul 2018 15:03:58 +0200
+Subject: [PATCH] qemu: Introduce a new graphics display type 'headless'
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since 2.10 QEMU supports a new display type egl-headless which uses the
+drm nodes for OpenGL rendering copying back the rendered bits back to
+QEMU into a dma-buf which can be accessed by standard "display" apps
+like VNC or SPICE. Although this display type can be used on its own,
+for any practical use case it makes sense to pair it with either VNC or
+SPICE display. The clear benefit of this display is that VNC gains
+OpenGL support, which it natively doesn't have, and SPICE gains remote
+OpenGL support (native OpenGL support only works locally through a UNIX
+socket, i.e. listen type=socket/none).
+
+Reviewed-by: Ján Tomko
+Signed-off-by: Erik Skultety
+(cherry picked from commit d8266ebe1615c4b043db6b8d486465722cdd0ef8)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1475770
+Signed-off-by: Erik Skultety
+Reviewed-by: Ján Tomko
+---
+ docs/formatdomain.html.in | 33 +++++++++-
+ docs/schemas/domaincommon.rng | 3 +
+ src/conf/domain_conf.c | 6 +-
+ src/conf/domain_conf.h | 1 +
+ src/libxl/libxl_conf.c | 1 +
+ src/qemu/qemu_command.c | 14 ++++-
+ src/qemu/qemu_domain.c | 60 ++++++++++++++++++-
+ src/qemu/qemu_driver.c | 2 +
+ src/qemu/qemu_hotplug.c | 1 +
+ src/qemu/qemu_process.c | 4 ++
+ src/vmx/vmx.c | 1 +
+ tests/domaincapsschemadata/full.xml | 1 +
+ .../graphics-egl-headless.args | 26 ++++++++
+ .../graphics-egl-headless.xml | 31 ++++++++++
+ .../graphics-sdl-egl-headless.xml | 35 +++++++++++
+ .../graphics-spice-egl-headless.args | 31 ++++++++++
+ .../graphics-spice-egl-headless.xml | 36 +++++++++++
+ .../graphics-spice-invalid-egl-headless.xml | 37 ++++++++++++
+ .../graphics-vnc-egl-headless.args | 28 +++++++++
+ .../graphics-vnc-egl-headless.xml | 37 ++++++++++++
+ tests/qemuxml2argvtest.c | 17 ++++++
+ .../graphics-spice-egl-headless.xml | 44 ++++++++++++++
+ .../graphics-vnc-egl-headless.xml | 42 +++++++++++++
+ tests/qemuxml2xmltest.c | 2 +
+ 24 files changed, 488 insertions(+), 5 deletions(-)
+ create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless.args
+ create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless.xml
+ create mode 100644 tests/qemuxml2argvdata/graphics-sdl-egl-headless.xml
+ create mode 100644 tests/qemuxml2argvdata/graphics-spice-egl-headless.args
+ create mode 100644 tests/qemuxml2argvdata/graphics-spice-egl-headless.xml
+ create mode 100644 tests/qemuxml2argvdata/graphics-spice-invalid-egl-headless.xml
+ create mode 100644 tests/qemuxml2argvdata/graphics-vnc-egl-headless.args
+ create mode 100644 tests/qemuxml2argvdata/graphics-vnc-egl-headless.xml
+ create mode 100644 tests/qemuxml2xmloutdata/graphics-spice-egl-headless.xml
+ create mode 100644 tests/qemuxml2xmloutdata/graphics-vnc-egl-headless.xml
+
+diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
+index a3afe137bf..9dd22554ad 100644
+--- a/docs/formatdomain.html.in
++++ b/docs/formatdomain.html.in
+@@ -6299,7 +6299,8 @@ qemu-kvm -net nic,model=? /dev/null
+
+ The graphics element has a mandatory type
+ attribute which takes the value sdl, vnc,
+- spice, rdp or desktop:
++ spice, rdp, desktop or
++ egl-headless:
+
+
+
sdl
+@@ -6358,6 +6359,11 @@ qemu-kvm -net nic,model=? /dev/null
+ auto-allocation and autoport having no effect due to
+ security reasons) Since 1.0.6.
+
++
++ Although VNC doesn't support OpenGL natively, it can be paired
++ with graphics type egl-headless (see below) which
++ will instruct QEMU to open and use drm nodes for OpenGL rendering.
++
+
+
spiceSince 0.8.6
+
+@@ -6463,6 +6469,12 @@ qemu-kvm -net nic,model=? /dev/null
+ You can enable or disable OpenGL support explicitly with
+ the gl element, by setting the enable
+ property. (QEMU only, since 1.3.3).
++ Note that this only works locally, since this requires usage of
++ UNIX sockets, i.e. using listen types 'socket' or
++ 'none'. For accelerated OpenGL with remote support, consider
++ pairing this element with type egl-headless
++ (see below). However, this will deliver weaker performance
++ compared to native Spice OpenGL support.
+
+
+ By default, QEMU will pick the first available GPU DRM render node.
+@@ -6498,6 +6510,25 @@ qemu-kvm -net nic,model=? /dev/null
+ fullscreen.
+
+
++
egl-headlessSince 4.6.0
++
++
++ This display type provides support for an OpenGL accelerated
++ display accessible both locally and remotely (for comparison,
++ Spice's native OpenGL support only works locally using UNIX
++ sockets at the moment, but has better performance). Since this
++ display type doesn't provide any window or graphical console like
++ the other types, for practical reasons it should be paired with
++ either vnc or spice graphics types.
++ This display type is only supported by QEMU domains
++ (needs QEMU 2.10 or newer) and doesn't
++ accept any attributes.
++