From 51d9a27c420b94e61abbfb73e14c6abef68d29b8 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 04:56:16 +0000 Subject: import libvirt-4.5.0-10.el7 --- diff --git a/.gitignore b/.gitignore index b62ce7d..95d8dbd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libvirt-3.9.0.tar.xz +SOURCES/libvirt-4.5.0.tar.xz diff --git a/.libvirt.metadata b/.libvirt.metadata index 0db550c..3fedbbb 100644 --- a/.libvirt.metadata +++ b/.libvirt.metadata @@ -1 +1 @@ -7aae5bfdbc859234833464a7faaa2a1cc0c2775e SOURCES/libvirt-3.9.0.tar.xz +5f097d246c0fba04d18ac7ec951ad56ffa1a8958 SOURCES/libvirt-4.5.0.tar.xz diff --git a/SOURCES/libvirt-Introduce-virDomainDeviceAliasIsUserAlias.patch b/SOURCES/libvirt-Introduce-virDomainDeviceAliasIsUserAlias.patch deleted file mode 100644 index e9cdd28..0000000 --- a/SOURCES/libvirt-Introduce-virDomainDeviceAliasIsUserAlias.patch +++ /dev/null @@ -1,79 +0,0 @@ -From c4df501b589eb7d4315c13bfe6ba653321135841 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 30 Nov 2017 17:45:57 +0100 -Subject: [PATCH] Introduce virDomainDeviceAliasIsUserAlias -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Allow parts of code outside domain_conf to decide whether the alias -is user-specified or not. - -(cherry picked from commit 309cd46b400d80420615b19adfebf7158492ae3b) - -https://bugzilla.redhat.com/show_bug.cgi?id=1518148 - -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 9 ++++++++- - src/conf/domain_conf.h | 2 ++ - src/libvirt_private.syms | 1 + - 3 files changed, 11 insertions(+), 1 deletion(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 83392a42c0..bd6d851f21 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -6662,6 +6662,13 @@ virDomainDeviceAddressParseXML(xmlNodePtr address, - #define USER_ALIAS_CHARS \ - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" - -+bool -+virDomainDeviceAliasIsUserAlias(const char *aliasStr) -+{ -+ return STRPREFIX(aliasStr, USER_ALIAS_PREFIX); -+} -+ -+ - /* Parse the XML definition for a device address - * @param node XML nodeset to parse for device address definition - */ -@@ -6715,7 +6722,7 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED, - - if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) || - (xmlopt->config.features & VIR_DOMAIN_DEF_FEATURE_USER_ALIAS && -- STRPREFIX(aliasStr, USER_ALIAS_PREFIX) && -+ virDomainDeviceAliasIsUserAlias(aliasStr) && - strspn(aliasStr, USER_ALIAS_CHARS) == strlen(aliasStr))) - VIR_STEAL_PTR(info->alias, aliasStr); - } -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 0e97f0437e..479a791f29 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2674,6 +2674,8 @@ int virDomainDeviceValidateAliasForHotplug(virDomainObjPtr vm, - virDomainDeviceDefPtr dev, - unsigned int flags); - -+bool virDomainDeviceAliasIsUserAlias(const char *aliasStr); -+ - int virDomainDefValidate(virDomainDefPtr def, - virCapsPtr caps, - unsigned int parseFlags, -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index 0449b0185f..19c1ecc408 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -292,6 +292,7 @@ virDomainDefVcpuOrderClear; - virDomainDeleteConfig; - virDomainDeviceAddressIsValid; - virDomainDeviceAddressTypeToString; -+virDomainDeviceAliasIsUserAlias; - virDomainDeviceDefCopy; - virDomainDeviceDefFree; - virDomainDeviceDefParse; --- -2.15.1 - diff --git a/SOURCES/libvirt-Introduce-virDomainInputDefGetPath.patch b/SOURCES/libvirt-Introduce-virDomainInputDefGetPath.patch deleted file mode 100644 index de76e4f..0000000 --- a/SOURCES/libvirt-Introduce-virDomainInputDefGetPath.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 90aa784ed6ab93eae0a5e555c55bd65bc3240647 Mon Sep 17 00:00:00 2001 -Message-Id: <90aa784ed6ab93eae0a5e555c55bd65bc3240647@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Mon, 27 Nov 2017 14:20:58 +0100 -Subject: [PATCH] Introduce virDomainInputDefGetPath -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Use it to denadify qemuDomainSetupInput. - -(cherry picked from commit cbf4242db7da3727f86934513c417acdec3d1a48) - -https://bugzilla.redhat.com/show_bug.cgi?id=1509866 - -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 16 ++++++++++++++++ - src/conf/domain_conf.h | 1 + - src/libvirt_private.syms | 1 + - src/qemu/qemu_domain.c | 21 ++++----------------- - 4 files changed, 22 insertions(+), 17 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 641a978f07..530fae9d9d 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1397,6 +1397,22 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def) - VIR_FREE(def); - } - -+const char *virDomainInputDefGetPath(virDomainInputDefPtr input) -+{ -+ switch ((virDomainInputType) input->type) { -+ case VIR_DOMAIN_INPUT_TYPE_MOUSE: -+ case VIR_DOMAIN_INPUT_TYPE_TABLET: -+ case VIR_DOMAIN_INPUT_TYPE_KBD: -+ case VIR_DOMAIN_INPUT_TYPE_LAST: -+ return NULL; -+ break; -+ -+ case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH: -+ return input->source.evdev; -+ } -+ return NULL; -+} -+ - void virDomainInputDefFree(virDomainInputDefPtr def) - { - if (!def) -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index f967e603d1..09635763a1 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2696,6 +2696,7 @@ int virDomainObjWaitUntil(virDomainObjPtr vm, - void virDomainPanicDefFree(virDomainPanicDefPtr panic); - void virDomainResourceDefFree(virDomainResourceDefPtr resource); - void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def); -+const char *virDomainInputDefGetPath(virDomainInputDefPtr input); - void virDomainInputDefFree(virDomainInputDefPtr def); - virDomainDiskDefPtr virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt); - void virDomainDiskDefFree(virDomainDiskDefPtr def); -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index 8d1d4a896b..3e0bc8730c 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -393,6 +393,7 @@ virDomainHypervTypeToString; - virDomainInputBusTypeToString; - virDomainInputDefFind; - virDomainInputDefFree; -+virDomainInputDefGetPath; - virDomainIOMMUModelTypeFromString; - virDomainIOMMUModelTypeToString; - virDomainIOThreadIDAdd; -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 2f987787cd..dbe9ed5e98 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -8977,25 +8977,12 @@ qemuDomainSetupInput(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - virDomainInputDefPtr input, - const struct qemuDomainCreateDeviceData *data) - { -- int ret = -1; -+ const char *path = virDomainInputDefGetPath(input); - -- switch ((virDomainInputType) input->type) { -- case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH: -- if (qemuDomainCreateDevice(input->source.evdev, data, false) < 0) -- goto cleanup; -- break; -+ if (path && qemuDomainCreateDevice(path, data, false) < 0) -+ return -1; - -- case VIR_DOMAIN_INPUT_TYPE_MOUSE: -- case VIR_DOMAIN_INPUT_TYPE_TABLET: -- case VIR_DOMAIN_INPUT_TYPE_KBD: -- case VIR_DOMAIN_INPUT_TYPE_LAST: -- /* nada */ -- break; -- } -- -- ret = 0; -- cleanup: -- return ret; -+ return 0; - } - - --- -2.15.1 - diff --git a/SOURCES/libvirt-Pass-oldDev-to-virDomainDefCompatibleDevice-on-device-update.patch b/SOURCES/libvirt-Pass-oldDev-to-virDomainDefCompatibleDevice-on-device-update.patch deleted file mode 100644 index cca3d5a..0000000 --- a/SOURCES/libvirt-Pass-oldDev-to-virDomainDefCompatibleDevice-on-device-update.patch +++ /dev/null @@ -1,270 +0,0 @@ -From 7164bcc8bec5165de244a74f32ca1469c7091d2d Mon Sep 17 00:00:00 2001 -Message-Id: <7164bcc8bec5165de244a74f32ca1469c7091d2d@dist-git> -From: Jiri Denemark -Date: Thu, 22 Feb 2018 13:30:27 +0100 -Subject: [PATCH] Pass oldDev to virDomainDefCompatibleDevice on device update -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When calling virDomainDefCompatibleDevice to check a new device during -device update, we need to pass the original device which is going to be -updated in addition to the new device. Otherwise, the function can -report false conflicts. - -The new argument is currently ignored by virDomainDefCompatibleDevice, -but this will change in the following patch. - -https://bugzilla.redhat.com/show_bug.cgi?id=1546971 - -Signed-off-by: Jiri Denemark -(cherry picked from commit b6a264e8550d4add3946ec2fd9ae31a76fbf16fe) - -https://bugzilla.redhat.com/show_bug.cgi?id=1557922 - -Conflicts: - src/qemu/qemu_driver.c -- context, qemuDomainUpdateDeviceLive - requires connection pointer in RHEL - -Signed-off-by: Jiri Denemark -Reviewed-by: Ján Tomko ---- - src/conf/domain_conf.c | 3 ++- - src/conf/domain_conf.h | 3 ++- - src/lxc/lxc_driver.c | 15 ++++++++----- - src/qemu/qemu_driver.c | 51 +++++++++++++++++++++++++++++++++--------- - 4 files changed, 54 insertions(+), 18 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 031d4b8e55..e9bba70057 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -27185,7 +27185,8 @@ virDomainDeviceInfoCheckBootIndex(virDomainDefPtr def ATTRIBUTE_UNUSED, - - int - virDomainDefCompatibleDevice(virDomainDefPtr def, -- virDomainDeviceDefPtr dev) -+ virDomainDeviceDefPtr dev, -+ virDomainDeviceDefPtr oldDev ATTRIBUTE_UNUSED) - { - virDomainDeviceInfoPtr info = virDomainDeviceGetInfo(dev); - -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 3817887322..fb09496e89 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -3006,7 +3006,8 @@ typedef enum { - } virDomainDeviceAction; - - int virDomainDefCompatibleDevice(virDomainDefPtr def, -- virDomainDeviceDefPtr dev); -+ virDomainDeviceDefPtr dev, -+ virDomainDeviceDefPtr oldDev); - - void virDomainRNGDefFree(virDomainRNGDefPtr def); - -diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c -index 7829ef8618..fe2405d08b 100644 ---- a/src/lxc/lxc_driver.c -+++ b/src/lxc/lxc_driver.c -@@ -3579,6 +3579,7 @@ lxcDomainUpdateDeviceConfig(virDomainDefPtr vmdef, - { - int ret = -1; - virDomainNetDefPtr net; -+ virDomainDeviceDef oldDev = { .type = dev->type }; - int idx; - - switch (dev->type) { -@@ -3587,8 +3588,11 @@ lxcDomainUpdateDeviceConfig(virDomainDefPtr vmdef, - if ((idx = virDomainNetFindIdx(vmdef, net)) < 0) - goto cleanup; - -- virDomainNetDefFree(vmdef->nets[idx]); -+ oldDev.data.net = vmdef->nets[idx]; -+ if (virDomainDefCompatibleDevice(vmdef, dev, &oldDev) < 0) -+ return -1; - -+ virDomainNetDefFree(vmdef->nets[idx]); - vmdef->nets[idx] = net; - dev->data.net = NULL; - ret = 0; -@@ -4791,7 +4795,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom, - if (!vmdef) - goto endjob; - -- if (virDomainDefCompatibleDevice(vmdef, dev) < 0) -+ if (virDomainDefCompatibleDevice(vmdef, dev, NULL) < 0) - goto endjob; - - if ((ret = lxcDomainAttachDeviceConfig(vmdef, dev)) < 0) -@@ -4799,7 +4803,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom, - } - - if (flags & VIR_DOMAIN_AFFECT_LIVE) { -- if (virDomainDefCompatibleDevice(vm->def, dev_copy) < 0) -+ if (virDomainDefCompatibleDevice(vm->def, dev_copy, NULL) < 0) - goto endjob; - - if ((ret = lxcDomainAttachDeviceLive(dom->conn, driver, vm, dev_copy)) < 0) -@@ -4902,9 +4906,8 @@ static int lxcDomainUpdateDeviceFlags(virDomainPtr dom, - if (!vmdef) - goto endjob; - -- if (virDomainDefCompatibleDevice(vmdef, dev) < 0) -- goto endjob; -- -+ /* virDomainDefCompatibleDevice call is delayed until we know the -+ * device we're going to update. */ - if ((ret = lxcDomainUpdateDeviceConfig(vmdef, dev)) < 0) - goto endjob; - } -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index b8022a06ba..3bd2d983a2 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -7830,6 +7830,7 @@ qemuDomainChangeDiskLive(virConnectPtr conn, - { - virDomainDiskDefPtr disk = dev->data.disk; - virDomainDiskDefPtr orig_disk = NULL; -+ virDomainDeviceDef oldDev = { .type = dev->type }; - int ret = -1; - - if (virStorageTranslateDiskSourcePool(conn, disk) < 0) -@@ -7847,6 +7848,10 @@ qemuDomainChangeDiskLive(virConnectPtr conn, - goto cleanup; - } - -+ oldDev.data.disk = orig_disk; -+ if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev) < 0) -+ goto cleanup; -+ - if (!qemuDomainDiskChangeSupported(disk, orig_disk)) - goto cleanup; - -@@ -7890,19 +7895,36 @@ qemuDomainUpdateDeviceLive(virConnectPtr conn, - bool force) - { - virQEMUDriverPtr driver = dom->conn->privateData; -+ virDomainDeviceDef oldDev = { .type = dev->type }; - int ret = -1; -+ int idx; - - switch ((virDomainDeviceType) dev->type) { - case VIR_DOMAIN_DEVICE_DISK: - qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, NULL); - ret = qemuDomainChangeDiskLive(conn, vm, dev, driver, force); - break; -+ - case VIR_DOMAIN_DEVICE_GRAPHICS: -+ if ((idx = qemuDomainFindGraphicsIndex(vm->def, dev->data.graphics) >= 0)) { -+ oldDev.data.graphics = vm->def->graphics[idx]; -+ if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev) < 0) -+ return -1; -+ } -+ - ret = qemuDomainChangeGraphics(driver, vm, dev->data.graphics); - break; -+ - case VIR_DOMAIN_DEVICE_NET: -+ if ((idx = virDomainNetFindIdx(vm->def, dev->data.net)) >= 0) { -+ oldDev.data.net = vm->def->nets[idx]; -+ if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev) < 0) -+ return -1; -+ } -+ - ret = qemuDomainChangeNet(driver, vm, dev); - break; -+ - case VIR_DOMAIN_DEVICE_FS: - case VIR_DOMAIN_DEVICE_INPUT: - case VIR_DOMAIN_DEVICE_SOUND: -@@ -8317,6 +8339,7 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef, - virDomainDiskDefPtr newDisk; - virDomainGraphicsDefPtr newGraphics; - virDomainNetDefPtr net; -+ virDomainDeviceDef oldDev = { .type = dev->type }; - int pos; - - switch ((virDomainDeviceType) dev->type) { -@@ -8328,6 +8351,10 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef, - return -1; - } - -+ oldDev.data.disk = vmdef->disks[pos]; -+ if (virDomainDefCompatibleDevice(vmdef, dev, &oldDev) < 0) -+ return -1; -+ - virDomainDiskDefFree(vmdef->disks[pos]); - vmdef->disks[pos] = newDisk; - dev->data.disk = NULL; -@@ -8343,8 +8370,11 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef, - return -1; - } - -- virDomainGraphicsDefFree(vmdef->graphics[pos]); -+ oldDev.data.graphics = vmdef->graphics[pos]; -+ if (virDomainDefCompatibleDevice(vmdef, dev, &oldDev) < 0) -+ return -1; - -+ virDomainGraphicsDefFree(vmdef->graphics[pos]); - vmdef->graphics[pos] = newGraphics; - dev->data.graphics = NULL; - break; -@@ -8354,8 +8384,11 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef, - if ((pos = virDomainNetFindIdx(vmdef, net)) < 0) - return -1; - -- virDomainNetDefFree(vmdef->nets[pos]); -+ oldDev.data.net = vmdef->nets[pos]; -+ if (virDomainDefCompatibleDevice(vmdef, dev, &oldDev) < 0) -+ return -1; - -+ virDomainNetDefFree(vmdef->nets[pos]); - vmdef->nets[pos] = net; - dev->data.net = NULL; - break; -@@ -8443,7 +8476,7 @@ qemuDomainAttachDeviceLiveAndConfig(virConnectPtr conn, - if (!vmdef) - goto cleanup; - -- if (virDomainDefCompatibleDevice(vmdef, dev) < 0) -+ if (virDomainDefCompatibleDevice(vmdef, dev, NULL) < 0) - goto cleanup; - if ((ret = qemuDomainAttachDeviceConfig(vmdef, dev, conn, caps, - parse_flags, -@@ -8452,7 +8485,7 @@ qemuDomainAttachDeviceLiveAndConfig(virConnectPtr conn, - } - - if (flags & VIR_DOMAIN_AFFECT_LIVE) { -- if (virDomainDefCompatibleDevice(vm->def, dev_copy) < 0) -+ if (virDomainDefCompatibleDevice(vm->def, dev_copy, NULL) < 0) - goto cleanup; - - if ((ret = qemuDomainAttachDeviceLive(vm, dev_copy, conn, driver)) < 0) -@@ -8592,9 +8625,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom, - if (!vmdef) - goto endjob; - -- if (virDomainDefCompatibleDevice(vmdef, dev) < 0) -- goto endjob; -- -+ /* virDomainDefCompatibleDevice call is delayed until we know the -+ * device we're going to update. */ - if ((ret = qemuDomainUpdateDeviceConfig(vmdef, dev, caps, - parse_flags, - driver->xmlopt)) < 0) -@@ -8602,9 +8634,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom, - } - - if (flags & VIR_DOMAIN_AFFECT_LIVE) { -- if (virDomainDefCompatibleDevice(vm->def, dev_copy) < 0) -- goto endjob; -- -+ /* virDomainDefCompatibleDevice call is delayed until we know the -+ * device we're going to update. */ - if ((ret = qemuDomainUpdateDeviceLive(dom->conn, vm, dev_copy, dom, force)) < 0) - goto endjob; - /* --- -2.17.0 - diff --git a/SOURCES/libvirt-RHEL-Add-rhel-machine-types-to-qemuDomainMachineNeedsFDC.patch b/SOURCES/libvirt-RHEL-Add-rhel-machine-types-to-qemuDomainMachineNeedsFDC.patch index c3f491d..d747a75 100644 --- a/SOURCES/libvirt-RHEL-Add-rhel-machine-types-to-qemuDomainMachineNeedsFDC.patch +++ b/SOURCES/libvirt-RHEL-Add-rhel-machine-types-to-qemuDomainMachineNeedsFDC.patch @@ -1,5 +1,5 @@ -From 6c4cb735843674c4dc3638fd22e222105bfc33ef Mon Sep 17 00:00:00 2001 -Message-Id: <6c4cb735843674c4dc3638fd22e222105bfc33ef@dist-git> +From ff2b3b8bdb05750071b2c799431c7cc35db348f3 Mon Sep 17 00:00:00 2001 +Message-Id: From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Mon, 22 Feb 2016 12:51:51 +0100 Subject: [PATCH] RHEL: Add rhel machine types to qemuDomainMachineNeedsFDC @@ -17,10 +17,10 @@ Signed-off-by: Jiri Denemark 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 13e77eedcd..81bfef946e 100644 +index 4c15d5a36a..4c2a162b85 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c -@@ -6833,6 +6833,9 @@ qemuDomainMachineNeedsFDC(const char *machine) +@@ -9239,6 +9239,9 @@ qemuDomainMachineNeedsFDC(const char *machine) STRPREFIX(p, "2.2") || STRPREFIX(p, "2.3")) return false; @@ -31,5 +31,5 @@ index 13e77eedcd..81bfef946e 100644 } return false; -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-RHEL-Add-support-for-QMP-I-O-error-reason.patch b/SOURCES/libvirt-RHEL-Add-support-for-QMP-I-O-error-reason.patch index 3651996..950cf92 100644 --- a/SOURCES/libvirt-RHEL-Add-support-for-QMP-I-O-error-reason.patch +++ b/SOURCES/libvirt-RHEL-Add-support-for-QMP-I-O-error-reason.patch @@ -1,5 +1,5 @@ -From 039a4ec94aca6cb2226161de49e4b8a7c53f8321 Mon Sep 17 00:00:00 2001 -Message-Id: <039a4ec94aca6cb2226161de49e4b8a7c53f8321@dist-git> +From 12912db55da81fff50119b780b151a0fc864d878 Mon Sep 17 00:00:00 2001 +Message-Id: <12912db55da81fff50119b780b151a0fc864d878@dist-git> From: Jiri Denemark Date: Thu, 9 Oct 2014 10:38:39 +0200 Subject: [PATCH] RHEL: Add support for QMP I/O error reason @@ -18,10 +18,10 @@ Signed-off-by: Jiri Denemark 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index e0f942788d..a1fa37e1e9 100644 +index ec8469476e..1bc5b662ae 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c -@@ -641,7 +641,7 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) +@@ -740,7 +740,7 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) { const char *device; const char *action; @@ -30,7 +30,7 @@ index e0f942788d..a1fa37e1e9 100644 bool nospc = false; int actionID; -@@ -657,8 +657,14 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) +@@ -756,8 +756,14 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) if ((device = virJSONValueObjectGetString(data, "device")) == NULL) VIR_WARN("missing device in disk io error event"); @@ -48,5 +48,5 @@ index e0f942788d..a1fa37e1e9 100644 if ((actionID = qemuMonitorIOErrorActionTypeFromString(action)) < 0) { VIR_WARN("unknown disk io error action '%s'", action); -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-RHEL-Define-ETHTOOL_-GS-COALESCE-when-building-on-older-kernels.patch b/SOURCES/libvirt-RHEL-Define-ETHTOOL_-GS-COALESCE-when-building-on-older-kernels.patch index 8649f9f..cd55ddf 100644 --- a/SOURCES/libvirt-RHEL-Define-ETHTOOL_-GS-COALESCE-when-building-on-older-kernels.patch +++ b/SOURCES/libvirt-RHEL-Define-ETHTOOL_-GS-COALESCE-when-building-on-older-kernels.patch @@ -1,5 +1,5 @@ -From c6e5d4660e094d9377300d76873545ef73886e0a Mon Sep 17 00:00:00 2001 -Message-Id: +From c26689a72b04c30ea703d8820f4fc3ce840c6e3b Mon Sep 17 00:00:00 2001 +Message-Id: From: Martin Kletzander Date: Tue, 25 Apr 2017 13:41:21 +0200 Subject: [PATCH] RHEL: Define ETHTOOL_[GS]COALESCE when building on older @@ -17,10 +17,10 @@ Signed-off-by: Jiri Denemark 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c -index 41ef65d882..4a63fe9af9 100644 +index b250af9e2c..bc1e70f0a8 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c -@@ -3350,7 +3350,14 @@ virNetDevGetEthtoolGFeatures(virBitmapPtr bitmap ATTRIBUTE_UNUSED, +@@ -3393,7 +3393,14 @@ virNetDevGetEthtoolGFeatures(virBitmapPtr bitmap ATTRIBUTE_UNUSED, # endif @@ -36,7 +36,7 @@ index 41ef65d882..4a63fe9af9 100644 /** * virNetDevSetCoalesce: * @ifname: interface name to modify -@@ -3450,20 +3457,6 @@ int virNetDevSetCoalesce(const char *ifname, +@@ -3493,20 +3500,6 @@ int virNetDevSetCoalesce(const char *ifname, VIR_FORCE_CLOSE(fd); return ret; } @@ -58,5 +58,5 @@ index 41ef65d882..4a63fe9af9 100644 /** -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-RHEL-Fix-maxvcpus-output.patch b/SOURCES/libvirt-RHEL-Fix-maxvcpus-output.patch index 039c712..4640622 100644 --- a/SOURCES/libvirt-RHEL-Fix-maxvcpus-output.patch +++ b/SOURCES/libvirt-RHEL-Fix-maxvcpus-output.patch @@ -1,5 +1,5 @@ -From e6b3f2c8091afc39840c44add90c0148db365811 Mon Sep 17 00:00:00 2001 -Message-Id: +From 7dff909fa34bdd93ad200dbffe70c0c1ee931925 Mon Sep 17 00:00:00 2001 +Message-Id: <7dff909fa34bdd93ad200dbffe70c0c1ee931925@dist-git> From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 17 Sep 2014 19:00:58 +0200 Subject: [PATCH] RHEL: Fix maxvcpus output @@ -19,10 +19,10 @@ Signed-off-by: Jiri Denemark 1 file changed, 5 insertions(+) diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c -index c485a97211..bd58aa43df 100644 +index 013c95bb56..3f7d70b87b 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c -@@ -1178,6 +1178,11 @@ virHostCPUGetKVMMaxVCPUs(void) +@@ -1214,6 +1214,11 @@ virHostCPUGetKVMMaxVCPUs(void) return -1; } @@ -35,5 +35,5 @@ index c485a97211..bd58aa43df 100644 /* at first try KVM_CAP_MAX_VCPUS to determine the maximum count */ if ((ret = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_MAX_VCPUS)) > 0) -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-RHEL-Hack-around-changed-Broadwell-Haswell-CPUs.patch b/SOURCES/libvirt-RHEL-Hack-around-changed-Broadwell-Haswell-CPUs.patch index b4c1c99..8bb5717 100644 --- a/SOURCES/libvirt-RHEL-Hack-around-changed-Broadwell-Haswell-CPUs.patch +++ b/SOURCES/libvirt-RHEL-Hack-around-changed-Broadwell-Haswell-CPUs.patch @@ -1,5 +1,5 @@ -From 01e432517f0a44054a5317cea7f8a1171a3b10c7 Mon Sep 17 00:00:00 2001 -Message-Id: <01e432517f0a44054a5317cea7f8a1171a3b10c7@dist-git> +From af7f65d5ce4fe129b0844eb031212a3fb397b8da Mon Sep 17 00:00:00 2001 +Message-Id: From: Jiri Denemark Date: Fri, 27 Mar 2015 12:48:40 +0100 Subject: [PATCH] RHEL: Hack around changed Broadwell/Haswell CPUs @@ -18,20 +18,20 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1199446 Signed-off-by: Jiri Denemark --- - src/qemu/qemu_command.c | 29 ++++++++++++++++++++++ - .../qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args | 2 +- - .../qemuxml2argv-cpu-host-model-cmt.args | 3 ++- - .../qemuxml2argv-cpu-tsc-frequency.args | 2 +- - .../qemuxml2argv-q35-acpi-nouefi.args | 2 +- - .../qemuxml2argv-q35-acpi-uefi.args | 2 +- - .../qemuxml2argv-q35-noacpi-nouefi.args | 2 +- + src/qemu/qemu_command.c | 29 +++++++++++++++++++ + tests/qemuxml2argvdata/cpu-Haswell.args | 2 +- + .../qemuxml2argvdata/cpu-host-model-cmt.args | 3 +- + tests/qemuxml2argvdata/cpu-tsc-frequency.args | 2 +- + tests/qemuxml2argvdata/q35-acpi-nouefi.args | 2 +- + tests/qemuxml2argvdata/q35-acpi-uefi.args | 2 +- + tests/qemuxml2argvdata/q35-noacpi-nouefi.args | 2 +- 7 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index b1cfafa790..365555ca87 100644 +index 4fc3176ad3..c1eefca639 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c -@@ -6857,6 +6857,8 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, +@@ -6677,6 +6677,8 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, size_t i; virCapsPtr caps = NULL; virCPUDefPtr cpu = def->cpu; @@ -40,7 +40,7 @@ index b1cfafa790..365555ca87 100644 if (!(caps = virQEMUDriverGetCapabilities(driver, false))) goto cleanup; -@@ -6911,6 +6913,11 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, +@@ -6734,6 +6736,11 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, virBufferAsprintf(buf, ",vendor=%s", cpu->vendor_id); for (i = 0; i < cpu->nfeatures; i++) { @@ -52,7 +52,7 @@ index b1cfafa790..365555ca87 100644 switch ((virCPUFeaturePolicy) cpu->features[i].policy) { case VIR_CPU_FEATURE_FORCE: case VIR_CPU_FEATURE_REQUIRE: -@@ -6934,6 +6941,28 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, +@@ -6757,6 +6764,28 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, } } @@ -81,26 +81,26 @@ index b1cfafa790..365555ca87 100644 ret = 0; cleanup: virObjectUnref(caps); -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args -index 06c9eed5b9..553b91c83b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args +diff --git a/tests/qemuxml2argvdata/cpu-Haswell.args b/tests/qemuxml2argvdata/cpu-Haswell.args +index c7ce396d05..6f20359524 100644 +--- a/tests/qemuxml2argvdata/cpu-Haswell.args ++++ b/tests/qemuxml2argvdata/cpu-Haswell.args @@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \ -name QEMUGuest1 \ -S \ - -M pc \ + -machine pc,accel=kvm,usb=off,dump-guest-core=off \ --cpu Haswell \ +-cpu Haswell,+rtm,+hle \ -m 214 \ -smp 6,sockets=6,cores=1,threads=1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-cmt.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-cmt.args -index ef45d98300..28cdf92782 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-cmt.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-cmt.args +diff --git a/tests/qemuxml2argvdata/cpu-host-model-cmt.args b/tests/qemuxml2argvdata/cpu-host-model-cmt.args +index 8767278d11..d236aa9e09 100644 +--- a/tests/qemuxml2argvdata/cpu-host-model-cmt.args ++++ b/tests/qemuxml2argvdata/cpu-host-model-cmt.args @@ -9,7 +9,8 @@ QEMU_AUDIO_DRV=none \ -S \ - -M pc \ + -machine pc,accel=tcg,usb=off,dump-guest-core=off \ -cpu Haswell,+vme,+ds,+acpi,+ss,+ht,+tm,+pbe,+dtes64,+monitor,+ds_cpl,+vmx,\ -+smx,+est,+tm2,+xtpr,+pdcm,+osxsave,+f16c,+rdrand,+pdpe1gb,+abm,+lahf_lm \ ++smx,+est,+tm2,+xtpr,+pdcm,+osxsave,+f16c,+rdrand,+pdpe1gb,+abm,+lahf_lm,+rtm,\ @@ -108,12 +108,12 @@ index ef45d98300..28cdf92782 100644 -m 214 \ -smp 6,sockets=6,cores=1,threads=1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-tsc-frequency.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-tsc-frequency.args -index 3e2da0f242..53193c6fe2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-tsc-frequency.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-tsc-frequency.args +diff --git a/tests/qemuxml2argvdata/cpu-tsc-frequency.args b/tests/qemuxml2argvdata/cpu-tsc-frequency.args +index 7824dea96f..216fd43014 100644 +--- a/tests/qemuxml2argvdata/cpu-tsc-frequency.args ++++ b/tests/qemuxml2argvdata/cpu-tsc-frequency.args @@ -10,7 +10,7 @@ QEMU_AUDIO_DRV=none \ - -M pc \ + -machine pc,accel=kvm,usb=off,dump-guest-core=off \ -cpu Haswell,+vme,+ds,+acpi,+ss,+ht,+tm,+pbe,+dtes64,+monitor,+ds_cpl,+vmx,\ +smx,+est,+tm2,+xtpr,+pdcm,+osxsave,+f16c,+rdrand,+pdpe1gb,+abm,+lahf_lm,\ -+invtsc,tsc-frequency=3504000000 \ @@ -121,45 +121,45 @@ index 3e2da0f242..53193c6fe2 100644 -m 214 \ -smp 1,sockets=1,cores=1,threads=1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args -index 503045de6b..5e1d3b4eb0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args +diff --git a/tests/qemuxml2argvdata/q35-acpi-nouefi.args b/tests/qemuxml2argvdata/q35-acpi-nouefi.args +index caef49ea16..a9375a35db 100644 +--- a/tests/qemuxml2argvdata/q35-acpi-nouefi.args ++++ b/tests/qemuxml2argvdata/q35-acpi-nouefi.args @@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \ -name guest \ -S \ - -M q35 \ + -machine q35,accel=tcg,usb=off,dump-guest-core=off \ --cpu Haswell \ +-cpu Haswell,+rtm,+hle \ -m 1024 \ -smp 1,sockets=1,cores=1,threads=1 \ -uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args -index fbbbcf9812..40214c69e8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args +diff --git a/tests/qemuxml2argvdata/q35-acpi-uefi.args b/tests/qemuxml2argvdata/q35-acpi-uefi.args +index a3293aeb9d..8e3368b9e9 100644 +--- a/tests/qemuxml2argvdata/q35-acpi-uefi.args ++++ b/tests/qemuxml2argvdata/q35-acpi-uefi.args @@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \ -name guest \ -S \ - -M q35 \ + -machine q35,accel=tcg,usb=off,dump-guest-core=off \ --cpu Haswell \ +-cpu Haswell,+rtm,+hle \ -drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,\ readonly=on \ -drive file=/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=pflash,format=raw,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args -index de2a7f30bc..1be5968e02 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args +diff --git a/tests/qemuxml2argvdata/q35-noacpi-nouefi.args b/tests/qemuxml2argvdata/q35-noacpi-nouefi.args +index fab2a6fcb0..0dd61840ef 100644 +--- a/tests/qemuxml2argvdata/q35-noacpi-nouefi.args ++++ b/tests/qemuxml2argvdata/q35-noacpi-nouefi.args @@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \ -name guest \ -S \ - -M q35 \ + -machine q35,accel=tcg,usb=off,dump-guest-core=off \ --cpu Haswell \ +-cpu Haswell,+rtm,+hle \ -m 1024 \ -smp 1,sockets=1,cores=1,threads=1 \ -uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-RHEL-Support-virtio-disk-hotplug-in-JSON-mode.patch b/SOURCES/libvirt-RHEL-Support-virtio-disk-hotplug-in-JSON-mode.patch index 0357f85..e0241fc 100644 --- a/SOURCES/libvirt-RHEL-Support-virtio-disk-hotplug-in-JSON-mode.patch +++ b/SOURCES/libvirt-RHEL-Support-virtio-disk-hotplug-in-JSON-mode.patch @@ -1,5 +1,5 @@ -From 618632843aeb3a587c2bbfdb7442217ae13b45fe Mon Sep 17 00:00:00 2001 -Message-Id: <618632843aeb3a587c2bbfdb7442217ae13b45fe@dist-git> +From 8bac3f7591f7df980a631deeb67a2f20eab6fc62 Mon Sep 17 00:00:00 2001 +Message-Id: <8bac3f7591f7df980a631deeb67a2f20eab6fc62@dist-git> From: Jiri Denemark Date: Tue, 5 Apr 2016 09:14:09 +0200 Subject: [PATCH] RHEL: Support virtio disk hotplug in JSON mode @@ -50,17 +50,17 @@ Conflicts: src/qemu/qemu_monitor_json.c - context; upstream doesn't try to call nonexistent drive_{add,del} QMP commands any more --- - src/qemu/qemu_monitor.c | 12 +++-- - src/qemu/qemu_monitor_json.c | 106 +++++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_monitor_json.h | 6 +++ - tests/qemuhotplugtest.c | 93 ++++++++++++++++++++++++++++++++++++- - 4 files changed, 211 insertions(+), 6 deletions(-) + src/qemu/qemu_monitor.c | 12 ++-- + src/qemu/qemu_monitor_json.c | 107 +++++++++++++++++++++++++++++++++++ + src/qemu/qemu_monitor_json.h | 6 ++ + tests/qemuhotplugtest.c | 93 +++++++++++++++++++++++++++++- + 4 files changed, 212 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 3cf23db874..12ad45d340 100644 +index 6fc038a8d9..5e0e95cc51 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c -@@ -3125,8 +3125,10 @@ qemuMonitorDriveDel(qemuMonitorPtr mon, +@@ -2947,8 +2947,10 @@ qemuMonitorDriveDel(qemuMonitorPtr mon, QEMU_CHECK_MONITOR(mon); @@ -73,7 +73,7 @@ index 3cf23db874..12ad45d340 100644 } -@@ -3247,8 +3249,10 @@ qemuMonitorAddDrive(qemuMonitorPtr mon, +@@ -3137,8 +3139,10 @@ qemuMonitorAddDrive(qemuMonitorPtr mon, QEMU_CHECK_MONITOR(mon); @@ -87,10 +87,10 @@ index 3cf23db874..12ad45d340 100644 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 8a75e0ef7e..e0f942788d 100644 +index af754e870e..ec8469476e 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c -@@ -3839,6 +3839,112 @@ int qemuMonitorJSONDelObject(qemuMonitorPtr mon, +@@ -4055,6 +4055,113 @@ int qemuMonitorJSONDelObject(qemuMonitorPtr mon, } @@ -200,14 +200,15 @@ index 8a75e0ef7e..e0f942788d 100644 + return ret; +} + - int qemuMonitorJSONSetDrivePassphrase(qemuMonitorPtr mon, - const char *alias, - const char *passphrase) ++ + int + qemuMonitorJSONDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions, + const char *device, const char *file, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index 02a504ab85..f1e818aed2 100644 +index b92fc3762b..9c8fab7cc0 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h -@@ -234,6 +234,12 @@ int qemuMonitorJSONAddObject(qemuMonitorPtr mon, +@@ -238,6 +238,12 @@ int qemuMonitorJSONAddObject(qemuMonitorPtr mon, int qemuMonitorJSONDelObject(qemuMonitorPtr mon, const char *objalias); @@ -217,15 +218,15 @@ index 02a504ab85..f1e818aed2 100644 +int qemuMonitorJSONDriveDel(qemuMonitorPtr mon, + const char *drivestr); + - int qemuMonitorJSONSetDrivePassphrase(qemuMonitorPtr mon, - const char *alias, - const char *passphrase); + int qemuMonitorJSONDiskSnapshot(qemuMonitorPtr mon, + virJSONValuePtr actions, + const char *device, diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c -index bdde7e45f3..7691ad8f0f 100644 +index 663e33ed00..cddedf768e 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c -@@ -663,6 +663,14 @@ mymain(void) - " }" \ +@@ -665,6 +665,14 @@ mymain(void) + " }" \ "}\r\n" +#define QMP_NOT_FOUND \ @@ -239,7 +240,7 @@ index bdde7e45f3..7691ad8f0f 100644 DO_TEST_UPDATE("graphics-spice", "graphics-spice-nochange", false, false, NULL); DO_TEST_UPDATE("graphics-spice-timeout", "graphics-spice-timeout-nochange", false, false, "set_password", QMP_OK, "expire_password", QMP_OK); -@@ -683,67 +691,135 @@ mymain(void) +@@ -685,67 +693,135 @@ mymain(void) "chardev-remove", QMP_OK); DO_TEST_ATTACH("base-live", "disk-virtio", false, true, @@ -376,7 +377,7 @@ index bdde7e45f3..7691ad8f0f 100644 "human-monitor-command", HMP("")); DO_TEST_ATTACH_EVENT("base-without-scsi-controller-live", "disk-scsi-2", false, true, -@@ -752,14 +828,17 @@ mymain(void) +@@ -754,14 +830,17 @@ mymain(void) "device_add", QMP_OK, "device_add", QMP_OK, "device_add", QMP_OK, @@ -395,7 +396,7 @@ index bdde7e45f3..7691ad8f0f 100644 "human-monitor-command", HMP("")); DO_TEST_ATTACH("base-live", "qemu-agent", false, true, -@@ -770,38 +849,47 @@ mymain(void) +@@ -772,38 +851,47 @@ mymain(void) "chardev-remove", QMP_OK); DO_TEST_ATTACH("base-ccw-live", "ccw-virtio", false, true, @@ -443,7 +444,7 @@ index bdde7e45f3..7691ad8f0f 100644 "human-monitor-command", HMP("OK\\r\\n"), "device_add", QMP_OK); -@@ -819,6 +907,7 @@ mymain(void) +@@ -821,6 +909,7 @@ mymain(void) "object-del", QMP_OK); DO_TEST_ATTACH("base-live+disk-scsi-wwn", "disk-scsi-duplicate-wwn", false, false, @@ -452,5 +453,5 @@ index bdde7e45f3..7691ad8f0f 100644 "device_add", QMP_OK); -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-RHEL-cpu-Add-downstream-only-CPU-features-for-CVE-2017-5715.patch b/SOURCES/libvirt-RHEL-cpu-Add-downstream-only-CPU-features-for-CVE-2017-5715.patch new file mode 100644 index 0000000..61e6655 --- /dev/null +++ b/SOURCES/libvirt-RHEL-cpu-Add-downstream-only-CPU-features-for-CVE-2017-5715.patch @@ -0,0 +1,194 @@ +From 5d335dc7f64e2bd394c1bf86c6e5582fd859857a Mon Sep 17 00:00:00 2001 +Message-Id: <5d335dc7f64e2bd394c1bf86c6e5582fd859857a@dist-git> +From: Paolo Bonzini +Date: Tue, 12 Dec 2017 16:23:42 +0100 +Subject: [PATCH] RHEL: cpu: Add downstream only CPU features for CVE-2017-5715 + +RHEL-only: The downstream patches for CVE-2017-5715 contained more CPU +features than what was eventually pushed upstream. We need to keep them +included for backward compatibility. + +Signed-off-by: Paolo Bonzini +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_map.xml | 6 ++++++ + .../x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml | 2 +- + tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml | 1 + + tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml | 1 + + tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml | 2 +- + tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml | 1 + + tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml | 1 + + tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml | 2 +- + tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml | 1 + + tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml | 1 + + tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml | 2 +- + tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml | 1 + + tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml | 1 + + 13 files changed, 18 insertions(+), 4 deletions(-) + +diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml +index 96daa0f9af..f1f8048c14 100644 +--- a/src/cpu/cpu_map.xml ++++ b/src/cpu/cpu_map.xml +@@ -298,6 +298,12 @@ + + + ++ ++ ++ ++ ++ ++ + + + +diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml +index e033bb141f..5c9cfa9bd6 100644 +--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml ++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml +@@ -1,6 +1,6 @@ + + + +- ++ + + +diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml +index a70cb6d46a..538bfe16ab 100644 +--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml ++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml +index b8e3399103..004423ee57 100644 +--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml ++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml +@@ -23,6 +23,7 @@ + + + ++ + + + +diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml +index aacc7a2b14..ec299652f7 100644 +--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml ++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml +@@ -1,6 +1,6 @@ + + + +- ++ + + +diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml +index a66c7a5644..d8aaaad29d 100644 +--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml ++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml +@@ -24,6 +24,7 @@ + + + ++ + + + +diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml +index 624d71db20..9bac4b4648 100644 +--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml ++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml +@@ -25,6 +25,7 @@ + + + ++ + + + +diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml +index d904808cec..85369d755c 100644 +--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml ++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml +@@ -1,7 +1,7 @@ + + + +- ++ + + + +diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml +index 60609f5c70..d4f303ecce 100644 +--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml ++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml +@@ -20,6 +20,7 @@ + + + ++ + + + +diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml +index 357cafd10a..60a7a9339d 100644 +--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml ++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml +@@ -25,6 +25,7 @@ + + + ++ + + + +diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml +index b5c70a9dc4..a5b85a15c2 100644 +--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml ++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml +@@ -1,7 +1,7 @@ + + + +- ++ + + + +diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml +index 5f51dea631..64b69dea56 100644 +--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml ++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml +index a11b31369d..00e8da7512 100644 +--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml ++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml +@@ -23,6 +23,7 @@ + + + ++ + + + +-- +2.18.0 + diff --git a/SOURCES/libvirt-RHEL-cpu-Fix-EPYC-IBRS-CPU-model.patch b/SOURCES/libvirt-RHEL-cpu-Fix-EPYC-IBRS-CPU-model.patch deleted file mode 100644 index 2e372c8..0000000 --- a/SOURCES/libvirt-RHEL-cpu-Fix-EPYC-IBRS-CPU-model.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 111f9cb4bd22a68c50237e52190663c3f43a66ee Mon Sep 17 00:00:00 2001 -Message-Id: <111f9cb4bd22a68c50237e52190663c3f43a66ee@dist-git> -From: Jiri Denemark -Date: Fri, 5 Jan 2018 17:40:30 +0100 -Subject: [PATCH] RHEL: cpu: Fix EPYC-IBRS CPU model - -It is spelled as EPYC-IBPB in QEMU. - -RHEL-only, upstream patches were sent for review with this patch -squashed in. - -CVE-2017-5715 - -Signed-off-by: Jiri Denemark ---- - src/cpu/cpu_map.xml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml -index a7888ec134..4d786f1e0a 100644 ---- a/src/cpu/cpu_map.xml -+++ b/src/cpu/cpu_map.xml -@@ -1754,7 +1754,7 @@ - - - -- -+ - - - --- -2.15.1 - diff --git a/SOURCES/libvirt-RHEL-qemu-Add-ability-to-set-sgio-values-for-hostdev.patch b/SOURCES/libvirt-RHEL-qemu-Add-ability-to-set-sgio-values-for-hostdev.patch index ef549ec..f741d2f 100644 --- a/SOURCES/libvirt-RHEL-qemu-Add-ability-to-set-sgio-values-for-hostdev.patch +++ b/SOURCES/libvirt-RHEL-qemu-Add-ability-to-set-sgio-values-for-hostdev.patch @@ -1,5 +1,5 @@ -From c696e4c1071b6a386d8c8428836eeb146886b644 Mon Sep 17 00:00:00 2001 -Message-Id: +From f2cf0ae7bc371c75f6c0e79192711f2b1d201b10 Mon Sep 17 00:00:00 2001 +Message-Id: From: John Ferlan Date: Thu, 9 Jul 2015 08:28:57 -0400 Subject: [PATCH] RHEL: qemu: Add ability to set sgio values for hostdev @@ -18,10 +18,10 @@ Signed-off-by: Jiri Denemark 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c -index ec61c9c526..f1c142efb6 100644 +index a4f545ef92..3ea9784854 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c -@@ -1570,6 +1570,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) +@@ -1633,6 +1633,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) virDomainDiskDefPtr disk = NULL; virDomainHostdevDefPtr hostdev = NULL; char *sysfs_path = NULL; @@ -29,7 +29,7 @@ index ec61c9c526..f1c142efb6 100644 const char *path = NULL; int val = -1; int ret = -1; -@@ -1591,14 +1592,10 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) +@@ -1654,14 +1655,10 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) if (!qemuIsSharedHostdev(hostdev)) return 0; @@ -46,7 +46,7 @@ index ec61c9c526..f1c142efb6 100644 } else { return 0; } -@@ -1607,7 +1604,11 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) +@@ -1670,7 +1667,11 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) goto cleanup; /* By default, filter the SG_IO commands, i.e. set unpriv_sgio to 0. */ @@ -59,7 +59,7 @@ index ec61c9c526..f1c142efb6 100644 /* Do not do anything if unpriv_sgio is not supported by the kernel and the * whitelist is enabled. But if requesting unfiltered access, always call -@@ -1620,6 +1621,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) +@@ -1683,6 +1684,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) ret = 0; cleanup: @@ -68,5 +68,5 @@ index ec61c9c526..f1c142efb6 100644 return ret; } -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch b/SOURCES/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch index fe9f6da..c299cd8 100644 --- a/SOURCES/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch +++ b/SOURCES/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch @@ -1,5 +1,5 @@ -From aa370aac88baeea6a35558f3c22a9206cc667eb9 Mon Sep 17 00:00:00 2001 -Message-Id: +From 712005bcf26190dc6fd1fe56283377987909cc4b Mon Sep 17 00:00:00 2001 +Message-Id: <712005bcf26190dc6fd1fe56283377987909cc4b@dist-git> From: John Ferlan Date: Thu, 9 Jul 2015 08:28:58 -0400 Subject: [PATCH] RHEL: qemu: Add check for unpriv sgio for SCSI generic host @@ -22,10 +22,10 @@ Signed-off-by: Jiri Denemark 1 file changed, 15 insertions(+) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c -index f1c142efb6..4e5b33b788 100644 +index 3ea9784854..7d15af9c0b 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c -@@ -1410,6 +1410,8 @@ qemuAddSharedHostdev(virQEMUDriverPtr driver, +@@ -1473,6 +1473,8 @@ qemuAddSharedHostdev(virQEMUDriverPtr driver, { char *dev_path = NULL; char *key = NULL; @@ -34,7 +34,7 @@ index f1c142efb6..4e5b33b788 100644 int ret = -1; if (!qemuIsSharedHostdev(hostdev)) -@@ -1418,6 +1420,19 @@ qemuAddSharedHostdev(virQEMUDriverPtr driver, +@@ -1481,6 +1483,19 @@ qemuAddSharedHostdev(virQEMUDriverPtr driver, if (!(dev_path = qemuGetHostdevPath(hostdev))) goto cleanup; @@ -55,5 +55,5 @@ index f1c142efb6..4e5b33b788 100644 goto cleanup; -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-RHEL-qemu-Support-vhost-user-multiqueue-with-QEMU-2.3.patch b/SOURCES/libvirt-RHEL-qemu-Support-vhost-user-multiqueue-with-QEMU-2.3.patch index cf534ed..908653f 100644 --- a/SOURCES/libvirt-RHEL-qemu-Support-vhost-user-multiqueue-with-QEMU-2.3.patch +++ b/SOURCES/libvirt-RHEL-qemu-Support-vhost-user-multiqueue-with-QEMU-2.3.patch @@ -1,5 +1,5 @@ -From 569531d2a63be9a2e4d3c234b22391e7fcd8e5cc Mon Sep 17 00:00:00 2001 -Message-Id: <569531d2a63be9a2e4d3c234b22391e7fcd8e5cc@dist-git> +From 1a2abd15b50c99659fe850673d95a2edd75f19a1 Mon Sep 17 00:00:00 2001 +Message-Id: <1a2abd15b50c99659fe850673d95a2edd75f19a1@dist-git> From: Martin Kletzander Date: Mon, 23 Nov 2015 12:46:36 +0100 Subject: [PATCH] RHEL: qemu: Support vhost-user-multiqueue with QEMU 2.3 @@ -16,10 +16,10 @@ Signed-off-by: Jiri Denemark 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 10ec0d4bb9..37a58b3640 100644 +index 0d79780f25..fc1cf53066 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c -@@ -4761,8 +4761,11 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, +@@ -4000,8 +4000,11 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_AARCH64_OFF); /* vhost-user supports multi-queue from v2.4.0 onwards, @@ -34,5 +34,5 @@ index 10ec0d4bb9..37a58b3640 100644 /* smm option is supported from v2.4.0 */ -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-RHEL-qemu-support-relative-backing-for-RHEL-7.0.z-qemu.patch b/SOURCES/libvirt-RHEL-qemu-support-relative-backing-for-RHEL-7.0.z-qemu.patch index 418c241..ef405b0 100644 --- a/SOURCES/libvirt-RHEL-qemu-support-relative-backing-for-RHEL-7.0.z-qemu.patch +++ b/SOURCES/libvirt-RHEL-qemu-support-relative-backing-for-RHEL-7.0.z-qemu.patch @@ -1,5 +1,5 @@ -From 9c0e9d27d742f8150378cb228a64662d9c4984d4 Mon Sep 17 00:00:00 2001 -Message-Id: <9c0e9d27d742f8150378cb228a64662d9c4984d4@dist-git> +From b9b227314c5736ad310c6b323f0adf0d9165e4d3 Mon Sep 17 00:00:00 2001 +Message-Id: From: Eric Blake Date: Tue, 7 Oct 2014 17:06:17 -0600 Subject: [PATCH] RHEL: qemu: support relative backing for RHEL 7.0.z qemu @@ -25,10 +25,10 @@ Signed-off-by: Jiri Denemark 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 7cb091056b..10ec0d4bb9 100644 +index 37c8fbe3d3..0d79780f25 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c -@@ -1555,6 +1555,7 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { +@@ -1006,6 +1006,7 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { { "add-fd", QEMU_CAPS_ADD_FD }, { "nbd-server-start", QEMU_CAPS_NBD_SERVER }, { "change-backing-file", QEMU_CAPS_CHANGE_BACKING_FILE }, @@ -37,5 +37,5 @@ index 7cb091056b..10ec0d4bb9 100644 { "migrate-incoming", QEMU_CAPS_INCOMING_DEFER }, { "query-hotpluggable-cpus", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS }, -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-RHEL-screenshot-Implement-multiple-screen-support.patch b/SOURCES/libvirt-RHEL-screenshot-Implement-multiple-screen-support.patch index dc3cb8d..e9b67c4 100644 --- a/SOURCES/libvirt-RHEL-screenshot-Implement-multiple-screen-support.patch +++ b/SOURCES/libvirt-RHEL-screenshot-Implement-multiple-screen-support.patch @@ -1,5 +1,5 @@ -From e326d80a0b1ff2606e16e6fabea8a1914a5cd1d2 Mon Sep 17 00:00:00 2001 -Message-Id: +From 6019d375ba10735d805801fb0ecee71e4a32871c Mon Sep 17 00:00:00 2001 +Message-Id: <6019d375ba10735d805801fb0ecee71e4a32871c@dist-git> From: Michal Privoznik Date: Fri, 26 Aug 2011 16:41:17 +0800 Subject: [PATCH] RHEL: screenshot: Implement multiple screen support @@ -26,115 +26,107 @@ Conflicts: src/qemu/qemu_monitor.c - don't return -1 without reporting an error --- - src/qemu/qemu_driver.c | 22 +++++++++++++++------- - src/qemu/qemu_monitor.c | 14 ++++++++++++-- - src/qemu/qemu_monitor.h | 3 ++- + src/qemu/qemu_driver.c | 20 +++++++++----------- + src/qemu/qemu_monitor.c | 13 +++++++++++++ + src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 24 ++++++++++++++++++++++++ src/qemu/qemu_monitor_json.h | 4 ++++ - 5 files changed, 57 insertions(+), 10 deletions(-) + 5 files changed, 53 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 1dff53441b..82c60e6ef1 100644 +index 825b2b27e6..00952a55e7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c -@@ -3999,6 +3999,8 @@ qemuDomainScreenshot(virDomainPtr dom, +@@ -3996,6 +3996,7 @@ qemuDomainScreenshot(virDomainPtr dom, char *ret = NULL; bool unlink_tmp = false; virQEMUDriverConfigPtr cfg = NULL; -+ int video_index = 0; -+ const char *video_id = NULL; ++ int rc; virCheckFlags(0, NULL); -@@ -4020,12 +4022,15 @@ qemuDomainScreenshot(virDomainPtr dom, - goto endjob; - } - -- /* Well, even if qemu allows multiple graphic cards, heads, whatever, -- * screenshot command does not */ -- if (screen) { -- virReportError(VIR_ERR_INVALID_ARG, -- "%s", _("currently is supported only taking " -- "screenshots of screen ID 0")); -+ while (video_index < vm->def->nvideos) { -+ if (screen < vm->def->videos[video_index]->heads) -+ break; -+ screen -= vm->def->videos[video_index]->heads; -+ video_index++; -+ } -+ -+ if (video_index == vm->def->nvideos) { -+ virReportError(VIR_ERR_INVALID_ARG, "%s", _("no such screen")); - goto endjob; +@@ -4021,12 +4022,6 @@ qemuDomainScreenshot(virDomainPtr dom, } -@@ -4040,8 +4045,11 @@ qemuDomainScreenshot(virDomainPtr dom, + if (screen) { +- if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SCREENDUMP_DEVICE)) { +- virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", +- _("qemu does not allow specifying screen ID")); +- goto endjob; +- } +- + for (i = 0; i < vm->def->nvideos; i++) { + const virDomainVideoDef *video = vm->def->videos[i]; +@@ -4057,11 +4052,14 @@ qemuDomainScreenshot(virDomainPtr dom, qemuSecuritySetSavedStateLabel(driver->securityManager, vm->def, tmp); -+ if (video_index) -+ video_id = vm->def->videos[video_index]->info.alias; -+ qemuDomainObjEnterMonitor(driver, vm); -- if (qemuMonitorScreendump(priv->mon, tmp) < 0) { -+ if (qemuMonitorScreendump(priv->mon, tmp, video_id) < 0) { - ignore_value(qemuDomainObjExitMonitor(driver, vm)); +- if (qemuMonitorScreendump(priv->mon, videoAlias, screen, tmp) < 0) { +- ignore_value(qemuDomainObjExitMonitor(driver, vm)); +- goto endjob; +- } +- if (qemuDomainObjExitMonitor(driver, vm) < 0) ++ ++ if (!videoAlias || ++ virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SCREENDUMP_DEVICE)) ++ rc = qemuMonitorScreendump(priv->mon, videoAlias, screen, tmp); ++ else ++ rc = qemuMonitorScreendumpRH(priv->mon, videoAlias, tmp); ++ ++ if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) goto endjob; - } + + if (VIR_CLOSE(tmp_fd) < 0) { diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index dd9d64a207..3cf23db874 100644 +index 6ed475ede0..6fc038a8d9 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c -@@ -3461,12 +3461,22 @@ qemuMonitorSendKey(qemuMonitorPtr mon, - - int - qemuMonitorScreendump(qemuMonitorPtr mon, -- const char *file) -+ const char *file, -+ const char *id) - { -- VIR_DEBUG("file=%s", file); -+ VIR_DEBUG("file=%s, id=%s", file, id); +@@ -3340,6 +3340,19 @@ qemuMonitorSendKey(qemuMonitorPtr mon, + } - QEMU_CHECK_MONITOR(mon); -+ if (id) { -+ if (!mon->json) { -+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -+ _("non-zero screen ID requires JSON monitor")); -+ return -1; -+ } -+ return qemuMonitorJSONScreendumpRH(mon, file, id); -+ } ++int ++qemuMonitorScreendumpRH(qemuMonitorPtr mon, ++ const char *device, ++ const char *file) ++{ ++ VIR_DEBUG("device=%s, file=%s", device, file); ++ ++ QEMU_CHECK_MONITOR(mon); ++ ++ return qemuMonitorJSONScreendumpRH(mon, device, file); ++} + - if (mon->json) - return qemuMonitorJSONScreendump(mon, file); - else ++ + int + qemuMonitorScreendump(qemuMonitorPtr mon, + const char *device, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index bc8494faee..7e20e96116 100644 +index b3d62324b4..f4d8225ca5 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h -@@ -888,7 +888,8 @@ int qemuMonitorArbitraryCommand(qemuMonitorPtr mon, +@@ -878,6 +878,9 @@ int qemuMonitorArbitraryCommand(qemuMonitorPtr mon, + int qemuMonitorInjectNMI(qemuMonitorPtr mon); ++int qemuMonitorScreendumpRH(qemuMonitorPtr mon, ++ const char *device, ++ const char *file); int qemuMonitorScreendump(qemuMonitorPtr mon, -- const char *file); -+ const char *file, -+ const char *id); - - int qemuMonitorSendKey(qemuMonitorPtr mon, - unsigned int holdtime, + const char *device, + unsigned int head, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 05cc634d20..8a75e0ef7e 100644 +index 3e90279b71..af754e870e 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c -@@ -4294,6 +4294,30 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon, +@@ -4481,6 +4481,30 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon, return ret; } +int qemuMonitorJSONScreendumpRH(qemuMonitorPtr mon, -+ const char *file, -+ const char *id) ++ const char *id, ++ const char *file) +{ + int ret = -1; + virJSONValuePtr cmd, reply = NULL; @@ -157,23 +149,23 @@ index 05cc634d20..8a75e0ef7e 100644 +} + int qemuMonitorJSONScreendump(qemuMonitorPtr mon, - const char *file) - { + const char *device, + unsigned int head, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index 739a99293c..02a504ab85 100644 +index 6bc0dd3ad2..b92fc3762b 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h -@@ -292,6 +292,10 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon, +@@ -297,6 +297,10 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon, unsigned int *keycodes, unsigned int nkeycodes); +int qemuMonitorJSONScreendumpRH(qemuMonitorPtr mon, -+ const char *file, -+ const char *id); ++ const char *id, ++ const char *file); + int qemuMonitorJSONScreendump(qemuMonitorPtr mon, - const char *file); - + const char *device, + unsigned int head, -- -2.14.3 +2.18.0 diff --git a/SOURCES/libvirt-Rename-virResctrlInfo-to-virResctrlInfoPerCache.patch b/SOURCES/libvirt-Rename-virResctrlInfo-to-virResctrlInfoPerCache.patch deleted file mode 100644 index bb00ca1..0000000 --- a/SOURCES/libvirt-Rename-virResctrlInfo-to-virResctrlInfoPerCache.patch +++ /dev/null @@ -1,97 +0,0 @@ -From f8604e5cb29526fa7374b1a6690ac3b285720c3f Mon Sep 17 00:00:00 2001 -Message-Id: -From: Martin Kletzander -Date: Wed, 31 Jan 2018 16:32:24 +0100 -Subject: [PATCH] Rename virResctrlInfo to virResctrlInfoPerCache - -https://bugzilla.redhat.com/show_bug.cgi?id=1289368 - -Just to ease the review of following patches. - -Signed-off-by: Martin Kletzander -(cherry picked from commit b2211a9e5492879be5f3c6ab9ed2d0dba849c964) -Signed-off-by: Martin Kletzander ---- - src/conf/capabilities.c | 2 +- - src/conf/capabilities.h | 2 +- - src/util/virresctrl.c | 4 ++-- - src/util/virresctrl.h | 8 ++++---- - 4 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c -index 798c9bdaea..e93eaed2f0 100644 ---- a/src/conf/capabilities.c -+++ b/src/conf/capabilities.c -@@ -904,7 +904,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf, - virBufferSetChildIndent(&controlBuf, buf); - for (j = 0; j < bank->ncontrols; j++) { - const char *min_unit; -- virResctrlInfoPtr controls = bank->controls[j]; -+ virResctrlInfoPerCachePtr controls = bank->controls[j]; - unsigned long long gran_short_size = controls->granularity; - unsigned long long min_short_size = controls->min; - -diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h -index 5048fa819d..27b88cb5ed 100644 ---- a/src/conf/capabilities.h -+++ b/src/conf/capabilities.h -@@ -148,7 +148,7 @@ struct _virCapsHostCacheBank { - virCacheType type; /* Data, Instruction or Unified */ - virBitmapPtr cpus; /* All CPUs that share this bank */ - size_t ncontrols; -- virResctrlInfoPtr *controls; -+ virResctrlInfoPerCachePtr *controls; - }; - - typedef struct _virCapsHost virCapsHost; -diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c -index 2a11825a52..050a08178e 100644 ---- a/src/util/virresctrl.c -+++ b/src/util/virresctrl.c -@@ -59,7 +59,7 @@ int - virResctrlGetCacheInfo(unsigned int level, - unsigned long long size, - virCacheType scope, -- virResctrlInfoPtr **controls, -+ virResctrlInfoPerCachePtr **controls, - size_t *ncontrols) - { - int ret = -1; -@@ -69,7 +69,7 @@ virResctrlGetCacheInfo(unsigned int level, - char *type_upper = NULL; - unsigned int bits = 0; - unsigned int min_cbm_bits = 0; -- virResctrlInfoPtr control; -+ virResctrlInfoPerCachePtr control; - - if (VIR_ALLOC(control) < 0) - goto cleanup; -diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h -index 848b13e98a..42e8527803 100644 ---- a/src/util/virresctrl.h -+++ b/src/util/virresctrl.h -@@ -36,9 +36,9 @@ typedef enum { - VIR_ENUM_DECL(virCache); - - --typedef struct _virResctrlInfo virResctrlInfo; --typedef virResctrlInfo *virResctrlInfoPtr; --struct _virResctrlInfo { -+typedef struct _virResctrlInfoPerCache virResctrlInfoPerCache; -+typedef virResctrlInfoPerCache *virResctrlInfoPerCachePtr; -+struct _virResctrlInfoPerCache { - /* Smallest possible increase of the allocation size in bytes */ - unsigned long long granularity; - /* Minimal allocatable size in bytes (if different from granularity) */ -@@ -54,7 +54,7 @@ int - virResctrlGetCacheInfo(unsigned int level, - unsigned long long size, - virCacheType scope, -- virResctrlInfoPtr **controls, -+ virResctrlInfoPerCachePtr **controls, - size_t *ncontrols); - - int --- -2.16.1 - diff --git a/SOURCES/libvirt-Revert-qemu-monitor-do-not-report-error-on-shutdown.patch b/SOURCES/libvirt-Revert-qemu-monitor-do-not-report-error-on-shutdown.patch deleted file mode 100644 index 5e23027..0000000 --- a/SOURCES/libvirt-Revert-qemu-monitor-do-not-report-error-on-shutdown.patch +++ /dev/null @@ -1,69 +0,0 @@ -From be2ee0f5055cff0fd449ce972935f1af8ebfee84 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Fri, 19 Jan 2018 14:35:17 +0100 -Subject: [PATCH] Revert "qemu: monitor: do not report error on shutdown" - -https://bugzilla.redhat.com/show_bug.cgi?id=1536461 - -This reverts commit aeda1b8c56dc58b0a413acc61bbea938b40499e1. - -Problem is that we need mon->lastError to be set because it's -used all over the place. Also, there's nothing wrong with -reporting error if one occurred. I mean, if there's a thread -executing an API and which currently is talking on monitor it -definitely wants the error reported. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 72adaf2f10509c3682f2c65ffad4176e00e5a2fb) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor.c | 10 +++------- - 1 file changed, 3 insertions(+), 7 deletions(-) - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 12ad45d340..b6af209a83 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -69,7 +69,6 @@ struct _qemuMonitor { - * < 0: an error occurred during the registration of @fd */ - int watch; - int hasSendFD; -- int willhangup; - - virDomainObjPtr vm; - -@@ -701,10 +700,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) - if (events & VIR_EVENT_HANDLE_HANGUP) { - hangup = true; - if (!error) { -- if (!mon->willhangup) { -- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("End of file from qemu monitor")); -- } -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("End of file from qemu monitor")); - eof = true; - events &= ~VIR_EVENT_HANDLE_HANGUP; - } -@@ -743,7 +740,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) - if (mon->lastError.code != VIR_ERR_OK) { - /* Already have an error, so clear any new error */ - virResetLastError(); -- } else if (!mon->willhangup) { -+ } else { - virErrorPtr err = virGetLastError(); - if (!err) - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -1337,7 +1334,6 @@ qemuMonitorEmitShutdown(qemuMonitorPtr mon, virTristateBool guest) - { - int ret = -1; - VIR_DEBUG("mon=%p guest=%u", mon, guest); -- mon->willhangup = 1; - - QEMU_MONITOR_CALLBACK(mon, ret, domainShutdown, mon->vm, guest); - return ret; --- -2.16.1 - diff --git a/SOURCES/libvirt-Revert-virNetDevSupportBandwidth-Enable-QoS-for-vhostuser.patch b/SOURCES/libvirt-Revert-virNetDevSupportBandwidth-Enable-QoS-for-vhostuser.patch deleted file mode 100644 index c75d21b..0000000 --- a/SOURCES/libvirt-Revert-virNetDevSupportBandwidth-Enable-QoS-for-vhostuser.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 9d000db886030a45b1d8d016dd884db6b61419de Mon Sep 17 00:00:00 2001 -Message-Id: <9d000db886030a45b1d8d016dd884db6b61419de@dist-git> -From: Michal Privoznik -Date: Mon, 13 Nov 2017 14:26:00 +0100 -Subject: [PATCH] Revert "virNetDevSupportBandwidth: Enable QoS for vhostuser" - -https://bugzilla.redhat.com/show_bug.cgi?id=1497410 - -This reverts commit bc8a99ef06417a2303ccab455f9f045e2a617916. - -The vhostuser is not a TAP. Therefore our QoS code is not able to -set any bandwidth. I don't really understand what I was thinking. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 676768edeb28689c48f8fe9b6923003c1ed39584) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/conf/netdev_bandwidth_conf.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/conf/netdev_bandwidth_conf.h b/src/conf/netdev_bandwidth_conf.h -index c378280654..30f988953c 100644 ---- a/src/conf/netdev_bandwidth_conf.h -+++ b/src/conf/netdev_bandwidth_conf.h -@@ -46,9 +46,9 @@ static inline bool virNetDevSupportBandwidth(virDomainNetType type) - case VIR_DOMAIN_NET_TYPE_NETWORK: - case VIR_DOMAIN_NET_TYPE_DIRECT: - case VIR_DOMAIN_NET_TYPE_ETHERNET: -- case VIR_DOMAIN_NET_TYPE_VHOSTUSER: - 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: --- -2.15.0 - diff --git a/SOURCES/libvirt-access-Fix-nwfilter-binding-ACL-access-API-name-generation.patch b/SOURCES/libvirt-access-Fix-nwfilter-binding-ACL-access-API-name-generation.patch new file mode 100644 index 0000000..6e296c0 --- /dev/null +++ b/SOURCES/libvirt-access-Fix-nwfilter-binding-ACL-access-API-name-generation.patch @@ -0,0 +1,60 @@ +From 99968171f09ae0f374b5e9c961032ffa6bd4dd11 Mon Sep 17 00:00:00 2001 +Message-Id: <99968171f09ae0f374b5e9c961032ffa6bd4dd11@dist-git> +From: John Ferlan +Date: Mon, 27 Aug 2018 08:27:47 -0400 +Subject: [PATCH] access: Fix nwfilter-binding ACL access API name generation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +https://bugzilla.redhat.com/show_bug.cgi?id=1611320 + +Generation of the ACL API policy is a "automated process" +based on this perl script which "worked" with the changes to +add nwfilter binding API's because they had the "nwfilter" +prefix; however, the generated output name was incorrect +based on the remote protocol algorithm which expected to +generate names such as 'nwfilter-binding.action' instead +of 'nwfilter.binding-action'. + +This effectively changes src/access/org.libvirt.api.policy entries: + + org.libvirt.api.nwfilter.binding-create ==> + org.libvirt.api.nwfilter-binding.create + + org.libvirt.api.nwfilter.binding-delete ==> + org.libvirt.api.nwfilter-binding.delete + + org.libvirt.api.nwfilter.binding-getattr ==> + org.libvirt.api.nwfilter-binding.getattr + + org.libvirt.api.nwfilter.binding-read ==> + org.libvirt.api.nwfilter-binding.read + +Signed-off-by: John Ferlan +Reviewed-by: Daniel P. Berrangé +(cherry picked from commit 6ef65e3c96d5d1f16a16daca83b81b818d461e64) +https: //bugzilla.redhat.com/show_bug.cgi?id=1622540 +Reviewed-by: Erik Skultety +--- + src/access/genpolkit.pl | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/access/genpolkit.pl b/src/access/genpolkit.pl +index 968cb8c55c..e074c90eb6 100755 +--- a/src/access/genpolkit.pl ++++ b/src/access/genpolkit.pl +@@ -22,8 +22,8 @@ use warnings; + + my @objects = ( + "CONNECT", "DOMAIN", "INTERFACE", +- "NETWORK","NODE_DEVICE", "NWFILTER", +- "SECRET", "STORAGE_POOL", "STORAGE_VOL", ++ "NETWORK","NODE_DEVICE", "NWFILTER_BINDING", "NWFILTER", ++ "SECRET", "STORAGE_POOL", "STORAGE_VOL", + ); + + my $objects = join ("|", @objects); +-- +2.18.0 + diff --git a/SOURCES/libvirt-conf-Add-infrastructure-for-disk-source-private-data-XML.patch b/SOURCES/libvirt-conf-Add-infrastructure-for-disk-source-private-data-XML.patch deleted file mode 100644 index 2015326..0000000 --- a/SOURCES/libvirt-conf-Add-infrastructure-for-disk-source-private-data-XML.patch +++ /dev/null @@ -1,510 +0,0 @@ -From 996dfd6322782e72583384381ffebf91ef1d3e27 Mon Sep 17 00:00:00 2001 -Message-Id: <996dfd6322782e72583384381ffebf91ef1d3e27@dist-git> -From: Peter Krempa -Date: Thu, 14 Dec 2017 14:31:51 +0100 -Subject: [PATCH] conf: Add infrastructure for disk source private data XML - -VM drivers may need to store additional private data to the status XML -so that it can be restored after libvirtd restart. Since not everything -is needed add a callback infrastructure, where VM drivers can add only -stuff they need. - -Note that the private data is formatted as a sub-element -of the or sub-element. This is done since -storing it out of band (in the VM private data) would require a complex -matching process to allow to put the data into correct place. - -(cherry picked from commit aed3d038a6565f3b0e916bdb004ca90b302b200d) - - Conflicts: - tests/qemublocktest.c: This file does not exist downstream yet. - -https://bugzilla.redhat.com/show_bug.cgi?id=1523261 -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 136 ++++++++++++++++++++++++++++++++++---------- - src/conf/domain_conf.h | 17 +++++- - src/conf/snapshot_conf.c | 18 +++--- - src/network/bridge_driver.c | 2 +- - src/qemu/qemu_domain.c | 2 +- - tests/virstoragetest.c | 2 +- - 6 files changed, 134 insertions(+), 43 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 2d54037b71..ad9c16a1e0 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -8550,11 +8550,43 @@ virDomainDiskSourceEncryptionParse(xmlNodePtr node, - } - - -+static int -+virDomainDiskSourcePrivateDataParse(xmlXPathContextPtr ctxt, -+ virStorageSourcePtr src, -+ unsigned int flags, -+ virDomainXMLOptionPtr xmlopt) -+{ -+ xmlNodePtr saveNode = ctxt->node; -+ xmlNodePtr node; -+ int ret = -1; -+ -+ if (!(flags & VIR_DOMAIN_DEF_PARSE_STATUS) || -+ !xmlopt || !xmlopt->privateData.storageParse) -+ return 0; -+ -+ if (!(node = virXPathNode("./privateData", ctxt))) -+ return 0; -+ -+ ctxt->node = node; -+ -+ if (xmlopt->privateData.storageParse(ctxt, src) < 0) -+ goto cleanup; -+ -+ ret = 0; -+ -+ cleanup: -+ ctxt->node = saveNode; -+ -+ return ret; -+} -+ -+ - int - virDomainDiskSourceParse(xmlNodePtr node, - xmlXPathContextPtr ctxt, - virStorageSourcePtr src, -- unsigned int flags) -+ unsigned int flags, -+ virDomainXMLOptionPtr xmlopt) - { - int ret = -1; - xmlNodePtr saveNode = ctxt->node; -@@ -8593,6 +8625,9 @@ virDomainDiskSourceParse(xmlNodePtr node, - if (virDomainDiskSourceEncryptionParse(node, &src->encryption) < 0) - goto cleanup; - -+ if (virDomainDiskSourcePrivateDataParse(ctxt, src, flags, xmlopt) < 0) -+ goto cleanup; -+ - /* People sometimes pass a bogus '' source path when they mean to omit the - * source element completely (e.g. CDROM without media). This is just a - * little compatibility check to help those broken apps */ -@@ -8610,7 +8645,8 @@ virDomainDiskSourceParse(xmlNodePtr node, - static int - virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt, - virStorageSourcePtr src, -- unsigned int flags) -+ unsigned int flags, -+ virDomainXMLOptionPtr xmlopt) - { - virStorageSourcePtr backingStore = NULL; - xmlNodePtr save_ctxt = ctxt->node; -@@ -8668,8 +8704,8 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt, - goto cleanup; - } - -- if (virDomainDiskSourceParse(source, ctxt, backingStore, flags) < 0 || -- virDomainDiskBackingStoreParse(ctxt, backingStore, flags) < 0) -+ if (virDomainDiskSourceParse(source, ctxt, backingStore, flags, xmlopt) < 0 || -+ virDomainDiskBackingStoreParse(ctxt, backingStore, flags, xmlopt) < 0) - goto cleanup; - - VIR_STEAL_PTR(src->backingStore, backingStore); -@@ -8771,7 +8807,8 @@ static int - virDomainDiskDefMirrorParse(virDomainDiskDefPtr def, - xmlNodePtr cur, - xmlXPathContextPtr ctxt, -- unsigned int flags) -+ unsigned int flags, -+ virDomainXMLOptionPtr xmlopt) - { - xmlNodePtr mirrorNode; - char *mirrorFormat = NULL; -@@ -8809,7 +8846,8 @@ virDomainDiskDefMirrorParse(virDomainDiskDefPtr def, - goto cleanup; - } - -- if (virDomainDiskSourceParse(mirrorNode, ctxt, def->mirror, flags) < 0) -+ if (virDomainDiskSourceParse(mirrorNode, ctxt, def->mirror, -+ flags, xmlopt) < 0) - goto cleanup; - } else { - /* For back-compat reasons, we handle a file name -@@ -9235,7 +9273,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, - if (!source && virXMLNodeNameEqual(cur, "source")) { - sourceNode = cur; - -- if (virDomainDiskSourceParse(cur, ctxt, def->src, flags) < 0) -+ if (virDomainDiskSourceParse(cur, ctxt, def->src, flags, xmlopt) < 0) - goto error; - - /* If we've already found an as a child of and -@@ -9316,7 +9354,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, - } else if (!def->mirror && - virXMLNodeNameEqual(cur, "mirror") && - !(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)) { -- if (virDomainDiskDefMirrorParse(def, cur, ctxt, flags) < 0) -+ if (virDomainDiskDefMirrorParse(def, cur, ctxt, flags, xmlopt) < 0) - goto error; - } else if (!authdef && - virXMLNodeNameEqual(cur, "auth")) { -@@ -9587,7 +9625,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, - product = NULL; - - if (!(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) { -- if (virDomainDiskBackingStoreParse(ctxt, def->src, flags) < 0) -+ if (virDomainDiskBackingStoreParse(ctxt, def->src, flags, xmlopt) < 0) - goto error; - } - -@@ -22349,12 +22387,43 @@ virDomainDiskSourceFormatNetwork(virBufferPtr attrBuf, - } - - -+static int -+virDomainDiskSourceFormatPrivateData(virBufferPtr buf, -+ virStorageSourcePtr src, -+ unsigned int flags, -+ virDomainXMLOptionPtr xmlopt) -+{ -+ virBuffer childBuf = VIR_BUFFER_INITIALIZER; -+ int ret = -1; -+ -+ if (!(flags & VIR_DOMAIN_DEF_FORMAT_STATUS) || -+ !xmlopt || !xmlopt->privateData.storageFormat) -+ return 0; -+ -+ virBufferSetChildIndent(&childBuf, buf); -+ -+ if (xmlopt->privateData.storageFormat(src, &childBuf) < 0) -+ goto cleanup; -+ -+ if (virXMLFormatElement(buf, "privateData", NULL, &childBuf) < 0) -+ goto cleanup; -+ -+ ret = 0; -+ -+ cleanup: -+ virBufferFreeAndReset(&childBuf); -+ -+ return ret; -+} -+ -+ - static int - virDomainDiskSourceFormatInternal(virBufferPtr buf, - virStorageSourcePtr src, - int policy, - unsigned int flags, -- bool skipSeclabels) -+ bool skipSeclabels, -+ virDomainXMLOptionPtr xmlopt) - { - const char *startupPolicy = NULL; - virBuffer attrBuf = VIR_BUFFER_INITIALIZER; -@@ -22436,6 +22505,9 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf, - virStorageEncryptionFormat(&childBuf, src->encryption) < 0) - return -1; - -+ if (virDomainDiskSourceFormatPrivateData(&childBuf, src, flags, xmlopt) < 0) -+ return -1; -+ - if (virXMLFormatElement(buf, "source", &attrBuf, &childBuf) < 0) - goto error; - } -@@ -22453,15 +22525,18 @@ int - virDomainDiskSourceFormat(virBufferPtr buf, - virStorageSourcePtr src, - int policy, -- unsigned int flags) -+ unsigned int flags, -+ virDomainXMLOptionPtr xmlopt) - { -- return virDomainDiskSourceFormatInternal(buf, src, policy, flags, false); -+ return virDomainDiskSourceFormatInternal(buf, src, policy, flags, false, xmlopt); - } - - - static int - virDomainDiskBackingStoreFormat(virBufferPtr buf, -- virStorageSourcePtr backingStore) -+ virStorageSourcePtr backingStore, -+ virDomainXMLOptionPtr xmlopt, -+ unsigned int flags) - { - const char *format; - -@@ -22490,9 +22565,9 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf, - - virBufferAsprintf(buf, "\n", format); - /* We currently don't output seclabels for backing chain element */ -- if (virDomainDiskSourceFormatInternal(buf, backingStore, 0, 0, true) < 0 || -- virDomainDiskBackingStoreFormat(buf, -- backingStore->backingStore) < 0) -+ if (virDomainDiskSourceFormatInternal(buf, backingStore, 0, flags, true, xmlopt) < 0 || -+ virDomainDiskBackingStoreFormat(buf, backingStore->backingStore, -+ xmlopt, flags) < 0) - return -1; - - virBufferAdjustIndent(buf, -2); -@@ -22510,7 +22585,8 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf, - static int - virDomainDiskDefFormat(virBufferPtr buf, - virDomainDiskDefPtr def, -- unsigned int flags) -+ unsigned int flags, -+ virDomainXMLOptionPtr xmlopt) - { - const char *type = virStorageTypeToString(def->src->type); - const char *device = virDomainDiskDeviceTypeToString(def->device); -@@ -22623,13 +22699,14 @@ virDomainDiskDefFormat(virBufferPtr buf, - } - - if (virDomainDiskSourceFormat(buf, def->src, def->startupPolicy, -- flags) < 0) -+ flags, xmlopt) < 0) - return -1; - - /* Don't format backingStore to inactive XMLs until the code for - * persistent storage of backing chains is ready. */ - if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE) && -- virDomainDiskBackingStoreFormat(buf, def->src->backingStore) < 0) -+ virDomainDiskBackingStoreFormat(buf, def->src->backingStore, -+ xmlopt, flags) < 0) - return -1; - - virBufferEscapeString(buf, "\n", def->domain_name); -@@ -22666,7 +22743,7 @@ virDomainDiskDefFormat(virBufferPtr buf, - virBufferAddLit(buf, ">\n"); - virBufferAdjustIndent(buf, 2); - virBufferEscapeString(buf, "\n", formatStr); -- if (virDomainDiskSourceFormat(buf, def->mirror, 0, 0) < 0) -+ if (virDomainDiskSourceFormat(buf, def->mirror, 0, 0, xmlopt) < 0) - return -1; - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); -@@ -25897,7 +25974,8 @@ int - virDomainDefFormatInternal(virDomainDefPtr def, - virCapsPtr caps, - unsigned int flags, -- virBufferPtr buf) -+ virBufferPtr buf, -+ virDomainXMLOptionPtr xmlopt) - { - unsigned char *uuid; - char uuidstr[VIR_UUID_STRING_BUFLEN]; -@@ -25952,10 +26030,10 @@ virDomainDefFormatInternal(virDomainDefPtr def, - * but no leading indentation before the starting element. - * Thankfully, libxml maps what looks like globals into - * thread-local uses, so we are thread-safe. */ -- xmlIndentTreeOutput = 1; -- xmlbuf = xmlBufferCreate(); -- if (xmlNodeDump(xmlbuf, def->metadata->doc, def->metadata, -- virBufferGetIndent(buf, false) / 2, 1) < 0) { -+ xmlIndentTreeOutput = 1; -+ xmlbuf = xmlBufferCreate(); -+ if (xmlNodeDump(xmlbuf, def->metadata->doc, def->metadata, -+ virBufferGetIndent(buf, false) / 2, 1) < 0) { - xmlBufferFree(xmlbuf); - xmlIndentTreeOutput = oldIndentTreeOutput; - goto error; -@@ -26528,7 +26606,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, - def->emulator); - - for (n = 0; n < def->ndisks; n++) -- if (virDomainDiskDefFormat(buf, def->disks[n], flags) < 0) -+ if (virDomainDiskDefFormat(buf, def->disks[n], flags, xmlopt) < 0) - goto error; - - for (n = 0; n < def->ncontrollers; n++) -@@ -26715,7 +26793,7 @@ virDomainDefFormat(virDomainDefPtr def, virCapsPtr caps, unsigned int flags) - virBuffer buf = VIR_BUFFER_INITIALIZER; - - virCheckFlags(VIR_DOMAIN_DEF_FORMAT_COMMON_FLAGS, NULL); -- if (virDomainDefFormatInternal(def, caps, flags, &buf) < 0) -+ if (virDomainDefFormatInternal(def, caps, flags, &buf, NULL) < 0) - return NULL; - - return virBufferContentAndReset(&buf); -@@ -26750,7 +26828,7 @@ virDomainObjFormat(virDomainXMLOptionPtr xmlopt, - xmlopt->privateData.format(&buf, obj) < 0) - goto error; - -- if (virDomainDefFormatInternal(obj->def, caps, flags, &buf) < 0) -+ if (virDomainDefFormatInternal(obj->def, caps, flags, &buf, xmlopt) < 0) - goto error; - - virBufferAdjustIndent(&buf, -2); -@@ -27704,7 +27782,7 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src, - - switch ((virDomainDeviceType) src->type) { - case VIR_DOMAIN_DEVICE_DISK: -- rc = virDomainDiskDefFormat(&buf, src->data.disk, flags); -+ rc = virDomainDiskDefFormat(&buf, src->data.disk, flags, xmlopt); - break; - case VIR_DOMAIN_DEVICE_LEASE: - rc = virDomainLeaseDefFormat(&buf, src->data.lease); -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 698d3280fe..5e67c9a9c1 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2626,6 +2626,12 @@ typedef int (*virDomainXMLPrivateDataParseFunc)(xmlXPathContextPtr, - virDomainObjPtr, - virDomainDefParserConfigPtr); - -+typedef int (*virDomainXMLPrivateDataStorageSourceParseFunc)(xmlXPathContextPtr ctxt, -+ virStorageSourcePtr src); -+typedef int (*virDomainXMLPrivateDataStorageSourceFormatFunc)(virStorageSourcePtr src, -+ virBufferPtr buf); -+ -+ - typedef struct _virDomainXMLPrivateDataCallbacks virDomainXMLPrivateDataCallbacks; - typedef virDomainXMLPrivateDataCallbacks *virDomainXMLPrivateDataCallbacksPtr; - struct _virDomainXMLPrivateDataCallbacks { -@@ -2639,6 +2645,8 @@ struct _virDomainXMLPrivateDataCallbacks { - virDomainXMLPrivateDataNewFunc chrSourceNew; - virDomainXMLPrivateDataFormatFunc format; - virDomainXMLPrivateDataParseFunc parse; -+ virDomainXMLPrivateDataStorageSourceParseFunc storageParse; -+ virDomainXMLPrivateDataStorageSourceFormatFunc storageFormat; - }; - - typedef bool (*virDomainABIStabilityDomain)(const virDomainDef *src, -@@ -2963,12 +2971,14 @@ char *virDomainObjFormat(virDomainXMLOptionPtr xmlopt, - int virDomainDefFormatInternal(virDomainDefPtr def, - virCapsPtr caps, - unsigned int flags, -- virBufferPtr buf); -+ virBufferPtr buf, -+ virDomainXMLOptionPtr xmlopt); - - int virDomainDiskSourceFormat(virBufferPtr buf, - virStorageSourcePtr src, - int policy, -- unsigned int flags); -+ unsigned int flags, -+ virDomainXMLOptionPtr xmlopt); - - int virDomainNetDefFormat(virBufferPtr buf, - virDomainNetDefPtr def, -@@ -3017,7 +3027,8 @@ virDomainDiskRemoveByName(virDomainDefPtr def, const char *name); - int virDomainDiskSourceParse(xmlNodePtr node, - xmlXPathContextPtr ctxt, - virStorageSourcePtr src, -- unsigned int flags); -+ unsigned int flags, -+ virDomainXMLOptionPtr xmlopt); - - int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net); - virDomainNetDefPtr virDomainNetFind(virDomainDefPtr def, const char *device); -diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c -index f0e852c92b..d7b086242b 100644 ---- a/src/conf/snapshot_conf.c -+++ b/src/conf/snapshot_conf.c -@@ -110,7 +110,8 @@ static int - virDomainSnapshotDiskDefParseXML(xmlNodePtr node, - xmlXPathContextPtr ctxt, - virDomainSnapshotDiskDefPtr def, -- unsigned int flags) -+ unsigned int flags, -+ virDomainXMLOptionPtr xmlopt) - { - int ret = -1; - char *snapshot = NULL; -@@ -155,7 +156,7 @@ virDomainSnapshotDiskDefParseXML(xmlNodePtr node, - } - - if ((cur = virXPathNode("./source", ctxt)) && -- virDomainDiskSourceParse(cur, ctxt, def->src, flags) < 0) -+ virDomainDiskSourceParse(cur, ctxt, def->src, flags, xmlopt) < 0) - goto cleanup; - - if ((driver = virXPathString("string(./driver/@type)", ctxt))) { -@@ -348,8 +349,8 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, - goto cleanup; - def->ndisks = n; - for (i = 0; i < def->ndisks; i++) { -- if (virDomainSnapshotDiskDefParseXML(nodes[i], ctxt, -- &def->disks[i], flags) < 0) -+ if (virDomainSnapshotDiskDefParseXML(nodes[i], ctxt, &def->disks[i], -+ flags, xmlopt) < 0) - goto cleanup; - } - VIR_FREE(nodes); -@@ -663,7 +664,8 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def, - - static void - virDomainSnapshotDiskDefFormat(virBufferPtr buf, -- virDomainSnapshotDiskDefPtr disk) -+ virDomainSnapshotDiskDefPtr disk, -+ virDomainXMLOptionPtr xmlopt) - { - int type = disk->src->type; - -@@ -686,7 +688,7 @@ virDomainSnapshotDiskDefFormat(virBufferPtr buf, - if (disk->src->format > 0) - virBufferEscapeString(buf, "\n", - virStorageFileFormatTypeToString(disk->src->format)); -- virDomainDiskSourceFormat(buf, disk->src, 0, 0); -+ virDomainDiskSourceFormat(buf, disk->src, 0, 0, xmlopt); - - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); -@@ -740,13 +742,13 @@ virDomainSnapshotDefFormat(const char *domain_uuid, - virBufferAddLit(&buf, "\n"); - virBufferAdjustIndent(&buf, 2); - for (i = 0; i < def->ndisks; i++) -- virDomainSnapshotDiskDefFormat(&buf, &def->disks[i]); -+ virDomainSnapshotDiskDefFormat(&buf, &def->disks[i], xmlopt); - virBufferAdjustIndent(&buf, -2); - virBufferAddLit(&buf, "\n"); - } - - if (def->dom) { -- if (virDomainDefFormatInternal(def->dom, caps, flags, &buf) < 0) -+ if (virDomainDefFormatInternal(def->dom, caps, flags, &buf, xmlopt) < 0) - goto error; - } else if (domain_uuid) { - virBufferAddLit(&buf, "\n"); -diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c -index fcaa66df91..334da7a85d 100644 ---- a/src/network/bridge_driver.c -+++ b/src/network/bridge_driver.c -@@ -233,7 +233,7 @@ networkRunHook(virNetworkObjPtr obj, - goto cleanup; - if (virNetworkDefFormatBuf(&buf, def, 0) < 0) - goto cleanup; -- if (dom && virDomainDefFormatInternal(dom, NULL, 0, &buf) < 0) -+ if (dom && virDomainDefFormatInternal(dom, NULL, 0, &buf, NULL) < 0) - goto cleanup; - - virBufferAdjustIndent(&buf, -2); -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 9dd9db049b..625bcb20d5 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -5245,7 +5245,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, - format: - ret = virDomainDefFormatInternal(def, caps, - virDomainDefFormatConvertXMLFlags(flags), -- buf); -+ buf, driver->xmlopt); - - cleanup: - virDomainDefFree(copy); -diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c -index e1d8751728..bdd0829c21 100644 ---- a/tests/virstoragetest.c -+++ b/tests/virstoragetest.c -@@ -693,7 +693,7 @@ testBackingParse(const void *args) - goto cleanup; - } - -- if (virDomainDiskSourceFormat(&buf, src, 0, 0) < 0 || -+ if (virDomainDiskSourceFormat(&buf, src, 0, 0, NULL) < 0 || - !(xml = virBufferContentAndReset(&buf))) { - fprintf(stderr, "failed to format disk source xml\n"); - goto cleanup; --- -2.15.1 - diff --git a/SOURCES/libvirt-conf-Add-support-for-cputune-cachetune.patch b/SOURCES/libvirt-conf-Add-support-for-cputune-cachetune.patch deleted file mode 100644 index 5ff1f1b..0000000 --- a/SOURCES/libvirt-conf-Add-support-for-cputune-cachetune.patch +++ /dev/null @@ -1,794 +0,0 @@ -From ba1ce05bd6e49217cd8c89b75e741e518d2b9292 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Martin Kletzander -Date: Wed, 31 Jan 2018 16:32:30 +0100 -Subject: [PATCH] conf: Add support for cputune/cachetune - -More info in the documentation, this is basically the XML parsing/formatting -support, schemas, tests and documentation for the new cputune/cachetune element -that will get used by following patches. - -Signed-off-by: Martin Kletzander -(cherry picked from commit 7387e3fea44e28118e1f72841d79503849e15985) -Signed-off-by: Martin Kletzander - -https://bugzilla.redhat.com/show_bug.cgi?id=1289368 - -Downstream changes: - -- Rename test XML files due to ab7a2fe230bb742cc4bc7f8d1475201b97fe49ab - -Signed-off-by: Martin Kletzander ---- - docs/formatdomain.html.in | 54 ++++ - docs/schemas/domaincommon.rng | 32 +++ - src/conf/domain_conf.c | 295 ++++++++++++++++++++- - src/conf/domain_conf.h | 13 + - .../genericxml2xmlindata/generic-cachetune-cdp.xml | 36 +++ - .../generic-cachetune-colliding-allocs.xml | 30 +++ - .../generic-cachetune-colliding-tunes.xml | 32 +++ - .../generic-cachetune-colliding-types.xml | 30 +++ - .../generic-cachetune-small.xml | 29 ++ - tests/genericxml2xmlindata/generic-cachetune.xml | 33 +++ - tests/genericxml2xmltest.c | 10 + - 11 files changed, 592 insertions(+), 2 deletions(-) - create mode 100644 tests/genericxml2xmlindata/generic-cachetune-cdp.xml - create mode 100644 tests/genericxml2xmlindata/generic-cachetune-colliding-allocs.xml - create mode 100644 tests/genericxml2xmlindata/generic-cachetune-colliding-tunes.xml - create mode 100644 tests/genericxml2xmlindata/generic-cachetune-colliding-types.xml - create mode 100644 tests/genericxml2xmlindata/generic-cachetune-small.xml - create mode 100644 tests/genericxml2xmlindata/generic-cachetune.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 0cfbf051b7..f33261d05c 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -689,6 +689,10 @@ - <iothread_quota>-1</iothread_quota> - <vcpusched vcpus='0-4,^3' scheduler='fifo' priority='1'/> - <iothreadsched iothreads='2' scheduler='batch'/> -+ <cachetune vcpus='0-3'> -+ <cache id='0' level='3' type='both' size='3' unit='MiB'/> -+ <cache id='1' level='3' type='both' size='3' unit='MiB'/> -+ </cachetune> - </cputune> - ... - </domain> -@@ -834,6 +838,56 @@ - Since 1.2.13 - - -+
cachetuneSince 4.1.0
-+
-+ Optional cachetune element can control allocations for CPU -+ caches using the resctrl on the host. Whether or not is this supported -+ can be gathered from capabilities where some limitations like minimum -+ size and required granularity are reported as well. The required -+ attribute vcpus specifies to which vCPUs this allocation -+ applies. A vCPU can only be member of one cachetune element -+ allocations. Supported subelements are: -+
-+
cache
-+
-+ This element controls the allocation of CPU cache and has the -+ following attributes: -+
-+
level
-+
-+ Host cache level from which to allocate. -+
-+
id
-+
-+ Host cache id from which to allocate. -+
-+
type
-+
-+ Type of allocation. Can be code for code -+ (instructions), data for data or both -+ for both code and data (unified). Currently the allocation can -+ be done only with the same type as the host supports, meaning -+ you cannot request both for host with CDP -+ (code/data prioritization) enabled. -+
-+
size
-+
-+ The size of the region to allocate. The value by default is in -+ bytes, but the unit attribute can be used to scale -+ the value. -+
-+
unit (optional)
-+
-+ If specified it is the unit such as KiB, MiB, GiB, or TiB -+ (described in the memory element -+ for Memory Allocation) -+ in which size is specified, defaults to bytes. -+
-+
-+
-+
-+ -+
- - - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 05709afc0c..564674b659 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -900,6 +900,38 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ both -+ code -+ data -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index ad9c16a1e0..181b035647 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -2886,6 +2886,19 @@ virDomainLoaderDefFree(virDomainLoaderDefPtr loader) - VIR_FREE(loader); - } - -+ -+static void -+virDomainCachetuneDefFree(virDomainCachetuneDefPtr cachetune) -+{ -+ if (!cachetune) -+ return; -+ -+ virObjectUnref(cachetune->alloc); -+ virBitmapFree(cachetune->vcpus); -+ VIR_FREE(cachetune); -+} -+ -+ - void virDomainDefFree(virDomainDefPtr def) - { - size_t i; -@@ -3058,6 +3071,10 @@ void virDomainDefFree(virDomainDefPtr def) - virDomainShmemDefFree(def->shmems[i]); - VIR_FREE(def->shmems); - -+ for (i = 0; i < def->ncachetunes; i++) -+ virDomainCachetuneDefFree(def->cachetunes[i]); -+ VIR_FREE(def->cachetunes); -+ - VIR_FREE(def->keywrap); - - if (def->namespaceData && def->ns.free) -@@ -18233,6 +18250,194 @@ virDomainDefParseBootOptions(virDomainDefPtr def, - } - - -+static int -+virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt, -+ xmlNodePtr node, -+ virResctrlAllocPtr alloc) -+{ -+ xmlNodePtr oldnode = ctxt->node; -+ unsigned int level; -+ unsigned int cache; -+ int type; -+ unsigned long long size; -+ char *tmp = NULL; -+ int ret = -1; -+ -+ ctxt->node = node; -+ -+ tmp = virXMLPropString(node, "id"); -+ if (!tmp) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("Missing cachetune attribute 'id'")); -+ goto cleanup; -+ } -+ if (virStrToLong_uip(tmp, NULL, 10, &cache) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("Invalid cachetune attribute 'id' value '%s'"), -+ tmp); -+ goto cleanup; -+ } -+ VIR_FREE(tmp); -+ -+ tmp = virXMLPropString(node, "level"); -+ if (!tmp) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("Missing cachetune attribute 'level'")); -+ goto cleanup; -+ } -+ if (virStrToLong_uip(tmp, NULL, 10, &level) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("Invalid cachetune attribute 'level' value '%s'"), -+ tmp); -+ goto cleanup; -+ } -+ VIR_FREE(tmp); -+ -+ tmp = virXMLPropString(node, "type"); -+ if (!tmp) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("Missing cachetune attribute 'type'")); -+ goto cleanup; -+ } -+ type = virCacheTypeFromString(tmp); -+ if (type < 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("Invalid cachetune attribute 'type' value '%s'"), -+ tmp); -+ goto cleanup; -+ } -+ VIR_FREE(tmp); -+ -+ if (virDomainParseScaledValue("./@size", "./@unit", -+ ctxt, &size, 1024, -+ ULLONG_MAX, true) < 0) -+ goto cleanup; -+ -+ if (virResctrlAllocSetSize(alloc, level, type, cache, size) < 0) -+ goto cleanup; -+ -+ ret = 0; -+ cleanup: -+ ctxt->node = oldnode; -+ VIR_FREE(tmp); -+ return ret; -+} -+ -+ -+static int -+virDomainCachetuneDefParse(virDomainDefPtr def, -+ xmlXPathContextPtr ctxt, -+ xmlNodePtr node, -+ unsigned int flags) -+{ -+ xmlNodePtr oldnode = ctxt->node; -+ xmlNodePtr *nodes = NULL; -+ virBitmapPtr vcpus = NULL; -+ virResctrlAllocPtr alloc = virResctrlAllocNew(); -+ virDomainCachetuneDefPtr tmp_cachetune = NULL; -+ char *tmp = NULL; -+ char *vcpus_str = NULL; -+ char *alloc_id = NULL; -+ ssize_t i = 0; -+ int n; -+ int ret = -1; -+ -+ ctxt->node = node; -+ -+ if (!alloc) -+ goto cleanup; -+ -+ if (VIR_ALLOC(tmp_cachetune) < 0) -+ goto cleanup; -+ -+ vcpus_str = virXMLPropString(node, "vcpus"); -+ if (!vcpus_str) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("Missing cachetune attribute 'vcpus'")); -+ goto cleanup; -+ } -+ if (virBitmapParse(vcpus_str, &vcpus, VIR_DOMAIN_CPUMASK_LEN) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("Invalid cachetune attribute 'vcpus' value '%s'"), -+ vcpus_str); -+ goto cleanup; -+ } -+ -+ /* We need to limit the bitmap to number of vCPUs. If there's nothing left, -+ * then we can just clean up and return 0 immediately */ -+ virBitmapShrink(vcpus, def->maxvcpus); -+ if (virBitmapIsAllClear(vcpus)) { -+ ret = 0; -+ goto cleanup; -+ } -+ -+ if ((n = virXPathNodeSet("./cache", ctxt, &nodes)) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Cannot extract cache nodes under cachetune")); -+ goto cleanup; -+ } -+ -+ for (i = 0; i < n; i++) { -+ if (virDomainCachetuneDefParseCache(ctxt, nodes[i], alloc) < 0) -+ goto cleanup; -+ } -+ -+ if (virResctrlAllocIsEmpty(alloc)) { -+ ret = 0; -+ goto cleanup; -+ } -+ -+ for (i = 0; i < def->ncachetunes; i++) { -+ if (virBitmapOverlaps(def->cachetunes[i]->vcpus, vcpus)) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("Overlapping vcpus in cachetunes")); -+ goto cleanup; -+ } -+ } -+ -+ /* We need to format it back because we need to be consistent in the naming -+ * even when users specify some "sub-optimal" string there. */ -+ VIR_FREE(vcpus_str); -+ vcpus_str = virBitmapFormat(vcpus); -+ if (!vcpus_str) -+ goto cleanup; -+ -+ if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)) -+ alloc_id = virXMLPropString(node, "id"); -+ -+ if (!alloc_id) { -+ /* The number of allocations is limited and the directory structure is flat, -+ * not hierarchical, so we need to have all same allocations in one -+ * directory, so it's nice to have it named appropriately. For now it's -+ * 'vcpus_...' but it's designed in order for it to be changeable in the -+ * future (it's part of the status XML). */ -+ if (virAsprintf(&alloc_id, "vcpus_%s", vcpus_str) < 0) -+ goto cleanup; -+ } -+ -+ if (virResctrlAllocSetID(alloc, alloc_id) < 0) -+ goto cleanup; -+ -+ VIR_STEAL_PTR(tmp_cachetune->vcpus, vcpus); -+ VIR_STEAL_PTR(tmp_cachetune->alloc, alloc); -+ -+ if (VIR_APPEND_ELEMENT(def->cachetunes, def->ncachetunes, tmp_cachetune) < 0) -+ goto cleanup; -+ -+ ret = 0; -+ cleanup: -+ ctxt->node = oldnode; -+ virDomainCachetuneDefFree(tmp_cachetune); -+ virObjectUnref(alloc); -+ virBitmapFree(vcpus); -+ VIR_FREE(alloc_id); -+ VIR_FREE(vcpus_str); -+ VIR_FREE(nodes); -+ VIR_FREE(tmp); -+ return ret; -+} -+ -+ - static virDomainDefPtr - virDomainDefParseXML(xmlDocPtr xml, - xmlNodePtr root, -@@ -18785,6 +18990,18 @@ virDomainDefParseXML(xmlDocPtr xml, - } - VIR_FREE(nodes); - -+ if ((n = virXPathNodeSet("./cputune/cachetune", ctxt, &nodes)) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("cannot extract cachetune nodes")); -+ goto error; -+ } -+ -+ for (i = 0; i < n; i++) { -+ if (virDomainCachetuneDefParse(def, ctxt, nodes[i], flags) < 0) -+ goto error; -+ } -+ VIR_FREE(nodes); -+ - if (virCPUDefParseXML(ctxt, "./cpu[1]", VIR_CPU_TYPE_GUEST, &def->cpu) < 0) - goto error; - -@@ -25736,9 +25953,80 @@ virDomainSchedulerFormat(virBufferPtr buf, - } - - -+static int -+virDomainCachetuneDefFormatHelper(unsigned int level, -+ virCacheType type, -+ unsigned int cache, -+ unsigned long long size, -+ void *opaque) -+{ -+ const char *unit; -+ virBufferPtr buf = opaque; -+ unsigned long long short_size = virFormatIntPretty(size, &unit); -+ -+ virBufferAsprintf(buf, -+ "\n", -+ cache, level, virCacheTypeToString(type), -+ short_size, unit); -+ -+ return 0; -+} -+ -+ -+static int -+virDomainCachetuneDefFormat(virBufferPtr buf, -+ virDomainCachetuneDefPtr cachetune, -+ unsigned int flags) -+{ -+ virBuffer childrenBuf = VIR_BUFFER_INITIALIZER; -+ char *vcpus = NULL; -+ int ret = -1; -+ -+ virBufferSetChildIndent(&childrenBuf, buf); -+ virResctrlAllocForeachSize(cachetune->alloc, -+ virDomainCachetuneDefFormatHelper, -+ &childrenBuf); -+ -+ -+ if (virBufferCheckError(&childrenBuf) < 0) -+ goto cleanup; -+ -+ if (!virBufferUse(&childrenBuf)) { -+ ret = 0; -+ goto cleanup; -+ } -+ -+ vcpus = virBitmapFormat(cachetune->vcpus); -+ if (!vcpus) -+ goto cleanup; -+ -+ virBufferAsprintf(buf, "alloc); -+ if (!alloc_id) -+ goto cleanup; -+ -+ virBufferAsprintf(buf, " id='%s'", alloc_id); -+ } -+ virBufferAddLit(buf, ">\n"); -+ -+ virBufferAddBuffer(buf, &childrenBuf); -+ virBufferAddLit(buf, "\n"); -+ -+ ret = 0; -+ cleanup: -+ virBufferFreeAndReset(&childrenBuf); -+ VIR_FREE(vcpus); -+ return ret; -+} -+ -+ - static int - virDomainCputuneDefFormat(virBufferPtr buf, -- virDomainDefPtr def) -+ virDomainDefPtr def, -+ unsigned int flags) - { - size_t i; - virBuffer childrenBuf = VIR_BUFFER_INITIALIZER; -@@ -25837,6 +26125,9 @@ virDomainCputuneDefFormat(virBufferPtr buf, - def->iothreadids[i]->iothread_id); - } - -+ for (i = 0; i < def->ncachetunes; i++) -+ virDomainCachetuneDefFormat(&childrenBuf, def->cachetunes[i], flags); -+ - if (virBufferCheckError(&childrenBuf) < 0) - return -1; - -@@ -26174,7 +26465,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, - } - } - -- if (virDomainCputuneDefFormat(buf, def) < 0) -+ if (virDomainCputuneDefFormat(buf, def, flags) < 0) - goto error; - - if (virDomainNumatuneFormatXML(buf, def->numa) < 0) -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 5e67c9a9c1..ed7b587bed 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -56,6 +56,7 @@ - # include "virperf.h" - # include "virtypedparam.h" - # include "virsavecookie.h" -+# include "virresctrl.h" - - /* forward declarations of all device types, required by - * virDomainDeviceDef -@@ -2190,6 +2191,15 @@ struct _virDomainCputune { - }; - - -+typedef struct _virDomainCachetuneDef virDomainCachetuneDef; -+typedef virDomainCachetuneDef *virDomainCachetuneDefPtr; -+ -+struct _virDomainCachetuneDef { -+ virBitmapPtr vcpus; -+ virResctrlAllocPtr alloc; -+}; -+ -+ - typedef struct _virDomainVcpuDef virDomainVcpuDef; - typedef virDomainVcpuDef *virDomainVcpuDefPtr; - -@@ -2318,6 +2328,9 @@ struct _virDomainDef { - - virDomainCputune cputune; - -+ virDomainCachetuneDefPtr *cachetunes; -+ size_t ncachetunes; -+ - virDomainNumaPtr numa; - virDomainResourceDefPtr resource; - virDomainIdMapDef idmap; -diff --git a/tests/genericxml2xmlindata/generic-cachetune-cdp.xml b/tests/genericxml2xmlindata/generic-cachetune-cdp.xml -new file mode 100644 -index 0000000000..9718f06098 ---- /dev/null -+++ b/tests/genericxml2xmlindata/generic-cachetune-cdp.xml -@@ -0,0 +1,36 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 4 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-i686 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/genericxml2xmlindata/generic-cachetune-colliding-allocs.xml b/tests/genericxml2xmlindata/generic-cachetune-colliding-allocs.xml -new file mode 100644 -index 0000000000..82c9176cba ---- /dev/null -+++ b/tests/genericxml2xmlindata/generic-cachetune-colliding-allocs.xml -@@ -0,0 +1,30 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 4 -+ -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-i686 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/genericxml2xmlindata/generic-cachetune-colliding-tunes.xml b/tests/genericxml2xmlindata/generic-cachetune-colliding-tunes.xml -new file mode 100644 -index 0000000000..a0f37028c9 ---- /dev/null -+++ b/tests/genericxml2xmlindata/generic-cachetune-colliding-tunes.xml -@@ -0,0 +1,32 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 4 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-i686 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/genericxml2xmlindata/generic-cachetune-colliding-types.xml b/tests/genericxml2xmlindata/generic-cachetune-colliding-types.xml -new file mode 100644 -index 0000000000..c229eccee4 ---- /dev/null -+++ b/tests/genericxml2xmlindata/generic-cachetune-colliding-types.xml -@@ -0,0 +1,30 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 4 -+ -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-i686 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/genericxml2xmlindata/generic-cachetune-small.xml b/tests/genericxml2xmlindata/generic-cachetune-small.xml -new file mode 100644 -index 0000000000..ab2d9cf885 ---- /dev/null -+++ b/tests/genericxml2xmlindata/generic-cachetune-small.xml -@@ -0,0 +1,29 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 4 -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-i686 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/genericxml2xmlindata/generic-cachetune.xml b/tests/genericxml2xmlindata/generic-cachetune.xml -new file mode 100644 -index 0000000000..645cab7771 ---- /dev/null -+++ b/tests/genericxml2xmlindata/generic-cachetune.xml -@@ -0,0 +1,33 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 4 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-i686 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c -index 0377a05e9c..4ced5c349c 100644 ---- a/tests/genericxml2xmltest.c -+++ b/tests/genericxml2xmltest.c -@@ -130,6 +130,16 @@ mymain(void) - DO_TEST_FULL("chardev-reconnect-invalid-mode", 0, false, - TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); - -+ DO_TEST("cachetune"); -+ DO_TEST("cachetune-small"); -+ DO_TEST("cachetune-cdp"); -+ DO_TEST_FULL("cachetune-colliding-allocs", false, true, -+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); -+ DO_TEST_FULL("cachetune-colliding-tunes", false, true, -+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); -+ DO_TEST_FULL("cachetune-colliding-types", false, true, -+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); -+ - virObjectUnref(caps); - virObjectUnref(xmlopt); - --- -2.16.1 - diff --git a/SOURCES/libvirt-conf-Add-target-type-and-model-for-pl011.patch b/SOURCES/libvirt-conf-Add-target-type-and-model-for-pl011.patch deleted file mode 100644 index fd6612b..0000000 --- a/SOURCES/libvirt-conf-Add-target-type-and-model-for-pl011.patch +++ /dev/null @@ -1,952 +0,0 @@ -From 623a617e8199a9c7abd1903399fdbeccf4e85add Mon Sep 17 00:00:00 2001 -Message-Id: <623a617e8199a9c7abd1903399fdbeccf4e85add@dist-git> -From: Andrea Bolognani -Date: Wed, 29 Nov 2017 16:23:14 +0100 -Subject: [PATCH] conf: Add target type and model for pl011 - -We can finally introduce a specific target model for the pl011 device -used by mach-virt guests, which means isa-serial will no longer show -up to confuse users. - -We make sure migration works in both directions by interpreting the -isa-serial target type, or the lack of target type, appropriately -when parsing the guest XML, and skipping the newly-introduced type -when formatting if for migration. We also verify that pl011 is not -used for non-mach-virt guests and add a bunch of test cases. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1512929 - -Signed-off-by: Andrea Bolognani -Reviewed-by: Pavel Hrdina -(cherry picked from commit eccdcb81fcfd1641960d397c82986b4517841794) -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 13 ++++--- - docs/schemas/domaincommon.rng | 2 + - src/conf/domain_conf.c | 3 ++ - src/conf/domain_conf.h | 2 + - src/qemu/qemu_command.c | 9 ++++- - src/qemu/qemu_domain.c | 26 +++++++++++++ - src/qemu/qemu_domain_address.c | 1 + - .../qemuxml2argv-mach-virt-console-native.args | 1 + - .../qemuxml2argv-mach-virt-console-native.xml | 17 +++++++++ - .../qemuxml2argv-mach-virt-console-virtio.args | 24 ++++++++++++ - .../qemuxml2argv-mach-virt-console-virtio.xml | 19 ++++++++++ - ...muxml2argv-mach-virt-serial+console-native.args | 1 + - ...emuxml2argv-mach-virt-serial+console-native.xml | 18 +++++++++ - .../qemuxml2argv-mach-virt-serial-compat.args | 1 + - .../qemuxml2argv-mach-virt-serial-compat.xml | 19 ++++++++++ - ...muxml2argv-mach-virt-serial-invalid-machine.xml | 21 +++++++++++ - .../qemuxml2argv-mach-virt-serial-native.args | 23 +++++++++++ - .../qemuxml2argv-mach-virt-serial-native.xml | 16 ++++++++ - .../qemuxml2argv-mach-virt-serial-pci.args | 26 +++++++++++++ - .../qemuxml2argv-mach-virt-serial-pci.xml | 18 +++++++++ - .../qemuxml2argv-mach-virt-serial-usb.args | 27 +++++++++++++ - .../qemuxml2argv-mach-virt-serial-usb.xml | 21 +++++++++++ - tests/qemuxml2argvtest.c | 27 +++++++++++++ - .../qemuxml2xmlout-aarch64-virtio-pci-default.xml | 4 +- - .../qemuxml2xmlout-mach-virt-console-native.xml | 1 + - .../qemuxml2xmlout-mach-virt-console-virtio.xml | 27 +++++++++++++ - ...uxml2xmlout-mach-virt-serial+console-native.xml | 1 + - .../qemuxml2xmlout-mach-virt-serial-compat.xml | 31 +++++++++++++++ - .../qemuxml2xmlout-mach-virt-serial-native.xml | 1 + - .../qemuxml2xmlout-mach-virt-serial-pci.xml | 44 ++++++++++++++++++++++ - .../qemuxml2xmlout-mach-virt-serial-usb.xml | 41 ++++++++++++++++++++ - tests/qemuxml2xmltest.c | 26 +++++++++++++ - 32 files changed, 503 insertions(+), 8 deletions(-) - create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml - create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.xml - create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-machine.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+console-native.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 0634f3396a..87389f4e73 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) -- is available as well. -+ spapr-vio-serial (usable with ppc64/pseries guests) and -+ system-serial (usable with aarch64/virt guests) are -+ available as well. -

- -

-@@ -6476,7 +6477,8 @@ qemu-kvm -net nic,model=? /dev/null - target type); pci-serial - (usable with the pci-serial target type); - spapr-vty (usable with the spapr-vio-serial -- target type). -+ target type); pl011 (usable with the -+ system-serial target type). -

- -

-@@ -6485,12 +6487,13 @@ qemu-kvm -net nic,model=? /dev/null -

- -

-- 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. -

- -

-diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 027d9ae7a1..957eae2832 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -3572,6 +3572,7 @@ - usb-serial - pci-serial - spapr-vio-serial -+ system-serial - - - -@@ -3584,6 +3585,7 @@ - usb-serial - pci-serial - spapr-vty -+ pl011 - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 97c7a66b5b..32089df3c2 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -446,6 +446,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTarget, - "usb-serial", - "pci-serial", - "spapr-vio-serial", -+ "system-serial", - ); - - VIR_ENUM_IMPL(virDomainChrChannelTarget, -@@ -474,6 +475,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel, - "usb-serial", - "pci-serial", - "spapr-vty", -+ "pl011", - ); - - VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST, -@@ -4063,6 +4065,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_SYSTEM: - 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 979e8cca00..d6febf3059 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -1078,6 +1078,7 @@ typedef enum { - 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_SYSTEM, - - VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST - } virDomainChrSerialTargetType; -@@ -1111,6 +1112,7 @@ typedef enum { - 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_PL011, - - VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST - } virDomainChrSerialTargetModel; -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 056dafea39..483eee6056 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -9230,6 +9230,7 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel) - 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_PL011: - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: - break; -@@ -9261,10 +9262,13 @@ qemuChrIsPlatformDevice(const virDomainDef *def, - virDomainChrDefPtr chr) - { - if (def->os.arch == VIR_ARCH_ARMV7L || def->os.arch == VIR_ARCH_AARCH64) { -- /* TARGET_TYPE_ISA here really means 'the default platform device' */ -+ -+ /* pl011 (used on mach-virt) is a platform device */ - if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && -- chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA) -+ chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM && -+ chr->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011) { - return true; -+ } - } - - /* If we got all the way here and we're still stuck with the default -@@ -10365,6 +10369,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: - break; - -+ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: - 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 -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 17c898896d..2fc173fa45 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -3468,6 +3468,7 @@ qemuDomainChrSerialTargetTypeToAddressType(int targetType) - 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_SYSTEM: - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: - break; -@@ -3489,6 +3490,8 @@ qemuDomainChrSerialTargetModelToTargetType(int targetModel) - 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_PL011: -+ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: - case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: - break; -@@ -3525,6 +3528,16 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef *chr) - } - break; - -+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: -+ if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Target type '%s' cannot have an " -+ "associated address"), -+ virDomainChrSerialTargetTypeToString(chr->targetType)); -+ return -1; -+ } -+ break; -+ - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: - break; -@@ -3536,6 +3549,7 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef *chr) - 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_PL011: - - expected = qemuDomainChrSerialTargetModelToTargetType(chr->targetModel); - -@@ -3592,6 +3606,12 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, - isCompatible = false; - } - -+ if (!qemuDomainIsVirt(def) && -+ (dev->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM || -+ dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011)) { -+ isCompatible = false; -+ } -+ - if (!isCompatible) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Serial device with target type '%s' and " -@@ -4243,6 +4263,8 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, - chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; - } else if (qemuDomainIsPSeries(def)) { - chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO; -+ } else if (qemuDomainIsVirt(def)) { -+ chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; - } - } - -@@ -4262,6 +4284,9 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, - 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_SYSTEM: -+ chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011; -+ break; - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: - /* Nothing to do */ -@@ -5178,6 +5203,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, - if (flags & VIR_DOMAIN_XML_MIGRATABLE) { - switch ((virDomainChrSerialTargetType) serial->targetType) { - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: -+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: - serial->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; - serial->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE; - break; -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index f62bb2f97e..db9656a3a5 100644 ---- a/src/qemu/qemu_domain_address.c -+++ b/src/qemu/qemu_domain_address.c -@@ -784,6 +784,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_SYSTEM: - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: - return 0; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args -new file mode 120000 -index 0000000000..1a90484d3b ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args -@@ -0,0 +1 @@ -+qemuxml2argv-mach-virt-serial-native.args -\ No newline at end of file -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml -new file mode 100644 -index 0000000000..6aba864d0b ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml -@@ -0,0 +1,17 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.args -new file mode 100644 -index 0000000000..2a862bff18 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.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-aarch64 \ -+-name guest \ -+-S \ -+-M virt \ -+-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 \ -+-no-acpi \ -+-boot c \ -+-device virtio-serial,id=virtio-serial0 \ -+-chardev pty,id=charconsole0 \ -+-device virtconsole,chardev=charconsole0,id=console0 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml -new file mode 100644 -index 0000000000..92704504c8 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml -@@ -0,0 +1,19 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.args -new file mode 120000 -index 0000000000..1a90484d3b ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.args -@@ -0,0 +1 @@ -+qemuxml2argv-mach-virt-serial-native.args -\ No newline at end of file -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.xml -new file mode 100644 -index 0000000000..549b764e98 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.xml -@@ -0,0 +1,18 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args -new file mode 120000 -index 0000000000..1a90484d3b ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args -@@ -0,0 +1 @@ -+qemuxml2argv-mach-virt-serial-native.args -\ No newline at end of file -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml -new file mode 100644 -index 0000000000..9e6be3ffeb ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml -@@ -0,0 +1,19 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-machine.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-machine.xml -new file mode 100644 -index 0000000000..a8de76abf9 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-machine.xml -@@ -0,0 +1,21 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-x86_64 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.args -new file mode 100644 -index 0000000000..f4bfce376a ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.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-aarch64 \ -+-name guest \ -+-S \ -+-M virt \ -+-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 \ -+-no-acpi \ -+-boot c \ -+-chardev pty,id=charserial0 \ -+-serial chardev:charserial0 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml -new file mode 100644 -index 0000000000..817f606eea ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml -@@ -0,0 +1,16 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args -new file mode 100644 -index 0000000000..334194efe1 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args -@@ -0,0 +1,26 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-aarch64 \ -+-name guest \ -+-S \ -+-M virt \ -+-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 \ -+-no-acpi \ -+-boot c \ -+-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \ -+-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \ -+-device pcie-root-port,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \ -+-chardev pty,id=charserial0 \ -+-device pci-serial,chardev=charserial0,id=serial0,bus=pci.2,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml -new file mode 100644 -index 0000000000..29aa7664b1 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml -@@ -0,0 +1,18 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args -new file mode 100644 -index 0000000000..44c4027acc ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.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-aarch64 \ -+-name guest \ -+-S \ -+-M virt \ -+-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 \ -+-no-acpi \ -+-boot c \ -+-device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\ -+addr=0x1 \ -+-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \ -+-device qemu-xhci,id=usb,bus=pci.1,addr=0x0 \ -+-chardev pty,id=charserial0 \ -+-device usb-serial,chardev=charserial0,id=serial0,bus=usb.0,port=1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml -new file mode 100644 -index 0000000000..35f192a3e5 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml -@@ -0,0 +1,21 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 2b3bbd1b8b..656b8c0995 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1898,6 +1898,33 @@ mymain(void) - QEMU_CAPS_NODEFCONFIG); - DO_TEST_PARSE_ERROR("pseries-serial-invalid-machine", NONE); - -+ DO_TEST("mach-virt-serial-native", -+ QEMU_CAPS_NODEFCONFIG); -+ DO_TEST("mach-virt-serial+console-native", -+ QEMU_CAPS_NODEFCONFIG); -+ DO_TEST("mach-virt-serial-compat", -+ QEMU_CAPS_NODEFCONFIG); -+ DO_TEST("mach-virt-serial-pci", -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_OBJECT_GPEX, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, -+ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, -+ QEMU_CAPS_DEVICE_PCI_BRIDGE, -+ QEMU_CAPS_DEVICE_PCI_SERIAL); -+ DO_TEST("mach-virt-serial-usb", -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_OBJECT_GPEX, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, -+ QEMU_CAPS_DEVICE_QEMU_XHCI, -+ QEMU_CAPS_DEVICE_USB_SERIAL); -+ DO_TEST("mach-virt-console-native", -+ QEMU_CAPS_NODEFCONFIG); -+ DO_TEST("mach-virt-console-virtio", -+ QEMU_CAPS_NODEFCONFIG); -+ DO_TEST_PARSE_ERROR("mach-virt-serial-invalid-machine", NONE); -+ - DO_TEST("disk-ide-drive-split", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_IDE_CD); -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml -index e5496424b3..9796d7f637 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml -@@ -71,7 +71,9 @@ -

- - -- -+ -+ -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.xml -new file mode 120000 -index 0000000000..a4768fcf86 ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.xml -@@ -0,0 +1 @@ -+qemuxml2xmlout-mach-virt-serial-compat.xml -\ No newline at end of file -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.xml -new file mode 100644 -index 0000000000..3e46cd2012 ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.xml -@@ -0,0 +1,27 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+console-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+console-native.xml -new file mode 120000 -index 0000000000..a4768fcf86 ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+console-native.xml -@@ -0,0 +1 @@ -+qemuxml2xmlout-mach-virt-serial-compat.xml -\ No newline at end of file -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml -new file mode 100644 -index 0000000000..3d7325a8db ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml -@@ -0,0 +1,31 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml -new file mode 120000 -index 0000000000..a4768fcf86 ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml -@@ -0,0 +1 @@ -+qemuxml2xmlout-mach-virt-serial-compat.xml -\ No newline at end of file -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml -new file mode 100644 -index 0000000000..4bcf69a3d1 ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml -@@ -0,0 +1,44 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -+ -+
-+ -+ -+ -+ -+
-+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+
-+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml -new file mode 100644 -index 0000000000..01c2a52555 ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml -@@ -0,0 +1,41 @@ -+ -+ guest -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 524288 -+ 524288 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-aarch64 -+ -+
-+ -+ -+ -+ -+ -+
-+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index f76bd5a68d..bd18507bb6 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -788,6 +788,32 @@ mymain(void) - DO_TEST("pseries-console-virtio", - QEMU_CAPS_NODEFCONFIG); - -+ DO_TEST("mach-virt-serial-native", -+ QEMU_CAPS_NODEFCONFIG); -+ DO_TEST("mach-virt-serial+console-native", -+ QEMU_CAPS_NODEFCONFIG); -+ DO_TEST("mach-virt-serial-compat", -+ QEMU_CAPS_NODEFCONFIG); -+ DO_TEST("mach-virt-serial-pci", -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_OBJECT_GPEX, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, -+ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, -+ QEMU_CAPS_DEVICE_PCI_BRIDGE, -+ QEMU_CAPS_DEVICE_PCI_SERIAL); -+ DO_TEST("mach-virt-serial-usb", -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_OBJECT_GPEX, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, -+ QEMU_CAPS_DEVICE_QEMU_XHCI, -+ QEMU_CAPS_DEVICE_USB_SERIAL); -+ DO_TEST("mach-virt-console-native", -+ QEMU_CAPS_NODEFCONFIG); -+ DO_TEST("mach-virt-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-Add-target-type-and-model-for-spapr-vty.patch b/SOURCES/libvirt-conf-Add-target-type-and-model-for-spapr-vty.patch deleted file mode 100644 index 610c5a2..0000000 --- a/SOURCES/libvirt-conf-Add-target-type-and-model-for-spapr-vty.patch +++ /dev/null @@ -1,1042 +0,0 @@ -From fd981b46a6729b5d5dac4923b860f888b0c193b9 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Andrea Bolognani -Date: Wed, 29 Nov 2017 16:23:12 +0100 -Subject: [PATCH] conf: Add target type and model for spapr-vty - -We can finally introduce a specific target model for the spapr-vty -device used by pSeries guests, which means isa-serial will no longer -show up to confuse users. - -We make sure migration works in both directions by interpreting the -isa-serial target type, or the lack of target type, appropriately -when parsing the guest XML, and skipping the newly-introduced type -when formatting if for migration. We also verify that spapr-vty is -not used for non-pSeries guests and add a bunch of test cases. - -This commit is best viewed with 'git show -w'. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511421 - -Signed-off-by: Andrea Bolognani -Reviewed-by: Pavel Hrdina -(cherry picked from commit c498a8921e447715189c8c6d22b7ca24cc810830) -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 13 ++-- - docs/schemas/domaincommon.rng | 2 + - src/conf/domain_conf.c | 6 +- - src/conf/domain_conf.h | 2 + - src/qemu/qemu_command.c | 67 +++++++++------------ - src/qemu/qemu_domain.c | 69 ++++++++++++++++++---- - src/qemu/qemu_domain_address.c | 1 + - .../qemuxml2argv-pseries-basic.args | 2 +- - .../qemuxml2argv-pseries-console-native.args | 1 + - .../qemuxml2argv-pseries-console-native.xml | 17 ++++++ - .../qemuxml2argv-pseries-console-virtio.args | 23 ++++++++ - .../qemuxml2argv-pseries-console-virtio.xml | 19 ++++++ - .../qemuxml2argv-pseries-cpu-compat-power9.args | 2 +- - .../qemuxml2argv-pseries-cpu-compat.args | 2 +- - .../qemuxml2argv-pseries-cpu-exact.args | 2 +- - .../qemuxml2argv-pseries-cpu-le.args | 2 +- - .../qemuxml2argv-pseries-panic-missing.args | 2 +- - .../qemuxml2argv-pseries-panic-no-address.args | 2 +- - ...qemuxml2argv-pseries-serial+console-native.args | 1 + - .../qemuxml2argv-pseries-serial+console-native.xml | 18 ++++++ - .../qemuxml2argv-pseries-serial-compat.args | 1 + - .../qemuxml2argv-pseries-serial-compat.xml | 19 ++++++ - ...qemuxml2argv-pseries-serial-invalid-machine.xml | 19 ++++++ - .../qemuxml2argv-pseries-serial-native.args | 22 +++++++ - .../qemuxml2argv-pseries-serial-native.xml | 16 +++++ - .../qemuxml2argv-pseries-usb-default.args | 2 +- - .../qemuxml2argv-pseries-usb-kbd.args | 2 +- - .../qemuxml2argv-pseries-usb-multi.args | 2 +- - .../qemuxml2argv-pseries-vio-user-assigned.args | 4 +- - .../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 4 +- - tests/qemuxml2argvtest.c | 16 +++++ - .../qemuxml2xmlout-panic-pseries.xml | 4 +- - .../qemuxml2xmlout-pseries-console-native.xml | 1 + - .../qemuxml2xmlout-pseries-console-virtio.xml | 31 ++++++++++ - .../qemuxml2xmlout-pseries-cpu-compat-power9.xml | 4 +- - .../qemuxml2xmlout-pseries-cpu-compat.xml | 4 +- - .../qemuxml2xmlout-pseries-cpu-exact.xml | 4 +- - .../qemuxml2xmlout-pseries-panic-missing.xml | 4 +- - .../qemuxml2xmlout-pseries-panic-no-address.xml | 4 +- - ...emuxml2xmlout-pseries-serial+console-native.xml | 1 + - .../qemuxml2xmlout-pseries-serial-compat.xml | 1 + - .../qemuxml2xmlout-pseries-serial-native.xml | 35 +++++++++++ - tests/qemuxml2xmltest.c | 15 +++++ - 43 files changed, 386 insertions(+), 82 deletions(-) - create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml - create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.xml - create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machine.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console-native.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index cf1167b9c6..0634f3396a 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -6462,7 +6462,9 @@ qemu-kvm -net nic,model=? /dev/null - 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). -+ is available); since 3.10.0, -+ spapr-vio-serial (usable with ppc64/pseries guests) -+ is available as well. -

- -

-@@ -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 @@ - - - -- -+ - - - - - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml -index e76f857aee..cd9d75c4b7 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml -@@ -27,7 +27,7 @@ - - - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml -index 8dc361dfc6..0c0bd7b348 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml -@@ -28,7 +28,7 @@ - - - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml -index 858b2c6750..305c53eab7 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml -@@ -31,7 +31,7 @@ -
- - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml -index f9f9abd2df..b38b3ce987 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml -@@ -30,7 +30,7 @@ - - - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml -index 1c55017678..06192fbb4a 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml -@@ -47,7 +47,7 @@ -
- - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml -index 95b6e2df1a..a6eaa38079 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml -@@ -104,10 +104,10 @@ -
- - -- -+ - - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml -index 7fe69bd6cb..e6ad234240 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml -@@ -55,7 +55,7 @@ -
- - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml -index b631e5b515..66448ec3dd 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml -@@ -44,7 +44,7 @@ -
- - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml -index fd5fdbece5..b1240b8ed1 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml -@@ -57,7 +57,7 @@ -
- - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml -index 4571b6a829..4f7ad323ed 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml -@@ -54,7 +54,7 @@ -
- - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml -index 7fb49feb0f..a563b6dddf 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml -@@ -22,7 +22,7 @@ - - - -- -+ -
- - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml -index f020056219..59587b3c32 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml -@@ -25,7 +25,7 @@ - - - -- -+ -
- - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml -index 3cbce9fe6a..a39e1fd015 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml -@@ -25,7 +25,7 @@ - - - -- -+ -
- - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml -index d69b387686..666eede1a5 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml -@@ -26,7 +26,7 @@ - - - -- -+ -
- - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml -index 7fb49feb0f..a563b6dddf 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml -@@ -22,7 +22,7 @@ - - - -- -+ -
- - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml -index 7fb49feb0f..a563b6dddf 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml -@@ -22,7 +22,7 @@ - - - -- -+ -
- - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml -index c4ccd98aac..27baaa3f14 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml -@@ -79,7 +79,7 @@ -
- - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml -index 79c4ebc734..63462e6f94 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml -@@ -28,7 +28,7 @@ - - - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml -index 9527b2d15f..c90bbeb7d5 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml -@@ -28,7 +28,7 @@ - - - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml -index 71516a31a9..a8790b5098 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml -@@ -27,13 +27,13 @@ - - - -- -+ - - -- -+ - - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml -index 18f51e5383..a8af87b53b 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml -@@ -29,12 +29,12 @@ - - - -- -+ - - - - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml -index 3a95b6088c..6d847de3a2 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml -@@ -40,7 +40,7 @@ -
- - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml -index 759b844395..30989658f4 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml -@@ -47,7 +47,7 @@ -
- - -- -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml -index 8c27470ddf..72cbcc4cb5 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml -@@ -46,7 +46,7 @@ -
- - -- -+ - - - --- -2.15.1 - diff --git a/SOURCES/libvirt-conf-Fix-a-error-msg-typo-in-virDomainVideoDefValidate.patch b/SOURCES/libvirt-conf-Fix-a-error-msg-typo-in-virDomainVideoDefValidate.patch new file mode 100644 index 0000000..6aaabd5 --- /dev/null +++ b/SOURCES/libvirt-conf-Fix-a-error-msg-typo-in-virDomainVideoDefValidate.patch @@ -0,0 +1,35 @@ +From d10524fd3934bf539b38599eb928b26089d17b52 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Han Han +Date: Tue, 31 Jul 2018 10:42:27 +0200 +Subject: [PATCH] conf: Fix a error msg typo in virDomainVideoDefValidate + +https://bugzilla.redhat.com/show_bug.cgi?id=1607825 + +Introduced by commit d48813e8. + +Signed-off-by: Han Han +Reviewed-by: Erik Skultety +(cherry picked from commit d1c4480390da7243e37daee37f8a40cb439a6a7c) +Signed-off-by: Erik Skultety +Reviewed-by: Jiri Denemark +--- + 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 23288aa01b..a05aad056d 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -5697,7 +5697,7 @@ virDomainVideoDefValidate(const virDomainVideoDef *video, + if (def->videos[i]->type == VIR_DOMAIN_VIDEO_TYPE_NONE && + def->nvideos > 1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("a '%s' video type must be the only video device " ++ _("a 'none' video type must be the only video device " + "defined for the domain")); + return -1; + } +-- +2.18.0 + diff --git a/SOURCES/libvirt-conf-Fix-crash-in-virDomainDefCompatibleDevice.patch b/SOURCES/libvirt-conf-Fix-crash-in-virDomainDefCompatibleDevice.patch deleted file mode 100644 index 08e18b5..0000000 --- a/SOURCES/libvirt-conf-Fix-crash-in-virDomainDefCompatibleDevice.patch +++ /dev/null @@ -1,47 +0,0 @@ -From b5eaca77959775ffce33c459a06f0dcacee5338d Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Thu, 1 Mar 2018 07:08:32 -0500 -Subject: [PATCH] conf: Fix crash in virDomainDefCompatibleDevice -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Commit id 'edae027c' blindly assumed that the passed @oldDev -parameter would not be NULL when calling virDomainDeviceGetInfo; -however, commit id 'b6a264e8' passed NULL for AttachDevice -callers under the premise that there wouldn't be a device -to check/update against. - -Signed-off-by: John Ferlan -(cherry picked from commit 5535856f0e31aa6abf4cda11b5c53c0f164680f0) - -https://bugzilla.redhat.com/show_bug.cgi?id=1557922 - -Signed-off-by: Jiri Denemark -Reviewed-by: Ján Tomko ---- - src/conf/domain_conf.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index f21c776ccd..7f4da169d6 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -27202,9 +27202,12 @@ virDomainDefCompatibleDevice(virDomainDefPtr def, - { - virDomainCompatibleDeviceData data = { - .newInfo = virDomainDeviceGetInfo(dev), -- .oldInfo = virDomainDeviceGetInfo(oldDev), -+ .oldInfo = NULL, - }; - -+ if (oldDev) -+ data.oldInfo = virDomainDeviceGetInfo(oldDev); -+ - if (!virDomainDefHasUSB(def) && - def->os.type != VIR_DOMAIN_OSTYPE_EXE && - virDomainDeviceIsUSB(dev)) { --- -2.17.0 - diff --git a/SOURCES/libvirt-conf-Fix-memory-leak-for-distances-in-virDomainNumaFree.patch b/SOURCES/libvirt-conf-Fix-memory-leak-for-distances-in-virDomainNumaFree.patch deleted file mode 100644 index 3747582..0000000 --- a/SOURCES/libvirt-conf-Fix-memory-leak-for-distances-in-virDomainNumaFree.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 8e0151c7b6ce80dc8145511848155e6170ce2bf6 Mon Sep 17 00:00:00 2001 -Message-Id: <8e0151c7b6ce80dc8145511848155e6170ce2bf6@dist-git> -From: John Ferlan -Date: Mon, 4 Dec 2017 13:38:53 +0100 -Subject: [PATCH] conf: Fix memory leak for distances in virDomainNumaFree - -https://bugzilla.redhat.com/show_bug.cgi?id=1454889 - -Commit id '74119a03f' neglected to clean up @distances when -the numa definition is cleaned up. - -(cherry picked from commit 9f0ccc717ba9026c30ce38951a354dd66fa12e3b) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/conf/numa_conf.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c -index 8fc3b0a196..466b64d5fa 100644 ---- a/src/conf/numa_conf.c -+++ b/src/conf/numa_conf.c -@@ -362,6 +362,9 @@ virDomainNumaFree(virDomainNumaPtr numa) - for (i = 0; i < numa->nmem_nodes; i++) { - virBitmapFree(numa->mem_nodes[i].cpumask); - virBitmapFree(numa->mem_nodes[i].nodeset); -+ -+ if (numa->mem_nodes[i].ndistances > 0) -+ VIR_FREE(numa->mem_nodes[i].distances); - } - VIR_FREE(numa->mem_nodes); - --- -2.15.1 - diff --git a/SOURCES/libvirt-conf-Fix-message-when-maximum-vCPU-count-is-less-than-current.patch b/SOURCES/libvirt-conf-Fix-message-when-maximum-vCPU-count-is-less-than-current.patch deleted file mode 100644 index 69ef6d6..0000000 --- a/SOURCES/libvirt-conf-Fix-message-when-maximum-vCPU-count-is-less-than-current.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 73e3efc5dae126514b00a8538664609810cadbc4 Mon Sep 17 00:00:00 2001 -Message-Id: <73e3efc5dae126514b00a8538664609810cadbc4@dist-git> -From: Peter Krempa -Date: Mon, 13 Nov 2017 13:48:09 +0100 -Subject: [PATCH] conf: Fix message when maximum vCPU count is less than - current - -Reword the message and drop the numbers (which were reversed) from it -so that it actually makes sense. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1509151 -(cherry picked from commit 50712e14f40ffdac8a71ce9ef091e4e7bd822585) -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 3b337d1a64..ca5d0bcc54 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1505,9 +1505,9 @@ virDomainDefSetVcpus(virDomainDefPtr def, - size_t i; - - if (vcpus > def->maxvcpus) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("maxvcpus must not be less than current vcpus (%u < %zu)"), -- vcpus, def->maxvcpus); -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("maximum vCPU count must not be less than current " -+ "vCPU count")); - return -1; - } - --- -2.15.0 - diff --git a/SOURCES/libvirt-conf-Format-cache-banks-in-capabilities-with-virFormatIntPretty.patch b/SOURCES/libvirt-conf-Format-cache-banks-in-capabilities-with-virFormatIntPretty.patch deleted file mode 100644 index a1d532b..0000000 --- a/SOURCES/libvirt-conf-Format-cache-banks-in-capabilities-with-virFormatIntPretty.patch +++ /dev/null @@ -1,166 +0,0 @@ -From 5a978253cced5135a6dd01c730faea2fd21a5dc9 Mon Sep 17 00:00:00 2001 -Message-Id: <5a978253cced5135a6dd01c730faea2fd21a5dc9@dist-git> -From: Martin Kletzander -Date: Wed, 31 Jan 2018 16:32:18 +0100 -Subject: [PATCH] conf: Format cache banks in capabilities with - virFormatIntPretty - -https://bugzilla.redhat.com/show_bug.cgi?id=1289368 - -Signed-off-by: Martin Kletzander -Reviewed-by: John Ferlan -(cherry picked from commit 63d95a19cc72d120d40092c1e97235d7b9d4eb29) -Signed-off-by: Martin Kletzander ---- - src/conf/capabilities.c | 50 ++++++++++++++-------- - tests/vircaps2xmldata/vircaps-x86_64-caches.xml | 2 +- - .../vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml | 4 +- - .../vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml | 4 +- - tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml | 4 +- - 5 files changed, 39 insertions(+), 25 deletions(-) - -diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c -index 1f7d8cdb31..798c9bdaea 100644 ---- a/src/conf/capabilities.c -+++ b/src/conf/capabilities.c -@@ -883,7 +883,8 @@ virCapabilitiesFormatCaches(virBufferPtr buf, - for (i = 0; i < ncaches; i++) { - virCapsHostCacheBankPtr bank = caches[i]; - char *cpus_str = virBitmapFormat(bank->cpus); -- bool kilos = !(bank->size % 1024); -+ const char *unit = NULL; -+ unsigned long long short_size = virFormatIntPretty(bank->size, &unit); - - if (!cpus_str) - return -1; -@@ -897,34 +898,47 @@ virCapabilitiesFormatCaches(virBufferPtr buf, - "size='%llu' unit='%s' cpus='%s'", - bank->id, bank->level, - virCacheTypeToString(bank->type), -- bank->size >> (kilos * 10), -- kilos ? "KiB" : "B", -- cpus_str); -+ short_size, unit, cpus_str); - VIR_FREE(cpus_str); - - virBufferSetChildIndent(&controlBuf, buf); - for (j = 0; j < bank->ncontrols; j++) { -- bool min_kilos = !(bank->controls[j]->granularity % 1024); -+ const char *min_unit; -+ virResctrlInfoPtr controls = bank->controls[j]; -+ unsigned long long gran_short_size = controls->granularity; -+ unsigned long long min_short_size = controls->min; - -- /* Only use KiB if both values are divisible */ -- if (bank->controls[j]->min) -- min_kilos = min_kilos && !(bank->controls[j]->min % 1024); -+ gran_short_size = virFormatIntPretty(gran_short_size, &unit); -+ min_short_size = virFormatIntPretty(min_short_size, &min_unit); - -- virBufferAsprintf(&controlBuf, -- "controls[j]->granularity >> (min_kilos * 10)); -+ /* Only use the smaller unit if they are different */ -+ if (min_short_size) { -+ unsigned long long gran_div; -+ unsigned long long min_div; - -- if (bank->controls[j]->min) { -- virBufferAsprintf(&controlBuf, -- " min='%llu'", -- bank->controls[j]->min >> (min_kilos * 10)); -+ gran_div = controls->granularity / gran_short_size; -+ min_div = controls->min / min_short_size; -+ -+ if (min_div > gran_div) { -+ min_short_size *= min_div / gran_div; -+ } else if (min_div < gran_div) { -+ unit = min_unit; -+ gran_short_size *= gran_div / min_div; -+ } - } - -+ virBufferAsprintf(&controlBuf, -+ "\n", -- min_kilos ? "KiB" : "B", -- virCacheTypeToString(bank->controls[j]->scope), -- bank->controls[j]->max_allocation); -+ unit, -+ virCacheTypeToString(controls->scope), -+ controls->max_allocation); - } - - if (virBufferCheckError(&controlBuf) < 0) -diff --git a/tests/vircaps2xmldata/vircaps-x86_64-caches.xml b/tests/vircaps2xmldata/vircaps-x86_64-caches.xml -index fe0be6d08f..0c6f3769a2 100644 ---- a/tests/vircaps2xmldata/vircaps-x86_64-caches.xml -+++ b/tests/vircaps2xmldata/vircaps-x86_64-caches.xml -@@ -29,7 +29,7 @@ - - - -- -+ - - - -diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml -index 7361537bfb..443917c62d 100644 ---- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml -+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml -@@ -41,11 +41,11 @@ - - - -- -+ - - - -- -+ - - - -diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml -index 4e91c87de3..0cd25e59a9 100644 ---- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml -+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml -@@ -22,8 +22,8 @@ - - - -- -- -+ -+ - - - -diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml -index eb02ad3322..7629259294 100644 ---- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml -+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml -@@ -41,10 +41,10 @@ - - - -- -+ - - -- -+ - - - --- -2.16.1 - diff --git a/SOURCES/libvirt-conf-Improve-error-handling-in-virDomainChrDefFormat.patch b/SOURCES/libvirt-conf-Improve-error-handling-in-virDomainChrDefFormat.patch deleted file mode 100644 index d3f07fc..0000000 --- a/SOURCES/libvirt-conf-Improve-error-handling-in-virDomainChrDefFormat.patch +++ /dev/null @@ -1,54 +0,0 @@ -From f2dd85b3b81cd5c0842ffb55554c1a9cb5e8764b Mon Sep 17 00:00:00 2001 -Message-Id: -From: Andrea Bolognani -Date: Wed, 29 Nov 2017 16:23:01 +0100 -Subject: [PATCH] conf: Improve error handling in virDomainChrDefFormat() - -We don't need to store the return value since we never modify it. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Pavel Hrdina -(cherry picked from commit be956c4e38770dd61998815bbea4b7c2fc38a7d6) - -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 | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index d68a5f415c..cf1bd030a0 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -24028,8 +24028,6 @@ virDomainChrDefFormat(virBufferPtr buf, - const char *elementName = virDomainChrDeviceTypeToString(def->deviceType); - bool tty_compat; - -- int ret = 0; -- - if (!elementName) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected char device type %d"), -@@ -24050,14 +24048,14 @@ virDomainChrDefFormat(virBufferPtr buf, - virDomainChrSourceDefFormat(buf, def->source, flags); - - if (virDomainChrTargetDefFormat(buf, def, flags) < 0) -- return -1; -+ return -1; - - virDomainDeviceInfoFormat(buf, &def->info, flags); - - virBufferAdjustIndent(buf, -2); - virBufferAsprintf(buf, "\n", elementName); - -- return ret; -+ return 0; - } - - static int --- -2.15.1 - diff --git a/SOURCES/libvirt-conf-Improve-virDomainChrTargetDefFormat.patch b/SOURCES/libvirt-conf-Improve-virDomainChrTargetDefFormat.patch deleted file mode 100644 index 5d75d47..0000000 --- a/SOURCES/libvirt-conf-Improve-virDomainChrTargetDefFormat.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 6e8cb0e122f7c269d1252ed7d55a7c82ae0062eb Mon Sep 17 00:00:00 2001 -Message-Id: <6e8cb0e122f7c269d1252ed7d55a7c82ae0062eb@dist-git> -From: Andrea Bolognani -Date: Wed, 29 Nov 2017 16:23:03 +0100 -Subject: [PATCH] conf: Improve virDomainChrTargetDefFormat() - -Make the switch statement type-aware, avoid calling -virDomainChrTargetTypeToString() more than once and check its -return value before using it. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Pavel Hrdina -(cherry picked from commit 46084f2aa1e9188709fcd7abc5c41fe165b2b19b) - -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 | 29 ++++++++++++++++++++++------- - 1 file changed, 22 insertions(+), 7 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 346edaa6bd..2489705d6b 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -23945,7 +23945,7 @@ virDomainChrTargetDefFormat(virBufferPtr buf, - const char *targetType = virDomainChrTargetTypeToString(def->deviceType, - def->targetType); - -- switch (def->deviceType) { -+ switch ((virDomainChrDeviceType) def->deviceType) { - case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: { - if (!targetType) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -23992,28 +23992,43 @@ virDomainChrTargetDefFormat(virBufferPtr buf, - } - - case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: -+ if (!targetType) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Could not format console target type")); -+ return -1; -+ } -+ - virBufferAsprintf(buf, - "\n", -- virDomainChrTargetTypeToString(def->deviceType, -- def->targetType), -- def->target.port); -+ targetType, def->target.port); - break; - - case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: -+ if (!targetType) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Could not format serial target type")); -+ return -1; -+ } -+ - if (def->targetType != VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { - virBufferAsprintf(buf, - "\n", -- virDomainChrTargetTypeToString(def->deviceType, -- def->targetType), -+ targetType, - def->target.port); - break; - } - ATTRIBUTE_FALLTHROUGH; - -- default: -+ case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: - virBufferAsprintf(buf, "\n", - def->target.port); - break; -+ -+ case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("unexpected char device type %d"), -+ def->deviceType); -+ return -1; - } - - return 0; --- -2.15.1 - diff --git a/SOURCES/libvirt-conf-Introduce-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE.patch b/SOURCES/libvirt-conf-Introduce-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE.patch deleted file mode 100644 index 18c006d..0000000 --- a/SOURCES/libvirt-conf-Introduce-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 4f4db541098163a2061cd63ce6bfb83ce2ed38b5 Mon Sep 17 00:00:00 2001 -Message-Id: <4f4db541098163a2061cd63ce6bfb83ce2ed38b5@dist-git> -From: Andrea Bolognani -Date: Wed, 29 Nov 2017 16:22:58 +0100 -Subject: [PATCH] conf: Introduce VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE - -This is the first step in getting rid of the assumption that -isa-serial is the default target type for serial devices. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Pavel Hrdina -(cherry picked from commit 6385c8c14233388d929ed62717684e7352543416) - -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 | 8 +++++--- - src/conf/domain_conf.h | 3 ++- - src/qemu/qemu_command.c | 13 +++++++++++++ - src/qemu/qemu_domain.c | 21 +++++++++++++++++++++ - src/qemu/qemu_domain_address.c | 1 + - 5 files changed, 42 insertions(+), 4 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 41674a85af..3a5ecd3a9d 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -441,6 +441,7 @@ VIR_ENUM_IMPL(virDomainChrDeviceState, VIR_DOMAIN_CHR_DEVICE_STATE_LAST, - - VIR_ENUM_IMPL(virDomainChrSerialTarget, - VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST, -+ "none", - "isa-serial", - "usb-serial", - "pci-serial") -@@ -4025,7 +4026,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) - - /* modify it to be a serial port */ - def->serials[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL; -- def->serials[0]->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; -+ def->serials[0]->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; - def->serials[0]->target.port = 0; - } else { - /* if the console source doesn't match */ -@@ -4049,7 +4050,8 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) - def->serials[0]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { - - switch ((virDomainChrSerialTargetType) def->serials[0]->targetType) { -- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: { -+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: -+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: { - - /* Create a stub console to match the serial port. - * console[0] either does not exist -@@ -11485,7 +11487,7 @@ virDomainChrDefaultTargetType(int devtype) - return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE; - - case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: -- return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; -+ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; - - case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: - case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 09635763a1..9502573b34 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -1073,7 +1073,8 @@ typedef enum { - } virDomainChrDeviceType; - - typedef enum { -- VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA = 0, -+ VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE = 0, -+ VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA, - VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB, - VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI, - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 3d970ed9d1..d593e60198 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -9255,6 +9255,14 @@ qemuChrIsPlatformDevice(const virDomainDef *def, - return true; - } - -+ /* If we got all the way here and we're still stuck with the default -+ * target type for a serial device, it means we have no clue what kind of -+ * device we're talking about and we must treat it as a platform device. */ -+ if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && -+ chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { -+ return true; -+ } -+ - return false; - } - -@@ -10378,7 +10386,12 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, - } - break; - -+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_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")); - goto error; -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index b15d994774..e43f7496c2 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -4095,6 +4095,27 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, - chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO; - } - -+ /* Historically, isa-serial and the default matched, so in order to -+ * maintain backwards compatibility we map them here. The actual default -+ * will be picked below based on the architecture and machine type. */ -+ if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && -+ chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA) { -+ chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; -+ } -+ -+ /* Set the default serial type */ -+ if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && -+ chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { -+ 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; -+ } -+ } -+ - /* clear auto generated unix socket path for inactive definitions */ - if (parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) { - if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0) -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index 7f4ac0f45a..989c0e6c93 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_NONE: - case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: - return 0; - } --- -2.15.1 - diff --git a/SOURCES/libvirt-conf-Introduce-new-hostdev-attribute-display.patch b/SOURCES/libvirt-conf-Introduce-new-hostdev-attribute-display.patch new file mode 100644 index 0000000..5a7084e --- /dev/null +++ b/SOURCES/libvirt-conf-Introduce-new-hostdev-attribute-display.patch @@ -0,0 +1,416 @@ +From 2d16cb96407ed22af46b892e3319f04ac61924ed Mon Sep 17 00:00:00 2001 +Message-Id: <2d16cb96407ed22af46b892e3319f04ac61924ed@dist-git> +From: Erik Skultety +Date: Thu, 19 Jul 2018 15:04:02 +0200 +Subject: [PATCH] conf: Introduce new attribute 'display' +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +QEMU 2.12 introduced a new type of display for mediated devices using +vfio-pci backend which allows a mediated device to be used as a VGA +compatible device as an alternative to an emulated video device. QEMU +exposes this feature via a vfio device property 'display' with supported +values 'on/off/auto' (libvirt will default to 'off'). + +This patch adds the necessary bits to domain config handling in order to +expose this feature. Since there's no convenient way for libvirt to come +up with usable defaults for the display setting, simply because libvirt +is not able to figure out which of the display implementations - dma-buf +which requires OpenGL support vs vfio regions which doesn't need OpenGL +(works with OpenGL enabled too) - the underlying mdev uses. + +Reviewed-by: Ján Tomko +Signed-off-by: Erik Skultety +(cherry picked from commit d54e45b6edd7623e488a19e30bc4148a21fa8b03) + +https://bugzilla.redhat.com/show_bug.cgi?id=1475770 +Signed-off-by: Erik Skultety +Reviewed-by: Ján Tomko +--- + docs/formatdomain.html.in | 20 +++- + docs/schemas/domaincommon.rng | 5 + + src/conf/domain_conf.c | 19 +++- + src/conf/domain_conf.h | 1 + + src/qemu/qemu_domain.c | 98 ++++++++++++++++++- + .../qemuxml2argvdata/hostdev-mdev-display.xml | 39 ++++++++ + .../hostdev-mdev-display.xml | 47 +++++++++ + tests/qemuxml2xmltest.c | 1 + + 8 files changed, 222 insertions(+), 8 deletions(-) + create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display.xml + create mode 100644 tests/qemuxml2xmloutdata/hostdev-mdev-display.xml + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index 9dd22554ad..3554c3dc30 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -4510,9 +4510,23 @@ + 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. There are also some implications on the +- usage of guest's address type depending on the model +- attribute, see the address element below. ++ a mediated device 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 ++ device (such as NVIDIA vGPU or Intel GVT-g) as an alternative to ++ emulated video devices. This attribute ++ is limited to model='vfio-pci' only. Supported values ++ are either on or off (default is 'off'). ++ It is required to use a ++ graphical framebuffer in order to ++ use this attribute, currently only supported with VNC, Spice and ++ egl-headless graphics devices. ++

++ Note: There are also some implications on the usage of guest's ++ address type depending on the model attribute, ++ see the address element below. ++

+ + +

+diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng +index 157726752c..be8430ab22 100644 +--- a/docs/schemas/domaincommon.rng ++++ b/docs/schemas/domaincommon.rng +@@ -4579,6 +4579,11 @@ + vfio-ccw + + ++ ++ ++ ++ ++ + + + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 72086f9e86..830c298158 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -7656,6 +7656,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, + char *rawio = NULL; + char *backendStr = NULL; + char *model = NULL; ++ char *display = NULL; + int backend; + int ret = -1; + virDomainHostdevSubsysPCIPtr pcisrc = &def->source.subsys.u.pci; +@@ -7675,6 +7676,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, + sgio = virXMLPropString(node, "sgio"); + rawio = virXMLPropString(node, "rawio"); + model = virXMLPropString(node, "model"); ++ display = virXMLPropString(node, "display"); + + /* @type is passed in from the caller rather than read from the + * xml document, because it is specified in different places for +@@ -7762,6 +7764,15 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, + model); + goto cleanup; + } ++ ++ if (display && ++ (mdevsrc->display = virTristateSwitchTypeFromString(display)) <= 0) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("unknown value '%s' for attribute " ++ "'display'"), ++ display); ++ goto cleanup; ++ } + } + + switch (def->source.subsys.type) { +@@ -7815,6 +7826,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, + VIR_FREE(rawio); + VIR_FREE(backendStr); + VIR_FREE(model); ++ VIR_FREE(display); + return ret; + } + +@@ -26568,9 +26580,14 @@ virDomainHostdevDefFormat(virBufferPtr buf, + virTristateBoolTypeToString(scsisrc->rawio)); + } + +- if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV) ++ if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV) { + virBufferAsprintf(buf, " model='%s'", + virMediatedDeviceModelTypeToString(mdevsrc->model)); ++ if (mdevsrc->display != VIR_TRISTATE_SWITCH_ABSENT) ++ virBufferAsprintf(buf, " display='%s'", ++ virTristateSwitchTypeToString(mdevsrc->display)); ++ } ++ + } + virBufferAddLit(buf, ">\n"); + virBufferAdjustIndent(buf, 2); +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 3deda1d978..8ca9558ceb 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -382,6 +382,7 @@ typedef struct _virDomainHostdevSubsysMediatedDev virDomainHostdevSubsysMediated + typedef virDomainHostdevSubsysMediatedDev *virDomainHostdevSubsysMediatedDevPtr; + struct _virDomainHostdevSubsysMediatedDev { + int model; /* enum virMediatedDeviceModelType */ ++ int display; /* virTristateSwitch */ + char uuidstr[VIR_UUID_STRING_BUFLEN]; /* mediated device's uuid string */ + }; + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 9498594857..5337f1ce55 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -4451,9 +4451,48 @@ qemuDomainDeviceDefValidateNetwork(const virDomainNetDef *net) + + + static int +-qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev, +- const virDomainDef *def) ++qemuDomainMdevDefValidate(const virDomainHostdevSubsysMediatedDev *mdevsrc, ++ const virDomainDef *def, ++ virQEMUCapsPtr qemuCaps) + { ++ if (mdevsrc->display == VIR_TRISTATE_SWITCH_ABSENT) ++ return 0; ++ ++ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_PCI_DISPLAY)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("display property of device vfio-pci is " ++ "not supported by this version of QEMU")); ++ return -1; ++ } ++ ++ if (mdevsrc->model != VIR_MDEV_MODEL_TYPE_VFIO_PCI) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _(" attribute 'display' is only supported" ++ " with model='vfio-pci'")); ++ ++ return -1; ++ } ++ ++ if (mdevsrc->display == VIR_TRISTATE_SWITCH_ON) { ++ if (def->ngraphics == 0) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("graphics device is needed for attribute value " ++ "'display=on' in ")); ++ return -1; ++ } ++ } ++ ++ return 0; ++} ++ ++ ++static int ++qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev, ++ const virDomainDef *def, ++ virQEMUCapsPtr qemuCaps) ++{ ++ const virDomainHostdevSubsysMediatedDev *mdevsrc; ++ + /* forbid capabilities mode hostdev in this kind of hypervisor */ + if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, +@@ -4463,6 +4502,24 @@ qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev, + return -1; + } + ++ if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) { ++ switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) { ++ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: ++ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: ++ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: ++ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST: ++ break; ++ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: ++ mdevsrc = &hostdev->source.subsys.u.mdev; ++ return qemuDomainMdevDefValidate(mdevsrc, def, qemuCaps); ++ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: ++ default: ++ virReportEnumRangeError(virDomainHostdevSubsysType, ++ hostdev->source.subsys.type); ++ return -1; ++ } ++ } ++ + return 0; + } + +@@ -5595,7 +5652,8 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, + break; + + case VIR_DOMAIN_DEVICE_HOSTDEV: +- ret = qemuDomainDeviceDefValidateHostdev(dev->data.hostdev, def); ++ ret = qemuDomainDeviceDefValidateHostdev(dev->data.hostdev, def, ++ qemuCaps); + break; + + case VIR_DOMAIN_DEVICE_VIDEO: +@@ -6205,6 +6263,35 @@ qemuDomainVsockDefPostParse(virDomainVsockDefPtr vsock) + } + + ++static int ++qemuDomainHostdevDefMdevPostParse(virDomainHostdevSubsysMediatedDevPtr mdevsrc, ++ virQEMUCapsPtr qemuCaps) ++{ ++ /* QEMU 2.12 added support for vfio-pci display type, we default to ++ * 'display=off' to stay safe from future changes */ ++ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_PCI_DISPLAY) && ++ mdevsrc->display == VIR_TRISTATE_SWITCH_ABSENT) ++ mdevsrc->display = VIR_TRISTATE_SWITCH_OFF; ++ ++ return 0; ++} ++ ++ ++static int ++qemuDomainHostdevDefPostParse(virDomainHostdevDefPtr hostdev, ++ virQEMUCapsPtr qemuCaps) ++{ ++ virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys; ++ ++ if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && ++ hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV && ++ qemuDomainHostdevDefMdevPostParse(&subsys->u.mdev, qemuCaps) < 0) ++ return -1; ++ ++ return 0; ++} ++ ++ + static int + qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, + const virDomainDef *def, +@@ -6255,11 +6342,14 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, + ret = qemuDomainVsockDefPostParse(dev->data.vsock); + break; + ++ case VIR_DOMAIN_DEVICE_HOSTDEV: ++ ret = qemuDomainHostdevDefPostParse(dev->data.hostdev, qemuCaps); ++ break; ++ + case VIR_DOMAIN_DEVICE_LEASE: + case VIR_DOMAIN_DEVICE_FS: + case VIR_DOMAIN_DEVICE_INPUT: + case VIR_DOMAIN_DEVICE_SOUND: +- case VIR_DOMAIN_DEVICE_HOSTDEV: + case VIR_DOMAIN_DEVICE_WATCHDOG: + case VIR_DOMAIN_DEVICE_GRAPHICS: + case VIR_DOMAIN_DEVICE_HUB: +diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display.xml b/tests/qemuxml2argvdata/hostdev-mdev-display.xml +new file mode 100644 +index 0000000000..f37e08e1b9 +--- /dev/null ++++ b/tests/qemuxml2argvdata/hostdev-mdev-display.xml +@@ -0,0 +1,39 @@ ++ ++ QEMUGuest2 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++ ++

++ ++ ++ ++ ++ ++ ++ ++ ++ ++
++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmloutdata/hostdev-mdev-display.xml b/tests/qemuxml2xmloutdata/hostdev-mdev-display.xml +new file mode 100644 +index 0000000000..94c11b1199 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/hostdev-mdev-display.xml +@@ -0,0 +1,47 @@ ++ ++ QEMUGuest2 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++ ++
++ ++ ++
++ ++ ++ ++
++ ++ ++ ++ ++ ++ ++