diff --git a/SOURCES/libvirt-Handle-copying-bitmaps-to-larger-data-buffers.patch b/SOURCES/libvirt-Handle-copying-bitmaps-to-larger-data-buffers.patch
new file mode 100644
index 0000000..8a5f286
--- /dev/null
+++ b/SOURCES/libvirt-Handle-copying-bitmaps-to-larger-data-buffers.patch
@@ -0,0 +1,54 @@
+From 806c01fea005e3887ad74efa3ecbab8294c0ddca Mon Sep 17 00:00:00 2001
+Message-Id: <806c01fea005e3887ad74efa3ecbab8294c0ddca@dist-git>
+From: "Allen, John" <John.Allen@amd.com>
+Date: Fri, 26 Apr 2019 15:12:01 +0200
+Subject: [PATCH] Handle copying bitmaps to larger data buffers
+
+If a bitmap of a shorter length than the data buffer is passed to
+virBitmapToDataBuf, it will read off the end of the bitmap and copy junk
+into the returned buffer. Add a check to only copy the length of the
+bitmap to the buffer.
+
+The problem can be observed after setting a vcpu affinity using the vcpupin
+command on a system with a large number of cores:
+  # virsh vcpupin example_domain 0 0
+  # virsh vcpupin example_domain 0
+     VCPU   CPU Affinity
+    ---------------------------
+     0      0,192,197-198,202
+
+Signed-off-by: John Allen <john.allen@amd.com>
+(cherry picked from commit 51f9f80d350e633adf479c6a9b3c55f82ca9cbd4)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1703159
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <8c72d73f39288e0a38d72481e771d1df53d593a3.1556284274.git.phrdina@redhat.com>
+Reviewed-by: Andrea Bolognani <abologna@redhat.com>
+---
+ src/util/virbitmap.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
+index 0cc5292d8c..0bc0d068bb 100644
+--- a/src/util/virbitmap.c
++++ b/src/util/virbitmap.c
+@@ -832,11 +832,15 @@ virBitmapToDataBuf(virBitmapPtr bitmap,
+                    unsigned char *bytes,
+                    size_t len)
+ {
++    size_t nbytes = bitmap->map_len * (VIR_BITMAP_BITS_PER_UNIT / CHAR_BIT);
+     unsigned long *l;
+     size_t i, j;
+ 
+     memset(bytes, 0, len);
+ 
++    /* If bitmap and buffer differ in size, only fill to the smaller length */
++    len = MIN(len, nbytes);
++
+     /* htole64 is not provided by gnulib, so we do the conversion by hand */
+     l = bitmap->map;
+     for (i = j = 0; i < len; i++, j++) {
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-RHEL-conf-storage-Fix-a-memory-leak-in-virStoragePoolDefParseSource.patch b/SOURCES/libvirt-RHEL-conf-storage-Fix-a-memory-leak-in-virStoragePoolDefParseSource.patch
new file mode 100644
index 0000000..d4580a0
--- /dev/null
+++ b/SOURCES/libvirt-RHEL-conf-storage-Fix-a-memory-leak-in-virStoragePoolDefParseSource.patch
@@ -0,0 +1,41 @@
+From b5f39d1ad467ab712d41f693f998c6a9e3046b4f Mon Sep 17 00:00:00 2001
+Message-Id: <b5f39d1ad467ab712d41f693f998c6a9e3046b4f@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Wed, 10 Apr 2019 10:25:01 +0200
+Subject: [PATCH] RHEL: conf: storage: Fix a memory leak in
+ virStoragePoolDefParseSource
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+RHEL-only
+
+Commit acf8c561 backported an upstream memory leak in @ver variable that
+was later fixed upstream by using AUTOFREE which is not available
+downstream, so we need a downstream fix. The issue was reported by
+coverity.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <b6665d1280309b887aa237c71cba7b66cbe593f2.1554884692.git.eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/conf/storage_conf.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
+index 5a124a0a2f..e171425239 100644
+--- a/src/conf/storage_conf.c
++++ b/src/conf/storage_conf.c
+@@ -566,6 +566,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
+  cleanup:
+     ctxt->node = relnode;
+ 
++    VIR_FREE(ver);
+     VIR_FREE(port);
+     VIR_FREE(nodeset);
+     virStorageAuthDefFree(authdef);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-RHEL-cpu_map-Mark-arch-facilities-feature-as-non-migratable.patch b/SOURCES/libvirt-RHEL-cpu_map-Mark-arch-facilities-feature-as-non-migratable.patch
index ebdaa75..ddd3d48 100644
--- a/SOURCES/libvirt-RHEL-cpu_map-Mark-arch-facilities-feature-as-non-migratable.patch
+++ b/SOURCES/libvirt-RHEL-cpu_map-Mark-arch-facilities-feature-as-non-migratable.patch
@@ -1,5 +1,5 @@
-From a74e5a0ea4e4a938bf9694b3d6194b68e5cffab1 Mon Sep 17 00:00:00 2001
-Message-Id: <a74e5a0ea4e4a938bf9694b3d6194b68e5cffab1@dist-git>
+From ead15fe7a0cd60eb91ff7744b24af15b6c122239 Mon Sep 17 00:00:00 2001
+Message-Id: <ead15fe7a0cd60eb91ff7744b24af15b6c122239@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Wed, 9 Jan 2019 15:39:49 +0100
 Subject: [PATCH] RHEL: cpu_map: Mark arch-facilities feature as non-migratable
@@ -39,5 +39,5 @@ index f1f8048c14..9d53d4b43a 100644
      </feature>
      <feature name='ssbd'>
 -- 
-2.20.1
+2.21.0
 
diff --git a/SOURCES/libvirt-RHEL-qemu-Alter-qemuSetUnprivSGIO-hostdev-shareable-logic.patch b/SOURCES/libvirt-RHEL-qemu-Alter-qemuSetUnprivSGIO-hostdev-shareable-logic.patch
new file mode 100644
index 0000000..aa40c07
--- /dev/null
+++ b/SOURCES/libvirt-RHEL-qemu-Alter-qemuSetUnprivSGIO-hostdev-shareable-logic.patch
@@ -0,0 +1,52 @@
+From 5b24ffe0ec9bd2fb18d26e6261b84556097067b7 Mon Sep 17 00:00:00 2001
+Message-Id: <5b24ffe0ec9bd2fb18d26e6261b84556097067b7@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 5 Dec 2018 08:49:31 -0500
+Subject: [PATCH] RHEL: qemu: Alter qemuSetUnprivSGIO hostdev shareable logic
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1656360
+
+RHEL-only
+
+Fix the logic to handle the case where if the <shareable/> element
+was removed from the domain <hostdev.../>, then we have to reset the
+SGIO value back to 0. Without this patch the check for not shareable
+and return 0 would bypass resetting the value back to 0.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_conf.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
+index de0cbca083..5971f3eb64 100644
+--- a/src/qemu/qemu_conf.c
++++ b/src/qemu/qemu_conf.c
+@@ -1667,9 +1667,6 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
+     } else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
+         hostdev = dev->data.hostdev;
+ 
+-        if (!qemuIsSharedHostdev(hostdev))
+-            return 0;
+-
+         if (!(hostdev_path = qemuGetHostdevPath(hostdev)))
+             goto cleanup;
+ 
+@@ -1686,7 +1683,9 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
+         disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED) {
+         val = 1;
+     } else {
+-        if (hostdev->source.subsys.u.scsi.sgio ==
++        /* Only settable if <shareable/> was present for hostdev */
++        if (qemuIsSharedHostdev(hostdev) &&
++            hostdev->source.subsys.u.scsi.sgio ==
+             VIR_DOMAIN_DEVICE_SGIO_UNFILTERED)
+             val = 1;
+     }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-RHEL-qemu-Alter-val-usage-in-qemuSetUnprivSGIO.patch b/SOURCES/libvirt-RHEL-qemu-Alter-val-usage-in-qemuSetUnprivSGIO.patch
new file mode 100644
index 0000000..07082ba
--- /dev/null
+++ b/SOURCES/libvirt-RHEL-qemu-Alter-val-usage-in-qemuSetUnprivSGIO.patch
@@ -0,0 +1,59 @@
+From 6764c4c345ba0ce1f60adab7958441279c3f4913 Mon Sep 17 00:00:00 2001
+Message-Id: <6764c4c345ba0ce1f60adab7958441279c3f4913@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 5 Dec 2018 08:49:30 -0500
+Subject: [PATCH] RHEL: qemu: Alter @val usage in qemuSetUnprivSGIO
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1656360
+
+RHEL-only
+
+Rather than initializing to -1 and then setting to the result
+of a boolean check (either 0 or 1), let's just initialize @val
+to 0 and then only change to 1 if conditions are "right".
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_conf.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
+index 7d15af9c0b..de0cbca083 100644
+--- a/src/qemu/qemu_conf.c
++++ b/src/qemu/qemu_conf.c
+@@ -1650,7 +1650,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
+     char *sysfs_path = NULL;
+     char *hostdev_path = NULL;
+     const char *path = NULL;
+-    int val = -1;
++    int val = 0;
+     int ret = -1;
+ 
+     /* "sgio" is only valid for block disk; cdrom
+@@ -1682,11 +1682,14 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
+         goto cleanup;
+ 
+     /* By default, filter the SG_IO commands, i.e. set unpriv_sgio to 0.  */
+-    if (dev->type == VIR_DOMAIN_DEVICE_DISK)
+-        val = (disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED);
+-    else
+-        val = (hostdev->source.subsys.u.scsi.sgio ==
+-               VIR_DOMAIN_DEVICE_SGIO_UNFILTERED);
++    if (dev->type == VIR_DOMAIN_DEVICE_DISK &&
++        disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED) {
++        val = 1;
++    } else {
++        if (hostdev->source.subsys.u.scsi.sgio ==
++            VIR_DOMAIN_DEVICE_SGIO_UNFILTERED)
++            val = 1;
++    }
+ 
+     /* 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
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-access-Modify-the-VIR_ERR_ACCESS_DENIED-to-include-driverName.patch b/SOURCES/libvirt-access-Modify-the-VIR_ERR_ACCESS_DENIED-to-include-driverName.patch
new file mode 100644
index 0000000..089ebf9
--- /dev/null
+++ b/SOURCES/libvirt-access-Modify-the-VIR_ERR_ACCESS_DENIED-to-include-driverName.patch
@@ -0,0 +1,159 @@
+From c7d644f205a64175961218c82f764cdd10766bff Mon Sep 17 00:00:00 2001
+Message-Id: <c7d644f205a64175961218c82f764cdd10766bff@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 07:22:20 -0400
+Subject: [PATCH] access: Modify the VIR_ERR_ACCESS_DENIED to include
+ driverName
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1631606
+
+Changes made to manage and utilize a secondary connection
+driver to APIs outside the scope of the primary connection
+driver have resulted in some confusion processing polkit rules
+since the simple "access denied" error message doesn't provide
+enough of a clue when combined with the "authentication failed:
+access denied by policy" as to which connection driver refused
+or failed the ACL check.
+
+In order to provide some context, let's modify the existing
+"access denied" error returned from the various vir*EnsureACL
+API's to provide the connection driver name that is causing
+the failure. This should provide the context for writing the
+polkit rules that would allow access via the driver, but yet
+still adhere to the virAccessManagerSanitizeError commentary
+regarding not telling the user why access was denied.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 605496be609e153526fcdd3e98df8cf5244bc8fa)
+Message-Id: <20190403112220.23881-1-jferlan@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ src/access/viraccessmanager.c | 26 ++++++++++++++------------
+ src/rpc/gendispatch.pl        |  3 ++-
+ 2 files changed, 16 insertions(+), 13 deletions(-)
+
+diff --git a/src/access/viraccessmanager.c b/src/access/viraccessmanager.c
+index e7b5bf38da..f5d62604cf 100644
+--- a/src/access/viraccessmanager.c
++++ b/src/access/viraccessmanager.c
+@@ -196,11 +196,13 @@ static void virAccessManagerDispose(void *object)
+  * should the admin need to debug things
+  */
+ static int
+-virAccessManagerSanitizeError(int ret)
++virAccessManagerSanitizeError(int ret,
++                              const char *driverName)
+ {
+     if (ret < 0) {
+         virResetLastError();
+-        virAccessError(VIR_ERR_ACCESS_DENIED, NULL);
++        virAccessError(VIR_ERR_ACCESS_DENIED,
++                       _("'%s' denied access"), driverName);
+     }
+ 
+     return ret;
+@@ -217,7 +219,7 @@ int virAccessManagerCheckConnect(virAccessManagerPtr manager,
+     if (manager->drv->checkConnect)
+         ret = manager->drv->checkConnect(manager, driverName, perm);
+ 
+-    return virAccessManagerSanitizeError(ret);
++    return virAccessManagerSanitizeError(ret, driverName);
+ }
+ 
+ 
+@@ -233,7 +235,7 @@ int virAccessManagerCheckDomain(virAccessManagerPtr manager,
+     if (manager->drv->checkDomain)
+         ret = manager->drv->checkDomain(manager, driverName, domain, perm);
+ 
+-    return virAccessManagerSanitizeError(ret);
++    return virAccessManagerSanitizeError(ret, driverName);
+ }
+ 
+ int virAccessManagerCheckInterface(virAccessManagerPtr manager,
+@@ -248,7 +250,7 @@ int virAccessManagerCheckInterface(virAccessManagerPtr manager,
+     if (manager->drv->checkInterface)
+         ret = manager->drv->checkInterface(manager, driverName, iface, perm);
+ 
+-    return virAccessManagerSanitizeError(ret);
++    return virAccessManagerSanitizeError(ret, driverName);
+ }
+ 
+ int virAccessManagerCheckNetwork(virAccessManagerPtr manager,
+@@ -263,7 +265,7 @@ int virAccessManagerCheckNetwork(virAccessManagerPtr manager,
+     if (manager->drv->checkNetwork)
+         ret = manager->drv->checkNetwork(manager, driverName, network, perm);
+ 
+-    return virAccessManagerSanitizeError(ret);
++    return virAccessManagerSanitizeError(ret, driverName);
+ }
+ 
+ int virAccessManagerCheckNodeDevice(virAccessManagerPtr manager,
+@@ -278,7 +280,7 @@ int virAccessManagerCheckNodeDevice(virAccessManagerPtr manager,
+     if (manager->drv->checkNodeDevice)
+         ret = manager->drv->checkNodeDevice(manager, driverName, nodedev, perm);
+ 
+-    return virAccessManagerSanitizeError(ret);
++    return virAccessManagerSanitizeError(ret, driverName);
+ }
+ 
+ int virAccessManagerCheckNWFilter(virAccessManagerPtr manager,
+@@ -293,7 +295,7 @@ int virAccessManagerCheckNWFilter(virAccessManagerPtr manager,
+     if (manager->drv->checkNWFilter)
+         ret = manager->drv->checkNWFilter(manager, driverName, nwfilter, perm);
+ 
+-    return virAccessManagerSanitizeError(ret);
++    return virAccessManagerSanitizeError(ret, driverName);
+ }
+ 
+ int virAccessManagerCheckNWFilterBinding(virAccessManagerPtr manager,
+@@ -308,7 +310,7 @@ int virAccessManagerCheckNWFilterBinding(virAccessManagerPtr manager,
+     if (manager->drv->checkNWFilterBinding)
+         ret = manager->drv->checkNWFilterBinding(manager, driverName, binding, perm);
+ 
+-    return virAccessManagerSanitizeError(ret);
++    return virAccessManagerSanitizeError(ret, driverName);
+ }
+ 
+ int virAccessManagerCheckSecret(virAccessManagerPtr manager,
+@@ -323,7 +325,7 @@ int virAccessManagerCheckSecret(virAccessManagerPtr manager,
+     if (manager->drv->checkSecret)
+         ret = manager->drv->checkSecret(manager, driverName, secret, perm);
+ 
+-    return virAccessManagerSanitizeError(ret);
++    return virAccessManagerSanitizeError(ret, driverName);
+ }
+ 
+ int virAccessManagerCheckStoragePool(virAccessManagerPtr manager,
+@@ -338,7 +340,7 @@ int virAccessManagerCheckStoragePool(virAccessManagerPtr manager,
+     if (manager->drv->checkStoragePool)
+         ret = manager->drv->checkStoragePool(manager, driverName, pool, perm);
+ 
+-    return virAccessManagerSanitizeError(ret);
++    return virAccessManagerSanitizeError(ret, driverName);
+ }
+ 
+ int virAccessManagerCheckStorageVol(virAccessManagerPtr manager,
+@@ -354,5 +356,5 @@ int virAccessManagerCheckStorageVol(virAccessManagerPtr manager,
+     if (manager->drv->checkStorageVol)
+         ret = manager->drv->checkStorageVol(manager, driverName, pool, vol, perm);
+ 
+-    return virAccessManagerSanitizeError(ret);
++    return virAccessManagerSanitizeError(ret, driverName);
+ }
+diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
+index 0c4648c0fb..a8b9f5aeca 100755
+--- a/src/rpc/gendispatch.pl
++++ b/src/rpc/gendispatch.pl
+@@ -2199,7 +2199,8 @@ elsif ($mode eq "client") {
+                     print "        virObjectUnref(mgr);\n";
+                     if ($action eq "Ensure") {
+                         print "        if (rv == 0)\n";
+-                        print "            virReportError(VIR_ERR_ACCESS_DENIED, NULL);\n";
++                        print "            virReportError(VIR_ERR_ACCESS_DENIED,\n";
++                        print"                            _(\"'%s' denied access\"), conn->driver->name);\n";
+                         print "        return $fail;\n";
+                     } else {
+                         print "        virResetLastError();\n";
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-admin-reject-clients-unless-their-UID-matches-the-current-UID.patch b/SOURCES/libvirt-admin-reject-clients-unless-their-UID-matches-the-current-UID.patch
index fe99250..8ab6861 100644
--- a/SOURCES/libvirt-admin-reject-clients-unless-their-UID-matches-the-current-UID.patch
+++ b/SOURCES/libvirt-admin-reject-clients-unless-their-UID-matches-the-current-UID.patch
@@ -1,5 +1,5 @@
-From dba153a54183187d16cb983d269516930c555ad8 Mon Sep 17 00:00:00 2001
-Message-Id: <dba153a54183187d16cb983d269516930c555ad8@dist-git>
+From 0abfa9e0b0b396420a165ac90e69952b23b5ca3e Mon Sep 17 00:00:00 2001
+Message-Id: <0abfa9e0b0b396420a165ac90e69952b23b5ca3e@dist-git>
 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
 Date: Wed, 15 May 2019 21:40:56 +0100
 Subject: [PATCH] admin: reject clients unless their UID matches the current
@@ -16,7 +16,7 @@ Fixes CVE-2019-10132
 
 Reviewed-by: Ján Tomko <jtomko@redhat.com>
 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
-(cherry picked from a private commit)
+(cherry picked from commit 96f41cd765c9e525fe28ee5abbfbf4a79b3720c7)
 Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
 Message-Id: <20190515204058.28077-2-berrange@redhat.com>
 ---
diff --git a/SOURCES/libvirt-api-disallow-virConnect-HypervisorCPU-on-read-only-connections.patch b/SOURCES/libvirt-api-disallow-virConnect-HypervisorCPU-on-read-only-connections.patch
index 97f8622..bf8786e 100644
--- a/SOURCES/libvirt-api-disallow-virConnect-HypervisorCPU-on-read-only-connections.patch
+++ b/SOURCES/libvirt-api-disallow-virConnect-HypervisorCPU-on-read-only-connections.patch
@@ -1,5 +1,5 @@
-From 66884f16592038ec091d4bb2ab1d492062a71c74 Mon Sep 17 00:00:00 2001
-Message-Id: <66884f16592038ec091d4bb2ab1d492062a71c74@dist-git>
+From f97144b76b3452e69c14834d1ecc69dbf802ac12 Mon Sep 17 00:00:00 2001
+Message-Id: <f97144b76b3452e69c14834d1ecc69dbf802ac12@dist-git>
 From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
 Date: Tue, 18 Jun 2019 13:30:02 +0200
 Subject: [PATCH] api: disallow virConnect*HypervisorCPU on read-only
diff --git a/SOURCES/libvirt-api-disallow-virConnectGetDomainCapabilities-on-read-only-connections.patch b/SOURCES/libvirt-api-disallow-virConnectGetDomainCapabilities-on-read-only-connections.patch
index 7028fcc..672dd0f 100644
--- a/SOURCES/libvirt-api-disallow-virConnectGetDomainCapabilities-on-read-only-connections.patch
+++ b/SOURCES/libvirt-api-disallow-virConnectGetDomainCapabilities-on-read-only-connections.patch
@@ -1,5 +1,5 @@
-From 804925f7bdd8cb7e80a0a76ea3323c55d89193ba Mon Sep 17 00:00:00 2001
-Message-Id: <804925f7bdd8cb7e80a0a76ea3323c55d89193ba@dist-git>
+From fae17c4141d504073e9cb16b49d2af9e73272ac2 Mon Sep 17 00:00:00 2001
+Message-Id: <fae17c4141d504073e9cb16b49d2af9e73272ac2@dist-git>
 From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
 Date: Tue, 18 Jun 2019 13:30:01 +0200
 Subject: [PATCH] api: disallow virConnectGetDomainCapabilities on read-only
@@ -22,10 +22,10 @@ Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
  1 file changed, 1 insertion(+)
 
 diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
-index 3855dfe0dd..a1c913bd86 100644
+index b936dd8eb7..ab2c44cfe1 100644
 --- a/src/libvirt-domain.c
 +++ b/src/libvirt-domain.c
-@@ -11279,6 +11279,7 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
+@@ -11287,6 +11287,7 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
      virResetLastError();
  
      virCheckConnectReturn(conn, NULL);
diff --git a/SOURCES/libvirt-api-disallow-virDomainManagedSaveDefineXML-on-read-only-connections.patch b/SOURCES/libvirt-api-disallow-virDomainManagedSaveDefineXML-on-read-only-connections.patch
index 170a379..6cd6db1 100644
--- a/SOURCES/libvirt-api-disallow-virDomainManagedSaveDefineXML-on-read-only-connections.patch
+++ b/SOURCES/libvirt-api-disallow-virDomainManagedSaveDefineXML-on-read-only-connections.patch
@@ -1,5 +1,5 @@
-From 0f8966e0ce1887610b5eb9d955780662fc854094 Mon Sep 17 00:00:00 2001
-Message-Id: <0f8966e0ce1887610b5eb9d955780662fc854094@dist-git>
+From 20a2fc74e717ca21e1a183b4e210872eb0c56be9 Mon Sep 17 00:00:00 2001
+Message-Id: <20a2fc74e717ca21e1a183b4e210872eb0c56be9@dist-git>
 From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
 Date: Tue, 18 Jun 2019 13:30:00 +0200
 Subject: [PATCH] api: disallow virDomainManagedSaveDefineXML on read-only
@@ -24,10 +24,10 @@ Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
  1 file changed, 1 insertion(+)
 
 diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
-index 0ba85b9360..3855dfe0dd 100644
+index 697326ae9a..b936dd8eb7 100644
 --- a/src/libvirt-domain.c
 +++ b/src/libvirt-domain.c
-@@ -9487,6 +9487,7 @@ virDomainManagedSaveDefineXML(virDomainPtr domain, const char *dxml,
+@@ -9495,6 +9495,7 @@ virDomainManagedSaveDefineXML(virDomainPtr domain, const char *dxml,
  
      virCheckDomainReturn(domain, -1);
      conn = domain->conn;
diff --git a/SOURCES/libvirt-api-disallow-virDomainSaveImageGetXMLDesc-on-read-only-connections.patch b/SOURCES/libvirt-api-disallow-virDomainSaveImageGetXMLDesc-on-read-only-connections.patch
index 83a3d5a..7653e1f 100644
--- a/SOURCES/libvirt-api-disallow-virDomainSaveImageGetXMLDesc-on-read-only-connections.patch
+++ b/SOURCES/libvirt-api-disallow-virDomainSaveImageGetXMLDesc-on-read-only-connections.patch
@@ -1,5 +1,5 @@
-From 799c1b70cdcfffd313315e9ab31d96bbb836aed6 Mon Sep 17 00:00:00 2001
-Message-Id: <799c1b70cdcfffd313315e9ab31d96bbb836aed6@dist-git>
+From 2e532b74b3100a06e0f1ba21f657883fe5aafcc5 Mon Sep 17 00:00:00 2001
+Message-Id: <2e532b74b3100a06e0f1ba21f657883fe5aafcc5@dist-git>
 From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
 Date: Tue, 18 Jun 2019 13:29:59 +0200
 Subject: [PATCH] api: disallow virDomainSaveImageGetXMLDesc on read-only
@@ -38,7 +38,7 @@ Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
  3 files changed, 4 insertions(+), 12 deletions(-)
 
 diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
-index ad0ded9ee3..0ba85b9360 100644
+index 568023176b..697326ae9a 100644
 --- a/src/libvirt-domain.c
 +++ b/src/libvirt-domain.c
 @@ -1073,9 +1073,7 @@ virDomainRestoreFlags(virConnectPtr conn, const char *from, const char *dxml,
@@ -67,7 +67,7 @@ index ad0ded9ee3..0ba85b9360 100644
      if (conn->driver->domainSaveImageGetXMLDesc) {
          char *ret;
 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
-index 21d836a540..fcccdb57c3 100644
+index 704ba24215..25818f5d8c 100644
 --- a/src/qemu/qemu_driver.c
 +++ b/src/qemu/qemu_driver.c
 @@ -6784,7 +6784,7 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path,
diff --git a/SOURCES/libvirt-conf-Add-memory-bandwidth-allocation-capability-of-host.patch b/SOURCES/libvirt-conf-Add-memory-bandwidth-allocation-capability-of-host.patch
new file mode 100644
index 0000000..bf92ee0
--- /dev/null
+++ b/SOURCES/libvirt-conf-Add-memory-bandwidth-allocation-capability-of-host.patch
@@ -0,0 +1,397 @@
+From a7292e2be3fef0c14d5393120471b1dc5d7a5adb Mon Sep 17 00:00:00 2001
+Message-Id: <a7292e2be3fef0c14d5393120471b1dc5d7a5adb@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:33:00 +0200
+Subject: [PATCH] conf: Add memory bandwidth allocation capability of host
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add new XML section to report host's memory bandwidth allocation
+capability. The format as below example:
+
+ <host>
+ .....
+   <memory_bandwidth>
+     <node id='0' cpus='0-19'>
+       <control granularity='10' min ='10' maxAllocs='8'/>
+     </node>
+   </memory_bandwidth>
+</host>
+
+granularity   ---- granularity of memory bandwidth, unit percentage.
+min           ---- minimum memory bandwidth allowed, unit percentage.
+maxAllocs     ---- maximum memory bandwidth allocation group supported.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 7995fecc25c6bc8d0ebb243ea2c8765b076c8974)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <eda433c39cf6e5462b3076fa3049ac5a042af0c1.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ docs/schemas/capability.rng                   |  33 ++++++
+ src/conf/capabilities.c                       | 107 ++++++++++++++++++
+ src/conf/capabilities.h                       |  11 ++
+ src/util/virresctrl.c                         |  20 ++++
+ src/util/virresctrl.h                         |  15 +++
+ .../resctrl/info/MB/bandwidth_gran            |   1 +
+ .../resctrl/info/MB/min_bandwidth             |   1 +
+ .../linux-resctrl/resctrl/info/MB/num_closids |   1 +
+ .../vircaps-x86_64-resctrl.xml                |   8 ++
+ tests/virresctrldata/resctrl.schemata         |   1 +
+ 10 files changed, 198 insertions(+)
+ create mode 100644 tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/bandwidth_gran
+ create mode 100644 tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/min_bandwidth
+ create mode 100644 tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/num_closids
+
+diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng
+index 52164d5ecb..d61515ccbe 100644
+--- a/docs/schemas/capability.rng
++++ b/docs/schemas/capability.rng
+@@ -51,6 +51,9 @@
+       <optional>
+         <ref name='cache'/>
+       </optional>
++      <optional>
++        <ref name='memory_bandwidth'/>
++      </optional>
+       <zeroOrMore>
+         <ref name='secmodel'/>
+       </zeroOrMore>
+@@ -326,6 +329,36 @@
+     </attribute>
+   </define>
+ 
++  <define name='memory_bandwidth'>
++    <element name='memory_bandwidth'>
++      <oneOrMore>
++        <element name='node'>
++          <attribute name='id'>
++            <ref name='unsignedInt'/>
++          </attribute>
++          <attribute name='cpus'>
++            <ref name='cpuset'/>
++          </attribute>
++          <zeroOrMore>
++            <element name='control'>
++              <attribute name='granularity'>
++                <ref name='unsignedInt'/>
++              </attribute>
++            <optional>
++              <attribute name='min'>
++                <ref name='unsignedInt'/>
++            </attribute>
++            </optional>
++              <attribute name='maxAllocs'>
++                <ref name='unsignedInt'/>
++              </attribute>
++            </element>
++          </zeroOrMore>
++        </element>
++      </oneOrMore>
++    </element>
++  </define>
++
+   <define name='guestcaps'>
+     <element name='guest'>
+       <ref name='ostype'/>
+diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
+index 7a810efa66..3d893447cb 100644
+--- a/src/conf/capabilities.c
++++ b/src/conf/capabilities.c
+@@ -197,6 +197,16 @@ virCapabilitiesFreeNUMAInfo(virCapsPtr caps)
+     caps->host.nnumaCell = 0;
+ }
+ 
++static void
++virCapsHostMemBWNodeFree(virCapsHostMemBWNodePtr ptr)
++{
++    if (!ptr)
++        return;
++
++    virBitmapFree(ptr->cpus);
++    VIR_FREE(ptr);
++}
++
+ static void
+ virCapabilitiesClearSecModel(virCapsHostSecModelPtr secmodel)
+ {
+@@ -239,6 +249,10 @@ virCapsDispose(void *object)
+         virCapsHostCacheBankFree(caps->host.caches[i]);
+     VIR_FREE(caps->host.caches);
+ 
++    for (i = 0; i < caps->host.nnodes; i++)
++        virCapsHostMemBWNodeFree(caps->host.nodes[i]);
++    VIR_FREE(caps->host.nodes);
++
+     VIR_FREE(caps->host.netprefix);
+     VIR_FREE(caps->host.pagesSize);
+     virCPUDefFree(caps->host.cpu);
+@@ -957,6 +971,58 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
+     return 0;
+ }
+ 
++static int
++virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf,
++                                     size_t nnodes,
++                                     virCapsHostMemBWNodePtr *nodes)
++{
++    size_t i = 0;
++    virBuffer controlBuf = VIR_BUFFER_INITIALIZER;
++
++    if (!nnodes)
++        return 0;
++
++    virBufferAddLit(buf, "<memory_bandwidth>\n");
++    virBufferAdjustIndent(buf, 2);
++
++    for (i = 0; i < nnodes; i++) {
++        virCapsHostMemBWNodePtr node = nodes[i];
++        virResctrlInfoMemBWPerNodePtr control = &node->control;
++        char *cpus_str = virBitmapFormat(node->cpus);
++
++        if (!cpus_str)
++            return -1;
++
++        virBufferAsprintf(buf,
++                          "<node id='%u' cpus='%s'",
++                          node->id, cpus_str);
++        VIR_FREE(cpus_str);
++
++        virBufferSetChildIndent(&controlBuf, buf);
++        virBufferAsprintf(&controlBuf,
++                          "<control granularity='%u' min ='%u' "
++                          "maxAllocs='%u'/>\n",
++                          control->granularity, control->min,
++                          control->max_allocation);
++
++        if (virBufferCheckError(&controlBuf) < 0)
++            return -1;
++
++        if (virBufferUse(&controlBuf)) {
++            virBufferAddLit(buf, ">\n");
++            virBufferAddBuffer(buf, &controlBuf);
++            virBufferAddLit(buf, "</node>\n");
++        } else {
++            virBufferAddLit(buf, "/>\n");
++        }
++    }
++
++    virBufferAdjustIndent(buf, -2);
++    virBufferAddLit(buf, "</memory_bandwidth>\n");
++
++    return 0;
++}
++
+ /**
+  * virCapabilitiesFormatXML:
+  * @caps: capabilities to format
+@@ -1060,6 +1126,10 @@ virCapabilitiesFormatXML(virCapsPtr caps)
+                                     caps->host.caches) < 0)
+         goto error;
+ 
++    if (virCapabilitiesFormatMemoryBandwidth(&buf, caps->host.nnodes,
++                                             caps->host.nodes) < 0)
++        goto error;
++
+     for (i = 0; i < caps->host.nsecModels; i++) {
+         virBufferAddLit(&buf, "<secmodel>\n");
+         virBufferAdjustIndent(&buf, 2);
+@@ -1602,6 +1672,40 @@ virCapabilitiesInitResctrl(virCapsPtr caps)
+ }
+ 
+ 
++static int
++virCapabilitiesInitResctrlMemory(virCapsPtr caps)
++{
++    virCapsHostMemBWNodePtr node = NULL;
++    size_t i = 0;
++    int ret = -1;
++
++    for (i = 0; i < caps->host.ncaches; i++) {
++        virCapsHostCacheBankPtr bank = caps->host.caches[i];
++        if (VIR_ALLOC(node) < 0)
++            goto cleanup;
++
++        if (virResctrlInfoGetMemoryBandwidth(caps->host.resctrl,
++                                             bank->level, &node->control) > 0) {
++            node->id = bank->id;
++            if (!(node->cpus = virBitmapNewCopy(bank->cpus)))
++                goto cleanup;
++
++            if (VIR_APPEND_ELEMENT(caps->host.nodes,
++                                   caps->host.nnodes, node) < 0) {
++                goto cleanup;
++            }
++        }
++        virCapsHostMemBWNodeFree(node);
++        node = NULL;
++    }
++
++    ret = 0;
++ cleanup:
++    virCapsHostMemBWNodeFree(node);
++    return ret;
++}
++
++
+ int
+ virCapabilitiesInitCaches(virCapsPtr caps)
+ {
+@@ -1731,6 +1835,9 @@ virCapabilitiesInitCaches(virCapsPtr caps)
+     qsort(caps->host.caches, caps->host.ncaches,
+           sizeof(*caps->host.caches), virCapsHostCacheBankSorter);
+ 
++    if (virCapabilitiesInitResctrlMemory(caps) < 0)
++        goto cleanup;
++
+     ret = 0;
+  cleanup:
+     VIR_FREE(type);
+diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
+index fe1b9ea455..046e275ac6 100644
+--- a/src/conf/capabilities.h
++++ b/src/conf/capabilities.h
+@@ -151,6 +151,14 @@ struct _virCapsHostCacheBank {
+     virResctrlInfoPerCachePtr *controls;
+ };
+ 
++typedef struct _virCapsHostMemBWNode virCapsHostMemBWNode;
++typedef virCapsHostMemBWNode *virCapsHostMemBWNodePtr;
++struct _virCapsHostMemBWNode {
++    unsigned int id;
++    virBitmapPtr cpus;  /* All CPUs that belong to this node*/
++    virResctrlInfoMemBWPerNode control;
++};
++
+ typedef struct _virCapsHost virCapsHost;
+ typedef virCapsHost *virCapsHostPtr;
+ struct _virCapsHost {
+@@ -175,6 +183,9 @@ struct _virCapsHost {
+     size_t ncaches;
+     virCapsHostCacheBankPtr *caches;
+ 
++    size_t nnodes;
++    virCapsHostMemBWNodePtr *nodes;
++
+     size_t nsecModels;
+     virCapsHostSecModelPtr secModels;
+ 
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index adf36a7c0a..4b5442f879 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -629,6 +629,26 @@ virResctrlInfoIsEmpty(virResctrlInfoPtr resctrl)
+ }
+ 
+ 
++int
++virResctrlInfoGetMemoryBandwidth(virResctrlInfoPtr resctrl,
++                                 unsigned int level,
++                                 virResctrlInfoMemBWPerNodePtr control)
++{
++    virResctrlInfoMemBWPtr membw_info = resctrl->membw_info;
++
++    if (!membw_info)
++        return 0;
++
++    if (membw_info->last_level_cache != level)
++        return 0;
++
++    control->granularity = membw_info->bandwidth_granularity;
++    control->min = membw_info->min_bandwidth;
++    control->max_allocation = membw_info->max_allocation;
++    return 1;
++}
++
++
+ int
+ virResctrlInfoGetCache(virResctrlInfoPtr resctrl,
+                        unsigned int level,
+diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h
+index 8d62517aa1..cfd56ddd06 100644
+--- a/src/util/virresctrl.h
++++ b/src/util/virresctrl.h
+@@ -50,6 +50,17 @@ struct _virResctrlInfoPerCache {
+     unsigned int max_allocation;
+ };
+ 
++typedef struct _virResctrlInfoMemBWPerNode virResctrlInfoMemBWPerNode;
++typedef virResctrlInfoMemBWPerNode *virResctrlInfoMemBWPerNodePtr;
++struct _virResctrlInfoMemBWPerNode {
++    /* Smallest possible increase of the allocation bandwidth in percentage */
++    unsigned int granularity;
++    /* Minimal allocatable bandwidth in percentage */
++    unsigned int min;
++    /* Maximum number of simultaneous allocations */
++    unsigned int max_allocation;
++};
++
+ typedef struct _virResctrlInfo virResctrlInfo;
+ typedef virResctrlInfo *virResctrlInfoPtr;
+ 
+@@ -63,6 +74,10 @@ virResctrlInfoGetCache(virResctrlInfoPtr resctrl,
+                        size_t *ncontrols,
+                        virResctrlInfoPerCachePtr **controls);
+ 
++int
++virResctrlInfoGetMemoryBandwidth(virResctrlInfoPtr resctrl,
++                                 unsigned int level,
++                                 virResctrlInfoMemBWPerNodePtr control);
+ /* Alloc-related things */
+ typedef struct _virResctrlAlloc virResctrlAlloc;
+ typedef virResctrlAlloc *virResctrlAllocPtr;
+diff --git a/tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/bandwidth_gran b/tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/bandwidth_gran
+new file mode 100644
+index 0000000000..f599e28b8a
+--- /dev/null
++++ b/tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/bandwidth_gran
+@@ -0,0 +1 @@
++10
+diff --git a/tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/min_bandwidth b/tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/min_bandwidth
+new file mode 100644
+index 0000000000..f599e28b8a
+--- /dev/null
++++ b/tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/min_bandwidth
+@@ -0,0 +1 @@
++10
+diff --git a/tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/num_closids b/tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/num_closids
+new file mode 100644
+index 0000000000..b8626c4cff
+--- /dev/null
++++ b/tests/vircaps2xmldata/linux-resctrl/resctrl/info/MB/num_closids
+@@ -0,0 +1 @@
++4
+diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
+index 4840614e86..9b00cf0995 100644
+--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
++++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
+@@ -49,6 +49,14 @@
+         <control granularity='768' min='1536' unit='KiB' type='both' maxAllocs='4'/>
+       </bank>
+     </cache>
++    <memory_bandwidth>
++      <node id='0' cpus='0-5'>
++        <control granularity='10' min ='10' maxAllocs='4'/>
++      </node>
++      <node id='1' cpus='6-11'>
++        <control granularity='10' min ='10' maxAllocs='4'/>
++      </node>
++    </memory_bandwidth>
+   </host>
+ 
+ </capabilities>
+diff --git a/tests/virresctrldata/resctrl.schemata b/tests/virresctrldata/resctrl.schemata
+index fa980e58c9..2578822b70 100644
+--- a/tests/virresctrldata/resctrl.schemata
++++ b/tests/virresctrldata/resctrl.schemata
+@@ -1 +1,2 @@
+ L3:0=000ff;1=000f0
++MB:0=100;1=100
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Add-optional-NFS-Source-Pool-protocol-ver-n-option.patch b/SOURCES/libvirt-conf-Add-optional-NFS-Source-Pool-protocol-ver-n-option.patch
new file mode 100644
index 0000000..1be6b48
--- /dev/null
+++ b/SOURCES/libvirt-conf-Add-optional-NFS-Source-Pool-protocol-ver-n-option.patch
@@ -0,0 +1,213 @@
+From acf8c5619852146eed84123c7f432db925781511 Mon Sep 17 00:00:00 2001
+Message-Id: <acf8c5619852146eed84123c7f432db925781511@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 10:58:19 -0400
+Subject: [PATCH] conf: Add optional NFS Source Pool <protocol ver='n'/> option
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+Add an optional way to define which NFS Server version will be
+used to content the target NFS server.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit 801f8cfb37f12007878df53332fdc03245a9d40d)
+Message-Id: <20190403145819.4656-1-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ docs/formatstorage.html.in                    | 16 ++++++++++++++
+ docs/schemas/storagepool.rng                  |  7 ++++++
+ src/conf/storage_conf.c                       | 22 +++++++++++++++++++
+ src/conf/storage_conf.h                       |  3 +++
+ .../pool-netfs-protocol-ver.xml               | 21 ++++++++++++++++++
+ .../pool-netfs-protocol-ver.xml               | 21 ++++++++++++++++++
+ tests/storagepoolxml2xmltest.c                |  1 +
+ 7 files changed, 91 insertions(+)
+ create mode 100644 tests/storagepoolxml2xmlin/pool-netfs-protocol-ver.xml
+ create mode 100644 tests/storagepoolxml2xmlout/pool-netfs-protocol-ver.xml
+
+diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in
+index b6bf3edbd2..b1b76a1dda 100644
+--- a/docs/formatstorage.html.in
++++ b/docs/formatstorage.html.in
+@@ -121,6 +121,16 @@
+ &lt;/source&gt;
+ ...</pre>
+ 
++    <pre>
++...
++  &lt;source&gt;
++    &lt;host name='localhost'/&gt;
++    &lt;dir path='/var/lib/libvirt/images'/&gt;
++    &lt;format type='nfs'/&gt;
++    &lt;protocol ver='3'/&gt;
++  &lt;/source&gt;
++...</pre>
++
+     <dl>
+       <dt><code>device</code></dt>
+       <dd>Provides the source for pools backed by physical devices
+@@ -386,6 +396,12 @@
+         LVM metadata type. All drivers are required to have a default
+         value for this, so it is optional. <span class="since">Since 0.4.1</span></dd>
+ 
++      <dt><code>protocol</code></dt>
++      <dd>For a <code>netfs</code> Storage Pool provide a mechanism to
++        define which NFS protocol version number will be used to contact
++        the server's NFS service. The attribute <code>ver</code> accepts
++        an unsigned integer as the version number to use.
++        <span class="since">Since 5.1.0</span></dd>
+       <dt><code>vendor</code></dt>
+       <dd>Provides optional information about the vendor of the
+         storage device. This contains a single
+diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng
+index 52b2044bef..0cb8beb926 100644
+--- a/docs/schemas/storagepool.rng
++++ b/docs/schemas/storagepool.rng
+@@ -520,6 +520,13 @@
+             <ref name='sourceinfohost'/>
+             <ref name='sourceinfodir'/>
+             <ref name='sourcefmtnetfs'/>
++            <optional>
++              <element name='protocol'>
++                <attribute name='ver'>
++                  <ref name='unsignedInt'/>
++                </attribute>
++              </element>
++            </optional>
+             <optional>
+               <ref name='sourceinfovendor'/>
+             </optional>
+diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
+index 5036ab9ef8..5a124a0a2f 100644
+--- a/src/conf/storage_conf.c
++++ b/src/conf/storage_conf.c
+@@ -415,6 +415,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
+     virStorageAuthDefPtr authdef = NULL;
+     char *name = NULL;
+     char *port = NULL;
++    char *ver = NULL;
+     int n;
+ 
+     relnode = ctxt->node;
+@@ -540,6 +541,24 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
+         authdef = NULL;
+     }
+ 
++    /* Option protocol version string (NFSvN) */
++    if ((ver = virXPathString("string(./protocol/@ver)", ctxt))) {
++        if ((source->format != VIR_STORAGE_POOL_NETFS_NFS) &&
++            (source->format != VIR_STORAGE_POOL_NETFS_AUTO)) {
++            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
++                           _("storage pool protocol ver unsupported for "
++                             "pool type '%s'"),
++                           virStoragePoolFormatFileSystemNetTypeToString(source->format));
++            goto cleanup;
++        }
++        if (virStrToLong_uip(ver, NULL, 0, &source->protocolVer) < 0) {
++            virReportError(VIR_ERR_XML_ERROR,
++                           _("storage pool protocol ver '%s' is malformaed"),
++                           ver);
++            goto cleanup;
++        }
++    }
++
+     source->vendor = virXPathString("string(./vendor/@name)", ctxt);
+     source->product = virXPathString("string(./product/@name)", ctxt);
+ 
+@@ -956,6 +975,9 @@ virStoragePoolSourceFormat(virBufferPtr buf,
+     if (src->auth)
+         virStorageAuthDefFormat(buf, src->auth);
+ 
++    if (src->protocolVer)
++        virBufferAsprintf(buf, "<protocol ver='%u'/>\n", src->protocolVer);
++
+     virBufferEscapeString(buf, "<vendor name='%s'/>\n", src->vendor);
+     virBufferEscapeString(buf, "<product name='%s'/>\n", src->product);
+ 
+diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h
+index 15dfd8becf..3b637e2258 100644
+--- a/src/conf/storage_conf.h
++++ b/src/conf/storage_conf.h
+@@ -203,6 +203,9 @@ struct _virStoragePoolSource {
+      * or lvm version, etc.
+      */
+     int format;
++
++    /* Protocol version value for netfs */
++    unsigned int protocolVer;
+ };
+ 
+ typedef struct _virStoragePoolTarget virStoragePoolTarget;
+diff --git a/tests/storagepoolxml2xmlin/pool-netfs-protocol-ver.xml b/tests/storagepoolxml2xmlin/pool-netfs-protocol-ver.xml
+new file mode 100644
+index 0000000000..40f3f94e41
+--- /dev/null
++++ b/tests/storagepoolxml2xmlin/pool-netfs-protocol-ver.xml
+@@ -0,0 +1,21 @@
++<pool type='netfs'>
++  <name>nfsimages</name>
++  <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
++  <capacity>0</capacity>
++  <allocation>0</allocation>
++  <available>0</available>
++  <source>
++    <host name='localhost'/>
++    <dir path='/var/lib/libvirt/images'/>
++    <format type='nfs'/>
++    <protocol ver='3'/>
++  </source>
++  <target>
++    <path>/mnt</path>
++    <permissions>
++      <mode>0700</mode>
++      <owner>0</owner>
++      <group>0</group>
++    </permissions>
++  </target>
++</pool>
+diff --git a/tests/storagepoolxml2xmlout/pool-netfs-protocol-ver.xml b/tests/storagepoolxml2xmlout/pool-netfs-protocol-ver.xml
+new file mode 100644
+index 0000000000..5fcad1305b
+--- /dev/null
++++ b/tests/storagepoolxml2xmlout/pool-netfs-protocol-ver.xml
+@@ -0,0 +1,21 @@
++<pool type='netfs'>
++  <name>nfsimages</name>
++  <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
++  <capacity unit='bytes'>0</capacity>
++  <allocation unit='bytes'>0</allocation>
++  <available unit='bytes'>0</available>
++  <source>
++    <host name='localhost'/>
++    <dir path='/var/lib/libvirt/images'/>
++    <format type='nfs'/>
++    <protocol ver='3'/>
++  </source>
++  <target>
++    <path>/mnt</path>
++    <permissions>
++      <mode>0700</mode>
++      <owner>0</owner>
++      <group>0</group>
++    </permissions>
++  </target>
++</pool>
+diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c
+index 29c0e42479..cf41b4d065 100644
+--- a/tests/storagepoolxml2xmltest.c
++++ b/tests/storagepoolxml2xmltest.c
+@@ -86,6 +86,7 @@ mymain(void)
+     DO_TEST("pool-iscsi-auth");
+     DO_TEST("pool-netfs");
+     DO_TEST("pool-netfs-auto");
++    DO_TEST("pool-netfs-protocol-ver");
+     DO_TEST("pool-netfs-gluster");
+     DO_TEST("pool-netfs-cifs");
+     DO_TEST("pool-scsi");
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Add-return-value-check-to-virResctrlAllocForeachCache.patch b/SOURCES/libvirt-conf-Add-return-value-check-to-virResctrlAllocForeachCache.patch
new file mode 100644
index 0000000..13da8f8
--- /dev/null
+++ b/SOURCES/libvirt-conf-Add-return-value-check-to-virResctrlAllocForeachCache.patch
@@ -0,0 +1,49 @@
+From 7a8c614b37e0d7e1b2eac08a72f46ef715b72c5a Mon Sep 17 00:00:00 2001
+Message-Id: <7a8c614b37e0d7e1b2eac08a72f46ef715b72c5a@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:59 +0200
+Subject: [PATCH] conf: Add return value check to virResctrlAllocForeachCache
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add return value check to virResctrlAllocForeachCache in
+virDomainCachetuneDefFormat. The virResctrlAllocForeachCache does have
+return value, so need check return value to make sure function executed
+without error.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 8d6f508e64728f9aaa5a624462ac0da325854cad)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <bfb8991c4b538b9ef5a2742370ab5f826a75fac2.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/conf/domain_conf.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index 2f56c077a9..74781fe596 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -27258,10 +27258,10 @@ virDomainCachetuneDefFormat(virBufferPtr buf,
+     int ret = -1;
+ 
+     virBufferSetChildIndent(&childrenBuf, buf);
+-    virResctrlAllocForeachCache(resctrl->alloc,
+-                                virDomainCachetuneDefFormatHelper,
+-                                &childrenBuf);
+-
++    if (virResctrlAllocForeachCache(resctrl->alloc,
++                                    virDomainCachetuneDefFormatHelper,
++                                    &childrenBuf) < 0)
++        goto cleanup;
+ 
+     if (virBufferCheckError(&childrenBuf) < 0)
+         goto cleanup;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Add-support-for-memorytune-XML-processing-for-resctrl-MBA.patch b/SOURCES/libvirt-conf-Add-support-for-memorytune-XML-processing-for-resctrl-MBA.patch
new file mode 100644
index 0000000..2d34310
--- /dev/null
+++ b/SOURCES/libvirt-conf-Add-support-for-memorytune-XML-processing-for-resctrl-MBA.patch
@@ -0,0 +1,503 @@
+From 1240e6d5b3d53a34a94b308ddf2f10a12f2556f6 Mon Sep 17 00:00:00 2001
+Message-Id: <1240e6d5b3d53a34a94b308ddf2f10a12f2556f6@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:58 +0200
+Subject: [PATCH] conf: Add support for memorytune XML processing for resctrl
+ MBA
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Introduce a new section memorytune to support memory bandwidth allocation.
+This is consistent with existing cachetune. As the example:
+below:
+  <cputune>
+    ......
+    <memorytune vcpus='0'>
+      <node id='0' bandwidth='30'/>
+    </memorytune>
+  </cputune>
+
+vpus      --- vpus subjected to this memory bandwidth.
+id        --- on which node memory bandwidth to be set.
+bandwidth --- the memory bandwidth percent to set.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 6956b7eedce4cb6dc2f95684fc3e10c163dfc6fc)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <3139e3b8f3c3d66891847b5a99bd9125ec01f00b.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ docs/formatdomain.html.in                     |  39 +++-
+ docs/schemas/domaincommon.rng                 |  17 ++
+ src/conf/domain_conf.c                        | 200 ++++++++++++++++++
+ .../memorytune-colliding-allocs.xml           |  30 +++
+ .../memorytune-colliding-cachetune.xml        |  32 +++
+ tests/genericxml2xmlindata/memorytune.xml     |  33 +++
+ tests/genericxml2xmltest.c                    |   5 +
+ 7 files changed, 355 insertions(+), 1 deletion(-)
+ create mode 100644 tests/genericxml2xmlindata/memorytune-colliding-allocs.xml
+ create mode 100644 tests/genericxml2xmlindata/memorytune-colliding-cachetune.xml
+ create mode 100644 tests/genericxml2xmlindata/memorytune.xml
+
+diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
+index 42acf7a828..8cf2c12524 100644
+--- a/docs/formatdomain.html.in
++++ b/docs/formatdomain.html.in
+@@ -757,6 +757,10 @@
+       &lt;cache id='0' level='3' type='both' size='3' unit='MiB'/&gt;
+       &lt;cache id='1' level='3' type='both' size='3' unit='MiB'/&gt;
+     &lt;/cachetune&gt;
++    &lt;memorytune vcpus='0-3'&gt;
++      &lt;node id='0' bandwidth='60'/&gt;
++    &lt;/memorytune&gt;
++
+   &lt;/cputune&gt;
+   ...
+ &lt;/domain&gt;
+@@ -910,7 +914,9 @@
+         size and required granularity are reported as well. The required
+         attribute <code>vcpus</code> specifies to which vCPUs this allocation
+         applies. A vCPU can only be member of one <code>cachetune</code> element
+-        allocations. Supported subelements are:
++        allocation. The vCPUs specified by cachetune can be identical with those
++        in memorytune, however they are not allowed to overlap.
++        Supported subelements are:
+         <dl>
+           <dt><code>cache</code></dt>
+           <dd>
+@@ -950,7 +956,38 @@
+             </dl>
+           </dd>
+         </dl>
++      </dd>
+ 
++      <dt><code>memorytune</code><span class="since">Since 4.7.0</span></dt>
++      <dd>
++        Optional <code>memorytune</code> element can control allocations for
++        memory bandwidth using the resctrl on the host. Whether or not is this
++        supported can be gathered from capabilities where some limitations like
++        minimum bandwidth and required granularity are reported as well. The
++        required attribute <code>vcpus</code> specifies to which vCPUs this
++        allocation applies. A vCPU can only be member of one
++        <code>memorytune</code> element allocation. The <code>vcpus</code> specified
++        by <code>memorytune</code> can be identical to those specified by
++        <code>cachetune</code>. However they are not allowed to overlap each other.
++        Supported subelements are:
++        <dl>
++          <dt><code>node</code></dt>
++          <dd>
++            This element controls the allocation of CPU memory bandwidth and has the
++            following attributes:
++            <dl>
++              <dt><code>id</code></dt>
++              <dd>
++                Host node id from which to allocate memory bandwidth.
++              </dd>
++              <dt><code>bandwidth</code></dt>
++              <dd>
++                The memory bandwidth to allocate from this node. The value by default
++                is in percentage.
++              </dd>
++            </dl>
++          </dd>
++        </dl>
+       </dd>
+     </dl>
+ 
+diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
+index ac04af51a1..48f0637cad 100644
+--- a/docs/schemas/domaincommon.rng
++++ b/docs/schemas/domaincommon.rng
+@@ -983,6 +983,23 @@
+             </oneOrMore>
+           </element>
+         </zeroOrMore>
++        <zeroOrMore>
++          <element name="memorytune">
++            <attribute name="vcpus">
++              <ref name='cpuset'/>
++            </attribute>
++            <oneOrMore>
++              <element name="node">
++                <attribute name="id">
++                  <ref name='unsignedInt'/>
++                </attribute>
++                <attribute name="bandwidth">
++                  <ref name='unsignedInt'/>
++                </attribute>
++              </element>
++            </oneOrMore>
++          </element>
++        </zeroOrMore>
+       </interleave>
+     </element>
+   </define>
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index 44bfd75b72..2f56c077a9 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -19296,6 +19296,129 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+ }
+ 
+ 
++static int
++virDomainMemorytuneDefParseMemory(xmlXPathContextPtr ctxt,
++                                  xmlNodePtr node,
++                                  virResctrlAllocPtr alloc)
++{
++    xmlNodePtr oldnode = ctxt->node;
++    unsigned int id;
++    unsigned int bandwidth;
++    char *tmp = NULL;
++    int ret = -1;
++
++    ctxt->node = node;
++
++    tmp = virXMLPropString(node, "id");
++    if (!tmp) {
++        virReportError(VIR_ERR_XML_ERROR, "%s",
++                       _("Missing memorytune attribute 'id'"));
++        goto cleanup;
++    }
++    if (virStrToLong_uip(tmp, NULL, 10, &id) < 0) {
++        virReportError(VIR_ERR_XML_ERROR,
++                       _("Invalid memorytune attribute 'id' value '%s'"),
++                       tmp);
++        goto cleanup;
++    }
++    VIR_FREE(tmp);
++
++    tmp = virXMLPropString(node, "bandwidth");
++    if (!tmp) {
++        virReportError(VIR_ERR_XML_ERROR, "%s",
++                       _("Missing memorytune attribute 'bandwidth'"));
++        goto cleanup;
++    }
++    if (virStrToLong_uip(tmp, NULL, 10, &bandwidth) < 0) {
++        virReportError(VIR_ERR_XML_ERROR,
++                       _("Invalid memorytune attribute 'bandwidth' value '%s'"),
++                       tmp);
++        goto cleanup;
++    }
++    VIR_FREE(tmp);
++    if (virResctrlAllocSetMemoryBandwidth(alloc, id, bandwidth) < 0)
++        goto cleanup;
++
++    ret = 0;
++ cleanup:
++    ctxt->node = oldnode;
++    VIR_FREE(tmp);
++    return ret;
++}
++
++
++static int
++virDomainMemorytuneDefParse(virDomainDefPtr def,
++                            xmlXPathContextPtr ctxt,
++                            xmlNodePtr node,
++                            unsigned int flags)
++{
++    xmlNodePtr oldnode = ctxt->node;
++    xmlNodePtr *nodes = NULL;
++    virBitmapPtr vcpus = NULL;
++    virResctrlAllocPtr alloc = NULL;
++    ssize_t i = 0;
++    int n;
++    int ret = -1;
++    bool new_alloc = false;
++
++    ctxt->node = node;
++
++    if (virDomainResctrlParseVcpus(def, node, &vcpus) < 0)
++        goto cleanup;
++
++    if (virBitmapIsAllClear(vcpus)) {
++        ret = 0;
++        goto cleanup;
++    }
++
++    if ((n = virXPathNodeSet("./node", ctxt, &nodes)) < 0) {
++        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++                       _("Cannot extract memory nodes under memorytune"));
++        goto cleanup;
++    }
++
++    if (virDomainResctrlVcpuMatch(def, vcpus, &alloc) < 0)
++        goto cleanup;
++
++    if (!alloc) {
++        alloc = virResctrlAllocNew();
++        if (!alloc)
++            goto cleanup;
++        new_alloc = true;
++    } else {
++        alloc = virObjectRef(alloc);
++    }
++
++    for (i = 0; i < n; i++) {
++        if (virDomainMemorytuneDefParseMemory(ctxt, nodes[i], alloc) < 0)
++            goto cleanup;
++    }
++    if (virResctrlAllocIsEmpty(alloc)) {
++        ret = 0;
++        goto cleanup;
++    }
++    /*
++     * If this is a new allocation, format ID and append to resctrl, otherwise
++     * just update the existing alloc information, which is done in above
++     * virDomainMemorytuneDefParseMemory */
++    if (new_alloc) {
++        if (virDomainResctrlAppend(def, node, alloc, vcpus, flags) < 0)
++            goto cleanup;
++        vcpus = NULL;
++        alloc = NULL;
++    }
++
++    ret = 0;
++ cleanup:
++    ctxt->node = oldnode;
++    virObjectUnref(alloc);
++    virBitmapFree(vcpus);
++    VIR_FREE(nodes);
++    return ret;
++}
++
++
+ static virDomainDefPtr
+ virDomainDefParseXML(xmlDocPtr xml,
+                      xmlNodePtr root,
+@@ -19856,6 +19979,18 @@ virDomainDefParseXML(xmlDocPtr xml,
+     }
+     VIR_FREE(nodes);
+ 
++    if ((n = virXPathNodeSet("./cputune/memorytune", ctxt, &nodes)) < 0) {
++        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++                       _("cannot extract memorytune nodes"));
++        goto error;
++    }
++
++    for (i = 0; i < n; i++) {
++        if (virDomainMemorytuneDefParse(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;
+ 
+@@ -27162,6 +27297,68 @@ virDomainCachetuneDefFormat(virBufferPtr buf,
+ }
+ 
+ 
++static int
++virDomainMemorytuneDefFormatHelper(unsigned int id,
++                                   unsigned int bandwidth,
++                                   void *opaque)
++{
++    virBufferPtr buf = opaque;
++
++    virBufferAsprintf(buf,
++                      "<node id='%u' bandwidth='%u'/>\n",
++                      id, bandwidth);
++    return 0;
++}
++
++
++static int
++virDomainMemorytuneDefFormat(virBufferPtr buf,
++                            virDomainResctrlDefPtr resctrl,
++                            unsigned int flags)
++{
++    virBuffer childrenBuf = VIR_BUFFER_INITIALIZER;
++    char *vcpus = NULL;
++    int ret = -1;
++
++    virBufferSetChildIndent(&childrenBuf, buf);
++    if (virResctrlAllocForeachMemory(resctrl->alloc,
++                                     virDomainMemorytuneDefFormatHelper,
++                                     &childrenBuf) < 0)
++        goto cleanup;
++
++    if (virBufferCheckError(&childrenBuf) < 0)
++        goto cleanup;
++
++    if (!virBufferUse(&childrenBuf)) {
++        ret = 0;
++        goto cleanup;
++    }
++
++    vcpus = virBitmapFormat(resctrl->vcpus);
++    if (!vcpus)
++        goto cleanup;
++
++    virBufferAsprintf(buf, "<memorytune vcpus='%s'", vcpus);
++
++    if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) {
++        const char *alloc_id = virResctrlAllocGetID(resctrl->alloc);
++        if (!alloc_id)
++            goto cleanup;
++
++        virBufferAsprintf(buf, " id='%s'", alloc_id);
++    }
++    virBufferAddLit(buf, ">\n");
++
++    virBufferAddBuffer(buf, &childrenBuf);
++    virBufferAddLit(buf, "</memorytune>\n");
++
++    ret = 0;
++ cleanup:
++    virBufferFreeAndReset(&childrenBuf);
++    VIR_FREE(vcpus);
++    return ret;
++}
++
+ static int
+ virDomainCputuneDefFormat(virBufferPtr buf,
+                           virDomainDefPtr def,
+@@ -27267,6 +27464,9 @@ virDomainCputuneDefFormat(virBufferPtr buf,
+     for (i = 0; i < def->nresctrls; i++)
+         virDomainCachetuneDefFormat(&childrenBuf, def->resctrls[i], flags);
+ 
++    for (i = 0; i < def->nresctrls; i++)
++        virDomainMemorytuneDefFormat(&childrenBuf, def->resctrls[i], flags);
++
+     if (virBufferCheckError(&childrenBuf) < 0)
+         return -1;
+ 
+diff --git a/tests/genericxml2xmlindata/memorytune-colliding-allocs.xml b/tests/genericxml2xmlindata/memorytune-colliding-allocs.xml
+new file mode 100644
+index 0000000000..9b8ebaa084
+--- /dev/null
++++ b/tests/genericxml2xmlindata/memorytune-colliding-allocs.xml
+@@ -0,0 +1,30 @@
++<domain type='qemu'>
++  <name>QEMUGuest1</name>
++  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
++  <memory unit='KiB'>219136</memory>
++  <currentMemory unit='KiB'>219136</currentMemory>
++  <vcpu placement='static'>4</vcpu>
++  <cputune>
++    <memorytune vcpus='0'>
++      <node id='0' bandwidth='50'/>
++      <node id='0' bandwidth='50'/>
++    </memorytune>
++  </cputune>
++  <os>
++    <type arch='i686' machine='pc'>hvm</type>
++    <boot dev='hd'/>
++  </os>
++  <clock offset='utc'/>
++  <on_poweroff>destroy</on_poweroff>
++  <on_reboot>restart</on_reboot>
++  <on_crash>destroy</on_crash>
++  <devices>
++    <emulator>/usr/bin/qemu-system-i686</emulator>
++    <controller type='usb' index='0'/>
++    <controller type='ide' index='0'/>
++    <controller type='pci' index='0' model='pci-root'/>
++    <input type='mouse' bus='ps2'/>
++    <input type='keyboard' bus='ps2'/>
++    <memballoon model='virtio'/>
++  </devices>
++</domain>
+diff --git a/tests/genericxml2xmlindata/memorytune-colliding-cachetune.xml b/tests/genericxml2xmlindata/memorytune-colliding-cachetune.xml
+new file mode 100644
+index 0000000000..5416870de2
+--- /dev/null
++++ b/tests/genericxml2xmlindata/memorytune-colliding-cachetune.xml
+@@ -0,0 +1,32 @@
++<domain type='qemu'>
++  <name>QEMUGuest1</name>
++  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
++  <memory unit='KiB'>219136</memory>
++  <currentMemory unit='KiB'>219136</currentMemory>
++  <vcpu placement='static'>4</vcpu>
++  <cputune>
++    <cachetune vcpus='0-1'>
++      <cache id='0' level='3' type='code' size='12' unit='KiB'/>
++    </cachetune>
++    <memorytune vcpus='0'>
++      <node id='0' bandwidth='50'/>
++    </memorytune>
++  </cputune>
++  <os>
++    <type arch='i686' machine='pc'>hvm</type>
++    <boot dev='hd'/>
++  </os>
++  <clock offset='utc'/>
++  <on_poweroff>destroy</on_poweroff>
++  <on_reboot>restart</on_reboot>
++  <on_crash>destroy</on_crash>
++  <devices>
++    <emulator>/usr/bin/qemu-system-i686</emulator>
++    <controller type='usb' index='0'/>
++    <controller type='ide' index='0'/>
++    <controller type='pci' index='0' model='pci-root'/>
++    <input type='mouse' bus='ps2'/>
++    <input type='keyboard' bus='ps2'/>
++    <memballoon model='virtio'/>
++  </devices>
++</domain>
+diff --git a/tests/genericxml2xmlindata/memorytune.xml b/tests/genericxml2xmlindata/memorytune.xml
+new file mode 100644
+index 0000000000..ea03e22fc2
+--- /dev/null
++++ b/tests/genericxml2xmlindata/memorytune.xml
+@@ -0,0 +1,33 @@
++<domain type='qemu'>
++  <name>QEMUGuest1</name>
++  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
++  <memory unit='KiB'>219136</memory>
++  <currentMemory unit='KiB'>219136</currentMemory>
++  <vcpu placement='static'>4</vcpu>
++  <cputune>
++    <memorytune vcpus='0-1'>
++      <node id='0' bandwidth='20'/>
++      <node id='1' bandwidth='30'/>
++    </memorytune>
++    <memorytune vcpus='3'>
++      <node id='0' bandwidth='50'/>
++    </memorytune>
++  </cputune>
++  <os>
++    <type arch='i686' machine='pc'>hvm</type>
++    <boot dev='hd'/>
++  </os>
++  <clock offset='utc'/>
++  <on_poweroff>destroy</on_poweroff>
++  <on_reboot>restart</on_reboot>
++  <on_crash>destroy</on_crash>
++  <devices>
++    <emulator>/usr/bin/qemu-system-i686</emulator>
++    <controller type='usb' index='0'/>
++    <controller type='ide' index='0'/>
++    <controller type='pci' index='0' model='pci-root'/>
++    <input type='mouse' bus='ps2'/>
++    <input type='keyboard' bus='ps2'/>
++    <memballoon model='virtio'/>
++  </devices>
++</domain>
+diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c
+index 7a4fc1eb7a..e6d4ef2a7f 100644
+--- a/tests/genericxml2xmltest.c
++++ b/tests/genericxml2xmltest.c
+@@ -140,6 +140,11 @@ mymain(void)
+                  TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE);
+     DO_TEST_FULL("cachetune-colliding-types", false, true,
+                  TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE);
++    DO_TEST("memorytune");
++    DO_TEST_FULL("memorytune-colliding-allocs", false, true,
++                 TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE);
++    DO_TEST_FULL("memorytune-colliding-cachetune", false, true,
++                 TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE);
+ 
+     DO_TEST("tseg");
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Expose-virDomainSCSIDriveAddressIsUsed.patch b/SOURCES/libvirt-conf-Expose-virDomainSCSIDriveAddressIsUsed.patch
new file mode 100644
index 0000000..ab7257b
--- /dev/null
+++ b/SOURCES/libvirt-conf-Expose-virDomainSCSIDriveAddressIsUsed.patch
@@ -0,0 +1,68 @@
+From bb9521f7e0e8a67f04b5776cccf8b458a16bc94b Mon Sep 17 00:00:00 2001
+Message-Id: <bb9521f7e0e8a67f04b5776cccf8b458a16bc94b@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 18 Apr 2019 18:43:10 +0200
+Subject: [PATCH] conf: Expose virDomainSCSIDriveAddressIsUsed
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1692296
+
+This function checks if given drive address is already present in
+passed domain definition. Expose the function as it will be used
+shortly.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
+Reviewed-by: Jim Fehlig <jfehlig@suse.com>
+(cherry picked from commit 89237d534f0fe950d06a2081089154160c6c2224)
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Message-Id: <79f85c93272ac232b81cb80f80d1ba396d557198.1555605741.git.mprivozn@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/conf/domain_conf.c   | 2 +-
+ src/conf/domain_conf.h   | 4 ++++
+ src/libvirt_private.syms | 1 +
+ 3 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index 712efbb9f9..1096499831 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -4400,7 +4400,7 @@ virDomainDriveAddressIsUsedByHostdev(const virDomainDef *def,
+  * Return true if the SCSI drive address is already in use, false
+  * otherwise.
+  */
+-static bool
++bool
+ virDomainSCSIDriveAddressIsUsed(const virDomainDef *def,
+                                 const virDomainDeviceDriveAddress *addr)
+ {
+diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
+index 5e2f21dea3..390bd81aa0 100644
+--- a/src/conf/domain_conf.h
++++ b/src/conf/domain_conf.h
+@@ -2785,6 +2785,10 @@ virDomainXMLNamespacePtr
+ virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt)
+     ATTRIBUTE_NONNULL(1);
+ 
++bool
++virDomainSCSIDriveAddressIsUsed(const virDomainDef *def,
++                                const virDomainDeviceDriveAddress *addr);
++
+ int virDomainDefPostParse(virDomainDefPtr def,
+                           virCapsPtr caps,
+                           unsigned int parseFlags,
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index 3325b90535..3000d6ee0a 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -520,6 +520,7 @@ virDomainRunningReasonTypeToString;
+ virDomainSaveConfig;
+ virDomainSaveStatus;
+ virDomainSaveXML;
++virDomainSCSIDriveAddressIsUsed;
+ virDomainSeclabelTypeFromString;
+ virDomainSeclabelTypeToString;
+ virDomainShmemDefEquals;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Factor-out-vcpus-overlapping-from-virDomainCachetuneDefParse.patch b/SOURCES/libvirt-conf-Factor-out-vcpus-overlapping-from-virDomainCachetuneDefParse.patch
new file mode 100644
index 0000000..f46e7db
--- /dev/null
+++ b/SOURCES/libvirt-conf-Factor-out-vcpus-overlapping-from-virDomainCachetuneDefParse.patch
@@ -0,0 +1,124 @@
+From c00106d41b74d86ee7357ed62399ea7ffb9cd393 Mon Sep 17 00:00:00 2001
+Message-Id: <c00106d41b74d86ee7357ed62399ea7ffb9cd393@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:56 +0200
+Subject: [PATCH] conf: Factor out vcpus overlapping from
+ virDomainCachetuneDefParse
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Factor out vcpus overlapping detecting part from
+virDomainCachetuneDefParse and introduce virDomainResctrlVcpuMatch.
+Instead of allocating virResctrlAllocPtr by default, allocating
+virResctrlAllocPtr after confirm vcpus not overlap with existing ones.
+And virDomainResctrlVcpuMatch can be reused by other resource control
+technologies. virDomainResctrlVcpuMatch can clarify old vcpus overlap
+error whether an overlap or a redefinition.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit e5cc7c0a0258530000aa9fd930c649b525b6f801)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <ee62ff896868ef147f9d7e6c67a5c151e0c4695b.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/conf/domain_conf.c | 51 ++++++++++++++++++++++++++++++++----------
+ 1 file changed, 39 insertions(+), 12 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index 07d21f8026..fb5adbcd10 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -19077,6 +19077,31 @@ virDomainResctrlParseVcpus(virDomainDefPtr def,
+ }
+ 
+ 
++static int
++virDomainResctrlVcpuMatch(virDomainDefPtr def,
++                          virBitmapPtr vcpus,
++                          virResctrlAllocPtr *alloc)
++{
++    ssize_t i = 0;
++
++    for (i = 0; i < def->nresctrls; i++) {
++        /* vcpus group has been created, directly use the existing one.
++         * Just updating memory allocation information of that group
++         */
++        if (virBitmapEqual(def->resctrls[i]->vcpus, vcpus)) {
++            *alloc = def->resctrls[i]->alloc;
++            break;
++        }
++        if (virBitmapOverlaps(def->resctrls[i]->vcpus, vcpus)) {
++            virReportError(VIR_ERR_XML_ERROR, "%s",
++                           _("Overlapping vcpus in resctrls"));
++            return -1;
++        }
++    }
++    return 0;
++}
++
++
+ static int
+ virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt,
+                                 xmlNodePtr node,
+@@ -19160,7 +19185,7 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+     xmlNodePtr oldnode = ctxt->node;
+     xmlNodePtr *nodes = NULL;
+     virBitmapPtr vcpus = NULL;
+-    virResctrlAllocPtr alloc = virResctrlAllocNew();
++    virResctrlAllocPtr alloc = NULL;
+     virDomainResctrlDefPtr tmp_resctrl = NULL;
+     char *tmp = NULL;
+     char *vcpus_str = NULL;
+@@ -19171,9 +19196,6 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+ 
+     ctxt->node = node;
+ 
+-    if (!alloc)
+-        goto cleanup;
+-
+     if (VIR_ALLOC(tmp_resctrl) < 0)
+         goto cleanup;
+ 
+@@ -19191,6 +19213,19 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+         goto cleanup;
+     }
+ 
++    if (virDomainResctrlVcpuMatch(def, vcpus, &alloc) < 0)
++        goto cleanup;
++
++    if (!alloc) {
++        alloc = virResctrlAllocNew();
++        if (!alloc)
++            goto cleanup;
++    } else {
++        virReportError(VIR_ERR_XML_ERROR, "%s",
++                       _("Identical vcpus in cachetunes found"));
++        goto cleanup;
++    }
++
+     for (i = 0; i < n; i++) {
+         if (virDomainCachetuneDefParseCache(ctxt, nodes[i], alloc) < 0)
+             goto cleanup;
+@@ -19201,14 +19236,6 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+         goto cleanup;
+     }
+ 
+-    for (i = 0; i < def->nresctrls; i++) {
+-        if (virBitmapOverlaps(def->resctrls[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);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Factor-out-vcpus-parsing-part-from-virDomainCachetuneDefParse.patch b/SOURCES/libvirt-conf-Factor-out-vcpus-parsing-part-from-virDomainCachetuneDefParse.patch
new file mode 100644
index 0000000..461216f
--- /dev/null
+++ b/SOURCES/libvirt-conf-Factor-out-vcpus-parsing-part-from-virDomainCachetuneDefParse.patch
@@ -0,0 +1,99 @@
+From ca59034c25fe39acb246f82587c0c32ba04d6c89 Mon Sep 17 00:00:00 2001
+Message-Id: <ca59034c25fe39acb246f82587c0c32ba04d6c89@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:55 +0200
+Subject: [PATCH] conf: Factor out vcpus parsing part from
+ virDomainCachetuneDefParse
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Extract vcpus parsing part from virDomainCachetuneDefParse into one
+function called virDomainResctrlParseVcpus. So that vcpus parsing logic
+can be reused by other resource control technologies. Adjust error
+message and use node->name so that the error message can fit to all
+technologies.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 6021c3926ba62a2593f0db63e5413e9663c69a5f)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <2f330b4bbface15dce23370d5f212b2240e031cd.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/conf/domain_conf.c | 48 +++++++++++++++++++++++++++++-------------
+ 1 file changed, 33 insertions(+), 15 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index 0c8afe78c6..07d21f8026 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -19045,6 +19045,38 @@ virDomainDefParseBootOptions(virDomainDefPtr def,
+ }
+ 
+ 
++static int
++virDomainResctrlParseVcpus(virDomainDefPtr def,
++                           xmlNodePtr node,
++                           virBitmapPtr *vcpus)
++{
++    char *vcpus_str = NULL;
++    int ret = -1;
++
++    vcpus_str = virXMLPropString(node, "vcpus");
++    if (!vcpus_str) {
++        virReportError(VIR_ERR_XML_ERROR, _("Missing %s attribute 'vcpus'"),
++                       node->name);
++        goto cleanup;
++    }
++    if (virBitmapParse(vcpus_str, vcpus, VIR_DOMAIN_CPUMASK_LEN) < 0) {
++        virReportError(VIR_ERR_XML_ERROR,
++                       _("Invalid %s attribute 'vcpus' value '%s'"),
++                       node->name, 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);
++
++    ret = 0;
++ cleanup:
++    VIR_FREE(vcpus_str);
++    return ret;
++}
++
++
+ static int
+ virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt,
+                                 xmlNodePtr node,
+@@ -19145,22 +19177,8 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+     if (VIR_ALLOC(tmp_resctrl) < 0)
+         goto cleanup;
+ 
+-    vcpus_str = virXMLPropString(node, "vcpus");
+-    if (!vcpus_str) {
+-        virReportError(VIR_ERR_XML_ERROR, "%s",
+-                       _("Missing cachetune attribute 'vcpus'"));
++    if (virDomainResctrlParseVcpus(def, node, &vcpus) < 0)
+         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;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Factor-out-virDomainResctrlDef-update-from-virDomainCachetuneDefParse.patch b/SOURCES/libvirt-conf-Factor-out-virDomainResctrlDef-update-from-virDomainCachetuneDefParse.patch
new file mode 100644
index 0000000..c8b844e
--- /dev/null
+++ b/SOURCES/libvirt-conf-Factor-out-virDomainResctrlDef-update-from-virDomainCachetuneDefParse.patch
@@ -0,0 +1,164 @@
+From 7551c4a8b453278e7a27a8e7a722851af1f23efc Mon Sep 17 00:00:00 2001
+Message-Id: <7551c4a8b453278e7a27a8e7a722851af1f23efc@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:57 +0200
+Subject: [PATCH] conf: Factor out virDomainResctrlDef update from
+ virDomainCachetuneDefParse
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Factor out vcpus virDomainResctrlDef update from
+virDomainCachetuneDefParse and introduce virDomainResctrlAppend.
+virDomainResctrlAppend will format vcpus string and append a new
+virDomainResctrlDef to virDomainDefPtr. So that this logic can
+be reusable.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 72824f67cdb9c474034539e81fb03fb1bc94495f)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <b3da60a6b3ca4eea6712bbbdfba03b6037e41239.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/conf/domain_conf.c | 93 +++++++++++++++++++++++++-----------------
+ 1 file changed, 55 insertions(+), 38 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index fb5adbcd10..44bfd75b72 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -19176,6 +19176,58 @@ virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt,
+ }
+ 
+ 
++static int
++virDomainResctrlAppend(virDomainDefPtr def,
++                       xmlNodePtr node,
++                       virResctrlAllocPtr alloc,
++                       virBitmapPtr vcpus,
++                       unsigned int flags)
++{
++    char *vcpus_str = NULL;
++    char *alloc_id = NULL;
++    virDomainResctrlDefPtr tmp_resctrl = NULL;
++    int ret = -1;
++
++    if (VIR_ALLOC(tmp_resctrl) < 0)
++        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. */
++    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;
++
++    tmp_resctrl->vcpus = vcpus;
++    tmp_resctrl->alloc = alloc;
++
++    if (VIR_APPEND_ELEMENT(def->resctrls, def->nresctrls, tmp_resctrl) < 0)
++        goto cleanup;
++
++    ret = 0;
++ cleanup:
++    virDomainResctrlDefFree(tmp_resctrl);
++    VIR_FREE(alloc_id);
++    VIR_FREE(vcpus_str);
++    return ret;
++}
++
++
+ static int
+ virDomainCachetuneDefParse(virDomainDefPtr def,
+                            xmlXPathContextPtr ctxt,
+@@ -19186,19 +19238,12 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+     xmlNodePtr *nodes = NULL;
+     virBitmapPtr vcpus = NULL;
+     virResctrlAllocPtr alloc = NULL;
+-    virDomainResctrlDefPtr tmp_resctrl = 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 (VIR_ALLOC(tmp_resctrl) < 0)
+-        goto cleanup;
+-
+     if (virDomainResctrlParseVcpus(def, node, &vcpus) < 0)
+         goto cleanup;
+ 
+@@ -19236,45 +19281,17 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+         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_resctrl->vcpus, vcpus);
+-    VIR_STEAL_PTR(tmp_resctrl->alloc, alloc);
+-
+-    if (VIR_APPEND_ELEMENT(def->resctrls, def->nresctrls, tmp_resctrl) < 0)
++    if (virDomainResctrlAppend(def, node, alloc, vcpus, flags) < 0)
+         goto cleanup;
++    vcpus = NULL;
++    alloc = NULL;
+ 
+     ret = 0;
+  cleanup:
+     ctxt->node = oldnode;
+-    virDomainResctrlDefFree(tmp_resctrl);
+     virObjectUnref(alloc);
+     virBitmapFree(vcpus);
+-    VIR_FREE(alloc_id);
+-    VIR_FREE(vcpus_str);
+     VIR_FREE(nodes);
+-    VIR_FREE(tmp);
+     return ret;
+ }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Fix-bug-in-finding-alloc-through-matching-vcpus.patch b/SOURCES/libvirt-conf-Fix-bug-in-finding-alloc-through-matching-vcpus.patch
new file mode 100644
index 0000000..2d9f402
--- /dev/null
+++ b/SOURCES/libvirt-conf-Fix-bug-in-finding-alloc-through-matching-vcpus.patch
@@ -0,0 +1,52 @@
+From 408d9e217f05b6c68351804df56aa9c9af7db4e7 Mon Sep 17 00:00:00 2001
+Message-Id: <408d9e217f05b6c68351804df56aa9c9af7db4e7@dist-git>
+From: Wang Huaqiang <huaqiang.wang@intel.com>
+Date: Mon, 15 Apr 2019 17:33:01 +0200
+Subject: [PATCH] conf: Fix bug in finding alloc through matching vcpus
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The @alloc object returned by virDomainResctrlVcpuMatch is not
+properly referenced and un-referenced in virDomainCachetuneDefParse.
+
+This patch fixes this problem.
+
+Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 3a1cdb06fd9bc5e35230f6198e697d6ec03d1206)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <7049386040dc0d170193b5fbfc81f2a8335d0063.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/conf/domain_conf.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index 74781fe596..6af14cc06f 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -19089,7 +19089,7 @@ virDomainResctrlVcpuMatch(virDomainDefPtr def,
+          * Just updating memory allocation information of that group
+          */
+         if (virBitmapEqual(def->resctrls[i]->vcpus, vcpus)) {
+-            *alloc = def->resctrls[i]->alloc;
++            *alloc = virObjectRef(def->resctrls[i]->alloc);
+             break;
+         }
+         if (virBitmapOverlaps(def->resctrls[i]->vcpus, vcpus)) {
+@@ -19386,8 +19386,6 @@ virDomainMemorytuneDefParse(virDomainDefPtr def,
+         if (!alloc)
+             goto cleanup;
+         new_alloc = true;
+-    } else {
+-        alloc = virObjectRef(alloc);
+     }
+ 
+     for (i = 0; i < n; i++) {
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Fix-check-for-chardev-source-path.patch b/SOURCES/libvirt-conf-Fix-check-for-chardev-source-path.patch
new file mode 100644
index 0000000..8b03303
--- /dev/null
+++ b/SOURCES/libvirt-conf-Fix-check-for-chardev-source-path.patch
@@ -0,0 +1,112 @@
+From dc638f4d9fea8647a190dc9d2dabc4ce81ab2a3c Mon Sep 17 00:00:00 2001
+Message-Id: <dc638f4d9fea8647a190dc9d2dabc4ce81ab2a3c@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Wed, 3 Apr 2019 17:08:57 +0200
+Subject: [PATCH] conf: Fix check for chardev source path
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Attempting to use a chardev definition like
+
+  <serial type='unix'>
+    <target type='isa-serial'/>
+  </serial>
+
+correctly results in an error being reported, since the source
+path - a required piece of information - is missing; however,
+the very similar
+
+  <serial type='unix'>
+    <target type='pci-serial'/>
+  </serial>
+
+was happily accepted by libvirt, only to result in libvirtd
+crashing as soon as the guest was started.
+
+The issue was caused by checking the chardev's targetType
+against whitelisted values from virDomainChrChannelTargetType
+without first checking the chardev's deviceType to make sure
+it is actually a channel, for which the check makes sense,
+rather than a different type of chardev.
+
+The only reason this wasn't spotted earlier is that the
+whitelisted values just so happen to correspond to USB and
+PCI serial devices and Xen and UML consoles respectively,
+all of which are fairly uncommon.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1609720
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+
+(cherry picked from commit 614193fac67445a7e92bf620ffef726ed1bd6f07)
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190403150857.20850-1-abologna@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ src/conf/domain_conf.c                            | 11 +++++++----
+ .../serial-unix-missing-source.xml                | 15 +++++++++++++++
+ tests/qemuxml2argvtest.c                          |  1 +
+ 3 files changed, 23 insertions(+), 4 deletions(-)
+ create mode 100644 tests/qemuxml2argvdata/serial-unix-missing-source.xml
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index eb4e9ac523..712efbb9f9 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -5531,11 +5531,14 @@ virDomainChrSourceDefValidate(const virDomainChrSourceDef *def,
+         break;
+ 
+     case VIR_DOMAIN_CHR_TYPE_UNIX:
+-        /* path can be auto generated */
++        /* The source path can be auto generated for certain specific
++         * types of channels, but in most cases we should report an
++         * error if the user didn't provide it */
+         if (!def->data.nix.path &&
+-            (!chr_def ||
+-             (chr_def->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN &&
+-              chr_def->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO))) {
++            !(chr_def &&
++              chr_def->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
++              (chr_def->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN ||
++               chr_def->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO))) {
+             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Missing source path attribute for char device"));
+             return -1;
+diff --git a/tests/qemuxml2argvdata/serial-unix-missing-source.xml b/tests/qemuxml2argvdata/serial-unix-missing-source.xml
+new file mode 100644
+index 0000000000..1e1221f12d
+--- /dev/null
++++ b/tests/qemuxml2argvdata/serial-unix-missing-source.xml
+@@ -0,0 +1,15 @@
++<domain type='qemu'>
++  <name>guest</name>
++  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
++  <memory unit='KiB'>1048576</memory>
++  <vcpu placement='static'>1</vcpu>
++  <os>
++    <type arch='aarch64' machine='virt'>hvm</type>
++  </os>
++  <devices>
++    <emulator>/usr/bin/qemu-system-aarch64</emulator>
++    <serial type='unix'>
++      <target type='pci-serial'/>
++    </serial>
++  </devices>
++</domain>
+diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
+index d97dc0ea8d..7a731e2f40 100644
+--- a/tests/qemuxml2argvtest.c
++++ b/tests/qemuxml2argvtest.c
+@@ -1363,6 +1363,7 @@ mymain(void)
+     DO_TEST("serial-unix-chardev",
+             QEMU_CAPS_DEVICE_ISA_SERIAL);
+     DO_TEST_CAPS_LATEST("serial-unix-chardev");
++    DO_TEST_PARSE_ERROR("serial-unix-missing-source", NONE);
+     DO_TEST("serial-tcp-chardev",
+             QEMU_CAPS_DEVICE_ISA_SERIAL);
+     DO_TEST("serial-udp-chardev",
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Introduce-virDomainGraphics-related-helpers.patch b/SOURCES/libvirt-conf-Introduce-virDomainGraphics-related-helpers.patch
new file mode 100644
index 0000000..06ce7a0
--- /dev/null
+++ b/SOURCES/libvirt-conf-Introduce-virDomainGraphics-related-helpers.patch
@@ -0,0 +1,121 @@
+From 7b4b21814c4a1af212b061e265ee0ca8220abd1e Mon Sep 17 00:00:00 2001
+Message-Id: <7b4b21814c4a1af212b061e265ee0ca8220abd1e@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:26 +0200
+Subject: [PATCH] conf: Introduce virDomainGraphics-related helpers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+A few simple helpers that allow us to determine whether a graphics can
+and will need to make use of a DRM render node.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 255e073263b55b524f68b64c282e73509f93985e)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <24845c3d51a90b5de6989e70e9de51b07b44ade9.1554791287.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/conf/domain_conf.c   | 43 ++++++++++++++++++++++++++++++++++++++++
+ src/conf/domain_conf.h   |  9 +++++++++
+ src/libvirt_private.syms |  3 +++
+ 3 files changed, 55 insertions(+)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index 6af14cc06f..d079be2bb5 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -30713,3 +30713,46 @@ virDomainGraphicsDefHasOpenGL(const virDomainDef *def)
+ 
+     return false;
+ }
++
++
++bool
++virDomainGraphicsSupportsRenderNode(const virDomainGraphicsDef *graphics)
++{
++    return graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE;
++}
++
++
++const char *
++virDomainGraphicsGetRenderNode(const virDomainGraphicsDef *graphics)
++{
++    const char *ret = NULL;
++
++    switch (graphics->type) {
++    case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
++        if (graphics->data.spice.gl == VIR_TRISTATE_BOOL_YES)
++            ret = graphics->data.spice.rendernode;
++        break;
++    case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
++    case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
++    case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
++    case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
++    case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
++    case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
++        break;
++    }
++
++    return ret;
++}
++
++
++bool
++virDomainGraphicsNeedsAutoRenderNode(const virDomainGraphicsDef *graphics)
++{
++    if (!virDomainGraphicsSupportsRenderNode(graphics))
++        return false;
++
++    if (virDomainGraphicsGetRenderNode(graphics))
++        return false;
++
++    return true;
++}
+diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
+index 65abe9cde6..b1139812d5 100644
+--- a/src/conf/domain_conf.h
++++ b/src/conf/domain_conf.h
+@@ -3651,4 +3651,13 @@ virDomainDefHasManagedPR(const virDomainDef *def);
+ bool
+ virDomainGraphicsDefHasOpenGL(const virDomainDef *def);
+ 
++bool
++virDomainGraphicsSupportsRenderNode(const virDomainGraphicsDef *graphics);
++
++const char *
++virDomainGraphicsGetRenderNode(const virDomainGraphicsDef *graphics);
++
++bool
++virDomainGraphicsNeedsAutoRenderNode(const virDomainGraphicsDef *graphics);
++
+ #endif /* __DOMAIN_CONF_H */
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index 6655dfdecc..984a9be18f 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -370,8 +370,10 @@ virDomainGraphicsAuthConnectedTypeToString;
+ virDomainGraphicsDefFree;
+ virDomainGraphicsDefHasOpenGL;
+ virDomainGraphicsGetListen;
++virDomainGraphicsGetRenderNode;
+ virDomainGraphicsListenAppendAddress;
+ virDomainGraphicsListenAppendSocket;
++virDomainGraphicsNeedsAutoRenderNode;
+ virDomainGraphicsSpiceChannelModeTypeFromString;
+ virDomainGraphicsSpiceChannelModeTypeToString;
+ virDomainGraphicsSpiceChannelNameTypeFromString;
+@@ -386,6 +388,7 @@ virDomainGraphicsSpiceStreamingModeTypeFromString;
+ virDomainGraphicsSpiceStreamingModeTypeToString;
+ virDomainGraphicsSpiceZlibCompressionTypeFromString;
+ virDomainGraphicsSpiceZlibCompressionTypeToString;
++virDomainGraphicsSupportsRenderNode;
+ virDomainGraphicsTypeFromString;
+ virDomainGraphicsTypeToString;
+ virDomainGraphicsVNCSharePolicyTypeFromString;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Rename-cachetune-to-resctrl.patch b/SOURCES/libvirt-conf-Rename-cachetune-to-resctrl.patch
new file mode 100644
index 0000000..f9ba031
--- /dev/null
+++ b/SOURCES/libvirt-conf-Rename-cachetune-to-resctrl.patch
@@ -0,0 +1,267 @@
+From 8e87a5625a571d05177c6766405db814b6e8e7b3 Mon Sep 17 00:00:00 2001
+Message-Id: <8e87a5625a571d05177c6766405db814b6e8e7b3@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:54 +0200
+Subject: [PATCH] conf: Rename cachetune to resctrl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Resctrl not only supports cache tuning, but also memory bandwidth
+tuning. Renaming cachetune to resctrl to reflect that. With resctrl,
+all allocation for different resources (cache, memory bandwidth) are
+aggregated and represented by a virResctrlAllocPtr inside
+virDomainResctrlDef.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit acc288d655237a22a95c5a1ae7207916fb9efac9)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <9ee9c0993a62ddf084968b211ca82c9e6b62ef0d.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/conf/domain_conf.c  | 44 ++++++++++++++++++++---------------------
+ src/conf/domain_conf.h  | 10 +++++-----
+ src/qemu/qemu_domain.c  |  2 +-
+ src/qemu/qemu_process.c | 18 ++++++++---------
+ 4 files changed, 37 insertions(+), 37 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index e04edd97dc..0c8afe78c6 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -2966,14 +2966,14 @@ virDomainLoaderDefFree(virDomainLoaderDefPtr loader)
+ 
+ 
+ static void
+-virDomainCachetuneDefFree(virDomainCachetuneDefPtr cachetune)
++virDomainResctrlDefFree(virDomainResctrlDefPtr resctrl)
+ {
+-    if (!cachetune)
++    if (!resctrl)
+         return;
+ 
+-    virObjectUnref(cachetune->alloc);
+-    virBitmapFree(cachetune->vcpus);
+-    VIR_FREE(cachetune);
++    virObjectUnref(resctrl->alloc);
++    virBitmapFree(resctrl->vcpus);
++    VIR_FREE(resctrl);
+ }
+ 
+ 
+@@ -3163,9 +3163,9 @@ 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);
++    for (i = 0; i < def->nresctrls; i++)
++        virDomainResctrlDefFree(def->resctrls[i]);
++    VIR_FREE(def->resctrls);
+ 
+     VIR_FREE(def->keywrap);
+ 
+@@ -19129,7 +19129,7 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+     xmlNodePtr *nodes = NULL;
+     virBitmapPtr vcpus = NULL;
+     virResctrlAllocPtr alloc = virResctrlAllocNew();
+-    virDomainCachetuneDefPtr tmp_cachetune = NULL;
++    virDomainResctrlDefPtr tmp_resctrl = NULL;
+     char *tmp = NULL;
+     char *vcpus_str = NULL;
+     char *alloc_id = NULL;
+@@ -19142,7 +19142,7 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+     if (!alloc)
+         goto cleanup;
+ 
+-    if (VIR_ALLOC(tmp_cachetune) < 0)
++    if (VIR_ALLOC(tmp_resctrl) < 0)
+         goto cleanup;
+ 
+     vcpus_str = virXMLPropString(node, "vcpus");
+@@ -19183,8 +19183,8 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+         goto cleanup;
+     }
+ 
+-    for (i = 0; i < def->ncachetunes; i++) {
+-        if (virBitmapOverlaps(def->cachetunes[i]->vcpus, vcpus)) {
++    for (i = 0; i < def->nresctrls; i++) {
++        if (virBitmapOverlaps(def->resctrls[i]->vcpus, vcpus)) {
+             virReportError(VIR_ERR_XML_ERROR, "%s",
+                            _("Overlapping vcpus in cachetunes"));
+             goto cleanup;
+@@ -19214,16 +19214,16 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
+     if (virResctrlAllocSetID(alloc, alloc_id) < 0)
+         goto cleanup;
+ 
+-    VIR_STEAL_PTR(tmp_cachetune->vcpus, vcpus);
+-    VIR_STEAL_PTR(tmp_cachetune->alloc, alloc);
++    VIR_STEAL_PTR(tmp_resctrl->vcpus, vcpus);
++    VIR_STEAL_PTR(tmp_resctrl->alloc, alloc);
+ 
+-    if (VIR_APPEND_ELEMENT(def->cachetunes, def->ncachetunes, tmp_cachetune) < 0)
++    if (VIR_APPEND_ELEMENT(def->resctrls, def->nresctrls, tmp_resctrl) < 0)
+         goto cleanup;
+ 
+     ret = 0;
+  cleanup:
+     ctxt->node = oldnode;
+-    virDomainCachetuneDefFree(tmp_cachetune);
++    virDomainResctrlDefFree(tmp_resctrl);
+     virObjectUnref(alloc);
+     virBitmapFree(vcpus);
+     VIR_FREE(alloc_id);
+@@ -27053,7 +27053,7 @@ virDomainCachetuneDefFormatHelper(unsigned int level,
+ 
+ static int
+ virDomainCachetuneDefFormat(virBufferPtr buf,
+-                            virDomainCachetuneDefPtr cachetune,
++                            virDomainResctrlDefPtr resctrl,
+                             unsigned int flags)
+ {
+     virBuffer childrenBuf = VIR_BUFFER_INITIALIZER;
+@@ -27061,7 +27061,7 @@ virDomainCachetuneDefFormat(virBufferPtr buf,
+     int ret = -1;
+ 
+     virBufferSetChildIndent(&childrenBuf, buf);
+-    virResctrlAllocForeachCache(cachetune->alloc,
++    virResctrlAllocForeachCache(resctrl->alloc,
+                                 virDomainCachetuneDefFormatHelper,
+                                 &childrenBuf);
+ 
+@@ -27074,14 +27074,14 @@ virDomainCachetuneDefFormat(virBufferPtr buf,
+         goto cleanup;
+     }
+ 
+-    vcpus = virBitmapFormat(cachetune->vcpus);
++    vcpus = virBitmapFormat(resctrl->vcpus);
+     if (!vcpus)
+         goto cleanup;
+ 
+     virBufferAsprintf(buf, "<cachetune vcpus='%s'", vcpus);
+ 
+     if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) {
+-        const char *alloc_id = virResctrlAllocGetID(cachetune->alloc);
++        const char *alloc_id = virResctrlAllocGetID(resctrl->alloc);
+         if (!alloc_id)
+             goto cleanup;
+ 
+@@ -27202,8 +27202,8 @@ virDomainCputuneDefFormat(virBufferPtr buf,
+                                  def->iothreadids[i]->iothread_id);
+     }
+ 
+-    for (i = 0; i < def->ncachetunes; i++)
+-        virDomainCachetuneDefFormat(&childrenBuf, def->cachetunes[i], flags);
++    for (i = 0; i < def->nresctrls; i++)
++        virDomainCachetuneDefFormat(&childrenBuf, def->resctrls[i], flags);
+ 
+     if (virBufferCheckError(&childrenBuf) < 0)
+         return -1;
+diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
+index 390bd81aa0..65abe9cde6 100644
+--- a/src/conf/domain_conf.h
++++ b/src/conf/domain_conf.h
+@@ -2232,10 +2232,10 @@ struct _virDomainCputune {
+ };
+ 
+ 
+-typedef struct _virDomainCachetuneDef virDomainCachetuneDef;
+-typedef virDomainCachetuneDef *virDomainCachetuneDefPtr;
++typedef struct _virDomainResctrlDef virDomainResctrlDef;
++typedef virDomainResctrlDef *virDomainResctrlDefPtr;
+ 
+-struct _virDomainCachetuneDef {
++struct _virDomainResctrlDef {
+     virBitmapPtr vcpus;
+     virResctrlAllocPtr alloc;
+ };
+@@ -2413,8 +2413,8 @@ struct _virDomainDef {
+ 
+     virDomainCputune cputune;
+ 
+-    virDomainCachetuneDefPtr *cachetunes;
+-    size_t ncachetunes;
++    virDomainResctrlDefPtr *resctrls;
++    size_t nresctrls;
+ 
+     virDomainNumaPtr numa;
+     virDomainResourceDefPtr resource;
+diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
+index d80f9b393e..112958f64a 100644
+--- a/src/qemu/qemu_domain.c
++++ b/src/qemu/qemu_domain.c
+@@ -3999,7 +3999,7 @@ qemuDomainDefValidate(const virDomainDef *def,
+         }
+     }
+ 
+-    if (def->ncachetunes &&
++    if (def->nresctrls &&
+         def->virtType != VIR_DOMAIN_VIRT_KVM) {
+         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                        _("cachetune is only supported for KVM domains"));
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index 208c64381c..a44f371346 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -2584,7 +2584,7 @@ qemuProcessResctrlCreate(virQEMUDriverPtr driver,
+     virCapsPtr caps = NULL;
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+ 
+-    if (!vm->def->ncachetunes)
++    if (!vm->def->nresctrls)
+         return 0;
+ 
+     /* Force capability refresh since resctrl info can change
+@@ -2593,9 +2593,9 @@ qemuProcessResctrlCreate(virQEMUDriverPtr driver,
+     if (!caps)
+         return -1;
+ 
+-    for (i = 0; i < vm->def->ncachetunes; i++) {
++    for (i = 0; i < vm->def->nresctrls; i++) {
+         if (virResctrlAllocCreate(caps->host.resctrl,
+-                                  vm->def->cachetunes[i]->alloc,
++                                  vm->def->resctrls[i]->alloc,
+                                   priv->machineName) < 0)
+             goto cleanup;
+     }
+@@ -5411,8 +5411,8 @@ qemuProcessSetupVcpu(virDomainObjPtr vm,
+                             &vcpu->sched) < 0)
+         return -1;
+ 
+-    for (i = 0; i < vm->def->ncachetunes; i++) {
+-        virDomainCachetuneDefPtr ct = vm->def->cachetunes[i];
++    for (i = 0; i < vm->def->nresctrls; i++) {
++        virDomainResctrlDefPtr ct = vm->def->resctrls[i];
+ 
+         if (virBitmapIsBitSet(ct->vcpus, vcpuid)) {
+             if (virResctrlAllocAddPID(ct->alloc, vcpupid) < 0)
+@@ -7108,8 +7108,8 @@ void qemuProcessStop(virQEMUDriverPtr driver,
+     /* Remove resctrl allocation after cgroups are cleaned up which makes it
+      * kind of safer (although removing the allocation should work even with
+      * pids in tasks file */
+-    for (i = 0; i < vm->def->ncachetunes; i++)
+-        virResctrlAllocRemove(vm->def->cachetunes[i]->alloc);
++    for (i = 0; i < vm->def->nresctrls; i++)
++        virResctrlAllocRemove(vm->def->resctrls[i]->alloc);
+ 
+     qemuProcessRemoveDomainStatus(driver, vm);
+ 
+@@ -7835,8 +7835,8 @@ qemuProcessReconnect(void *opaque)
+     if (qemuConnectAgent(driver, obj) < 0)
+         goto error;
+ 
+-    for (i = 0; i < obj->def->ncachetunes; i++) {
+-        if (virResctrlAllocDeterminePath(obj->def->cachetunes[i]->alloc,
++    for (i = 0; i < obj->def->nresctrls; i++) {
++        if (virResctrlAllocDeterminePath(obj->def->resctrls[i]->alloc,
+                                          priv->machineName) < 0)
+             goto error;
+     }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-Report-TSC-frequency-in-host-CPU-capabilities.patch b/SOURCES/libvirt-conf-Report-TSC-frequency-in-host-CPU-capabilities.patch
new file mode 100644
index 0000000..722ff32
--- /dev/null
+++ b/SOURCES/libvirt-conf-Report-TSC-frequency-in-host-CPU-capabilities.patch
@@ -0,0 +1,149 @@
+From 5b07ca7c378a5e62fec0ed4808e8905fe447e85e Mon Sep 17 00:00:00 2001
+Message-Id: <5b07ca7c378a5e62fec0ed4808e8905fe447e85e@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Tue, 4 Jun 2019 13:04:30 +0200
+Subject: [PATCH] conf: Report TSC frequency in host CPU capabilities
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This patch adds a new
+
+    <counter name='tsc' frequency='N' scaling='on|off'/>
+
+element into the host CPU capabilities XML.
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit c277b9ad5c740bb4c4b915754ae74621f93f9d37)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Conflicts:
+	src/conf/cpu_conf.h
+            - virenum.h doesn't exist downstream
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <c0a6203e4a667c31668e0df508b08b515177276f.1559646067.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/conf/cpu_conf.c | 48 +++++++++++++++++++++++++++++++++++++++++++++
+ src/conf/cpu_conf.h |  2 ++
+ 2 files changed, 50 insertions(+)
+
+diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
+index 43a3ab5dcd..d0ad265fbe 100644
+--- a/src/conf/cpu_conf.c
++++ b/src/conf/cpu_conf.c
+@@ -102,6 +102,7 @@ virCPUDefFree(virCPUDefPtr def)
+ 
+     virCPUDefFreeModel(def);
+     VIR_FREE(def->cache);
++    VIR_FREE(def->tsc);
+     VIR_FREE(def);
+ }
+ 
+@@ -223,6 +224,13 @@ virCPUDefCopyWithoutModel(const virCPUDef *cpu)
+         *copy->cache = *cpu->cache;
+     }
+ 
++    if (cpu->tsc) {
++        if (VIR_ALLOC(copy->tsc) < 0)
++            goto error;
++
++        *copy->tsc = *cpu->tsc;
++    }
++
+     return copy;
+ 
+  error:
+@@ -276,6 +284,8 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
+     char *cpuMode;
+     char *fallback = NULL;
+     char *vendor_id = NULL;
++    char *tscScaling = NULL;
++    virHostCPUTscInfoPtr tsc = NULL;
+     int ret = -1;
+ 
+     *cpu = NULL;
+@@ -392,6 +402,32 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
+                            _("invalid microcode version"));
+             goto cleanup;
+         }
++
++        if (virXPathBoolean("boolean(./counter[@name='tsc'])", ctxt) > 0) {
++            if (VIR_ALLOC(tsc) < 0)
++                goto cleanup;
++
++            if (virXPathULongLong("./counter[@name='tsc']/@frequency", ctxt,
++                                  &tsc->frequency) < 0) {
++                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
++                               _("Invalid TSC frequency"));
++                goto cleanup;
++            }
++
++            tscScaling = virXPathString("string(./counter[@name='tsc']/@scaling)",
++                                        ctxt);
++            if (tscScaling) {
++                int scaling = virTristateBoolTypeFromString(tscScaling);
++                if (scaling < 0) {
++                    virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
++                                   _("Invalid TSC scaling attribute"));
++                    goto cleanup;
++                }
++                tsc->scaling = scaling;
++            }
++
++            VIR_STEAL_PTR(def->tsc, tsc);
++        }
+     }
+ 
+     if (!(def->model = virXPathString("string(./model[1])", ctxt)) &&
+@@ -577,6 +613,8 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
+     VIR_FREE(fallback);
+     VIR_FREE(vendor_id);
+     VIR_FREE(nodes);
++    VIR_FREE(tscScaling);
++    VIR_FREE(tsc);
+     virCPUDefFree(def);
+     return ret;
+ }
+@@ -734,6 +772,16 @@ virCPUDefFormatBuf(virBufferPtr buf,
+         virBufferAsprintf(buf, "<microcode version='%u'/>\n",
+                           def->microcodeVersion);
+ 
++    if (def->type == VIR_CPU_TYPE_HOST && def->tsc) {
++        virBufferAddLit(buf, "<counter name='tsc'");
++        virBufferAsprintf(buf, " frequency='%llu'", def->tsc->frequency);
++        if (def->tsc->scaling) {
++            virBufferAsprintf(buf, " scaling='%s'",
++                              virTristateBoolTypeToString(def->tsc->scaling));
++        }
++        virBufferAddLit(buf, "/>\n");
++    }
++
+     if (def->sockets && def->cores && def->threads) {
+         virBufferAddLit(buf, "<topology");
+         virBufferAsprintf(buf, " sockets='%u'", def->sockets);
+diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
+index 9f2e7ee264..5bda4d6961 100644
+--- a/src/conf/cpu_conf.h
++++ b/src/conf/cpu_conf.h
+@@ -30,6 +30,7 @@
+ # include "virbitmap.h"
+ # include "virarch.h"
+ # include "numa_conf.h"
++# include "virhostcpu.h"
+ 
+ # define VIR_CPU_VENDOR_ID_LENGTH 12
+ 
+@@ -141,6 +142,7 @@ struct _virCPUDef {
+     size_t nfeatures_max;
+     virCPUFeatureDefPtr features;
+     virCPUCacheDefPtr cache;
++    virHostCPUTscInfoPtr tsc;
+ };
+ 
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-gfx-Add-egl-headless-as-a-member-to-virDomainGraphicsDef-struct.patch b/SOURCES/libvirt-conf-gfx-Add-egl-headless-as-a-member-to-virDomainGraphicsDef-struct.patch
new file mode 100644
index 0000000..bc32606
--- /dev/null
+++ b/SOURCES/libvirt-conf-gfx-Add-egl-headless-as-a-member-to-virDomainGraphicsDef-struct.patch
@@ -0,0 +1,43 @@
+From 3af732efb21503e81d31ff600d024b240d6105f3 Mon Sep 17 00:00:00 2001
+Message-Id: <3af732efb21503e81d31ff600d024b240d6105f3@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:30 +0200
+Subject: [PATCH] conf: gfx: Add egl-headless as a member to
+ virDomainGraphicsDef struct
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since we need to specify the rendernode option onto QEMU cmdline, we
+need this union member to retain consistency in how we build the
+cmdline.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 0a75de221984b971cb841c6918e6746eb22b1547)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <5dc5762e104b6a4729bf6fa9a470f10a6e6c256f.1554791287.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/conf/domain_conf.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
+index b1139812d5..2d272f907f 100644
+--- a/src/conf/domain_conf.h
++++ b/src/conf/domain_conf.h
+@@ -1656,6 +1656,9 @@ struct _virDomainGraphicsDef {
+             virTristateBool gl;
+             char *rendernode;
+         } spice;
++        struct {
++            char *rendernode;
++        } egl_headless;
+     } data;
+     /* nListens, listens, and *port are only useful if type is vnc,
+      * rdp, or spice. They've been extracted from the union only to
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-conf-gfx-egl-headless-Introduce-a-new-gl-subelement.patch b/SOURCES/libvirt-conf-gfx-egl-headless-Introduce-a-new-gl-subelement.patch
new file mode 100644
index 0000000..db82645
--- /dev/null
+++ b/SOURCES/libvirt-conf-gfx-egl-headless-Introduce-a-new-gl-subelement.patch
@@ -0,0 +1,307 @@
+From a701d9ee0f3e5cd939356191f25d0ec378dbb5c4 Mon Sep 17 00:00:00 2001
+Message-Id: <a701d9ee0f3e5cd939356191f25d0ec378dbb5c4@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:31 +0200
+Subject: [PATCH] conf: gfx: egl-headless: Introduce a new <gl> subelement
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Unlike with SPICE and SDL which use the <gl> subelement to enable OpenGL
+acceleration, specifying egl-headless graphics in the XML has
+essentially the same meaning, thus in case of egl-headless we don't have
+a need for the 'enable' element attribute and we'll only be interested
+in the 'rendernode' one further down the road.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 5f931fe39112129efb1204a1aac60b180ef31b42)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <a52b7103d576f2713b6d1839e2bc7e2381b80519.1554791287.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ docs/formatdomain.html.in                     | 11 +++--
+ docs/schemas/domaincommon.rng                 | 17 +++++--
+ src/conf/domain_conf.c                        | 45 ++++++++++++++++++-
+ src/qemu/qemu_process.c                       | 17 +++++--
+ .../graphics-egl-headless-rendernode.xml      | 33 ++++++++++++++
+ .../graphics-egl-headless-rendernode.xml      | 41 +++++++++++++++++
+ tests/qemuxml2xmltest.c                       |  2 +
+ 7 files changed, 156 insertions(+), 10 deletions(-)
+ create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless-rendernode.xml
+ create mode 100644 tests/qemuxml2xmloutdata/graphics-egl-headless-rendernode.xml
+
+diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
+index 8cf2c12524..e848dc1e0d 100644
+--- a/docs/formatdomain.html.in
++++ b/docs/formatdomain.html.in
+@@ -6573,12 +6573,17 @@ qemu-kvm -net nic,model=? /dev/null
+               the other types, for practical reasons it should be paired with
+               either <code>vnc</code> or <code>spice</code> graphics types.
+               This display type is only supported by QEMU domains
+-              (needs QEMU <span class="since">2.10</span> or newer) and doesn't
+-              accept any attributes.
++              (needs QEMU <span class="since">2.10</span> or newer).
++              <span class="Since">5.0.0</span> this element accepts a
++              <code>&lt;gl/&gt;</code> sub-element with an optional attribute
++              <code>rendernode</code> which can be used to specify an absolute
++              path to a host's DRI device to be used for OpenGL rendering.
+             </p>
+             <pre>
+ &lt;graphics type='spice' autoport='yes'/&gt;
+-&lt;graphics type='egl-headless'/&gt;
++&lt;graphics type='egl-headless'&gt;
++  &lt;gl rendernode='/dev/dri/renderD128'/&gt;
++&lt;/graphics&gt;
+             </pre>
+           </dd>
+         </dl>
+diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
+index 48f0637cad..f37ee4d354 100644
+--- a/docs/schemas/domaincommon.rng
++++ b/docs/schemas/domaincommon.rng
+@@ -3383,9 +3383,20 @@
+             </attribute>
+           </optional>
+         </group>
+-        <attribute name="type">
+-          <value>egl-headless</value>
+-        </attribute>
++        <group>
++          <attribute name="type">
++            <value>egl-headless</value>
++          </attribute>
++          <optional>
++            <element name="gl">
++              <optional>
++                <attribute name="rendernode">
++                  <ref name="absFilePath"/>
++                </attribute>
++              </optional>
++            </element>
++          </optional>
++        </group>
+       </choice>
+     </element>
+   </define>
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index d079be2bb5..1aef0c76f8 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -14274,6 +14274,24 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphicsDefPtr def,
+ }
+ 
+ 
++static int
++virDomainGraphicsDefParseXMLEGLHeadless(virDomainGraphicsDefPtr def,
++                                        xmlNodePtr node,
++                                        xmlXPathContextPtr ctxt)
++{
++    xmlNodePtr save = ctxt->node;
++    xmlNodePtr glNode;
++
++    ctxt->node = node;
++
++    if ((glNode = virXPathNode("./gl", ctxt)))
++        def->data.egl_headless.rendernode = virXMLPropString(glNode,
++                                                             "rendernode");
++    ctxt->node = save;
++    return 0;
++}
++
++
+ /* Parse the XML definition for a graphics device */
+ static virDomainGraphicsDefPtr
+ virDomainGraphicsDefParseXML(xmlNodePtr node,
+@@ -14323,6 +14341,9 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
+             goto error;
+         break;
+     case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
++        if (virDomainGraphicsDefParseXMLEGLHeadless(def, node, ctxt) < 0)
++            goto error;
++        break;
+     case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
+         break;
+     }
+@@ -26724,6 +26745,20 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
+         break;
+ 
+     case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
++        if (!def->data.egl_headless.rendernode)
++            break;
++
++        if (!children) {
++            virBufferAddLit(buf, ">\n");
++            virBufferAdjustIndent(buf, 2);
++            children = true;
++        }
++
++        virBufferAddLit(buf, "<gl");
++        virBufferEscapeString(buf, " rendernode='%s'",
++                              def->data.egl_headless.rendernode);
++        virBufferAddLit(buf, "/>\n");
++        break;
+     case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
+         break;
+     }
+@@ -30718,7 +30753,13 @@ virDomainGraphicsDefHasOpenGL(const virDomainDef *def)
+ bool
+ virDomainGraphicsSupportsRenderNode(const virDomainGraphicsDef *graphics)
+ {
+-    return graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE;
++    bool ret = false;
++
++    if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE ||
++        graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS)
++        ret = true;
++
++    return ret;
+ }
+ 
+ 
+@@ -30733,6 +30774,8 @@ virDomainGraphicsGetRenderNode(const virDomainGraphicsDef *graphics)
+             ret = graphics->data.spice.rendernode;
+         break;
+     case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
++        ret = graphics->data.egl_headless.rendernode;
++        break;
+     case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
+     case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
+     case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index 465dabd8e3..8811aefb95 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -4755,14 +4755,25 @@ static int
+ qemuProcessGraphicsSetupRenderNode(virDomainGraphicsDefPtr graphics,
+                                    virQEMUCapsPtr qemuCaps)
+ {
++    char **rendernode = NULL;
++
+     if (!virDomainGraphicsNeedsAutoRenderNode(graphics))
+         return 0;
+ 
+     /* Don't bother picking a DRM node if QEMU doesn't support it. */
+-    if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE_RENDERNODE))
+-        return 0;
++    if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
++        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE_RENDERNODE))
++            return 0;
+ 
+-    if (!(graphics->data.spice.rendernode = virHostGetDRMRenderNode()))
++        rendernode = &graphics->data.spice.rendernode;
++    } else {
++        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_EGL_HEADLESS_RENDERNODE))
++            return 0;
++
++        rendernode = &graphics->data.egl_headless.rendernode;
++    }
++
++    if (!(*rendernode = virHostGetDRMRenderNode()))
+         return -1;
+ 
+     return 0;
+diff --git a/tests/qemuxml2argvdata/graphics-egl-headless-rendernode.xml b/tests/qemuxml2argvdata/graphics-egl-headless-rendernode.xml
+new file mode 100644
+index 0000000000..a8d54e75da
+--- /dev/null
++++ b/tests/qemuxml2argvdata/graphics-egl-headless-rendernode.xml
+@@ -0,0 +1,33 @@
++<domain type='qemu'>
++  <name>QEMUGuest1</name>
++  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
++  <memory unit='KiB'>219100</memory>
++  <currentMemory unit='KiB'>219100</currentMemory>
++  <vcpu placement='static'>1</vcpu>
++  <os>
++    <type arch='i686' machine='pc'>hvm</type>
++    <boot dev='hd'/>
++  </os>
++  <clock offset='utc'/>
++  <on_poweroff>destroy</on_poweroff>
++  <on_reboot>restart</on_reboot>
++  <on_crash>destroy</on_crash>
++  <devices>
++    <emulator>/usr/bin/qemu-system-i686</emulator>
++    <disk type='block' device='disk'>
++      <driver name='qemu' type='raw'/>
++      <source dev='/dev/HostVG/QEMUGuest1'/>
++      <target dev='hda' bus='ide'/>
++      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
++    </disk>
++    <controller type='usb' index='0'/>
++    <controller type='ide' index='0'/>
++    <controller type='pci' index='0' model='pci-root'/>
++    <input type='mouse' bus='ps2'/>
++    <input type='keyboard' bus='ps2'/>
++    <graphics type='egl-headless'>
++      <gl rendernode='/dev/dri/foo'/>
++    </graphics>
++    <memballoon model='none'/>
++  </devices>
++</domain>
+diff --git a/tests/qemuxml2xmloutdata/graphics-egl-headless-rendernode.xml b/tests/qemuxml2xmloutdata/graphics-egl-headless-rendernode.xml
+new file mode 100644
+index 0000000000..9b7ac89928
+--- /dev/null
++++ b/tests/qemuxml2xmloutdata/graphics-egl-headless-rendernode.xml
+@@ -0,0 +1,41 @@
++<domain type='qemu'>
++  <name>QEMUGuest1</name>
++  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
++  <memory unit='KiB'>219100</memory>
++  <currentMemory unit='KiB'>219100</currentMemory>
++  <vcpu placement='static'>1</vcpu>
++  <os>
++    <type arch='i686' machine='pc'>hvm</type>
++    <boot dev='hd'/>
++  </os>
++  <clock offset='utc'/>
++  <on_poweroff>destroy</on_poweroff>
++  <on_reboot>restart</on_reboot>
++  <on_crash>destroy</on_crash>
++  <devices>
++    <emulator>/usr/bin/qemu-system-i686</emulator>
++    <disk type='block' device='disk'>
++      <driver name='qemu' type='raw'/>
++      <source dev='/dev/HostVG/QEMUGuest1'/>
++      <target dev='hda' bus='ide'/>
++      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
++    </disk>
++    <controller type='usb' index='0'>
++      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
++    </controller>
++    <controller type='ide' index='0'>
++      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
++    </controller>
++    <controller type='pci' index='0' model='pci-root'/>
++    <input type='mouse' bus='ps2'/>
++    <input type='keyboard' bus='ps2'/>
++    <graphics type='egl-headless'>
++      <gl rendernode='/dev/dri/foo'/>
++    </graphics>
++    <video>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
++      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
++    </video>
++    <memballoon model='none'/>
++  </devices>
++</domain>
+diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
+index 5bd522e765..1f67d74797 100644
+--- a/tests/qemuxml2xmltest.c
++++ b/tests/qemuxml2xmltest.c
+@@ -434,6 +434,8 @@ mymain(void)
+     cfg->spiceAutoUnixSocket = false;
+     DO_TEST("graphics-spice-egl-headless", NONE);
+ 
++    DO_TEST("graphics-egl-headless-rendernode", NONE);
++
+     DO_TEST("input-usbmouse", NONE);
+     DO_TEST("input-usbtablet", NONE);
+     DO_TEST("misc-acpi", NONE);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-cpu-Don-t-access-invalid-memory-in-virCPUx86Translate.patch b/SOURCES/libvirt-cpu-Don-t-access-invalid-memory-in-virCPUx86Translate.patch
index aaf679b..1866e76 100644
--- a/SOURCES/libvirt-cpu-Don-t-access-invalid-memory-in-virCPUx86Translate.patch
+++ b/SOURCES/libvirt-cpu-Don-t-access-invalid-memory-in-virCPUx86Translate.patch
@@ -1,5 +1,5 @@
-From b470757774a776e2bcbff50c7ae7f40323d10064 Mon Sep 17 00:00:00 2001
-Message-Id: <b470757774a776e2bcbff50c7ae7f40323d10064@dist-git>
+From bcaa73c80a8634c7db6e7b3a90f2f56b0817bfc5 Mon Sep 17 00:00:00 2001
+Message-Id: <bcaa73c80a8634c7db6e7b3a90f2f56b0817bfc5@dist-git>
 From: Michal Privoznik <mprivozn@redhat.com>
 Date: Thu, 7 Mar 2019 14:17:01 +0100
 Subject: [PATCH] cpu: Don't access invalid memory in virCPUx86Translate
diff --git a/SOURCES/libvirt-cpu_conf-Fix-XPath-for-parsing-TSC-frequency.patch b/SOURCES/libvirt-cpu_conf-Fix-XPath-for-parsing-TSC-frequency.patch
new file mode 100644
index 0000000..f14c956
--- /dev/null
+++ b/SOURCES/libvirt-cpu_conf-Fix-XPath-for-parsing-TSC-frequency.patch
@@ -0,0 +1,44 @@
+From 3e0b4c3b680df486b750174203da60e01198bddf Mon Sep 17 00:00:00 2001
+Message-Id: <3e0b4c3b680df486b750174203da60e01198bddf@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Thu, 6 Jun 2019 09:29:38 +0200
+Subject: [PATCH] cpu_conf: Fix XPath for parsing TSC frequency
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Due to this bug the following command would fail on any host where TSC
+frequency can be probed:
+
+    $ virsh capabilities | virsh cpu-baseline /dev/stdin
+    error: unsupported configuration: Invalid TSC frequency
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 4d21d4acf2eac961b8c25f1ec49a9c25f3951fdb)
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/conf/cpu_conf.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
+index d0ad265fbe..7a5e642541 100644
+--- a/src/conf/cpu_conf.c
++++ b/src/conf/cpu_conf.c
+@@ -407,8 +407,8 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
+             if (VIR_ALLOC(tsc) < 0)
+                 goto cleanup;
+ 
+-            if (virXPathULongLong("./counter[@name='tsc']/@frequency", ctxt,
+-                                  &tsc->frequency) < 0) {
++            if (virXPathULongLong("string(./counter[@name='tsc']/@frequency)",
++                                  ctxt, &tsc->frequency) < 0) {
+                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                                _("Invalid TSC frequency"));
+                 goto cleanup;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-cpu_map-Add-Icelake-CPU-models.patch b/SOURCES/libvirt-cpu_map-Add-Icelake-CPU-models.patch
new file mode 100644
index 0000000..3553e54
--- /dev/null
+++ b/SOURCES/libvirt-cpu_map-Add-Icelake-CPU-models.patch
@@ -0,0 +1,220 @@
+From d7968283b11e437d36d8e8606098b10980aa5d5f Mon Sep 17 00:00:00 2001
+Message-Id: <d7968283b11e437d36d8e8606098b10980aa5d5f@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Tue, 9 Apr 2019 09:38:40 +0200
+Subject: [PATCH] cpu_map: Add Icelake CPU models
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Introduced in QEMU by commit v3.0.0-156-g8a11c62da9.
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit 993d85ae5e2422a664ba5f700ed3bf7abd989cfc)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1526624
+
+Conflicts:
+	src/cpu_map/x86_Icelake-Client.xml
+	src/cpu_map/x86_Icelake-Server.xml
+            - no CPU map split downstream
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <bda8992318e2de7b5d71de824529f6e3604ae058.1554795362.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/cpu/cpu_map.xml | 178 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 178 insertions(+)
+
+diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
+index 234c62781b..1a4f1321f8 100644
+--- a/src/cpu/cpu_map.xml
++++ b/src/cpu/cpu_map.xml
+@@ -2009,6 +2009,184 @@
+       <feature name='xsaveopt'/>
+     </model>
+ 
++    <model name='Icelake-Client'>
++      <signature family='6' model='126'/> <!-- 0706e0 -->
++      <vendor name='Intel'/>
++      <feature name='3dnowprefetch'/>
++      <feature name='abm'/>
++      <feature name='adx'/>
++      <feature name='aes'/>
++      <feature name='apic'/>
++      <feature name='arat'/>
++      <feature name='avx'/>
++      <feature name='avx2'/>
++      <feature name='avx512-vpopcntdq'/>
++      <feature name='avx512bitalg'/>
++      <feature name='avx512vbmi'/>
++      <feature name='avx512vbmi2'/>
++      <feature name='avx512vnni'/>
++      <feature name='bmi1'/>
++      <feature name='bmi2'/>
++      <feature name='clflush'/>
++      <feature name='cmov'/>
++      <feature name='cx16'/>
++      <feature name='cx8'/>
++      <feature name='de'/>
++      <feature name='erms'/>
++      <feature name='f16c'/>
++      <feature name='fma'/>
++      <feature name='fpu'/>
++      <feature name='fsgsbase'/>
++      <feature name='fxsr'/>
++      <feature name='gfni'/>
++      <feature name='hle'/>
++      <feature name='intel-pt'/>
++      <feature name='invpcid'/>
++      <feature name='lahf_lm'/>
++      <feature name='lm'/>
++      <feature name='mca'/>
++      <feature name='mce'/>
++      <feature name='mmx'/>
++      <feature name='movbe'/>
++      <feature name='mpx'/>
++      <feature name='msr'/>
++      <feature name='mtrr'/>
++      <feature name='nx'/>
++      <!-- 'ospke' is a dynamic feature and cannot be enabled manually
++           see QEMU's commit 9ccb9784b57 for more details -->
++      <feature name='pae'/>
++      <feature name='pat'/>
++      <feature name='pcid'/>
++      <feature name='pclmuldq'/>
++      <feature name='pge'/>
++      <feature name='pku'/>
++      <feature name='pni'/>
++      <feature name='popcnt'/>
++      <feature name='pse'/>
++      <feature name='pse36'/>
++      <feature name='rdrand'/>
++      <feature name='rdseed'/>
++      <feature name='rdtscp'/>
++      <feature name='rtm'/>
++      <feature name='sep'/>
++      <feature name='smap'/>
++      <feature name='smep'/>
++      <feature name='spec-ctrl'/>
++      <feature name='ssbd'/>
++      <feature name='sse'/>
++      <feature name='sse2'/>
++      <feature name='sse4.1'/>
++      <feature name='sse4.2'/>
++      <feature name='ssse3'/>
++      <feature name='syscall'/>
++      <feature name='tsc'/>
++      <feature name='tsc-deadline'/>
++      <feature name='umip'/>
++      <feature name='vaes'/>
++      <feature name='vme'/>
++      <feature name='vpclmulqdq'/>
++      <feature name='wbnoinvd'/>
++      <feature name='x2apic'/>
++      <feature name='xgetbv1'/>
++      <feature name='xsave'/>
++      <feature name='xsavec'/>
++      <feature name='xsaveopt'/>
++    </model>
++
++    <model name='Icelake-Server'>
++      <signature family='6' model='134'/> <!-- 080660 -->
++      <vendor name='Intel'/>
++      <feature name='3dnowprefetch'/>
++      <feature name='abm'/>
++      <feature name='adx'/>
++      <feature name='aes'/>
++      <feature name='apic'/>
++      <feature name='arat'/>
++      <feature name='avx'/>
++      <feature name='avx2'/>
++      <feature name='avx512-vpopcntdq'/>
++      <feature name='avx512bitalg'/>
++      <feature name='avx512bw'/>
++      <feature name='avx512cd'/>
++      <feature name='avx512dq'/>
++      <feature name='avx512f'/>
++      <feature name='avx512vbmi'/>
++      <feature name='avx512vbmi2'/>
++      <feature name='avx512vl'/>
++      <feature name='avx512vnni'/>
++      <feature name='bmi1'/>
++      <feature name='bmi2'/>
++      <feature name='clflush'/>
++      <feature name='clflushopt'/>
++      <feature name='clwb'/>
++      <feature name='cmov'/>
++      <feature name='cx16'/>
++      <feature name='cx8'/>
++      <feature name='de'/>
++      <feature name='erms'/>
++      <feature name='f16c'/>
++      <feature name='fma'/>
++      <feature name='fpu'/>
++      <feature name='fsgsbase'/>
++      <feature name='fxsr'/>
++      <feature name='gfni'/>
++      <feature name='hle'/>
++      <feature name='intel-pt'/>
++      <feature name='invpcid'/>
++      <feature name='la57'/>
++      <feature name='lahf_lm'/>
++      <feature name='lm'/>
++      <feature name='mca'/>
++      <feature name='mce'/>
++      <feature name='mmx'/>
++      <feature name='movbe'/>
++      <feature name='mpx'/>
++      <feature name='msr'/>
++      <feature name='mtrr'/>
++      <feature name='nx'/>
++      <!-- 'ospke' is a dynamic feature and cannot be enabled manually
++           see QEMU's commit 9ccb9784b57 for more details -->
++      <feature name='pae'/>
++      <feature name='pat'/>
++      <feature name='pcid'/>
++      <feature name='pclmuldq'/>
++      <feature name='pconfig'/>
++      <feature name='pdpe1gb'/>
++      <feature name='pge'/>
++      <feature name='pku'/>
++      <feature name='pni'/>
++      <feature name='popcnt'/>
++      <feature name='pse'/>
++      <feature name='pse36'/>
++      <feature name='rdrand'/>
++      <feature name='rdseed'/>
++      <feature name='rdtscp'/>
++      <feature name='rtm'/>
++      <feature name='sep'/>
++      <feature name='smap'/>
++      <feature name='smep'/>
++      <feature name='spec-ctrl'/>
++      <feature name='ssbd'/>
++      <feature name='sse'/>
++      <feature name='sse2'/>
++      <feature name='sse4.1'/>
++      <feature name='sse4.2'/>
++      <feature name='ssse3'/>
++      <feature name='syscall'/>
++      <feature name='tsc'/>
++      <feature name='tsc-deadline'/>
++      <feature name='umip'/>
++      <feature name='vaes'/>
++      <feature name='vme'/>
++      <feature name='vpclmulqdq'/>
++      <feature name='wbnoinvd'/>
++      <feature name='x2apic'/>
++      <feature name='xgetbv1'/>
++      <feature name='xsave'/>
++      <feature name='xsavec'/>
++      <feature name='xsaveopt'/>
++    </model>
++
+     <!-- AMD CPUs -->
+     <model name='athlon'>
+       <vendor name='AMD'/>
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-cpu_map-Add-features-for-Icelake-CPUs.patch b/SOURCES/libvirt-cpu_map-Add-features-for-Icelake-CPUs.patch
new file mode 100644
index 0000000..0bcace7
--- /dev/null
+++ b/SOURCES/libvirt-cpu_map-Add-features-for-Icelake-CPUs.patch
@@ -0,0 +1,505 @@
+From f1269c8165b8c805e57e37179f893d3f2a1d4f95 Mon Sep 17 00:00:00 2001
+Message-Id: <f1269c8165b8c805e57e37179f893d3f2a1d4f95@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Tue, 9 Apr 2019 09:38:39 +0200
+Subject: [PATCH] cpu_map: Add features for Icelake CPUs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+QEMU commits:
+
+    e37a5c7fa4 (v2.12.0)
+        i386: Add Intel Processor Trace feature support
+
+    c2f193b538 (v2.7.0)
+        target-i386: Add support for UMIP and RDPID CPUID bits
+
+    aff9e6e46a (v2.12.0)
+        x86/cpu: Enable new SSE/AVX/AVX512 cpu features
+
+    f77543772d (v2.9.0)
+        x86: add AVX512_VPOPCNTDQ features
+
+    5131dc433d (v3.1.0)
+        i386: Add CPUID bit for PCONFIG
+
+    59a80a19ca (v3.1.0)
+        i386: Add CPUID bit for WBNOINVD
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit 9813081119b6727c8b6067a783465addef06525e)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1526624
+https://bugzilla.redhat.com/show_bug.cgi?id=1527659
+
+Conflicts:
+	src/cpu_map/x86_features.xml
+            - no CPU map split downstream
+
+	tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml
+	tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml
+	tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml
+	tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml
+            - the "stibp" feature added upstream by commit eb1b551d21e
+              to libvirt 5.0.0 is already in RHEL-7 thanks to "RHEL:
+              cpu: Add downstream only CPU features for CVE-2017-5715"
+
+	tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v4-guest.xml
+            - upstream commit e7e1e3003d5 "cpu_map: Add more signatures
+              for Broadwell CPU models" is already backported to RHEL-7
+
+	tests/cputestdata/x86_64-cpuid-Core-i7-7600U-guest.xml
+	tests/cputestdata/x86_64-cpuid-Core-i7-7600U-host.xml
+	tests/cputestdata/x86_64-cpuid-Core-i7-7600U-json.xml
+	tests/cputestdata/x86_64-cpuid-Core-i7-8700-guest.xml
+	tests/cputestdata/x86_64-cpuid-Core-i7-8700-host.xml
+	tests/cputestdata/x86_64-cpuid-Core-i7-8700-json.xml
+            - these tests were added upstream later, but they are
+              already backported to RHEL-7
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <cb4c0855a285ea0c9f8ed17216c3f022adc27b69.1554795361.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/cpu/cpu_map.xml                           | 33 +++++++++++++++++++
+ .../x86_64-cpuid-Core-i5-6600-guest.xml       |  1 +
+ .../x86_64-cpuid-Core-i5-6600-host.xml        |  1 +
+ .../x86_64-cpuid-Core-i7-5600U-arat-guest.xml |  1 +
+ .../x86_64-cpuid-Core-i7-5600U-arat-host.xml  |  1 +
+ .../x86_64-cpuid-Core-i7-5600U-guest.xml      |  1 +
+ .../x86_64-cpuid-Core-i7-5600U-host.xml       |  1 +
+ .../x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml |  1 +
+ .../x86_64-cpuid-Core-i7-5600U-ibrs-host.xml  |  1 +
+ .../x86_64-cpuid-Core-i7-7600U-guest.xml      |  1 +
+ .../x86_64-cpuid-Core-i7-7600U-host.xml       |  1 +
+ .../x86_64-cpuid-Core-i7-7600U-json.xml       |  1 +
+ .../x86_64-cpuid-Core-i7-7700-guest.xml       |  1 +
+ .../x86_64-cpuid-Core-i7-7700-host.xml        |  1 +
+ .../x86_64-cpuid-Core-i7-8700-guest.xml       |  1 +
+ .../x86_64-cpuid-Core-i7-8700-host.xml        |  1 +
+ .../x86_64-cpuid-Core-i7-8700-json.xml        |  1 +
+ .../x86_64-cpuid-Xeon-E3-1245-v5-guest.xml    |  1 +
+ .../x86_64-cpuid-Xeon-E3-1245-v5-host.xml     |  1 +
+ .../x86_64-cpuid-Xeon-E5-2623-v4-guest.xml    |  1 +
+ .../x86_64-cpuid-Xeon-E5-2623-v4-host.xml     |  1 +
+ .../x86_64-cpuid-Xeon-E5-2630-v4-guest.xml    |  1 +
+ .../x86_64-cpuid-Xeon-E5-2630-v4-host.xml     |  1 +
+ .../x86_64-cpuid-Xeon-E5-2650-v4-guest.xml    |  1 +
+ .../x86_64-cpuid-Xeon-E5-2650-v4-host.xml     |  1 +
+ .../x86_64-cpuid-Xeon-Gold-5115-guest.xml     |  1 +
+ .../x86_64-cpuid-Xeon-Gold-5115-host.xml      |  1 +
+ .../x86_64-cpuid-Xeon-Gold-6148-guest.xml     |  1 +
+ .../x86_64-cpuid-Xeon-Gold-6148-host.xml      |  1 +
+ 29 files changed, 61 insertions(+)
+
+diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
+index 1382c29cd1..234c62781b 100644
+--- a/src/cpu/cpu_map.xml
++++ b/src/cpu/cpu_map.xml
+@@ -257,6 +257,9 @@
+     <feature name='clwb'>
+       <cpuid eax_in='0x07' ecx_in='0x00' ebx='0x01000000'/>
+     </feature>
++    <feature name='intel-pt'>
++      <cpuid eax_in='0x07' ecx_in='0x00' ebx='0x02000000'/>
++    </feature>
+     <feature name='avx512pf'>
+       <cpuid eax_in='0x07' ecx_in='0x00' ebx='0x04000000'/>
+     </feature>
+@@ -279,12 +282,36 @@
+     <feature name='avx512vbmi'>
+       <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00000002'/>
+     </feature>
++    <feature name='umip'>
++      <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00000004'/>
++    </feature>
+     <feature name='pku'>
+       <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00000008'/>
+     </feature>
+     <feature name='ospke'>
+       <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00000010'/>
+     </feature>
++    <feature name='avx512vbmi2'>
++      <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00000040'/>
++    </feature>
++    <feature name='gfni'>
++      <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00000100'/>
++    </feature>
++    <feature name='vaes'>
++      <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00000200'/>
++    </feature>
++    <feature name='vpclmulqdq'>
++      <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00000400'/>
++    </feature>
++    <feature name='avx512vnni'>
++      <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00000800'/>
++    </feature>
++    <feature name='avx512bitalg'>
++      <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00001000'/>
++    </feature>
++    <feature name='avx512-vpopcntdq'>
++      <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00004000'/>
++    </feature>
+     <feature name='la57'>
+       <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00010000'/>
+     </feature>
+@@ -295,6 +322,9 @@
+     <feature name='avx512-4fmaps'>
+       <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00000008'/>
+     </feature>
++    <feature name='pconfig'>
++      <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00040000'/>
++    </feature>
+     <feature name='spec-ctrl'>
+       <cpuid eax_in='0x07' ecx_in='0x00' edx='0x04000000'/>
+     </feature>
+@@ -436,6 +466,9 @@
+     </feature>
+ 
+     <!-- More AMD-specific features -->
++    <feature name='wbnoinvd'>
++      <cpuid eax_in='0x80000008' ebx='0x00000200'/>
++    </feature>
+     <feature name='ibpb'>
+       <cpuid eax_in='0x80000008' ebx='0x00001000'/>
+     </feature>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-6600-guest.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-6600-guest.xml
+index c3561d5971..5777a0bfba 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i5-6600-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i5-6600-guest.xml
+@@ -19,6 +19,7 @@
+   <feature policy='require' name='osxsave'/>
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='clflushopt'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='xsaves'/>
+   <feature policy='require' name='pdpe1gb'/>
+   <feature policy='require' name='invtsc'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i5-6600-host.xml b/tests/cputestdata/x86_64-cpuid-Core-i5-6600-host.xml
+index c799394eaf..faaa07f19b 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i5-6600-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i5-6600-host.xml
+@@ -20,6 +20,7 @@
+   <feature name='osxsave'/>
+   <feature name='tsc_adjust'/>
+   <feature name='clflushopt'/>
++  <feature name='intel-pt'/>
+   <feature name='xsaves'/>
+   <feature name='pdpe1gb'/>
+   <feature name='invtsc'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-arat-guest.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-arat-guest.xml
+index 877895cf15..e825e2a0fb 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-arat-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-arat-guest.xml
+@@ -22,6 +22,7 @@
+   <feature policy='require' name='rdrand'/>
+   <feature policy='require' name='arat'/>
+   <feature policy='require' name='tsc_adjust'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='xsaveopt'/>
+   <feature policy='require' name='pdpe1gb'/>
+   <feature policy='require' name='abm'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-arat-host.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-arat-host.xml
+index 9b24941e0e..ea622c87c7 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-arat-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-arat-host.xml
+@@ -23,6 +23,7 @@
+   <feature name='rdrand'/>
+   <feature name='arat'/>
+   <feature name='tsc_adjust'/>
++  <feature name='intel-pt'/>
+   <feature name='xsaveopt'/>
+   <feature name='pdpe1gb'/>
+   <feature name='abm'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-guest.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-guest.xml
+index 877895cf15..e825e2a0fb 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-guest.xml
+@@ -22,6 +22,7 @@
+   <feature policy='require' name='rdrand'/>
+   <feature policy='require' name='arat'/>
+   <feature policy='require' name='tsc_adjust'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='xsaveopt'/>
+   <feature policy='require' name='pdpe1gb'/>
+   <feature policy='require' name='abm'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-host.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-host.xml
+index 9b24941e0e..ea622c87c7 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-host.xml
+@@ -23,6 +23,7 @@
+   <feature name='rdrand'/>
+   <feature name='arat'/>
+   <feature name='tsc_adjust'/>
++  <feature name='intel-pt'/>
+   <feature name='xsaveopt'/>
+   <feature name='pdpe1gb'/>
+   <feature name='abm'/>
+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 538bfe16ab..5d3093cec1 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 @@
+   <feature policy='require' name='rdrand'/>
+   <feature policy='require' name='arat'/>
+   <feature policy='require' name='tsc_adjust'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='stibp'/>
+   <feature policy='require' name='xsaveopt'/>
+   <feature policy='require' name='pdpe1gb'/>
+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 004423ee57..a534d2dec5 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 @@
+   <feature name='rdrand'/>
+   <feature name='arat'/>
+   <feature name='tsc_adjust'/>
++  <feature name='intel-pt'/>
+   <feature name='stibp'/>
+   <feature name='xsaveopt'/>
+   <feature name='pdpe1gb'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-guest.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-guest.xml
+index 141c01c841..70a0fc3286 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-guest.xml
+@@ -19,6 +19,7 @@
+   <feature policy='require' name='osxsave'/>
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='clflushopt'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='stibp'/>
+   <feature policy='require' name='ssbd'/>
+   <feature policy='require' name='xsaves'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-host.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-host.xml
+index 53bfc9728d..bbdfb6aa61 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-host.xml
+@@ -20,6 +20,7 @@
+   <feature name='osxsave'/>
+   <feature name='tsc_adjust'/>
+   <feature name='clflushopt'/>
++  <feature name='intel-pt'/>
+   <feature name='stibp'/>
+   <feature name='ssbd'/>
+   <feature name='xsaves'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-json.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-json.xml
+index f2c23b6b19..48089c6003 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-json.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-7600U-json.xml
+@@ -6,6 +6,7 @@
+   <feature policy='require' name='hypervisor'/>
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='clflushopt'/>
++  <feature policy='require' name='umip'/>
+   <feature policy='require' name='ssbd'/>
+   <feature policy='require' name='xsaves'/>
+   <feature policy='require' name='pdpe1gb'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-7700-guest.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-7700-guest.xml
+index c3561d5971..5777a0bfba 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-7700-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-7700-guest.xml
+@@ -19,6 +19,7 @@
+   <feature policy='require' name='osxsave'/>
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='clflushopt'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='xsaves'/>
+   <feature policy='require' name='pdpe1gb'/>
+   <feature policy='require' name='invtsc'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-7700-host.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-7700-host.xml
+index c799394eaf..faaa07f19b 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-7700-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-7700-host.xml
+@@ -20,6 +20,7 @@
+   <feature name='osxsave'/>
+   <feature name='tsc_adjust'/>
+   <feature name='clflushopt'/>
++  <feature name='intel-pt'/>
+   <feature name='xsaves'/>
+   <feature name='pdpe1gb'/>
+   <feature name='invtsc'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-8700-guest.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-8700-guest.xml
+index 141c01c841..70a0fc3286 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-8700-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-8700-guest.xml
+@@ -19,6 +19,7 @@
+   <feature policy='require' name='osxsave'/>
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='clflushopt'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='stibp'/>
+   <feature policy='require' name='ssbd'/>
+   <feature policy='require' name='xsaves'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-8700-host.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-8700-host.xml
+index 53bfc9728d..bbdfb6aa61 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-8700-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-8700-host.xml
+@@ -20,6 +20,7 @@
+   <feature name='osxsave'/>
+   <feature name='tsc_adjust'/>
+   <feature name='clflushopt'/>
++  <feature name='intel-pt'/>
+   <feature name='stibp'/>
+   <feature name='ssbd'/>
+   <feature name='xsaves'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-8700-json.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-8700-json.xml
+index bf79d435a3..fd7539f7ce 100644
+--- a/tests/cputestdata/x86_64-cpuid-Core-i7-8700-json.xml
++++ b/tests/cputestdata/x86_64-cpuid-Core-i7-8700-json.xml
+@@ -5,6 +5,7 @@
+   <feature policy='require' name='hypervisor'/>
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='clflushopt'/>
++  <feature policy='require' name='umip'/>
+   <feature policy='require' name='ssbd'/>
+   <feature policy='require' name='xsaves'/>
+   <feature policy='require' name='pdpe1gb'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-v5-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-v5-guest.xml
+index c3561d5971..5777a0bfba 100644
+--- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-v5-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-v5-guest.xml
+@@ -19,6 +19,7 @@
+   <feature policy='require' name='osxsave'/>
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='clflushopt'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='xsaves'/>
+   <feature policy='require' name='pdpe1gb'/>
+   <feature policy='require' name='invtsc'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-v5-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-v5-host.xml
+index c799394eaf..faaa07f19b 100644
+--- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-v5-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1245-v5-host.xml
+@@ -20,6 +20,7 @@
+   <feature name='osxsave'/>
+   <feature name='tsc_adjust'/>
+   <feature name='clflushopt'/>
++  <feature name='intel-pt'/>
+   <feature name='xsaves'/>
+   <feature name='pdpe1gb'/>
+   <feature name='invtsc'/>
+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 e2ad344497..a5c6d9b471 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
+@@ -24,6 +24,7 @@
+   <feature policy='require' name='arat'/>
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='cmt'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='stibp'/>
+   <feature policy='require' name='xsaveopt'/>
+   <feature policy='require' name='mbm_total'/>
+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 60a7a9339d..43a0b93ab4 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 @@
+   <feature name='arat'/>
+   <feature name='tsc_adjust'/>
+   <feature name='cmt'/>
++  <feature name='intel-pt'/>
+   <feature name='stibp'/>
+   <feature name='xsaveopt'/>
+   <feature name='mbm_total'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-guest.xml
+index c670b1f4df..e2999db8e9 100644
+--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-guest.xml
+@@ -24,6 +24,7 @@
+   <feature policy='require' name='arat'/>
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='cmt'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='xsaveopt'/>
+   <feature policy='require' name='mbm_total'/>
+   <feature policy='require' name='mbm_local'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-host.xml
+index f482864a98..5dd8d749de 100644
+--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2630-v4-host.xml
+@@ -25,6 +25,7 @@
+   <feature name='arat'/>
+   <feature name='tsc_adjust'/>
+   <feature name='cmt'/>
++  <feature name='intel-pt'/>
+   <feature name='xsaveopt'/>
+   <feature name='mbm_total'/>
+   <feature name='mbm_local'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v4-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v4-guest.xml
+index c670b1f4df..e2999db8e9 100644
+--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v4-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v4-guest.xml
+@@ -24,6 +24,7 @@
+   <feature policy='require' name='arat'/>
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='cmt'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='xsaveopt'/>
+   <feature policy='require' name='mbm_total'/>
+   <feature policy='require' name='mbm_local'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v4-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v4-host.xml
+index f482864a98..5dd8d749de 100644
+--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v4-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2650-v4-host.xml
+@@ -25,6 +25,7 @@
+   <feature name='arat'/>
+   <feature name='tsc_adjust'/>
+   <feature name='cmt'/>
++  <feature name='intel-pt'/>
+   <feature name='xsaveopt'/>
+   <feature name='mbm_total'/>
+   <feature name='mbm_local'/>
+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 64b69dea56..8f014f6e28 100644
+--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml
+@@ -21,6 +21,7 @@
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='cmt'/>
+   <feature policy='require' name='clflushopt'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='pku'/>
+   <feature policy='require' name='stibp'/>
+   <feature policy='require' name='xsaves'/>
+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 00e8da7512..9de76fd640 100644
+--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml
+@@ -22,6 +22,7 @@
+   <feature name='tsc_adjust'/>
+   <feature name='cmt'/>
+   <feature name='clflushopt'/>
++  <feature name='intel-pt'/>
+   <feature name='pku'/>
+   <feature name='stibp'/>
+   <feature name='xsaves'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6148-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6148-guest.xml
+index f72bcea68b..f31ca1ffc5 100644
+--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6148-guest.xml
++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6148-guest.xml
+@@ -21,6 +21,7 @@
+   <feature policy='require' name='tsc_adjust'/>
+   <feature policy='require' name='cmt'/>
+   <feature policy='require' name='clflushopt'/>
++  <feature policy='require' name='intel-pt'/>
+   <feature policy='require' name='pku'/>
+   <feature policy='require' name='xsaves'/>
+   <feature policy='require' name='mbm_total'/>
+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6148-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6148-host.xml
+index 1a68e35c19..b18ceddc60 100644
+--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6148-host.xml
++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6148-host.xml
+@@ -22,6 +22,7 @@
+   <feature name='tsc_adjust'/>
+   <feature name='cmt'/>
+   <feature name='clflushopt'/>
++  <feature name='intel-pt'/>
+   <feature name='pku'/>
+   <feature name='xsaves'/>
+   <feature name='mbm_total'/>
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-cpu_map-Add-hex-representation-of-signatures.patch b/SOURCES/libvirt-cpu_map-Add-hex-representation-of-signatures.patch
index 7746a87..efdffc6 100644
--- a/SOURCES/libvirt-cpu_map-Add-hex-representation-of-signatures.patch
+++ b/SOURCES/libvirt-cpu_map-Add-hex-representation-of-signatures.patch
@@ -1,5 +1,5 @@
-From d0fff22c96e56f72e05009b038fc8a80ae35a6ff Mon Sep 17 00:00:00 2001
-Message-Id: <d0fff22c96e56f72e05009b038fc8a80ae35a6ff@dist-git>
+From c032d2492e245deccc66b34ca1006028d5759d80 Mon Sep 17 00:00:00 2001
+Message-Id: <c032d2492e245deccc66b34ca1006028d5759d80@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 26 Feb 2019 09:22:36 +0100
 Subject: [PATCH] cpu_map: Add hex representation of signatures
diff --git a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Broadwell-CPU-models.patch b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Broadwell-CPU-models.patch
index 4a962a1..9b300ca 100644
--- a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Broadwell-CPU-models.patch
+++ b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Broadwell-CPU-models.patch
@@ -1,5 +1,5 @@
-From a4fe8dfb0c2df61f1b903e8858cd6430954f30e2 Mon Sep 17 00:00:00 2001
-Message-Id: <a4fe8dfb0c2df61f1b903e8858cd6430954f30e2@dist-git>
+From e7e1e3003d52fee05ef040e273c590a66d90e6f9 Mon Sep 17 00:00:00 2001
+Message-Id: <e7e1e3003d52fee05ef040e273c590a66d90e6f9@dist-git>
 From: Jiri Denemark <Jiri.Denemark@gmail.com>
 Date: Wed, 20 Mar 2019 17:15:16 +0100
 Subject: [PATCH] cpu_map: Add more signatures for Broadwell CPU models
diff --git a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Conroe-CPU-model.patch b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Conroe-CPU-model.patch
index ba9434b..5a13136 100644
--- a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Conroe-CPU-model.patch
+++ b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Conroe-CPU-model.patch
@@ -1,5 +1,5 @@
-From 76c38a02c95057563349d6298aa70bde014b75c8 Mon Sep 17 00:00:00 2001
-Message-Id: <76c38a02c95057563349d6298aa70bde014b75c8@dist-git>
+From 3161fe76b8f7852521589993fb0330464d5a0307 Mon Sep 17 00:00:00 2001
+Message-Id: <3161fe76b8f7852521589993fb0330464d5a0307@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 26 Feb 2019 10:45:56 +0100
 Subject: [PATCH] cpu_map: Add more signatures for Conroe CPU model
diff --git a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Haswell-CPU-models.patch b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Haswell-CPU-models.patch
index b4cec74..6a0db7c 100644
--- a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Haswell-CPU-models.patch
+++ b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Haswell-CPU-models.patch
@@ -1,5 +1,5 @@
-From b7208e290e2312156f8efbbffad31316d73d8a42 Mon Sep 17 00:00:00 2001
-Message-Id: <b7208e290e2312156f8efbbffad31316d73d8a42@dist-git>
+From 265ba06a2613a05c2b770bfd7ca9a83147d87362 Mon Sep 17 00:00:00 2001
+Message-Id: <265ba06a2613a05c2b770bfd7ca9a83147d87362@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 26 Feb 2019 12:06:05 +0100
 Subject: [PATCH] cpu_map: Add more signatures for Haswell CPU models
diff --git a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-IvyBridge-CPU-models.patch b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-IvyBridge-CPU-models.patch
index c622d77..cd0d37a 100644
--- a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-IvyBridge-CPU-models.patch
+++ b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-IvyBridge-CPU-models.patch
@@ -1,5 +1,5 @@
-From 883cfd41ab4b39528ba94f272bd2d78e009aa92d Mon Sep 17 00:00:00 2001
-Message-Id: <883cfd41ab4b39528ba94f272bd2d78e009aa92d@dist-git>
+From 000aefe7232ce1dd4c51b923e1a7fedd19fbff7f Mon Sep 17 00:00:00 2001
+Message-Id: <000aefe7232ce1dd4c51b923e1a7fedd19fbff7f@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 26 Feb 2019 12:22:00 +0100
 Subject: [PATCH] cpu_map: Add more signatures for IvyBridge CPU models
diff --git a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Nehalem-CPU-models.patch b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Nehalem-CPU-models.patch
index df74a44..26636b7 100644
--- a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Nehalem-CPU-models.patch
+++ b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Nehalem-CPU-models.patch
@@ -1,5 +1,5 @@
-From a520258a7d3d6bf144b2fac4717bccee91d5d0ca Mon Sep 17 00:00:00 2001
-Message-Id: <a520258a7d3d6bf144b2fac4717bccee91d5d0ca@dist-git>
+From 4fa3e47f1e63a9e29f9df466b73e1d332c98ef5e Mon Sep 17 00:00:00 2001
+Message-Id: <4fa3e47f1e63a9e29f9df466b73e1d332c98ef5e@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 26 Feb 2019 12:59:37 +0100
 Subject: [PATCH] cpu_map: Add more signatures for Nehalem CPU models
diff --git a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Penryn-CPU-model.patch b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Penryn-CPU-model.patch
index 191ba46..27b233f 100644
--- a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Penryn-CPU-model.patch
+++ b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Penryn-CPU-model.patch
@@ -1,5 +1,5 @@
-From 3c834c19e111e5df17ce7c4206d4c8213709e819 Mon Sep 17 00:00:00 2001
-Message-Id: <3c834c19e111e5df17ce7c4206d4c8213709e819@dist-git>
+From 18528617659bbf6cf61eb3faccdd6794240827f6 Mon Sep 17 00:00:00 2001
+Message-Id: <18528617659bbf6cf61eb3faccdd6794240827f6@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 26 Feb 2019 12:59:50 +0100
 Subject: [PATCH] cpu_map: Add more signatures for Penryn CPU model
diff --git a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-SandyBridge-CPU-models.patch b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-SandyBridge-CPU-models.patch
index 97269e7..edd25c5 100644
--- a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-SandyBridge-CPU-models.patch
+++ b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-SandyBridge-CPU-models.patch
@@ -1,5 +1,5 @@
-From 0b0c3aef9a537d9395d53806ac3695348a47dc09 Mon Sep 17 00:00:00 2001
-Message-Id: <0b0c3aef9a537d9395d53806ac3695348a47dc09@dist-git>
+From 663256a04ab602b25b861db27fdac57876cc8cd2 Mon Sep 17 00:00:00 2001
+Message-Id: <663256a04ab602b25b861db27fdac57876cc8cd2@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 26 Feb 2019 20:26:35 +0100
 Subject: [PATCH] cpu_map: Add more signatures for SandyBridge CPU models
diff --git a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Skylake-Client-CPU-models.patch b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Skylake-Client-CPU-models.patch
index ecdcd66..4ca2921 100644
--- a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Skylake-Client-CPU-models.patch
+++ b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Skylake-Client-CPU-models.patch
@@ -1,5 +1,5 @@
-From 8760102a2e73747c6ae570c699c3da6752c9efb7 Mon Sep 17 00:00:00 2001
-Message-Id: <8760102a2e73747c6ae570c699c3da6752c9efb7@dist-git>
+From 4a84b7c166cd4a807d39663d3cb879e599c5b349 Mon Sep 17 00:00:00 2001
+Message-Id: <4a84b7c166cd4a807d39663d3cb879e599c5b349@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 26 Feb 2019 21:02:49 +0100
 Subject: [PATCH] cpu_map: Add more signatures for Skylake-Client CPU models
diff --git a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Westmere-CPU-model.patch b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Westmere-CPU-model.patch
index 252acd1..a1a268d 100644
--- a/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Westmere-CPU-model.patch
+++ b/SOURCES/libvirt-cpu_map-Add-more-signatures-for-Westmere-CPU-model.patch
@@ -1,5 +1,5 @@
-From c34ca3d596e641381b3397958be5f584f6318777 Mon Sep 17 00:00:00 2001
-Message-Id: <c34ca3d596e641381b3397958be5f584f6318777@dist-git>
+From 7dc1f39e60d8ed40b3dd4f391a488eb6a5f74ca2 Mon Sep 17 00:00:00 2001
+Message-Id: <7dc1f39e60d8ed40b3dd4f391a488eb6a5f74ca2@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Mon, 25 Feb 2019 16:44:11 +0100
 Subject: [PATCH] cpu_map: Add more signatures for Westmere CPU model
diff --git a/SOURCES/libvirt-cpu_map-Add-support-for-cldemote-CPU-feature.patch b/SOURCES/libvirt-cpu_map-Add-support-for-cldemote-CPU-feature.patch
new file mode 100644
index 0000000..cbeb770
--- /dev/null
+++ b/SOURCES/libvirt-cpu_map-Add-support-for-cldemote-CPU-feature.patch
@@ -0,0 +1,46 @@
+From 3139985e97cbd2e38deeef7d82eb989f348707bc Mon Sep 17 00:00:00 2001
+Message-Id: <3139985e97cbd2e38deeef7d82eb989f348707bc@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Thu, 25 Apr 2019 16:36:43 +0200
+Subject: [PATCH] cpu_map: Add support for cldemote CPU feature
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Added in QEMU by v2.12.0-481-g0da0fb0628 (released in 3.0).
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 8feeee9ee23f0500cc2585e1b11231c54de8e93d)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1537731
+https://bugzilla.redhat.com/show_bug.cgi?id=1537777
+
+Conflicts:
+	src/cpu_map/x86_features.xml
+            - features are defined in src/cpu/cpu_map.xml downstream
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <bb26b8e5c8323be651bae3d1c15aa04528f2c26d.1556202959.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/cpu/cpu_map.xml | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
+index 1a4f1321f8..1d65a92e6d 100644
+--- a/src/cpu/cpu_map.xml
++++ b/src/cpu/cpu_map.xml
+@@ -315,6 +315,9 @@
+     <feature name='la57'>
+       <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x00010000'/>
+     </feature>
++    <feature name='cldemote'>
++      <cpuid eax_in='0x07' ecx_in='0x00' ecx='0x02000000'/>
++    </feature>
+ 
+     <feature name='avx512-4vnniw'>
+       <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00000004'/>
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-cpu_map-Define-md-clear-CPUID-bit.patch b/SOURCES/libvirt-cpu_map-Define-md-clear-CPUID-bit.patch
index 7116abf..b482d06 100644
--- a/SOURCES/libvirt-cpu_map-Define-md-clear-CPUID-bit.patch
+++ b/SOURCES/libvirt-cpu_map-Define-md-clear-CPUID-bit.patch
@@ -1,17 +1,21 @@
-From 96b390925bffede1dcf2940cc79120b54dc3ed6c Mon Sep 17 00:00:00 2001
-Message-Id: <96b390925bffede1dcf2940cc79120b54dc3ed6c@dist-git>
+From fcf4343a70f4654f7b76ebffcd040902fe0db0e9 Mon Sep 17 00:00:00 2001
+Message-Id: <fcf4343a70f4654f7b76ebffcd040902fe0db0e9@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Fri, 5 Apr 2019 15:11:20 +0200
 Subject: [PATCH] cpu_map: Define md-clear CPUID bit
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
-CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
 
 The bit is set when microcode provides the mechanism to invoke a flush
 of various exploitable CPU buffers by invoking the VERW instruction.
 
 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
 Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
-(cherry picked from a private commit)
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit 538d873571d7a682852dc1d70e5f4478f4d64e85)
 
 Conflicts:
 	src/cpu_map/x86_features.xml
@@ -21,10 +25,6 @@ Conflicts:
 	tests/cputestdata/x86_64-cpuid-Xeon-Platinum-8268-host.xml
             - test data missing downstream
 
-	tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml
-	tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml
-            - intel-pt feature is missing in RHEL-7.6
-
 Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
 ---
  src/cpu/cpu_map.xml                                        | 3 +++
@@ -35,18 +35,18 @@ Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
  5 files changed, 7 insertions(+), 1 deletion(-)
 
 diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
-index 1382c29cd1..e8960470ad 100644
+index 1d65a92e6d..12f664434f 100644
 --- a/src/cpu/cpu_map.xml
 +++ b/src/cpu/cpu_map.xml
-@@ -295,6 +295,9 @@
+@@ -325,6 +325,9 @@
      <feature name='avx512-4fmaps'>
        <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00000008'/>
      </feature>
 +    <feature name='md-clear'> <!-- md_clear -->
 +      <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00000400'/>
 +    </feature>
-     <feature name='spec-ctrl'>
-       <cpuid eax_in='0x07' ecx_in='0x00' edx='0x04000000'/>
+     <feature name='pconfig'>
+       <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00040000'/>
      </feature>
 diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-enabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-enabled.xml
 index 0deca9fba6..74763a462b 100644
@@ -62,25 +62,25 @@ index 0deca9fba6..74763a462b 100644
    <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000121' edx='0x2c100800'/>
  </cpudata>
 diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml
-index 141c01c841..3b3472742e 100644
+index 70a0fc3286..867970d2c7 100644
 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml
 +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml
-@@ -19,6 +19,7 @@
-   <feature policy='require' name='osxsave'/>
+@@ -20,6 +20,7 @@
    <feature policy='require' name='tsc_adjust'/>
    <feature policy='require' name='clflushopt'/>
+   <feature policy='require' name='intel-pt'/>
 +  <feature policy='require' name='md-clear'/>
    <feature policy='require' name='stibp'/>
    <feature policy='require' name='ssbd'/>
    <feature policy='require' name='xsaves'/>
 diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml
-index 53bfc9728d..df4f97417c 100644
+index bbdfb6aa61..e7ced42797 100644
 --- a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml
 +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml
-@@ -20,6 +20,7 @@
-   <feature name='osxsave'/>
+@@ -21,6 +21,7 @@
    <feature name='tsc_adjust'/>
    <feature name='clflushopt'/>
+   <feature name='intel-pt'/>
 +  <feature name='md-clear'/>
    <feature name='stibp'/>
    <feature name='ssbd'/>
diff --git a/SOURCES/libvirt-cpu_x86-Add-x86ModelCopySignatures-helper.patch b/SOURCES/libvirt-cpu_x86-Add-x86ModelCopySignatures-helper.patch
index 0b36a89..d3d15cd 100644
--- a/SOURCES/libvirt-cpu_x86-Add-x86ModelCopySignatures-helper.patch
+++ b/SOURCES/libvirt-cpu_x86-Add-x86ModelCopySignatures-helper.patch
@@ -1,5 +1,5 @@
-From 53cf8a5c5e91132ac3d12bbe2e611594272bb30a Mon Sep 17 00:00:00 2001
-Message-Id: <53cf8a5c5e91132ac3d12bbe2e611594272bb30a@dist-git>
+From 9c6ce78ae4da48e98abfcc50b8d5056d54503c14 Mon Sep 17 00:00:00 2001
+Message-Id: <9c6ce78ae4da48e98abfcc50b8d5056d54503c14@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Mon, 4 Mar 2019 16:18:42 +0100
 Subject: [PATCH] cpu_x86: Add x86ModelCopySignatures helper
diff --git a/SOURCES/libvirt-cpu_x86-Allow-multiple-signatures-for-a-CPU-model.patch b/SOURCES/libvirt-cpu_x86-Allow-multiple-signatures-for-a-CPU-model.patch
index 4939755..a2965df 100644
--- a/SOURCES/libvirt-cpu_x86-Allow-multiple-signatures-for-a-CPU-model.patch
+++ b/SOURCES/libvirt-cpu_x86-Allow-multiple-signatures-for-a-CPU-model.patch
@@ -1,5 +1,5 @@
-From ac2924813141609b07860a0df5c6bd56eddf0b3e Mon Sep 17 00:00:00 2001
-Message-Id: <ac2924813141609b07860a0df5c6bd56eddf0b3e@dist-git>
+From 26527762b782dbac88abea82d570bc89fcd9af40 Mon Sep 17 00:00:00 2001
+Message-Id: <26527762b782dbac88abea82d570bc89fcd9af40@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Fri, 22 Feb 2019 17:20:59 +0100
 Subject: [PATCH] cpu_x86: Allow multiple signatures for a CPU model
diff --git a/SOURCES/libvirt-cpu_x86-Do-not-cache-microcode-version.patch b/SOURCES/libvirt-cpu_x86-Do-not-cache-microcode-version.patch
index e5d5152..d18cf66 100644
--- a/SOURCES/libvirt-cpu_x86-Do-not-cache-microcode-version.patch
+++ b/SOURCES/libvirt-cpu_x86-Do-not-cache-microcode-version.patch
@@ -1,7 +1,7 @@
-From 1054c2ab4381145ddc9e937a40c109980f15cf69 Mon Sep 17 00:00:00 2001
-Message-Id: <1054c2ab4381145ddc9e937a40c109980f15cf69@dist-git>
+From 0f34aa83adc7e87ff0189ae6af1c8acbc3589812 Mon Sep 17 00:00:00 2001
+Message-Id: <0f34aa83adc7e87ff0189ae6af1c8acbc3589812@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
-Date: Fri, 5 Apr 2019 11:33:32 +0200
+Date: Tue, 9 Apr 2019 09:38:41 +0200
 Subject: [PATCH] cpu_x86: Do not cache microcode version
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
@@ -18,9 +18,11 @@ Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
 Reviewed-by: Ján Tomko <jtomko@redhat.com>
 (cherry picked from commit be46f613261d3b655a1f15afd635087e68a9c39b)
 
-CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+https://bugzilla.redhat.com/show_bug.cgi?id=1576369
 
 Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <9fc5ee158cea54ec90a235071a7adb3bcda48689.1554795362.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
 ---
  src/cpu/cpu_x86.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/SOURCES/libvirt-cpu_x86-Fix-placement-of-CheckFeature-functions.patch b/SOURCES/libvirt-cpu_x86-Fix-placement-of-CheckFeature-functions.patch
new file mode 100644
index 0000000..7440446
--- /dev/null
+++ b/SOURCES/libvirt-cpu_x86-Fix-placement-of-CheckFeature-functions.patch
@@ -0,0 +1,119 @@
+From fe175a3b2ab1176f26116e909a5014611c52339b Mon Sep 17 00:00:00 2001
+Message-Id: <fe175a3b2ab1176f26116e909a5014611c52339b@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Tue, 4 Jun 2019 13:04:31 +0200
+Subject: [PATCH] cpu_x86: Fix placement of *CheckFeature functions
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Commit 0a97486e09 moved them outside #ifdef, but after virCPUx86GetHost,
+which will start calling them in the following patch.
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit 32f577ab10aefda6c4666abd07814c5c39f57788)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Conflicts:
+	src/cpu/cpu_x86.c
+            - only the last commit (from three upstream commits) moving
+              these functions was backported
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <60813074ba13f616ac2be224f4f800c98b169ec2.1559646067.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/cpu/cpu_x86.c | 69 ++++++++++++++++++++++++-----------------------
+ 1 file changed, 35 insertions(+), 34 deletions(-)
+
+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
+index 1acd8c4f49..bd10862f57 100644
+--- a/src/cpu/cpu_x86.c
++++ b/src/cpu/cpu_x86.c
+@@ -2212,6 +2212,41 @@ x86Encode(virArch arch,
+ }
+ 
+ 
++static int
++virCPUx86CheckFeature(const virCPUDef *cpu,
++                      const char *name)
++{
++    int ret = -1;
++    virCPUx86MapPtr map;
++    virCPUx86ModelPtr model = NULL;
++
++    if (!(map = virCPUx86GetMap()))
++        return -1;
++
++    if (!(model = x86ModelFromCPU(cpu, map, -1)))
++        goto cleanup;
++
++    ret = x86FeatureInData(name, &model->data, map);
++
++ cleanup:
++    x86ModelFree(model);
++    return ret;
++}
++
++
++static int
++virCPUx86DataCheckFeature(const virCPUData *data,
++                          const char *name)
++{
++    virCPUx86MapPtr map;
++
++    if (!(map = virCPUx86GetMap()))
++        return -1;
++
++    return x86FeatureInData(name, &data->data.x86, map);
++}
++
++
+ #if defined(__i386__) || defined(__x86_64__)
+ static inline void
+ cpuidCall(virCPUx86CPUID *cpuid)
+@@ -2888,40 +2923,6 @@ virCPUx86UpdateLive(virCPUDefPtr cpu,
+ }
+ 
+ 
+-static int
+-virCPUx86CheckFeature(const virCPUDef *cpu,
+-                      const char *name)
+-{
+-    int ret = -1;
+-    virCPUx86MapPtr map;
+-    virCPUx86ModelPtr model = NULL;
+-
+-    if (!(map = virCPUx86GetMap()))
+-        return -1;
+-
+-    if (!(model = x86ModelFromCPU(cpu, map, -1)))
+-        goto cleanup;
+-
+-    ret = x86FeatureInData(name, &model->data, map);
+-
+- cleanup:
+-    x86ModelFree(model);
+-    return ret;
+-}
+-
+-
+-static int
+-virCPUx86DataCheckFeature(const virCPUData *data,
+-                          const char *name)
+-{
+-    virCPUx86MapPtr map;
+-
+-    if (!(map = virCPUx86GetMap()))
+-        return -1;
+-
+-    return x86FeatureInData(name, &data->data.x86, map);
+-}
+-
+ static int
+ virCPUx86GetModels(char ***models)
+ {
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-cpu_x86-Log-decoded-CPU-model-and-signatures.patch b/SOURCES/libvirt-cpu_x86-Log-decoded-CPU-model-and-signatures.patch
index de561c5..cdb3bfa 100644
--- a/SOURCES/libvirt-cpu_x86-Log-decoded-CPU-model-and-signatures.patch
+++ b/SOURCES/libvirt-cpu_x86-Log-decoded-CPU-model-and-signatures.patch
@@ -1,5 +1,5 @@
-From 8877885f067aaa87b7ab42de914de5e50f4ef32d Mon Sep 17 00:00:00 2001
-Message-Id: <8877885f067aaa87b7ab42de914de5e50f4ef32d@dist-git>
+From f7b450f2998a2027a4626573db9982615600586b Mon Sep 17 00:00:00 2001
+Message-Id: <f7b450f2998a2027a4626573db9982615600586b@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Mon, 4 Mar 2019 16:37:31 +0100
 Subject: [PATCH] cpu_x86: Log decoded CPU model and signatures
diff --git a/SOURCES/libvirt-cpu_x86-Probe-TSC-frequency-and-scaling-support.patch b/SOURCES/libvirt-cpu_x86-Probe-TSC-frequency-and-scaling-support.patch
new file mode 100644
index 0000000..b679d94
--- /dev/null
+++ b/SOURCES/libvirt-cpu_x86-Probe-TSC-frequency-and-scaling-support.patch
@@ -0,0 +1,48 @@
+From 7d495864b89cd3a65aac555f42de044c592ad21b Mon Sep 17 00:00:00 2001
+Message-Id: <7d495864b89cd3a65aac555f42de044c592ad21b@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Tue, 4 Jun 2019 13:04:32 +0200
+Subject: [PATCH] cpu_x86: Probe TSC frequency and scaling support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When the host CPU supports invariant TSC the host CPU definition created
+by virCPUx86GetHost will contain (unless probing fails for some reason)
+addition TSC related data.
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit ceb04d15e671b4fea1d674ee43c91410da9fe57d)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <a738a180a4b3771d57ed46449aa305f4e914a98d.1559646067.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/cpu/cpu_x86.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
+index bd10862f57..e06e452aee 100644
+--- a/src/cpu/cpu_x86.c
++++ b/src/cpu/cpu_x86.c
+@@ -2587,6 +2587,15 @@ virCPUx86GetHost(virCPUDefPtr cpu,
+     ret = x86DecodeCPUData(cpu, cpuData, models);
+     cpu->microcodeVersion = virHostCPUGetMicrocodeVersion();
+ 
++    /* Probing for TSC frequency makes sense only if the CPU supports
++     * invariant TSC (Linux calls this constant_tsc in /proc/cpuinfo). */
++    if (virCPUx86DataCheckFeature(cpuData, "invtsc") == 1) {
++        VIR_DEBUG("Checking invariant TSC frequency");
++        cpu->tsc = virHostCPUGetTscInfo();
++    } else {
++        VIR_DEBUG("Host CPU does not support invariant TSC");
++    }
++
+  cleanup:
+     virCPUx86DataFree(cpuData);
+     return ret;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-cpu_x86-Separate-signature-parsing-from-x86ModelParse.patch b/SOURCES/libvirt-cpu_x86-Separate-signature-parsing-from-x86ModelParse.patch
index 0ab1498..476af89 100644
--- a/SOURCES/libvirt-cpu_x86-Separate-signature-parsing-from-x86ModelParse.patch
+++ b/SOURCES/libvirt-cpu_x86-Separate-signature-parsing-from-x86ModelParse.patch
@@ -1,5 +1,5 @@
-From 054fbe2bdd426eb9f3346513ac7d39f0b843a04e Mon Sep 17 00:00:00 2001
-Message-Id: <054fbe2bdd426eb9f3346513ac7d39f0b843a04e@dist-git>
+From 223e57b0ed8b285bc38d51252dc3ded63f8f3e11 Mon Sep 17 00:00:00 2001
+Message-Id: <223e57b0ed8b285bc38d51252dc3ded63f8f3e11@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Wed, 20 Mar 2019 14:55:20 +0100
 Subject: [PATCH] cpu_x86: Separate signature parsing from x86ModelParse
diff --git a/SOURCES/libvirt-cpu_x86-Store-CPU-signature-in-an-array.patch b/SOURCES/libvirt-cpu_x86-Store-CPU-signature-in-an-array.patch
index 0de43e8..143a313 100644
--- a/SOURCES/libvirt-cpu_x86-Store-CPU-signature-in-an-array.patch
+++ b/SOURCES/libvirt-cpu_x86-Store-CPU-signature-in-an-array.patch
@@ -1,5 +1,5 @@
-From 892d1dd5115d91c9ca527a5be954087f390b6159 Mon Sep 17 00:00:00 2001
-Message-Id: <892d1dd5115d91c9ca527a5be954087f390b6159@dist-git>
+From b4bc2a799e6e305dc0595a29aae68a39a5983dee Mon Sep 17 00:00:00 2001
+Message-Id: <b4bc2a799e6e305dc0595a29aae68a39a5983dee@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Mon, 4 Mar 2019 16:36:33 +0100
 Subject: [PATCH] cpu_x86: Store CPU signature in an array
diff --git a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Core-TM-i7-7600U.patch b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Core-TM-i7-7600U.patch
index f45c70a..eb11fed 100644
--- a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Core-TM-i7-7600U.patch
+++ b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Core-TM-i7-7600U.patch
@@ -1,5 +1,5 @@
-From 7a985e4dbab5d6e71e4371c6c961e9f0773d964e Mon Sep 17 00:00:00 2001
-Message-Id: <7a985e4dbab5d6e71e4371c6c961e9f0773d964e@dist-git>
+From 07928211835aa0ff9b5398b0fbfbab9c08e2801d Mon Sep 17 00:00:00 2001
+Message-Id: <07928211835aa0ff9b5398b0fbfbab9c08e2801d@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Thu, 21 Feb 2019 22:14:53 +0100
 Subject: [PATCH] cputest: Add data for Intel(R) Core(TM) i7-7600U
diff --git a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Core-TM-i7-8700.patch b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Core-TM-i7-8700.patch
index c641d30..8d09e35 100644
--- a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Core-TM-i7-8700.patch
+++ b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Core-TM-i7-8700.patch
@@ -1,5 +1,5 @@
-From 9195e10f017bd06435f8eb0c78f2eecf34391531 Mon Sep 17 00:00:00 2001
-Message-Id: <9195e10f017bd06435f8eb0c78f2eecf34391531@dist-git>
+From 3d3c6150b17d01a3a0e74fcdabfeb7700ba2985d Mon Sep 17 00:00:00 2001
+Message-Id: <3d3c6150b17d01a3a0e74fcdabfeb7700ba2985d@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Mon, 4 Mar 2019 16:45:48 +0100
 Subject: [PATCH] cputest: Add data for Intel(R) Core(TM) i7-8700
diff --git a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E3-1225-v5.patch b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E3-1225-v5.patch
index 732b74c..fe798f3 100644
--- a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E3-1225-v5.patch
+++ b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E3-1225-v5.patch
@@ -1,31 +1,30 @@
-From dc31ed12dd6b199cc7963ee6177c7dac0ffea041 Mon Sep 17 00:00:00 2001
-Message-Id: <dc31ed12dd6b199cc7963ee6177c7dac0ffea041@dist-git>
+From 21665cdbf25ce849c08d0c56a44f1483682cd745 Mon Sep 17 00:00:00 2001
+Message-Id: <21665cdbf25ce849c08d0c56a44f1483682cd745@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Fri, 5 Apr 2019 11:19:30 +0200
 Subject: [PATCH] cputest: Add data for Intel(R) Xeon(R) CPU E3-1225 v5
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
 Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
-(cherry picked from a private commit)
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit 5cd9db3ac11e88846cbcf95fad9f6fae9d880dee)
 
-CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
-
-Conflicts:
-	tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml
-	tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml
-            - intel-pt feature is missing int RHEL-7.6
+CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
 
 Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
 ---
  tests/cputest.c                               |   1 +
  .../x86_64-cpuid-Xeon-E3-1225-v5-disabled.xml |   7 +
  .../x86_64-cpuid-Xeon-E3-1225-v5-enabled.xml  |   8 +
- .../x86_64-cpuid-Xeon-E3-1225-v5-guest.xml    |  27 +
- .../x86_64-cpuid-Xeon-E3-1225-v5-host.xml     |  28 +
+ .../x86_64-cpuid-Xeon-E3-1225-v5-guest.xml    |  28 +
+ .../x86_64-cpuid-Xeon-E3-1225-v5-host.xml     |  29 +
  .../x86_64-cpuid-Xeon-E3-1225-v5-json.xml     |  11 +
  .../x86_64-cpuid-Xeon-E3-1225-v5.json         | 652 ++++++++++++++++++
  .../x86_64-cpuid-Xeon-E3-1225-v5.sig          |   4 +
  .../x86_64-cpuid-Xeon-E3-1225-v5.xml          |  47 ++
- 9 files changed, 785 insertions(+)
+ 9 files changed, 787 insertions(+)
  create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-disabled.xml
  create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-enabled.xml
  create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml
@@ -76,10 +75,10 @@ index 0000000000..0deca9fba6
 +</cpudata>
 diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml
 new file mode 100644
-index 0000000000..141c01c841
+index 0000000000..70a0fc3286
 --- /dev/null
 +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-guest.xml
-@@ -0,0 +1,27 @@
+@@ -0,0 +1,28 @@
 +<cpu mode='custom' match='exact'>
 +  <model fallback='forbid'>Skylake-Client-IBRS</model>
 +  <vendor>Intel</vendor>
@@ -101,6 +100,7 @@ index 0000000000..141c01c841
 +  <feature policy='require' name='osxsave'/>
 +  <feature policy='require' name='tsc_adjust'/>
 +  <feature policy='require' name='clflushopt'/>
++  <feature policy='require' name='intel-pt'/>
 +  <feature policy='require' name='stibp'/>
 +  <feature policy='require' name='ssbd'/>
 +  <feature policy='require' name='xsaves'/>
@@ -109,10 +109,10 @@ index 0000000000..141c01c841
 +</cpu>
 diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml
 new file mode 100644
-index 0000000000..53bfc9728d
+index 0000000000..bbdfb6aa61
 --- /dev/null
 +++ b/tests/cputestdata/x86_64-cpuid-Xeon-E3-1225-v5-host.xml
-@@ -0,0 +1,28 @@
+@@ -0,0 +1,29 @@
 +<cpu>
 +  <arch>x86_64</arch>
 +  <model>Skylake-Client-IBRS</model>
@@ -135,6 +135,7 @@ index 0000000000..53bfc9728d
 +  <feature name='osxsave'/>
 +  <feature name='tsc_adjust'/>
 +  <feature name='clflushopt'/>
++  <feature name='intel-pt'/>
 +  <feature name='stibp'/>
 +  <feature name='ssbd'/>
 +  <feature name='xsaves'/>
diff --git a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E5-2630-v4.patch b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E5-2630-v4.patch
index 089a517..bc429c6 100644
--- a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E5-2630-v4.patch
+++ b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E5-2630-v4.patch
@@ -1,5 +1,5 @@
-From c300bfc8b035630e7940a2d3853973c8bc910e72 Mon Sep 17 00:00:00 2001
-Message-Id: <c300bfc8b035630e7940a2d3853973c8bc910e72@dist-git>
+From 2b9e257012ac32127e3269722a02d2ad7ff83cd4 Mon Sep 17 00:00:00 2001
+Message-Id: <2b9e257012ac32127e3269722a02d2ad7ff83cd4@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Thu, 21 Feb 2019 21:51:58 +0100
 Subject: [PATCH] cputest: Add data for Intel(R) Xeon(R) CPU E5-2630 v4
diff --git a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E5-2650.patch b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E5-2650.patch
index 6cf973d..cfb4617 100644
--- a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E5-2650.patch
+++ b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E5-2650.patch
@@ -1,5 +1,5 @@
-From 0330dfbfdac2761a3e29d737bfa1bddd4ad6371f Mon Sep 17 00:00:00 2001
-Message-Id: <0330dfbfdac2761a3e29d737bfa1bddd4ad6371f@dist-git>
+From 95d518a7c282f9c7b7eaeec77bcc8ca42d3ece58 Mon Sep 17 00:00:00 2001
+Message-Id: <95d518a7c282f9c7b7eaeec77bcc8ca42d3ece58@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Wed, 27 Feb 2019 09:49:36 +0100
 Subject: [PATCH] cputest: Add data for Intel(R) Xeon(R) CPU E5-2650
diff --git a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E7540.patch b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E7540.patch
index 80e1ed5..c0e2fec 100644
--- a/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E7540.patch
+++ b/SOURCES/libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E7540.patch
@@ -1,5 +1,5 @@
-From 6c7f91a602ba245f5a73f5788160e89eb82da23d Mon Sep 17 00:00:00 2001
-Message-Id: <6c7f91a602ba245f5a73f5788160e89eb82da23d@dist-git>
+From 087d0010521efd3ca021fd4156ef02fc2431e062 Mon Sep 17 00:00:00 2001
+Message-Id: <087d0010521efd3ca021fd4156ef02fc2431e062@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 26 Feb 2019 21:22:25 +0100
 Subject: [PATCH] cputest: Add data for Intel(R) Xeon(R) CPU E7540
diff --git a/SOURCES/libvirt-docs-schemas-Fix-missing-timestamp-inside-backingStore.patch b/SOURCES/libvirt-docs-schemas-Fix-missing-timestamp-inside-backingStore.patch
new file mode 100644
index 0000000..960b392
--- /dev/null
+++ b/SOURCES/libvirt-docs-schemas-Fix-missing-timestamp-inside-backingStore.patch
@@ -0,0 +1,37 @@
+From 192e29d8c8cb8a43b5aecdca21ddac0dc32189a8 Mon Sep 17 00:00:00 2001
+Message-Id: <192e29d8c8cb8a43b5aecdca21ddac0dc32189a8@dist-git>
+From: Julio Faracco <jcfaracco@gmail.com>
+Date: Wed, 3 Apr 2019 13:44:41 +0200
+Subject: [PATCH] docs: schemas: Fix missing timestamp inside backingStore
+
+All backingStore XML definitions have a XML tag with the timestamp. This
+timestamp is not defined insinde RNG volume storage schema and it is
+causing some problems to validate and check volume XMLs.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1594266
+
+Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+(cherry picked from commit 0376939dd03f490ff54398d569ec17b0a1150b49)
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <19f5f223eefe47bb095f487d527c23724d789ae2.1554291860.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ docs/schemas/storagevol.rng | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/docs/schemas/storagevol.rng b/docs/schemas/storagevol.rng
+index 96d6b3e6d0..32aaa2784d 100644
+--- a/docs/schemas/storagevol.rng
++++ b/docs/schemas/storagevol.rng
+@@ -139,6 +139,7 @@
+         </element>
+         <ref name='format'/>
+         <ref name='permissions'/>
++        <ref name='timestamps'/>
+       </interleave>
+     </element>
+   </define>
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-domain-conf-graphics-Fix-picking-DRI-renderer-automatically-for-SPICE.patch b/SOURCES/libvirt-domain-conf-graphics-Fix-picking-DRI-renderer-automatically-for-SPICE.patch
new file mode 100644
index 0000000..957ca25
--- /dev/null
+++ b/SOURCES/libvirt-domain-conf-graphics-Fix-picking-DRI-renderer-automatically-for-SPICE.patch
@@ -0,0 +1,57 @@
+From 804b6a228fc35d8debb2cfef413c69d10fd57f31 Mon Sep 17 00:00:00 2001
+Message-Id: <804b6a228fc35d8debb2cfef413c69d10fd57f31@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:36 +0200
+Subject: [PATCH] domain: conf: graphics: Fix picking DRI renderer
+ automatically for SPICE
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Commit 255e0732 introduced a few graphics-related helpers. The problem
+is that virDomainGraphicsNeedsAutoRenderNode returns true if it gets
+NULL as a response from virDomainGraphicsNeedsAutoRenderNode. That's
+okay for egl-headless because that one always needs a DRM render node,
+the same is not true for SPICE though, and unless the XML specifies
+<gl enable='yes'> for SPICE, there's no need for any renderer.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 1215195fd882efac47c07c16bfff0ad9a33c45a3)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <5c8d0a9c4926354df65414bb6b12bff5bcb823f2.1554791287.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/conf/domain_conf.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index 1aef0c76f8..aaf6a6bab1 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -30770,8 +30770,7 @@ virDomainGraphicsGetRenderNode(const virDomainGraphicsDef *graphics)
+ 
+     switch (graphics->type) {
+     case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
+-        if (graphics->data.spice.gl == VIR_TRISTATE_BOOL_YES)
+-            ret = graphics->data.spice.rendernode;
++        ret = graphics->data.spice.rendernode;
+         break;
+     case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
+         ret = graphics->data.egl_headless.rendernode;
+@@ -30794,6 +30793,10 @@ virDomainGraphicsNeedsAutoRenderNode(const virDomainGraphicsDef *graphics)
+     if (!virDomainGraphicsSupportsRenderNode(graphics))
+         return false;
+ 
++    if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
++        graphics->data.spice.gl != VIR_TRISTATE_BOOL_YES)
++        return false;
++
+     if (virDomainGraphicsGetRenderNode(graphics))
+         return false;
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-locking-restrict-sockets-to-mode-0600.patch b/SOURCES/libvirt-locking-restrict-sockets-to-mode-0600.patch
index fde25c9..f4b16d0 100644
--- a/SOURCES/libvirt-locking-restrict-sockets-to-mode-0600.patch
+++ b/SOURCES/libvirt-locking-restrict-sockets-to-mode-0600.patch
@@ -1,5 +1,5 @@
-From 9062f89d17d1ab5d6c5c3efae8c6056149ef0a28 Mon Sep 17 00:00:00 2001
-Message-Id: <9062f89d17d1ab5d6c5c3efae8c6056149ef0a28@dist-git>
+From a9fced99a9fb436909cf9df22502f5f7c7479ebb Mon Sep 17 00:00:00 2001
+Message-Id: <a9fced99a9fb436909cf9df22502f5f7c7479ebb@dist-git>
 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
 Date: Wed, 15 May 2019 21:40:57 +0100
 Subject: [PATCH] locking: restrict sockets to mode 0600
@@ -17,7 +17,7 @@ Fixes CVE-2019-10132
 
 Reviewed-by: Ján Tomko <jtomko@redhat.com>
 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
-(cherry picked from a private commit)
+(cherry picked from commit f111e09468693909b1f067aa575efdafd9a262a1)
 Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
 Message-Id: <20190515204058.28077-3-berrange@redhat.com>
 ---
diff --git a/SOURCES/libvirt-logging-ensure-pending-I-O-is-drained-before-reading-position.patch b/SOURCES/libvirt-logging-ensure-pending-I-O-is-drained-before-reading-position.patch
new file mode 100644
index 0000000..14570b1
--- /dev/null
+++ b/SOURCES/libvirt-logging-ensure-pending-I-O-is-drained-before-reading-position.patch
@@ -0,0 +1,148 @@
+From c90c82df8b2ce989e628338a6f43b75acdd5a868 Mon Sep 17 00:00:00 2001
+Message-Id: <c90c82df8b2ce989e628338a6f43b75acdd5a868@dist-git>
+From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+Date: Wed, 3 Apr 2019 17:03:46 +0200
+Subject: [PATCH] logging: ensure pending I/O is drained before reading
+ position
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The virtualization driver has two connections to the virtlogd daemon,
+one pipe fd for writing to the log file, and one socket fd for making
+RPC calls. The typical sequence is to write some data to the pipe fd and
+then make an RPC call to determine the current log file offset.
+
+Unfortunately these two operations are not guaranteed to be handling in
+order by virtlogd. The event loop for virtlogd may identify an incoming
+event on both the pipe fd and socket fd in the same iteration of the
+event loop. It is then entirely possible that it will process the socket
+fd RPC call before reading the pending log data from the pipe fd.
+
+As a result the virtualization driver will get an outdated log file
+offset reported back.
+
+This can be seen with the QEMU driver where, when a guest fails to
+start, it will randomly include too much data in the error message it
+has fetched from the log file.
+
+The solution is to ensure we have drained all pending data from the pipe
+fd before reporting the log file offset. The pipe fd is always in
+blocking mode, so cares needs to be taken to avoid blocking. When
+draining this is taken care of by using poll(). The extra complication
+is that they might already be an event loop dispatch pending on the pipe
+fd. If we have just drained the pipe this pending event will be invalid
+so must be discarded.
+
+See also https://bugzilla.redhat.com/show_bug.cgi?id=1356108
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+
+(cherry picked from commit cc9e80c59368478d179ee3eb7bf8106664c56870)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1660531
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190403150346.20086-1-abologna@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ src/logging/log_handler.c | 48 +++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 48 insertions(+)
+
+diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c
+index 5364e06dff..25065ed177 100644
+--- a/src/logging/log_handler.c
++++ b/src/logging/log_handler.c
+@@ -34,6 +34,7 @@
+ 
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <poll.h>
+ 
+ #include "configmake.h"
+ 
+@@ -50,6 +51,7 @@ struct _virLogHandlerLogFile {
+     virRotatingFileWriterPtr file;
+     int watch;
+     int pipefd; /* Read from QEMU via this */
++    bool drained;
+ 
+     char *driver;
+     unsigned char domuuid[VIR_UUID_BUFLEN];
+@@ -153,6 +155,11 @@ virLogHandlerDomainLogFileEvent(int watch,
+         return;
+     }
+ 
++    if (logfile->drained) {
++        logfile->drained = false;
++        goto cleanup;
++    }
++
+  reread:
+     len = read(fd, buf, sizeof(buf));
+     if (len < 0) {
+@@ -170,6 +177,7 @@ virLogHandlerDomainLogFileEvent(int watch,
+     if (events & VIR_EVENT_HANDLE_HANGUP)
+         goto error;
+ 
++ cleanup:
+     virObjectUnlock(handler);
+     return;
+ 
+@@ -435,6 +443,44 @@ virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler,
+ }
+ 
+ 
++static void
++virLogHandlerDomainLogFileDrain(virLogHandlerLogFilePtr file)
++{
++    char buf[1024];
++    ssize_t len;
++    struct pollfd pfd;
++    int ret;
++
++    for (;;) {
++        pfd.fd = file->pipefd;
++        pfd.events = POLLIN;
++        pfd.revents = 0;
++
++        ret = poll(&pfd, 1, 0);
++        if (ret < 0) {
++            if (errno == EINTR)
++                continue;
++
++            return;
++        }
++
++        if (ret == 0)
++            return;
++
++        len = read(file->pipefd, buf, sizeof(buf));
++        file->drained = true;
++        if (len < 0) {
++            if (errno == EINTR)
++                continue;
++            return;
++        }
++
++        if (virRotatingFileWriterAppend(file->file, buf, len) != len)
++            return;
++    }
++}
++
++
+ int
+ virLogHandlerDomainGetLogFilePosition(virLogHandlerPtr handler,
+                                       const char *path,
+@@ -465,6 +511,8 @@ virLogHandlerDomainGetLogFilePosition(virLogHandlerPtr handler,
+         goto cleanup;
+     }
+ 
++    virLogHandlerDomainLogFileDrain(file);
++
+     *inode = virRotatingFileWriterGetINode(file->file);
+     *offset = virRotatingFileWriterGetOffset(file->file);
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-logging-restrict-sockets-to-mode-0600.patch b/SOURCES/libvirt-logging-restrict-sockets-to-mode-0600.patch
index a080a11..ec43afd 100644
--- a/SOURCES/libvirt-logging-restrict-sockets-to-mode-0600.patch
+++ b/SOURCES/libvirt-logging-restrict-sockets-to-mode-0600.patch
@@ -1,5 +1,5 @@
-From b87dc9bc856cd8b9d6dbf61ff7b1aa61653748fb Mon Sep 17 00:00:00 2001
-Message-Id: <b87dc9bc856cd8b9d6dbf61ff7b1aa61653748fb@dist-git>
+From 4c11cc47e947eba9329692f857728758959078cf Mon Sep 17 00:00:00 2001
+Message-Id: <4c11cc47e947eba9329692f857728758959078cf@dist-git>
 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
 Date: Wed, 15 May 2019 21:40:58 +0100
 Subject: [PATCH] logging: restrict sockets to mode 0600
@@ -17,7 +17,7 @@ Fixes CVE-2019-10132
 
 Reviewed-by: Ján Tomko <jtomko@redhat.com>
 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
-(cherry picked from a private commit)
+(cherry picked from commit e37bd65f9948c1185456b2cdaa3bd6e875af680f)
 Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
 Message-Id: <20190515204058.28077-4-berrange@redhat.com>
 ---
diff --git a/SOURCES/libvirt-nwfilter-Add-extra-verbiage-for-binding-create-delete.patch b/SOURCES/libvirt-nwfilter-Add-extra-verbiage-for-binding-create-delete.patch
new file mode 100644
index 0000000..63693e2
--- /dev/null
+++ b/SOURCES/libvirt-nwfilter-Add-extra-verbiage-for-binding-create-delete.patch
@@ -0,0 +1,96 @@
+From 81d6db6e7af7d9f159cfb1c5b7bfc7b6f16b4b23 Mon Sep 17 00:00:00 2001
+Message-Id: <81d6db6e7af7d9f159cfb1c5b7bfc7b6f16b4b23@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 07:04:46 -0400
+Subject: [PATCH] nwfilter: Add extra verbiage for binding create/delete
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1609454
+
+Add some cautionary words related to the create and delete
+NWFilter Binding use cases and possible issues that may result
+to the virsh nwfilter-binding-{create|delete} descriptions
+and the virNWFilterBinding{CreateXML|Delete) API descriptions.
+
+Essentially summarizing commit 2d9318b6c without using the
+shoot yourself in the foot wording.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit b4833917f12a0ffa4b5957ef77edea737cb8ad58)
+Message-Id: <20190403110446.15118-1-jferlan@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ src/libvirt-nwfilter.c | 16 ++++++++++++++--
+ tools/virsh.pod        | 14 ++++++++++++--
+ 2 files changed, 26 insertions(+), 4 deletions(-)
+
+diff --git a/src/libvirt-nwfilter.c b/src/libvirt-nwfilter.c
+index e572d46c18..3da85adc9e 100644
+--- a/src/libvirt-nwfilter.c
++++ b/src/libvirt-nwfilter.c
+@@ -678,7 +678,14 @@ virNWFilterBindingGetFilterName(virNWFilterBindingPtr binding)
+  * @flags: currently unused, pass 0
+  *
+  * Define a new network filter, based on an XML description
+- * similar to the one returned by virNWFilterGetXMLDesc()
++ * similar to the one returned by virNWFilterGetXMLDesc(). This
++ * API may be used to associate a filter with a currently running
++ * guest that does not have a filter defined for a specific network
++ * port. Since the bindings are generally automatically managed by
++ * the hypervisor, using this command to define a filter for a network
++ * port and then starting the guest afterwards may prevent the guest
++ * from starting if it attempts to use the network port and finds a
++ * filter already defined.
+  *
+  * virNWFilterFree should be used to free the resources after the
+  * binding object is no longer needed.
+@@ -717,7 +724,12 @@ virNWFilterBindingCreateXML(virConnectPtr conn, const char *xml, unsigned int fl
+  * @binding: a binding object
+  *
+  * Delete the binding object. This does not free the
+- * associated virNWFilterBindingPtr object.
++ * associated virNWFilterBindingPtr object. This API
++ * may be used to remove the network port binding filter
++ * currently in use for the guest while the guest is
++ * running without needing to restart the guest. Restoring
++ * the network port binding filter for the running guest
++ * would be accomplished by using virNWFilterBindingCreateXML.
+  *
+  * Returns 0 in case of success and -1 in case of failure.
+  */
+diff --git a/tools/virsh.pod b/tools/virsh.pod
+index 368ce89ed8..0e704bc407 100644
+--- a/tools/virsh.pod
++++ b/tools/virsh.pod
+@@ -4825,13 +4825,23 @@ of the network filters directly.
+ =item B<nwfilter-binding-create> I<xmlfile>
+ 
+ Associate a network port with a network filter. The network filter backend
+-will immediately attempt to instantiate the filter rules on the port.
++will immediately attempt to instantiate the filter rules on the port. This
++command may be used to associate a filter with a currently running guest
++that does not have a filter defined for a specific network port. Since the
++bindings are generally automatically managed by the hypervisor, using this
++command to define a filter for a network port and then starting the guest
++afterwards may prevent the guest from starting if it attempts to use the
++network port and finds a filter already defined.
+ 
+ =item B<nwfilter-binding-delete> I<port-name>
+ 
+ Disassociate a network port from a network filter. The network filter
+ backend will immediately tear down the filter rules that exist on the
+-port.
++port. This command may be used to remove the network port binding for
++a filter currently in use for the guest while the guest is running
++without needing to restart the guest. Restoring the network port binding
++filter for the running guest would be accomplished by using
++I<nwfilter-binding-create>.
+ 
+ =item B<nwfilter-binding-list>
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-nwfilter-fix-adding-std-MAC-and-IP-values-to-filter-binding.patch b/SOURCES/libvirt-nwfilter-fix-adding-std-MAC-and-IP-values-to-filter-binding.patch
new file mode 100644
index 0000000..88a4d68
--- /dev/null
+++ b/SOURCES/libvirt-nwfilter-fix-adding-std-MAC-and-IP-values-to-filter-binding.patch
@@ -0,0 +1,164 @@
+From f6e6fee82c36159f5f4b52c3926c95b1f6e40e5d Mon Sep 17 00:00:00 2001
+Message-Id: <f6e6fee82c36159f5f4b52c3926c95b1f6e40e5d@dist-git>
+From: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
+Date: Tue, 30 Apr 2019 18:00:59 +0100
+Subject: [PATCH] nwfilter: fix adding std MAC and IP values to filter binding
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Commit d1a7c08eb changed filter instantiation code to ignore MAC and IP
+variables explicitly specified for filter binding. It just replaces
+explicit values with values associated with the binding. Before the
+commit virNWFilterCreateVarsFrom was used so that explicit value
+take precedence. Let's bring old behavior back.
+
+This is useful. For example if domain has two interfaces it makes
+sense to list both mac adresses in MAC var of every interface
+filterref. So that if guest make a bond of these interfaces
+and start sending frames with one of the mac adresses from
+both interfaces we can pass outgress traffic from both
+interfaces too.
+
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
+(cherry picked from commit 01e11ebcb6e8f24662b7c67b70134c192785691c)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1691358
+
+Message-Id: <20190430170059.25891-1-berrange@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/nwfilter/nwfilter_gentech_driver.c | 92 +++++++++-----------------
+ 1 file changed, 32 insertions(+), 60 deletions(-)
+
+diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
+index e5dea91f83..ece5d28f41 100644
+--- a/src/nwfilter/nwfilter_gentech_driver.c
++++ b/src/nwfilter/nwfilter_gentech_driver.c
+@@ -128,60 +128,6 @@ virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst)
+ }
+ 
+ 
+-/**
+- * virNWFilterVarHashmapAddStdValues:
+- * @tables: pointer to hash tabel to add values to
+- * @macaddr: The string of the MAC address to add to the hash table,
+- *    may be NULL
+- * @ipaddr: The string of the IP address to add to the hash table;
+- *    may be NULL
+- *
+- * Returns 0 in case of success, -1 in case an error happened with
+- * error having been reported.
+- *
+- * Adds a couple of standard keys (MAC, IP) to the hash table.
+- */
+-static int
+-virNWFilterVarHashmapAddStdValues(virHashTablePtr table,
+-                                  const char *macaddr,
+-                                  const virNWFilterVarValue *ipaddr)
+-{
+-    virNWFilterVarValue *val;
+-
+-    if (macaddr) {
+-        val = virNWFilterVarValueCreateSimpleCopyValue(macaddr);
+-        if (!val)
+-            return -1;
+-
+-        if (virHashUpdateEntry(table,
+-                               NWFILTER_STD_VAR_MAC,
+-                               val) < 0) {
+-            virNWFilterVarValueFree(val);
+-            virReportError(VIR_ERR_INTERNAL_ERROR,
+-                           "%s", _("Could not add variable 'MAC' to hashmap"));
+-            return -1;
+-        }
+-    }
+-
+-    if (ipaddr) {
+-        val = virNWFilterVarValueCopy(ipaddr);
+-        if (!val)
+-            return -1;
+-
+-        if (virHashUpdateEntry(table,
+-                               NWFILTER_STD_VAR_IP,
+-                               val) < 0) {
+-            virNWFilterVarValueFree(val);
+-            virReportError(VIR_ERR_INTERNAL_ERROR,
+-                           "%s", _("Could not add variable 'IP' to hashmap"));
+-            return -1;
+-        }
+-    }
+-
+-    return 0;
+-}
+-
+-
+ /**
+  * Convert a virHashTable into a string of comma-separated
+  * variable names.
+@@ -707,6 +653,28 @@ virNWFilterDoInstantiate(virNWFilterTechDriverPtr techdriver,
+ }
+ 
+ 
++static int
++virNWFilterVarHashmapAddStdValue(virHashTablePtr table,
++                                 const char *var,
++                                 const char *value)
++{
++    virNWFilterVarValue *val;
++
++    if (virHashLookup(table, var))
++        return 0;
++
++    if (!(val = virNWFilterVarValueCreateSimpleCopyValue(value)))
++        return -1;
++
++    if (virHashAddEntry(table, var, val) < 0) {
++        virNWFilterVarValueFree(val);
++        return -1;
++    }
++
++    return 0;
++}
++
++
+ /*
+  * Call this function while holding the NWFilter filter update lock
+  */
+@@ -719,7 +687,7 @@ virNWFilterInstantiateFilterUpdate(virNWFilterDriverStatePtr driver,
+                                    bool forceWithPendingReq,
+                                    bool *foundNewFilter)
+ {
+-    int rc;
++    int rc = -1;
+     const char *drvname = EBIPTABLES_DRIVER_ID;
+     virNWFilterTechDriverPtr techdriver;
+     virNWFilterObjPtr obj;
+@@ -745,14 +713,18 @@ virNWFilterInstantiateFilterUpdate(virNWFilterDriverStatePtr driver,
+         return -1;
+ 
+     virMacAddrFormat(&binding->mac, vmmacaddr);
++    if (virNWFilterVarHashmapAddStdValue(binding->filterparams,
++                                         NWFILTER_STD_VAR_MAC,
++                                         vmmacaddr) < 0)
++        goto err_exit;
+ 
+     ipaddr = virNWFilterIPAddrMapGetIPAddr(binding->portdevname);
+-
+-    if (virNWFilterVarHashmapAddStdValues(binding->filterparams,
+-                                          vmmacaddr, ipaddr) < 0) {
+-        rc = -1;
++    if (ipaddr &&
++        virNWFilterVarHashmapAddStdValue(binding->filterparams,
++                                         NWFILTER_STD_VAR_IP,
++                                         virNWFilterVarValueGetSimple(ipaddr)) < 0)
+         goto err_exit;
+-    }
++
+ 
+     filter = virNWFilterObjGetDef(obj);
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Add-entry-for-balloon-stat-stat-disk-caches.patch b/SOURCES/libvirt-qemu-Add-entry-for-balloon-stat-stat-disk-caches.patch
new file mode 100644
index 0000000..b9087da
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Add-entry-for-balloon-stat-stat-disk-caches.patch
@@ -0,0 +1,132 @@
+From dafb35cfae38f63e861e16623f83392cac3b73dc Mon Sep 17 00:00:00 2001
+Message-Id: <dafb35cfae38f63e861e16623f83392cac3b73dc@dist-git>
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= <tgolembi@redhat.com>
+Date: Wed, 3 Apr 2019 13:19:17 +0200
+Subject: [PATCH] qemu: Add entry for balloon stat stat-disk-caches
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+QEMU commit bf1e7140e adds reporting of new balloon statistic to QEMU
+2.12. Value represents the amount of memory that can be quickly
+reclaimed without additional I/O. Let's add that too.
+
+Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit aee046550893e7c0e5ccb4861dd3f0715d31eeb7)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1690122
+Signed-off-by: Jaroslav Suchanek <jsuchane@redhat.com>
+Message-Id: <1554290357-24601-1-git-send-email-jsuchane@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ include/libvirt/libvirt-domain.h | 9 ++++++++-
+ src/libvirt-domain.c             | 3 +++
+ src/qemu/qemu_driver.c           | 1 +
+ src/qemu/qemu_monitor_json.c     | 2 ++
+ tools/virsh-domain-monitor.c     | 2 ++
+ tools/virsh.pod                  | 5 +++++
+ 6 files changed, 21 insertions(+), 1 deletion(-)
+
+diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
+index 796f2e1408..fdd2d6b8ea 100644
+--- a/include/libvirt/libvirt-domain.h
++++ b/include/libvirt/libvirt-domain.h
+@@ -628,11 +628,18 @@ typedef enum {
+     /* Timestamp of the last update of statistics, in seconds. */
+     VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE     = 9,
+ 
++    /*
++     * The amount of memory, that can be quickly reclaimed without
++     * additional I/O (in kB). Typically these pages are used for caching files
++     * from disk.
++     */
++    VIR_DOMAIN_MEMORY_STAT_DISK_CACHES     = 10,
++
+     /*
+      * The number of statistics supported by this version of the interface.
+      * To add new statistics, add them to the enum and increase this value.
+      */
+-    VIR_DOMAIN_MEMORY_STAT_NR              = 10,
++    VIR_DOMAIN_MEMORY_STAT_NR              = 11,
+ 
+ # ifdef VIR_ENUM_SENTINELS
+     VIR_DOMAIN_MEMORY_STAT_LAST = VIR_DOMAIN_MEMORY_STAT_NR
+diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
+index 5f7f0bfeba..568023176b 100644
+--- a/src/libvirt-domain.c
++++ b/src/libvirt-domain.c
+@@ -5732,6 +5732,9 @@ virDomainGetInterfaceParameters(virDomainPtr domain,
+  *     Current balloon value (in kb).
+  * VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE
+  *     Timestamp of the last statistic
++ * VIR_DOMAIN_MEMORY_STAT_DISK_CACHES
++ *     Memory that can be reclaimed without additional I/O, typically disk
++ *     caches (in kb).
+  *
+  * Returns: The number of stats provided or -1 in case of failure.
+  */
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index 295613ba3c..99d0dad911 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -19788,6 +19788,7 @@ qemuDomainGetStatsBalloon(virQEMUDriverPtr driver,
+         STORE_MEM_RECORD(RSS, "rss")
+         STORE_MEM_RECORD(LAST_UPDATE, "last-update")
+         STORE_MEM_RECORD(USABLE, "usable")
++        STORE_MEM_RECORD(DISK_CACHES, "disk_caches")
+     }
+ 
+ #undef STORE_MEM_RECORD
+diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
+index 8970d95584..438d82e194 100644
+--- a/src/qemu/qemu_monitor_json.c
++++ b/src/qemu/qemu_monitor_json.c
+@@ -2100,6 +2100,8 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
+                       VIR_DOMAIN_MEMORY_STAT_USABLE, 1024);
+     GET_BALLOON_STATS(data, "last-update",
+                       VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE, 1);
++    GET_BALLOON_STATS(statsdata, "stat-disk-caches",
++                      VIR_DOMAIN_MEMORY_STAT_DISK_CACHES, 1024);
+     ret = got;
+  cleanup:
+     virJSONValueFree(cmd);
+diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
+index 87660ee674..b9b4f9739b 100644
+--- a/tools/virsh-domain-monitor.c
++++ b/tools/virsh-domain-monitor.c
+@@ -364,6 +364,8 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd)
+             vshPrint(ctl, "rss %llu\n", stats[i].val);
+         if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE)
+             vshPrint(ctl, "last_update %llu\n", stats[i].val);
++        if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_DISK_CACHES)
++            vshPrint(ctl, "disk_caches %llu\n", stats[i].val);
+     }
+ 
+     ret = true;
+diff --git a/tools/virsh.pod b/tools/virsh.pod
+index 3e9c264fe8..00cbee19b6 100644
+--- a/tools/virsh.pod
++++ b/tools/virsh.pod
+@@ -924,6 +924,8 @@ B<Explanation of fields>:
+   usable            - The amount of memory which can be reclaimed by balloon
+ without causing host swapping (in KiB)
+   last-update       - Timestamp of the last update of statistics (in seconds)
++  disk_caches       - The amount of memory that can be reclaimed without
++additional I/O, typically disk caches (in KiB)
+ 
+ For QEMU/KVM with a memory balloon, setting the optional I<--period> to a
+ value larger than 0 in seconds will allow the balloon driver to return
+@@ -1030,6 +1032,9 @@ I<--balloon> returns:
+                     balloon without causing host swapping (in KiB)
+  "balloon.last-update" - timestamp of the last update of statistics
+                          (in seconds)
++ "balloon.disk_caches " - the amount of memory that can be reclaimed
++                          without additional I/O, typically disk
++                          caches (in KiB)
+ 
+ I<--vcpu> returns:
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Avoid-duplicate-resume-events-and-state-changes.patch b/SOURCES/libvirt-qemu-Avoid-duplicate-resume-events-and-state-changes.patch
index 473caeb..762fa84 100644
--- a/SOURCES/libvirt-qemu-Avoid-duplicate-resume-events-and-state-changes.patch
+++ b/SOURCES/libvirt-qemu-Avoid-duplicate-resume-events-and-state-changes.patch
@@ -1,5 +1,5 @@
-From f01aeffaa7dbb4e9efe61f9826deed14c4cb3b41 Mon Sep 17 00:00:00 2001
-Message-Id: <f01aeffaa7dbb4e9efe61f9826deed14c4cb3b41@dist-git>
+From b8a36e1ebf239a91bf62e861ca25cea3616b644f Mon Sep 17 00:00:00 2001
+Message-Id: <b8a36e1ebf239a91bf62e861ca25cea3616b644f@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Wed, 12 Sep 2018 14:34:33 +0200
 Subject: [PATCH] qemu: Avoid duplicate resume events and state changes
@@ -239,5 +239,5 @@ index 37568165b7..2d51c0fa25 100644
   cleanup:
      virObjectUnref(cfg);
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-qemu-Avoid-probing-non-native-binaries-all-the-time.patch b/SOURCES/libvirt-qemu-Avoid-probing-non-native-binaries-all-the-time.patch
new file mode 100644
index 0000000..43586c9
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Avoid-probing-non-native-binaries-all-the-time.patch
@@ -0,0 +1,46 @@
+From 1172018ff6df4618a02fd05a46d33dbdb06131bf Mon Sep 17 00:00:00 2001
+Message-Id: <1172018ff6df4618a02fd05a46d33dbdb06131bf@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Fri, 5 Apr 2019 10:57:41 +0200
+Subject: [PATCH] qemu: Avoid probing non-native binaries all the time
+
+A side effect of recent changes is that we would always try
+to regenerate the capabilities cache for non-native QEMU
+binaries based on /dev/kvm availability, which is of course
+complete nonsense. Make sure that doesn't happen.
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit 55e5eb94788be06dd366de4987523bbc731672db)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628469
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190405085744.8179-5-abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_capabilities.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index c31c991a6f..ca044564e5 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -3906,6 +3906,14 @@ virQEMUCapsIsValid(void *data,
+         return false;
+     }
+ 
++    if (!virQEMUCapsGuestIsNative(priv->hostArch, qemuCaps->arch)) {
++        VIR_DEBUG("Guest arch (%s) is not native to host arch (%s), "
++                  "skipping KVM-related checks",
++                  virArchToString(qemuCaps->arch),
++                  virArchToString(priv->hostArch));
++        return true;
++    }
++
+     kvmUsable = virFileAccessibleAs("/dev/kvm", R_OK | W_OK,
+                                     priv->runUid, priv->runGid) == 0;
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Check-TSC-frequency-before-starting-QEMU.patch b/SOURCES/libvirt-qemu-Check-TSC-frequency-before-starting-QEMU.patch
new file mode 100644
index 0000000..a03957f
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Check-TSC-frequency-before-starting-QEMU.patch
@@ -0,0 +1,121 @@
+From 539a83390fb4b4b0dd7b029b7dd4ba2a345611cd Mon Sep 17 00:00:00 2001
+Message-Id: <539a83390fb4b4b0dd7b029b7dd4ba2a345611cd@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Tue, 4 Jun 2019 13:04:33 +0200
+Subject: [PATCH] qemu: Check TSC frequency before starting QEMU
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When migrating a domain with invtsc CPU feature enabled, the TSC
+frequency of the destination host must match the frequency used when the
+domain was started on the source host or the destination host has to
+support TSC scaling.
+
+If the frequencies do not match and the destination host does not
+support TSC scaling, QEMU will fail to set the right TSC frequency when
+starting vCPUs on the destination and thus migration will fail. However,
+this is quite late since both host might have spent significant time
+transferring memory and perhaps even storage data.
+
+By adding the check to libvirt we can let migration fail before any data
+starts to be sent over. If for some reason libvirt is unable to detect
+the host's TSC frequency or scaling support, we'll just let QEMU try and
+the migration will either succeed or fail later.
+
+Luckily, we mandate TSC frequency to be explicitly set in the domain XML
+to even allow migration of domains with invtsc. We can just check
+whether the requested frequency is compatible with the current host
+before starting QEMU.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit 7da62c91f043209e3d40c2dc7655c5e35a4309bf)
+
+Conflicts:
+	src/qemu/qemu_process.c
+            - qemuProcessStartValidateXML function was removed upstream
+              by commit v4.9.0-89-g91afd53cb8
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <f5fcbf9d5afc4e156d1d2c888dc360d06bb29a1a.1559646067.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_process.c | 53 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 53 insertions(+)
+
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index 2795796166..7f70d79566 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -5181,6 +5181,56 @@ qemuProcessStartValidateXML(virQEMUDriverPtr driver,
+ }
+ 
+ 
++static int
++qemuProcessStartValidateTSC(virDomainObjPtr vm,
++                            virCapsPtr caps)
++{
++    size_t i;
++    unsigned long long freq = 0;
++    virHostCPUTscInfoPtr tsc;
++
++    for (i = 0; i < vm->def->clock.ntimers; i++) {
++        virDomainTimerDefPtr timer = vm->def->clock.timers[i];
++
++        if (timer->name == VIR_DOMAIN_TIMER_NAME_TSC &&
++            timer->frequency > 0) {
++            freq = timer->frequency;
++            break;
++        }
++    }
++
++    if (freq == 0)
++        return 0;
++
++    VIR_DEBUG("Requested TSC frequency %llu Hz", freq);
++
++    if (!caps->host.cpu || !caps->host.cpu->tsc) {
++        VIR_DEBUG("Host TSC frequency could not be probed");
++        return 0;
++    }
++
++    tsc = caps->host.cpu->tsc;
++    VIR_DEBUG("Host TSC frequency %llu Hz, scaling %s",
++              tsc->frequency, virTristateBoolTypeToString(tsc->scaling));
++
++    if (freq == tsc->frequency || tsc->scaling == VIR_TRISTATE_BOOL_YES)
++        return 0;
++
++    if (tsc->scaling == VIR_TRISTATE_BOOL_ABSENT) {
++        VIR_DEBUG("TSC frequencies do not match and scaling support is "
++                  "unknown, QEMU will try and possibly fail later");
++        return 0;
++    }
++
++    virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
++                   _("Requested TSC frequency %llu Hz does not match "
++                     "host (%llu Hz) and TSC scaling is not supported "
++                     "by the host CPU"),
++                   freq, tsc->frequency);
++    return -1;
++}
++
++
+ /**
+  * qemuProcessStartValidate:
+  * @vm: domain object
+@@ -5241,6 +5291,9 @@ qemuProcessStartValidate(virQEMUDriverPtr driver,
+     if (qemuProcessStartValidateDisks(vm, qemuCaps) < 0)
+         return -1;
+ 
++    if (qemuProcessStartValidateTSC(vm, caps) < 0)
++        return -1;
++
+     VIR_DEBUG("Checking for any possible (non-fatal) issues");
+ 
+     qemuProcessStartWarnShmem(vm);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Clarify-QEMU_CAPS_KVM.patch b/SOURCES/libvirt-qemu-Clarify-QEMU_CAPS_KVM.patch
new file mode 100644
index 0000000..37d5cea
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Clarify-QEMU_CAPS_KVM.patch
@@ -0,0 +1,89 @@
+From 74789a3addee2f186e100dcaca4c1aedd95f8434 Mon Sep 17 00:00:00 2001
+Message-Id: <74789a3addee2f186e100dcaca4c1aedd95f8434@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Fri, 5 Apr 2019 10:57:42 +0200
+Subject: [PATCH] qemu: Clarify QEMU_CAPS_KVM
+
+This capability is documented as having one meaning (whether
+KVM is enabled by default) but is actually assigned two other
+meanings over its life: whether the query-kvm QMP command is
+available at first, and later on whether KVM is usable / was
+used during probing.
+
+Since the query-kvm QMP command was available in 1.5.0, we
+can avoid probing for it; additionally, we can simplify the
+logic by setting the flag when it applies instead of initially
+setting it and then clearing it when it doesn't.
+
+The flag's description is also updated to reflect reality.
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit c3be8bb4235b447dc29568f96b8c31cc741fc358)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628469
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190405085744.8179-6-abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_capabilities.c | 19 ++-----------------
+ src/qemu/qemu_capabilities.h |  2 +-
+ 2 files changed, 3 insertions(+), 18 deletions(-)
+
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index ca044564e5..6386f206b8 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -1003,7 +1003,6 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = {
+     { "block-stream", QEMU_CAPS_BLOCKJOB_ASYNC },
+     { "dump-guest-memory", QEMU_CAPS_DUMP_GUEST_MEMORY },
+     { "query-spice", QEMU_CAPS_SPICE },
+-    { "query-kvm", QEMU_CAPS_KVM },
+     { "block-commit", QEMU_CAPS_BLOCK_COMMIT },
+     { "query-vnc", QEMU_CAPS_VNC },
+     { "drive-mirror", QEMU_CAPS_DRIVE_MIRROR },
+@@ -2585,25 +2584,11 @@ virQEMUCapsProbeQMPKVMState(virQEMUCapsPtr qemuCaps,
+     bool enabled = false;
+     bool present = false;
+ 
+-    if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM))
+-        return 0;
+-
+     if (qemuMonitorGetKVMState(mon, &enabled, &present) < 0)
+         return -1;
+ 
+-    /* The QEMU_CAPS_KVM flag was initially set according to the QEMU
+-     * reporting the recognition of 'query-kvm' QMP command. That merely
+-     * indicates existence of the command though, not whether KVM support
+-     * is actually available, nor whether it is enabled by default.
+-     *
+-     * If it is not present we need to clear the flag, and if it is
+-     * not enabled by default we need to change the flag.
+-     */
+-    if (!present) {
+-        virQEMUCapsClear(qemuCaps, QEMU_CAPS_KVM);
+-    } else if (!enabled) {
+-        virQEMUCapsClear(qemuCaps, QEMU_CAPS_KVM);
+-    }
++    if (present && enabled)
++        virQEMUCapsSet(qemuCaps, QEMU_CAPS_KVM);
+ 
+     return 0;
+ }
+diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
+index 98668115d6..6acd9fe825 100644
+--- a/src/qemu/qemu_capabilities.h
++++ b/src/qemu/qemu_capabilities.h
+@@ -65,7 +65,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
+     X_QEMU_CAPS_MIGRATE_QEMU_TCP, /* have qemu tcp migration */
+     X_QEMU_CAPS_MIGRATE_QEMU_EXEC, /* have qemu exec migration */
+     X_QEMU_CAPS_DRIVE_CACHE_V2, /* cache= flag wanting new v2 values */
+-    QEMU_CAPS_KVM, /* Whether KVM is enabled by default */
++    QEMU_CAPS_KVM, /* Whether KVM is usable / was used during probing */
+     X_QEMU_CAPS_DRIVE_FORMAT, /* Is -drive format= avail */
+ 
+     /* 15 */
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Don-t-cache-microcode-version.patch b/SOURCES/libvirt-qemu-Don-t-cache-microcode-version.patch
index 0e4e5cb..875a710 100644
--- a/SOURCES/libvirt-qemu-Don-t-cache-microcode-version.patch
+++ b/SOURCES/libvirt-qemu-Don-t-cache-microcode-version.patch
@@ -1,7 +1,7 @@
-From abfcb113bd1200dc91e8d6e3bcbd2084d458f554 Mon Sep 17 00:00:00 2001
-Message-Id: <abfcb113bd1200dc91e8d6e3bcbd2084d458f554@dist-git>
+From e5c98595ed558673ecd179b5c6204d981a6cdd2b Mon Sep 17 00:00:00 2001
+Message-Id: <e5c98595ed558673ecd179b5c6204d981a6cdd2b@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
-Date: Fri, 12 Apr 2019 21:21:05 +0200
+Date: Mon, 15 Apr 2019 15:49:01 +0200
 Subject: [PATCH] qemu: Don't cache microcode version
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
@@ -20,7 +20,7 @@ Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
 Reviewed-by: Ján Tomko <jtomko@redhat.com>
 (cherry picked from commit 673c62a3b7855a0685d8f116e227c402720b9ee9)
 
-CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+https://bugzilla.redhat.com/show_bug.cgi?id=1576369
 
 Conflicts:
 	src/qemu/qemu_capabilities.c
@@ -28,6 +28,8 @@ Conflicts:
               7948ad4129a and 1a3de67001c) are missing
 
 Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <d277660601022095d263f57bf5349cd535ee4c9f.1555334286.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
 ---
  src/qemu/qemu_capabilities.c | 12 ++++++++----
  src/qemu/qemu_capabilities.h |  3 +--
@@ -36,10 +38,10 @@ Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
  4 files changed, 11 insertions(+), 15 deletions(-)
 
 diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
-index 4f2051a2bb..96aa1b15e4 100644
+index 8819452ff6..a27ea85824 100644
 --- a/src/qemu/qemu_capabilities.c
 +++ b/src/qemu/qemu_capabilities.c
-@@ -4625,7 +4625,7 @@ virQEMUCapsNewData(const char *binary,
+@@ -4614,7 +4614,7 @@ virQEMUCapsNewData(const char *binary,
                                             priv->libDir,
                                             priv->runUid,
                                             priv->runGid,
@@ -48,7 +50,7 @@ index 4f2051a2bb..96aa1b15e4 100644
                                             priv->kernelVersion);
  }
  
-@@ -4708,8 +4708,7 @@ virFileCachePtr
+@@ -4697,8 +4697,7 @@ virFileCachePtr
  virQEMUCapsCacheNew(const char *libDir,
                      const char *cacheDir,
                      uid_t runUid,
@@ -58,7 +60,7 @@ index 4f2051a2bb..96aa1b15e4 100644
  {
      char *capsCacheDir = NULL;
      virFileCachePtr cache = NULL;
-@@ -4733,7 +4732,6 @@ virQEMUCapsCacheNew(const char *libDir,
+@@ -4722,7 +4721,6 @@ virQEMUCapsCacheNew(const char *libDir,
  
      priv->runUid = runUid;
      priv->runGid = runGid;
@@ -66,7 +68,7 @@ index 4f2051a2bb..96aa1b15e4 100644
  
      if (uname(&uts) == 0 &&
          virAsprintf(&priv->kernelVersion, "%s %s", uts.release, uts.version) < 0)
-@@ -4754,8 +4752,11 @@ virQEMUCapsPtr
+@@ -4743,8 +4741,11 @@ virQEMUCapsPtr
  virQEMUCapsCacheLookup(virFileCachePtr cache,
                         const char *binary)
  {
@@ -78,7 +80,7 @@ index 4f2051a2bb..96aa1b15e4 100644
      ret = virFileCacheLookup(cache, binary);
  
      VIR_DEBUG("Returning caps %p for %s", ret, binary);
-@@ -4801,10 +4802,13 @@ virQEMUCapsPtr
+@@ -4790,10 +4791,13 @@ virQEMUCapsPtr
  virQEMUCapsCacheLookupByArch(virFileCachePtr cache,
                               virArch arch)
  {
@@ -93,7 +95,7 @@ index 4f2051a2bb..96aa1b15e4 100644
      if (!ret) {
          /* If the first attempt at finding capabilities has failed, try
 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
-index 9e8ad5f5c3..7a91b7da62 100644
+index 6acd9fe825..25ad4218e0 100644
 --- a/src/qemu/qemu_capabilities.h
 +++ b/src/qemu/qemu_capabilities.h
 @@ -572,8 +572,7 @@ void virQEMUCapsFilterByMachineType(virQEMUCapsPtr qemuCaps,
@@ -107,7 +109,7 @@ index 9e8ad5f5c3..7a91b7da62 100644
                                        const char *binary);
  virQEMUCapsPtr virQEMUCapsCacheLookupCopy(virFileCachePtr cache,
 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
-index 295613ba3c..21d836a540 100644
+index e11f57a56a..3b3281c13f 100644
 --- a/src/qemu/qemu_driver.c
 +++ b/src/qemu/qemu_driver.c
 @@ -592,8 +592,6 @@ qemuStateInitialize(bool privileged,
diff --git a/SOURCES/libvirt-qemu-Don-t-check-for-dev-kvm-presence.patch b/SOURCES/libvirt-qemu-Don-t-check-for-dev-kvm-presence.patch
new file mode 100644
index 0000000..346c3df
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Don-t-check-for-dev-kvm-presence.patch
@@ -0,0 +1,46 @@
+From cc4e45e8bcb2d141bbf2ddc14e0fef8c234662df Mon Sep 17 00:00:00 2001
+Message-Id: <cc4e45e8bcb2d141bbf2ddc14e0fef8c234662df@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Fri, 5 Apr 2019 10:57:43 +0200
+Subject: [PATCH] qemu: Don't check for /dev/kvm presence
+
+The file being present doesn't necessarily mean anything these
+days, as it's created independently of whether the kvm module
+has been loaded[1]; moreover, we're already gathering all the
+information we need through QMP, so poking the filesystem at
+all is entirely unnecessary.
+
+[1] https://github.com/systemd/systemd/commit/d35d6249d5a7ed3228
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit 2f8b91ee74ff617aba322d034119427cad977af9)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628469
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190405085744.8179-7-abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_capabilities.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index 6386f206b8..8819452ff6 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -832,9 +832,8 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
+     if (!binary)
+         return 0;
+ 
+-    if (virFileExists("/dev/kvm") &&
+-        (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM) ||
+-         kvmbin))
++    if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM) ||
++        kvmbin)
+         haskvm = true;
+ 
+     if (virQEMUCapsGetMachineTypesCaps(qemubinCaps, &nmachines, &machines) < 0)
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Don-t-ignore-resume-events.patch b/SOURCES/libvirt-qemu-Don-t-ignore-resume-events.patch
index a44eb50..09d370c 100644
--- a/SOURCES/libvirt-qemu-Don-t-ignore-resume-events.patch
+++ b/SOURCES/libvirt-qemu-Don-t-ignore-resume-events.patch
@@ -1,5 +1,5 @@
-From 7359db070b7a1379ea33e2754a00e56ca5e6b29f Mon Sep 17 00:00:00 2001
-Message-Id: <7359db070b7a1379ea33e2754a00e56ca5e6b29f@dist-git>
+From 12fe6020638d011daf9772cc822c28b55d662310 Mon Sep 17 00:00:00 2001
+Message-Id: <12fe6020638d011daf9772cc822c28b55d662310@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Wed, 7 Nov 2018 14:34:52 +0100
 Subject: [PATCH] qemu: Don't ignore resume events
@@ -64,5 +64,5 @@ index 2d51c0fa25..9b5cb93325 100644
      virObjectEventStateQueue(driver->domainEventState, event);
      virObjectUnref(cfg);
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-qemu-Drop-QEMU_CAPS_ENABLE_KVM.patch b/SOURCES/libvirt-qemu-Drop-QEMU_CAPS_ENABLE_KVM.patch
new file mode 100644
index 0000000..8eb820a
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Drop-QEMU_CAPS_ENABLE_KVM.patch
@@ -0,0 +1,106 @@
+From 91b7c36af5d91f9ddfe47a3a2b1b35368ef171a4 Mon Sep 17 00:00:00 2001
+Message-Id: <91b7c36af5d91f9ddfe47a3a2b1b35368ef171a4@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Fri, 5 Apr 2019 10:57:40 +0200
+Subject: [PATCH] qemu: Drop QEMU_CAPS_ENABLE_KVM
+
+It was already available in 1.5.0.
+
+Moreover, we're not even formatting it on the QEMU command
+line, ever: we just use it as part of some logic that decides
+whether KVM support should be advertised, and as it turns out
+that logic is actually buggy and dropping this capability
+fixes it.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628469
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit 88983855d5496a74b97551860db737c2b17b100e)
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190405085744.8179-4-abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_capabilities.c |  3 ---
+ src/qemu/qemu_capabilities.h |  2 +-
+ tests/qemuxml2argvtest.c     | 11 +++++------
+ 3 files changed, 6 insertions(+), 10 deletions(-)
+
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index 4f2051a2bb..c31c991a6f 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -834,7 +834,6 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
+ 
+     if (virFileExists("/dev/kvm") &&
+         (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM) ||
+-         virQEMUCapsGet(qemubinCaps, QEMU_CAPS_ENABLE_KVM) ||
+          kvmbin))
+         haskvm = true;
+ 
+@@ -2604,7 +2603,6 @@ virQEMUCapsProbeQMPKVMState(virQEMUCapsPtr qemuCaps,
+         virQEMUCapsClear(qemuCaps, QEMU_CAPS_KVM);
+     } else if (!enabled) {
+         virQEMUCapsClear(qemuCaps, QEMU_CAPS_KVM);
+-        virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_KVM);
+     }
+ 
+     return 0;
+@@ -3912,7 +3910,6 @@ virQEMUCapsIsValid(void *data,
+                                     priv->runUid, priv->runGid) == 0;
+ 
+     if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) &&
+-        virQEMUCapsGet(qemuCaps, QEMU_CAPS_ENABLE_KVM) &&
+         kvmUsable) {
+         VIR_DEBUG("KVM was not enabled when probing '%s', "
+                   "but it should be usable now",
+diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
+index 9e8ad5f5c3..98668115d6 100644
+--- a/src/qemu/qemu_capabilities.h
++++ b/src/qemu/qemu_capabilities.h
+@@ -79,7 +79,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
+     X_QEMU_CAPS_XEN_DOMID, /* -xen-domid */
+     X_QEMU_CAPS_MIGRATE_QEMU_UNIX, /* qemu migration via unix sockets */
+     X_QEMU_CAPS_CHARDEV, /* Is the new -chardev arg available */
+-    QEMU_CAPS_ENABLE_KVM, /* -enable-kvm flag */
++    X_QEMU_CAPS_ENABLE_KVM, /* -enable-kvm flag */
+     X_QEMU_CAPS_MONITOR_JSON, /* JSON mode for monitor */
+ 
+     /* 25 */
+diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
+index 7a731e2f40..f401076731 100644
+--- a/tests/qemuxml2argvtest.c
++++ b/tests/qemuxml2argvtest.c
+@@ -912,16 +912,15 @@ mymain(void)
+     DO_TEST("clock-france", NONE);
+     DO_TEST("clock-hpet-off", NONE);
+     DO_TEST("clock-catchup", QEMU_CAPS_KVM_PIT_TICK_POLICY);
+-    DO_TEST("cpu-kvmclock", QEMU_CAPS_ENABLE_KVM);
+-    DO_TEST("cpu-host-kvmclock", QEMU_CAPS_ENABLE_KVM);
++    DO_TEST("cpu-kvmclock", NONE);
++    DO_TEST("cpu-host-kvmclock", NONE);
+     DO_TEST("kvmclock", QEMU_CAPS_KVM);
+     DO_TEST("clock-timer-hyperv-rtc", QEMU_CAPS_KVM);
+ 
+-    DO_TEST("cpu-eoi-disabled", QEMU_CAPS_ENABLE_KVM);
+-    DO_TEST("cpu-eoi-enabled", QEMU_CAPS_ENABLE_KVM);
++    DO_TEST("cpu-eoi-disabled", NONE);
++    DO_TEST("cpu-eoi-enabled", NONE);
+     DO_TEST("controller-order",
+             QEMU_CAPS_KVM,
+-            QEMU_CAPS_ENABLE_KVM,
+             QEMU_CAPS_PIIX3_USB_UHCI,
+             QEMU_CAPS_CCID_PASSTHRU,
+             QEMU_CAPS_SPICE,
+@@ -933,7 +932,7 @@ mymain(void)
+     DO_TEST("eoi-enabled", NONE);
+     DO_TEST("pv-spinlock-disabled", NONE);
+     DO_TEST("pv-spinlock-enabled", NONE);
+-    DO_TEST("kvmclock+eoi-disabled", QEMU_CAPS_ENABLE_KVM);
++    DO_TEST("kvmclock+eoi-disabled", NONE);
+ 
+     DO_TEST("hyperv", NONE);
+     DO_TEST("hyperv-off", NONE);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Drop-cleanup-label-from-qemuProcessInitCpuAffinity.patch b/SOURCES/libvirt-qemu-Drop-cleanup-label-from-qemuProcessInitCpuAffinity.patch
new file mode 100644
index 0000000..a76a997
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Drop-cleanup-label-from-qemuProcessInitCpuAffinity.patch
@@ -0,0 +1,74 @@
+From dea07e831c50f648e7eaf5706713ecbdf9de813a Mon Sep 17 00:00:00 2001
+Message-Id: <dea07e831c50f648e7eaf5706713ecbdf9de813a@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Fri, 7 Jun 2019 11:59:08 +0200
+Subject: [PATCH] qemu: Drop cleanup label from qemuProcessInitCpuAffinity()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+We're using VIR_AUTOPTR() for everything now, plus the
+cleanup section was not doing anything useful anyway.
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit de563ebcf9d72e5815933a0d715aa9c462bf50cc)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1718172
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190607095909.5538-2-abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_process.c | 18 ++++++++----------
+ 1 file changed, 8 insertions(+), 10 deletions(-)
+
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index f77c2ad275..f68a345c54 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -2356,7 +2356,6 @@ qemuProcessGetAllCpuAffinity(virBitmapPtr *cpumapRet)
+ static int
+ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
+ {
+-    int ret = -1;
+     VIR_AUTOPTR(virBitmap) cpumapToSet = NULL;
+     virDomainNumatuneMemMode mem_mode;
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+@@ -2387,25 +2386,24 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
+                                              priv->autoNodeset,
+                                              &nodeset,
+                                              -1) < 0)
+-            goto cleanup;
++            return -1;
+ 
+         if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
+-            goto cleanup;
++            return -1;
+     } else if (vm->def->cputune.emulatorpin) {
+         if (virBitmapCopy(cpumapToSet, vm->def->cputune.emulatorpin) < 0)
+-            goto cleanup;
++            return -1;
+     } else {
+         if (qemuProcessGetAllCpuAffinity(&cpumapToSet) < 0)
+-            goto cleanup;
++            return -1;
+     }
+ 
+     if (cpumapToSet &&
+-        virProcessSetAffinity(vm->pid, cpumapToSet) < 0)
+-        goto cleanup;
++        virProcessSetAffinity(vm->pid, cpumapToSet) < 0) {
++        return -1;
++    }
+ 
+-    ret = 0;
+- cleanup:
+-    return ret;
++    return 0;
+ }
+ 
+ /* set link states to down on interfaces at qemu start */
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Filter-non-SCSI-hostdevs-in-qemuHostdevPrepareSCSIDevices.patch b/SOURCES/libvirt-qemu-Filter-non-SCSI-hostdevs-in-qemuHostdevPrepareSCSIDevices.patch
new file mode 100644
index 0000000..725f46c
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Filter-non-SCSI-hostdevs-in-qemuHostdevPrepareSCSIDevices.patch
@@ -0,0 +1,43 @@
+From 3560b106745b8d1ed16203858b4a9434de4d79cf Mon Sep 17 00:00:00 2001
+Message-Id: <3560b106745b8d1ed16203858b4a9434de4d79cf@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Tue, 29 Jan 2019 19:01:49 -0500
+Subject: [PATCH] qemu: Filter non SCSI hostdevs in
+ qemuHostdevPrepareSCSIDevices
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1665474 (RHEL7)
+https://bugzilla.redhat.com/show_bug.cgi?id=1665244 (RHEL8)
+
+When commit 1d94b3e7 added code to walk the [n]hostdevs list looking
+to add shared hostdevs, it should've filtered any hostdevs that were
+not SCSI hostdev's.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit f30ac207ad96a567ade0d8a49023ade9233b2b72)
+Message-Id: <20190130000151.4479-2-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_hostdev.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
+index 1e040f98b7..8b1ad6b447 100644
+--- a/src/qemu/qemu_hostdev.c
++++ b/src/qemu/qemu_hostdev.c
+@@ -278,6 +278,9 @@ qemuHostdevPrepareSCSIDevices(virQEMUDriverPtr driver,
+     for (i = 0; i < nhostdevs; i++) {
+         virDomainDeviceDef dev;
+ 
++        if (!virHostdevIsSCSIDevice(hostdevs[i]))
++            continue;
++
+         dev.type = VIR_DOMAIN_DEVICE_HOSTDEV;
+         dev.data.hostdev = hostdevs[i];
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Fix-NULL-pointer-access-in-qemuProcessInitCpuAffinity.patch b/SOURCES/libvirt-qemu-Fix-NULL-pointer-access-in-qemuProcessInitCpuAffinity.patch
new file mode 100644
index 0000000..239a991
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Fix-NULL-pointer-access-in-qemuProcessInitCpuAffinity.patch
@@ -0,0 +1,47 @@
+From 2ebba4a1ef6914c2b030b52c67c56d7aca49290f Mon Sep 17 00:00:00 2001
+Message-Id: <2ebba4a1ef6914c2b030b52c67c56d7aca49290f@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Fri, 7 Jun 2019 11:59:09 +0200
+Subject: [PATCH] qemu: Fix NULL pointer access in qemuProcessInitCpuAffinity()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Commit 2f2254c7f4e5 attempted to fix a memory leak by ensuring
+cpumapToSet is always a freshly allocated bitmap, but regrettably
+introduced a NULL pointer access while doing so, because it called
+virBitmapCopy() without allocating the destination bitmap first.
+
+Solve the issue by using virBitmapNewCopy() instead.
+
+Reported-by: John Ferlan <jferlan@redhat.com>
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit a84922c09e9e1a0ca4f8fb1e8b4b1c7b55bd79e9)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1718172
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190607095909.5538-3-abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_process.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index f68a345c54..9e6e6528e2 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -2391,7 +2391,7 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
+         if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
+             return -1;
+     } else if (vm->def->cputune.emulatorpin) {
+-        if (virBitmapCopy(cpumapToSet, vm->def->cputune.emulatorpin) < 0)
++        if (!(cpumapToSet = virBitmapNewCopy(vm->def->cputune.emulatorpin)))
+             return -1;
+     } else {
+         if (qemuProcessGetAllCpuAffinity(&cpumapToSet) < 0)
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Fix-crash-trying-to-use-iSCSI-hostdev.patch b/SOURCES/libvirt-qemu-Fix-crash-trying-to-use-iSCSI-hostdev.patch
new file mode 100644
index 0000000..d946922
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Fix-crash-trying-to-use-iSCSI-hostdev.patch
@@ -0,0 +1,46 @@
+From e6623828b4e41fab3df1593a670341a55b3f6a71 Mon Sep 17 00:00:00 2001
+Message-Id: <e6623828b4e41fab3df1593a670341a55b3f6a71@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Tue, 29 Jan 2019 19:01:51 -0500
+Subject: [PATCH] qemu: Fix crash trying to use iSCSI hostdev
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1669586 (RHEL7)
+https://bugzilla.redhat.com/show_bug.cgi?id=1669424 (RHEL8)
+
+RHEL-only
+
+Commit 2878c0c7b moved the qemuIsSharedHostdev filter in the
+HOSTDEV half of the logic to allow calling qemuGetHostdevPath;
+however, that neglected to check whether the SCSI hostdev was
+using the iSCSI protocol which has a different overlayed struct
+format (u.iscsi vs. u.host) resulting in attempted access of
+u.host when calling virSCSIDeviceGetDevName.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Message-Id: <20190130000151.4479-4-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_conf.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
+index 768e9d8308..a81298326f 100644
+--- a/src/qemu/qemu_conf.c
++++ b/src/qemu/qemu_conf.c
+@@ -1667,6 +1667,10 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
+     } else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
+         hostdev = dev->data.hostdev;
+ 
++        if (hostdev->source.subsys.u.scsi.protocol ==
++            VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
++            return 0;
++
+         if (!(hostdev_path = qemuGetHostdevPath(hostdev)))
+             goto cleanup;
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Fix-leak-in-qemuProcessInitCpuAffinity.patch b/SOURCES/libvirt-qemu-Fix-leak-in-qemuProcessInitCpuAffinity.patch
new file mode 100644
index 0000000..7e6bdd8
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Fix-leak-in-qemuProcessInitCpuAffinity.patch
@@ -0,0 +1,84 @@
+From c34dd2135b250a3681c36eead2e85630ad2e13a2 Mon Sep 17 00:00:00 2001
+Message-Id: <c34dd2135b250a3681c36eead2e85630ad2e13a2@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Tue, 4 Jun 2019 16:22:07 +0200
+Subject: [PATCH] qemu: Fix leak in qemuProcessInitCpuAffinity()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In two out of three scenarios we are cleaning up properly after
+ourselves, but commit 5f2212c062c7 has changed the remaining one
+in a way that caused it to start leaking cpumapToSet.
+
+Refactor the logic so that cpumapToSet is always a freshly
+allocated bitmap that gets cleaned up automatically thanks to
+VIR_AUTOPTR(); this also allows us to remove the hostcpumap
+variable.
+
+Reported-by: John Ferlan <jferlan@redhat.com>
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 2f2254c7f4e5bff52ea62a77831230bebc076bab)
+
+Conflicts:
+
+  * src/qemu/qemu_process.c:
+    - When upstream commit f136b83139c6 was backported to RHEL
+      7.7 as downstream commit eb7ef8053311, the cleanup path in
+      qemuProcessInitCpuAffinity() had to be modified to account
+      for the lack of VIR_AUTO*() in libvirt 4.5.0; since I'm
+      dragging in the memory management macros as part of this
+      series, however, I took the opportunity to update the
+      cleanup path again: it now matches upstream.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1703661
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190604142207.2036-7-abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_process.c | 12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index 4c28f250f6..f77c2ad275 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -2357,8 +2357,7 @@ static int
+ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
+ {
+     int ret = -1;
+-    virBitmapPtr cpumapToSet = NULL;
+-    virBitmapPtr hostcpumap = NULL;
++    VIR_AUTOPTR(virBitmap) cpumapToSet = NULL;
+     virDomainNumatuneMemMode mem_mode;
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+ 
+@@ -2393,11 +2392,11 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
+         if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
+             goto cleanup;
+     } else if (vm->def->cputune.emulatorpin) {
+-        cpumapToSet = vm->def->cputune.emulatorpin;
+-    } else {
+-        if (qemuProcessGetAllCpuAffinity(&hostcpumap) < 0)
++        if (virBitmapCopy(cpumapToSet, vm->def->cputune.emulatorpin) < 0)
++            goto cleanup;
++    } else {
++        if (qemuProcessGetAllCpuAffinity(&cpumapToSet) < 0)
+             goto cleanup;
+-        cpumapToSet = hostcpumap;
+     }
+ 
+     if (cpumapToSet &&
+@@ -2406,7 +2405,6 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
+ 
+     ret = 0;
+  cleanup:
+-    virBitmapFree(hostcpumap);
+     return ret;
+ }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Fix-logic-error-in-qemuSetUnprivSGIO.patch b/SOURCES/libvirt-qemu-Fix-logic-error-in-qemuSetUnprivSGIO.patch
new file mode 100644
index 0000000..14f9969
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Fix-logic-error-in-qemuSetUnprivSGIO.patch
@@ -0,0 +1,61 @@
+From eec80321b1066ea326746fb70e99575e5d2f2954 Mon Sep 17 00:00:00 2001
+Message-Id: <eec80321b1066ea326746fb70e99575e5d2f2954@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Tue, 29 Jan 2019 19:01:50 -0500
+Subject: [PATCH] qemu: Fix logic error in qemuSetUnprivSGIO
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1669581 (RHEL7)
+https://bugzilla.redhat.com/show_bug.cgi?id=1666605 (RHEL8)
+
+RHEL-only
+
+Commit 8b246c4bb had a logic error with using both DISK and
+sgio which resulted in a DISK that didn't have sgio set falling
+into the else clause and trying to deref a NULL @hostdev resulting
+in a libvirtd crash:
+
+Thread 1 (Thread 0x7ffbc6353700 (LWP 12642)):
+ 0  0x00007ffb958e7d7a in qemuSetUnprivSGIO
+ 1  0x00007ffb958d9d92 in qemuDomainAttachDeviceDiskLive
+ 2  0x00007ffb9594fce8 in qemuDomainAttachDeviceFlags
+ 3  0x00007ffbde399d71 in virDomainAttachDevice
+ 4  0x0000563b73ded4b2 in remoteDispatchDomainAttachDeviceHelper
+
+for hotplug of XML:
+
+<disk device="lun" type="block">
+  <source dev="/dev/sdb"/>
+  <driver name="qemu" type="raw"/>
+  <target bus="scsi" dev="sdb"/>
+</disk>
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Message-Id: <20190130000151.4479-3-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_conf.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
+index 5971f3eb64..768e9d8308 100644
+--- a/src/qemu/qemu_conf.c
++++ b/src/qemu/qemu_conf.c
+@@ -1679,9 +1679,9 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
+         goto cleanup;
+ 
+     /* By default, filter the SG_IO commands, i.e. set unpriv_sgio to 0.  */
+-    if (dev->type == VIR_DOMAIN_DEVICE_DISK &&
+-        disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED) {
+-        val = 1;
++    if (dev->type == VIR_DOMAIN_DEVICE_DISK) {
++        if (disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED)
++            val = 1;
+     } else {
+         /* Only settable if <shareable/> was present for hostdev */
+         if (qemuIsSharedHostdev(hostdev) &&
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Fix-post-copy-migration-on-the-source.patch b/SOURCES/libvirt-qemu-Fix-post-copy-migration-on-the-source.patch
index 4445b81..a0406f2 100644
--- a/SOURCES/libvirt-qemu-Fix-post-copy-migration-on-the-source.patch
+++ b/SOURCES/libvirt-qemu-Fix-post-copy-migration-on-the-source.patch
@@ -1,5 +1,5 @@
-From 35c8afb44903ae12239323873af0c0376082b02b Mon Sep 17 00:00:00 2001
-Message-Id: <35c8afb44903ae12239323873af0c0376082b02b@dist-git>
+From 5d260e0603146e1bdb3246498126745ab1a4245a Mon Sep 17 00:00:00 2001
+Message-Id: <5d260e0603146e1bdb3246498126745ab1a4245a@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Thu, 15 Nov 2018 11:16:43 +0100
 Subject: [PATCH] qemu: Fix post-copy migration on the source
@@ -106,5 +106,5 @@ index 9b5cb93325..485e455a44 100644
  }
  
 -- 
-2.20.1
+2.21.0
 
diff --git a/SOURCES/libvirt-qemu-Fix-qemuProcessInitCpuAffinity.patch b/SOURCES/libvirt-qemu-Fix-qemuProcessInitCpuAffinity.patch
new file mode 100644
index 0000000..715a23c
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Fix-qemuProcessInitCpuAffinity.patch
@@ -0,0 +1,73 @@
+From 7be804cd87131dbb2a0861e07980826a15dce376 Mon Sep 17 00:00:00 2001
+Message-Id: <7be804cd87131dbb2a0861e07980826a15dce376@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Tue, 4 Jun 2019 16:22:06 +0200
+Subject: [PATCH] qemu: Fix qemuProcessInitCpuAffinity()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Ever since the feature was introduced with commit 0f8e7ae33ace,
+it has contained a logic error in that it attempted to use a NUMA
+node map where a CPU map was expected.
+
+Because of that, guests using <numatune> might fail to start:
+
+  # virsh start guest
+  error: Failed to start domain guest
+  error: cannot set CPU affinity on process 40055: Invalid argument
+
+This was particularly easy to trigger on POWER 8 machines, where
+secondary threads always show up as offline in the host: having
+
+  <numatune>
+    <memory mode='strict' placement='static' nodeset='1'/>
+  </numatune>
+
+in the guest configuration, for example, would result in libvirt
+trying to set the process affinity so that it would prefer
+running on CPU 1, but since that's a secondary thread and thus
+shows up as offline, the operation would fail, and so would
+starting the guest.
+
+Use the newly introduced virNumaNodesetToCPUset() to convert the
+NUMA node map to a CPU map, which in the example above would be
+48,56,64,72,80,88 - a valid input for virProcessSetAffinity().
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1703661
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 5f2212c062c720716b7701fa0a5511311dc6e906)
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190604142207.2036-6-abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_process.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index 7f70d79566..4c28f250f6 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -2382,11 +2382,16 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
+     if (virDomainNumaGetNodeCount(vm->def->numa) <= 1 &&
+         virDomainNumatuneGetMode(vm->def->numa, -1, &mem_mode) == 0 &&
+         mem_mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT) {
++        virBitmapPtr nodeset = NULL;
++
+         if (virDomainNumatuneMaybeGetNodeset(vm->def->numa,
+                                              priv->autoNodeset,
+-                                             &cpumapToSet,
++                                             &nodeset,
+                                              -1) < 0)
+             goto cleanup;
++
++        if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
++            goto cleanup;
+     } else if (vm->def->cputune.emulatorpin) {
+         cpumapToSet = vm->def->cputune.emulatorpin;
+     } else {
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Make-virQEMUCapsProbeHostCPUForEmulator-more-generic.patch b/SOURCES/libvirt-qemu-Make-virQEMUCapsProbeHostCPUForEmulator-more-generic.patch
new file mode 100644
index 0000000..7ea7ed5
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Make-virQEMUCapsProbeHostCPUForEmulator-more-generic.patch
@@ -0,0 +1,107 @@
+From b7a1f0836d350bb4ee6930784a6f219e600ef794 Mon Sep 17 00:00:00 2001
+Message-Id: <b7a1f0836d350bb4ee6930784a6f219e600ef794@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Tue, 4 Jun 2019 13:04:27 +0200
+Subject: [PATCH] qemu: Make virQEMUCapsProbeHostCPUForEmulator more generic
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The function is renamed as virQEMUCapsProbeHostCPU and it does not get
+the list of allowed CPU models from qemuCaps anymore. This is
+responsibility is moved to the caller. The result is just a very thin
+wrapper around virCPUGetHost mostly required mocking in tests.
+
+The generic function is used in place of a direct call to virCPUGetHost
+in virQEMUCapsInitHostCPUModel to make sure tests don't accidentally
+probe host CPU.
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit dd3fc650de8ef8b05b491c9f362b660e07a857fd)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <36a308ac10a2c86970ea3188dcb197c75adddefe.1559646067.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/qemu/qemu_capabilities.c | 14 ++++++--------
+ src/qemu/qemu_capspriv.h     |  5 ++---
+ tests/qemucpumock.c          |  5 ++---
+ 3 files changed, 10 insertions(+), 14 deletions(-)
+
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index 66eefae988..c5032f9192 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -924,12 +924,10 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
+ 
+ 
+ virCPUDefPtr
+-virQEMUCapsProbeHostCPUForEmulator(virArch hostArch,
+-                                   virQEMUCapsPtr qemuCaps,
+-                                   virDomainVirtType type)
++virQEMUCapsProbeHostCPU(virArch hostArch,
++                        virDomainCapsCPUModelsPtr models)
+ {
+-    return virCPUGetHost(hostArch, VIR_CPU_TYPE_GUEST, NULL,
+-                         virQEMUCapsGetCPUDefinitions(qemuCaps, type));
++    return virCPUGetHost(hostArch, VIR_CPU_TYPE_GUEST, NULL, models);
+ }
+ 
+ 
+@@ -2960,7 +2958,8 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
+     } else if (rc == 1) {
+         VIR_DEBUG("No host CPU model info from QEMU; probing host CPU directly");
+ 
+-        hostCPU = virQEMUCapsProbeHostCPUForEmulator(hostArch, qemuCaps, type);
++        hostCPU = virQEMUCapsProbeHostCPU(hostArch,
++                                          virQEMUCapsGetCPUDefinitions(qemuCaps, type));
+         if (!hostCPU ||
+             virCPUDefCopyModelFilter(cpu, hostCPU, true,
+                                      virQEMUCapsCPUFilterFeatures,
+@@ -2973,8 +2972,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
+         goto error;
+     } else if (type == VIR_DOMAIN_VIRT_KVM &&
+                virCPUGetHostIsSupported(qemuCaps->arch)) {
+-        if (!(fullCPU = virCPUGetHost(qemuCaps->arch, VIR_CPU_TYPE_GUEST,
+-                                      NULL, NULL)))
++        if (!(fullCPU = virQEMUCapsProbeHostCPU(qemuCaps->arch, NULL)))
+             goto error;
+ 
+         if (!(cpuExpanded = virCPUDefCopy(cpu)) ||
+diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h
+index cb5e0dd9a9..8e458ef227 100644
+--- a/src/qemu/qemu_capspriv.h
++++ b/src/qemu/qemu_capspriv.h
+@@ -81,9 +81,8 @@ virQEMUCapsSetCPUModelInfo(virQEMUCapsPtr qemuCaps,
+                            qemuMonitorCPUModelInfoPtr modelInfo);
+ 
+ virCPUDefPtr
+-virQEMUCapsProbeHostCPUForEmulator(virArch hostArch,
+-                                   virQEMUCapsPtr qemuCaps,
+-                                   virDomainVirtType type) ATTRIBUTE_NOINLINE;
++virQEMUCapsProbeHostCPU(virArch hostArch,
++                        virDomainCapsCPUModelsPtr models) ATTRIBUTE_NOINLINE;
+ 
+ void
+ virQEMUCapsSetGICCapabilities(virQEMUCapsPtr qemuCaps,
+diff --git a/tests/qemucpumock.c b/tests/qemucpumock.c
+index 74dcfa6291..0e89e9764f 100644
+--- a/tests/qemucpumock.c
++++ b/tests/qemucpumock.c
+@@ -29,9 +29,8 @@
+ 
+ 
+ virCPUDefPtr
+-virQEMUCapsProbeHostCPUForEmulator(virArch hostArch ATTRIBUTE_UNUSED,
+-                                   virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED,
+-                                   virDomainVirtType type ATTRIBUTE_UNUSED)
++virQEMUCapsProbeHostCPU(virArch hostArch ATTRIBUTE_UNUSED,
++                        virDomainCapsCPUModelsPtr models ATTRIBUTE_UNUSED)
+ {
+     const char *model = getenv("VIR_TEST_MOCK_FAKE_HOST_CPU");
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Map-running-reason-to-resume-event-detail.patch b/SOURCES/libvirt-qemu-Map-running-reason-to-resume-event-detail.patch
index 817b06b..b2bdc8f 100644
--- a/SOURCES/libvirt-qemu-Map-running-reason-to-resume-event-detail.patch
+++ b/SOURCES/libvirt-qemu-Map-running-reason-to-resume-event-detail.patch
@@ -1,5 +1,5 @@
-From 919834294448ac9d1569a1f2620ea01d79a86e96 Mon Sep 17 00:00:00 2001
-Message-Id: <919834294448ac9d1569a1f2620ea01d79a86e96@dist-git>
+From eec58172c15c8aa05c3beb0a4200b148d00574e6 Mon Sep 17 00:00:00 2001
+Message-Id: <eec58172c15c8aa05c3beb0a4200b148d00574e6@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 11 Sep 2018 15:13:08 +0200
 Subject: [PATCH] qemu: Map running reason to resume event detail
@@ -20,6 +20,7 @@ Reviewed-by: John Ferlan <jferlan@redhat.com>
 
 https://bugzilla.redhat.com/show_bug.cgi?id=1634758
 https://bugzilla.redhat.com/show_bug.cgi?id=1634759
+https://bugzilla.redhat.com/show_bug.cgi?id=1612943
 
 Conflicts:
 	src/qemu/qemu_domain.c
@@ -117,5 +118,5 @@ index 7325bc4c90..37568165b7 100644
          if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
              VIR_WARN("Unable to save status on vm %s after state change",
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-qemu-Pass-running-reason-to-RESUME-event-handler.patch b/SOURCES/libvirt-qemu-Pass-running-reason-to-RESUME-event-handler.patch
index 6e404ce..0aac618 100644
--- a/SOURCES/libvirt-qemu-Pass-running-reason-to-RESUME-event-handler.patch
+++ b/SOURCES/libvirt-qemu-Pass-running-reason-to-RESUME-event-handler.patch
@@ -1,5 +1,5 @@
-From 725d1095dfd473b2a0da59594276413ea6a7fa8b Mon Sep 17 00:00:00 2001
-Message-Id: <725d1095dfd473b2a0da59594276413ea6a7fa8b@dist-git>
+From 6e26897793df5cd001123f4ff805b6598d89b5db Mon Sep 17 00:00:00 2001
+Message-Id: <6e26897793df5cd001123f4ff805b6598d89b5db@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Mon, 10 Sep 2018 19:41:53 +0200
 Subject: [PATCH] qemu: Pass running reason to RESUME event handler
@@ -27,6 +27,7 @@ Reviewed-by: John Ferlan <jferlan@redhat.com>
 
 https://bugzilla.redhat.com/show_bug.cgi?id=1634758
 https://bugzilla.redhat.com/show_bug.cgi?id=1634759
+https://bugzilla.redhat.com/show_bug.cgi?id=1612943
 
 Conflicts:
 	src/qemu/qemu_domain.h
@@ -119,5 +120,5 @@ index 26979faa72..7325bc4c90 100644
      VIR_DEBUG("Updating guest CPU definition");
      if (qemuProcessUpdateGuestCPU(vm->def, priv->qemuCaps, caps, flags) < 0)
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-qemu-Properly-report-VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT.patch b/SOURCES/libvirt-qemu-Properly-report-VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT.patch
index 2cfbf59..b029559 100644
--- a/SOURCES/libvirt-qemu-Properly-report-VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT.patch
+++ b/SOURCES/libvirt-qemu-Properly-report-VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT.patch
@@ -1,5 +1,5 @@
-From fcfb306555cbae44542d3819e93a24f68b7e431a Mon Sep 17 00:00:00 2001
-Message-Id: <fcfb306555cbae44542d3819e93a24f68b7e431a@dist-git>
+From 45d759d4b20daea1e58a823f1ae082d6875fa21e Mon Sep 17 00:00:00 2001
+Message-Id: <45d759d4b20daea1e58a823f1ae082d6875fa21e@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Mon, 10 Sep 2018 15:10:54 +0200
 Subject: [PATCH] qemu: Properly report VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT
@@ -17,6 +17,7 @@ Reviewed-by: John Ferlan <jferlan@redhat.com>
 
 https://bugzilla.redhat.com/show_bug.cgi?id=1634758
 https://bugzilla.redhat.com/show_bug.cgi?id=1634759
+https://bugzilla.redhat.com/show_bug.cgi?id=1612943
 
 Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
 Reviewed-by: Ján Tomko <jtomko@redhat.com>
@@ -38,5 +39,5 @@ index c7689cc239..26aa557d9f 100644
                                                   VIR_DOMAIN_EVENT_RESUMED,
                                                   detail);
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-qemu-Put-format-raw-onto-cmd-line-for-SCSI-passthrough.patch b/SOURCES/libvirt-qemu-Put-format-raw-onto-cmd-line-for-SCSI-passthrough.patch
new file mode 100644
index 0000000..8497421
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Put-format-raw-onto-cmd-line-for-SCSI-passthrough.patch
@@ -0,0 +1,91 @@
+From ccd5133d42ea5f02d3c5bc730c3aec534b96b8d5 Mon Sep 17 00:00:00 2001
+Message-Id: <ccd5133d42ea5f02d3c5bc730c3aec534b96b8d5@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Wed, 3 Apr 2019 15:33:36 +0200
+Subject: [PATCH] qemu: Put format=raw onto cmd line for SCSI passthrough
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1632833
+
+When doing a SCSI passthrough we don't put format= onto the
+command line. This causes qemu to probe the format automatically
+which ends up in a warning in the domain log and possible qemu
+disabling writes to the first block (according to the warning
+message).
+
+Based-on-work-of: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit 641a95c9b64e74dccb55ebae8f00da3f10c1feae)
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+
+Conflicts: tests/qemuxml2argvdata/hostdev-scsi-lsi.args:
+  tests/qemuxml2argvdata/hostdev-scsi-readonly.args:
+  tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args:
+    - Context, since v4.7.0-rc1~268 is not backported
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Message-Id: <6c743591aaf31e4313ab12dec9171716d55fdb43.1554298414.git.mprivozn@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ src/qemu/qemu_command.c                              | 2 +-
+ tests/qemuxml2argvdata/hostdev-scsi-lsi.args         | 2 +-
+ tests/qemuxml2argvdata/hostdev-scsi-readonly.args    | 2 +-
+ tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
+index 98b554627e..d372b1bd79 100644
+--- a/src/qemu/qemu_command.c
++++ b/src/qemu/qemu_command.c
+@@ -4740,7 +4740,7 @@ qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev,
+     } else {
+         if (!(source = qemuBuildSCSIHostHostdevDrvStr(dev)))
+             goto error;
+-        virBufferAsprintf(&buf, "file=/dev/%s,if=none", source);
++        virBufferAsprintf(&buf, "file=/dev/%s,if=none,format=raw", source);
+     }
+     VIR_FREE(source);
+ 
+diff --git a/tests/qemuxml2argvdata/hostdev-scsi-lsi.args b/tests/qemuxml2argvdata/hostdev-scsi-lsi.args
+index ffb4cc1eaa..c37a269e45 100644
+--- a/tests/qemuxml2argvdata/hostdev-scsi-lsi.args
++++ b/tests/qemuxml2argvdata/hostdev-scsi-lsi.args
+@@ -25,6 +25,6 @@ server,nowait \
+ -usb \
+ -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
+ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+--drive file=/dev/sg0,if=none,id=drive-hostdev0 \
++-drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev0 \
+ -device scsi-generic,bus=scsi0.0,scsi-id=7,drive=drive-hostdev0,id=hostdev0 \
+ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
+diff --git a/tests/qemuxml2argvdata/hostdev-scsi-readonly.args b/tests/qemuxml2argvdata/hostdev-scsi-readonly.args
+index 938ba3bf3f..061c6c1e9f 100644
+--- a/tests/qemuxml2argvdata/hostdev-scsi-readonly.args
++++ b/tests/qemuxml2argvdata/hostdev-scsi-readonly.args
+@@ -25,7 +25,7 @@ server,nowait \
+ -usb \
+ -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
+ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+--drive file=/dev/sg0,if=none,id=drive-hostdev0,readonly=on \
++-drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev0,readonly=on \
+ -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=4,lun=8,\
+ drive=drive-hostdev0,id=hostdev0 \
+ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
+diff --git a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args
+index 18543e24f1..304f11446c 100644
+--- a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args
++++ b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args
+@@ -25,7 +25,7 @@ server,nowait \
+ -usb \
+ -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
+ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+--drive file=/dev/sg0,if=none,id=drive-hostdev0 \
++-drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev0 \
+ -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=4,lun=8,\
+ drive=drive-hostdev0,id=hostdev0 \
+ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Remove-duplicated-qemuAgentCheckError.patch b/SOURCES/libvirt-qemu-Remove-duplicated-qemuAgentCheckError.patch
new file mode 100644
index 0000000..bdf9245
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Remove-duplicated-qemuAgentCheckError.patch
@@ -0,0 +1,50 @@
+From 02683e9bc2ec38c7b7fb2ec2bba789701c514ddc Mon Sep 17 00:00:00 2001
+Message-Id: <02683e9bc2ec38c7b7fb2ec2bba789701c514ddc@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Thu, 10 Jan 2019 12:49:10 +0100
+Subject: [PATCH] qemu: Remove duplicated qemuAgentCheckError
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Commit 5b3492fadb moved qemuAgentCheckError calls into
+qemuAgentCommand for various reasons; however, subsequent
+commit 0977b8aa0 adding a new command made call again
+So let's just remove the duplicitous call from
+qemuAgentGetInterfaces.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+ACKed-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit 9ed175fbc2deecfdaeabca7bc77c7e7ae33a3377)
+Signed-off-by: Ján Tomko <jtomko@redhat.com>
+
+7.7: https://bugzilla.redhat.com/show_bug.cgi?id=1663051
+8.0: https://bugzilla.redhat.com/show_bug.cgi?id=1665000
+CVE-2019-3840
+Message-Id: <14650d570abb94757791fcdb50b65d65bb8d5601.1547120910.git.jtomko@redhat.com>
+
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_agent.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
+index 10c6ef09fa..986e37b07d 100644
+--- a/src/qemu/qemu_agent.c
++++ b/src/qemu/qemu_agent.c
+@@ -1987,10 +1987,9 @@ qemuAgentGetInterfaces(qemuAgentPtr mon,
+     if (!(cmd = qemuAgentMakeCommand("guest-network-get-interfaces", NULL)))
+         goto cleanup;
+ 
+-    if (qemuAgentCommand(mon, cmd, &reply, false, VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK) < 0 ||
+-        qemuAgentCheckError(cmd, reply) < 0) {
++    if (qemuAgentCommand(mon, cmd, &reply, false,
++                         VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK) < 0)
+         goto cleanup;
+-    }
+ 
+     if (!(ret_array = virJSONValueObjectGet(reply, "return"))) {
+         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Report-more-appropriate-running-reasons.patch b/SOURCES/libvirt-qemu-Report-more-appropriate-running-reasons.patch
index 1095745..ba0b90b 100644
--- a/SOURCES/libvirt-qemu-Report-more-appropriate-running-reasons.patch
+++ b/SOURCES/libvirt-qemu-Report-more-appropriate-running-reasons.patch
@@ -1,5 +1,5 @@
-From 338a37710209d5fc35e326925318f087d572ba25 Mon Sep 17 00:00:00 2001
-Message-Id: <338a37710209d5fc35e326925318f087d572ba25@dist-git>
+From 8e342d61e9c51689689b000c73d1cd93a44e6980 Mon Sep 17 00:00:00 2001
+Message-Id: <8e342d61e9c51689689b000c73d1cd93a44e6980@dist-git>
 From: Jiri Denemark <jdenemar@redhat.com>
 Date: Tue, 11 Sep 2018 19:26:07 +0200
 Subject: [PATCH] qemu: Report more appropriate running reasons
@@ -18,6 +18,7 @@ Reviewed-by: John Ferlan <jferlan@redhat.com>
 
 https://bugzilla.redhat.com/show_bug.cgi?id=1634758
 https://bugzilla.redhat.com/show_bug.cgi?id=1634759
+https://bugzilla.redhat.com/show_bug.cgi?id=1612943
 
 Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
 Reviewed-by: Ján Tomko <jtomko@redhat.com>
@@ -57,5 +58,5 @@ index a4b1f97df5..26979faa72 100644
                   VIR_WARN("Could not resume domain '%s' after migration to file",
                            vm->def->name);
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-qemu-Rework-setting-process-affinity.patch b/SOURCES/libvirt-qemu-Rework-setting-process-affinity.patch
new file mode 100644
index 0000000..28fd91c
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Rework-setting-process-affinity.patch
@@ -0,0 +1,273 @@
+From eb7ef8053311d82d43912a5cc1e82d0266bb29de Mon Sep 17 00:00:00 2001
+Message-Id: <eb7ef8053311d82d43912a5cc1e82d0266bb29de@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 18 Apr 2019 18:58:57 +0200
+Subject: [PATCH] qemu: Rework setting process affinity
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+RHEL-7.7: https://bugzilla.redhat.com/show_bug.cgi?id=1695434
+RHEL-8.0.1: https://bugzilla.redhat.com/show_bug.cgi?id=1503284
+
+The way we currently start qemu from CPU affinity POV is as
+follows:
+
+  1) the child process is set affinity to all online CPUs (unless
+  some vcpu pinning was given in the domain XML)
+
+  2) Once qemu is running, cpuset cgroup is configured taking
+  memory pinning into account
+
+Problem is that we let qemu allocate its memory just anywhere in
+1) and then rely in 2) to be able to move the memory to
+configured NUMA nodes. This might not be always possible (e.g.
+qemu might lock some parts of its memory) and is very suboptimal
+(copying large memory between NUMA nodes takes significant amount
+of time).
+
+The solution is to set affinity to one of (in priority order):
+  - The CPUs associated with NUMA memory affinity mask
+  - The CPUs associated with emulator pinning
+  - All online host CPUs
+
+Later (once QEMU has allocated its memory) we then change this
+again to (again in priority order):
+  - The CPUs associated with emulator pinning
+  - The CPUs returned by numad
+  - The CPUs associated with vCPU pinning
+  - All online host CPUs
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit f136b83139c63f20de0df3285d9e82df2fb97bfc)
+
+I had to explicitly free bitmaps, because there is no VIR_AUTOPTR
+just yet.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Message-Id: <a6edd347c999f999a49d1a878c74c690eb2ab619.1555606711.git.mprivozn@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_process.c | 130 +++++++++++++++++++---------------------
+ 1 file changed, 63 insertions(+), 67 deletions(-)
+
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index 6945d76b18..7d04a6e226 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -2335,6 +2335,21 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver,
+ }
+ 
+ 
++static int
++qemuProcessGetAllCpuAffinity(virBitmapPtr *cpumapRet)
++{
++    *cpumapRet = NULL;
++
++    if (!virHostCPUHasBitmap())
++        return 0;
++
++    if (!(*cpumapRet = virHostCPUGetOnlineBitmap()))
++        return -1;
++
++    return 0;
++}
++
++
+ /*
+  * To be run between fork/exec of QEMU only
+  */
+@@ -2342,9 +2357,9 @@ static int
+ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
+ {
+     int ret = -1;
+-    virBitmapPtr cpumap = NULL;
+     virBitmapPtr cpumapToSet = NULL;
+     virBitmapPtr hostcpumap = NULL;
++    virDomainNumatuneMemMode mem_mode;
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+ 
+     if (!vm->pid) {
+@@ -2353,58 +2368,39 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
+         return -1;
+     }
+ 
+-    if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) {
+-        VIR_DEBUG("Set CPU affinity with advisory nodeset from numad");
+-        cpumapToSet = priv->autoCpuset;
++    /* Here is the deal, we can't set cpuset.mems before qemu is
++     * started as it clashes with KVM allocation. Therefore, we
++     * used to let qemu allocate its memory anywhere as we would
++     * then move the memory to desired NUMA node via CGroups.
++     * However, that might not be always possible because qemu
++     * might lock some parts of its memory (e.g. due to VFIO).
++     * Even if it possible, memory has to be copied between NUMA
++     * nodes which is suboptimal.
++     * Solution is to set affinity that matches the best what we
++     * would have set in CGroups and then fix it later, once qemu
++     * is already running. */
++    if (virDomainNumaGetNodeCount(vm->def->numa) <= 1 &&
++        virDomainNumatuneGetMode(vm->def->numa, -1, &mem_mode) == 0 &&
++        mem_mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT) {
++        if (virDomainNumatuneMaybeGetNodeset(vm->def->numa,
++                                             priv->autoNodeset,
++                                             &cpumapToSet,
++                                             -1) < 0)
++            goto cleanup;
++    } else if (vm->def->cputune.emulatorpin) {
++        cpumapToSet = vm->def->cputune.emulatorpin;
+     } else {
+-        VIR_DEBUG("Set CPU affinity with specified cpuset");
+-        if (vm->def->cpumask) {
+-            cpumapToSet = vm->def->cpumask;
+-        } else {
+-            /* You may think this is redundant, but we can't assume libvirtd
+-             * itself is running on all pCPUs, so we need to explicitly set
+-             * the spawned QEMU instance to all pCPUs if no map is given in
+-             * its config file */
+-            int hostcpus;
+-
+-            if (virHostCPUHasBitmap()) {
+-                hostcpumap = virHostCPUGetOnlineBitmap();
+-                cpumap = virProcessGetAffinity(vm->pid);
+-            }
+-
+-            if (hostcpumap && cpumap && virBitmapEqual(hostcpumap, cpumap)) {
+-                /* we're using all available CPUs, no reason to set
+-                 * mask. If libvirtd is running without explicit
+-                 * affinity, we can use hotplugged CPUs for this VM */
+-                ret = 0;
+-                goto cleanup;
+-            } else {
+-                /* setaffinity fails if you set bits for CPUs which
+-                 * aren't present, so we have to limit ourselves */
+-                if ((hostcpus = virHostCPUGetCount()) < 0)
+-                    goto cleanup;
+-
+-                if (hostcpus > QEMUD_CPUMASK_LEN)
+-                    hostcpus = QEMUD_CPUMASK_LEN;
+-
+-                virBitmapFree(cpumap);
+-                if (!(cpumap = virBitmapNew(hostcpus)))
+-                    goto cleanup;
+-
+-                virBitmapSetAll(cpumap);
+-
+-                cpumapToSet = cpumap;
+-            }
+-        }
++        if (qemuProcessGetAllCpuAffinity(&hostcpumap) < 0)
++            goto cleanup;
++        cpumapToSet = hostcpumap;
+     }
+ 
+-    if (virProcessSetAffinity(vm->pid, cpumapToSet) < 0)
++    if (cpumapToSet &&
++        virProcessSetAffinity(vm->pid, cpumapToSet) < 0)
+         goto cleanup;
+ 
+     ret = 0;
+-
+  cleanup:
+-    virBitmapFree(cpumap);
+     virBitmapFree(hostcpumap);
+     return ret;
+ }
+@@ -2478,7 +2474,8 @@ qemuProcessSetupPid(virDomainObjPtr vm,
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+     virDomainNumatuneMemMode mem_mode;
+     virCgroupPtr cgroup = NULL;
+-    virBitmapPtr use_cpumask;
++    virBitmapPtr use_cpumask = NULL;
++    virBitmapPtr hostcpumap = NULL;
+     char *mem_mask = NULL;
+     int ret = -1;
+ 
+@@ -2490,12 +2487,21 @@ qemuProcessSetupPid(virDomainObjPtr vm,
+     }
+ 
+     /* Infer which cpumask shall be used. */
+-    if (cpumask)
++    if (cpumask) {
+         use_cpumask = cpumask;
+-    else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO)
++    } else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) {
+         use_cpumask = priv->autoCpuset;
+-    else
++    } else if (vm->def->cpumask) {
+         use_cpumask = vm->def->cpumask;
++    } else {
++        /* You may think this is redundant, but we can't assume libvirtd
++         * itself is running on all pCPUs, so we need to explicitly set
++         * the spawned QEMU instance to all pCPUs if no map is given in
++         * its config file */
++        if (qemuProcessGetAllCpuAffinity(&hostcpumap) < 0)
++            goto cleanup;
++        use_cpumask = hostcpumap;
++    }
+ 
+     /*
+      * If CPU cgroup controller is not initialized here, then we need
+@@ -2520,13 +2526,7 @@ qemuProcessSetupPid(virDomainObjPtr vm,
+                 qemuSetupCgroupCpusetCpus(cgroup, use_cpumask) < 0)
+                 goto cleanup;
+ 
+-            /*
+-             * Don't setup cpuset.mems for the emulator, they need to
+-             * be set up after initialization in order for kvm
+-             * allocations to succeed.
+-             */
+-            if (nameval != VIR_CGROUP_THREAD_EMULATOR &&
+-                mem_mask && virCgroupSetCpusetMems(cgroup, mem_mask) < 0)
++            if (mem_mask && virCgroupSetCpusetMems(cgroup, mem_mask) < 0)
+                 goto cleanup;
+ 
+         }
+@@ -2553,6 +2553,7 @@ qemuProcessSetupPid(virDomainObjPtr vm,
+     ret = 0;
+  cleanup:
+     VIR_FREE(mem_mask);
++    virBitmapFree(hostcpumap);
+     if (cgroup) {
+         if (ret < 0)
+             virCgroupRemove(cgroup);
+@@ -6428,12 +6429,7 @@ qemuProcessLaunch(virConnectPtr conn,
+ 
+     /* This must be done after cgroup placement to avoid resetting CPU
+      * affinity */
+-    if (!vm->def->cputune.emulatorpin &&
+-        qemuProcessInitCpuAffinity(vm) < 0)
+-        goto cleanup;
+-
+-    VIR_DEBUG("Setting emulator tuning/settings");
+-    if (qemuProcessSetupEmulator(vm) < 0)
++    if (qemuProcessInitCpuAffinity(vm) < 0)
+         goto cleanup;
+ 
+     VIR_DEBUG("Setting cgroup for external devices (if required)");
+@@ -6502,10 +6498,6 @@ qemuProcessLaunch(virConnectPtr conn,
+     if (qemuProcessUpdateAndVerifyCPU(driver, vm, asyncJob) < 0)
+         goto cleanup;
+ 
+-    VIR_DEBUG("Setting up post-init cgroup restrictions");
+-    if (qemuSetupCpusetMems(vm) < 0)
+-        goto cleanup;
+-
+     VIR_DEBUG("setting up hotpluggable cpus");
+     if (qemuDomainHasHotpluggableStartupVcpus(vm->def)) {
+         if (qemuDomainRefreshVcpuInfo(driver, vm, asyncJob, false) < 0)
+@@ -6531,6 +6523,10 @@ qemuProcessLaunch(virConnectPtr conn,
+     if (qemuProcessDetectIOThreadPIDs(driver, vm, asyncJob) < 0)
+         goto cleanup;
+ 
++    VIR_DEBUG("Setting emulator tuning/settings");
++    if (qemuProcessSetupEmulator(vm) < 0)
++        goto cleanup;
++
+     VIR_DEBUG("Setting global CPU cgroup (if required)");
+     if (qemuSetupGlobalCpuCgroup(vm) < 0)
+         goto cleanup;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Set-identity-for-the-reconnect-all-thread.patch b/SOURCES/libvirt-qemu-Set-identity-for-the-reconnect-all-thread.patch
new file mode 100644
index 0000000..ae58806
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Set-identity-for-the-reconnect-all-thread.patch
@@ -0,0 +1,94 @@
+From 773d0240b0d5678f0183eed75dbef7e60d54e3f8 Mon Sep 17 00:00:00 2001
+Message-Id: <773d0240b0d5678f0183eed75dbef7e60d54e3f8@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 07:28:30 -0400
+Subject: [PATCH] qemu: Set identity for the reconnect all thread
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1631622
+
+If polkit authentication is enabled, an attempt to open
+the connection failed during virAccessDriverPolkitGetCaller
+when the call to virIdentityGetCurrent returned NULL resulting
+in the errors:
+
+  virAccessDriverPolkitGetCaller:87 : access denied:
+  Policy kit denied action org.libvirt.api.connect.getattr from <anonymous>
+
+Because qemuProcessReconnect runs in a thread during
+daemonRunStateInit processing it doesn't have the thread
+local identity. Thus when the virGetConnectNWFilter is
+called as part of the qemuProcessFiltersInstantiate when
+virDomainConfNWFilterInstantiate is run the attempt to get
+the idenity fails and results in the anonymous error above.
+
+To fix this, let's grab/use the virIdenityPtr of the process
+that will be creating the thread, e.g. what daemonRunStateInit
+has set and use that for our thread. That way any other similar
+processing that uses/requires an identity for any other call
+that would have previously been successfully run won't fail in
+a similar manner.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit b04b82f8cb671f067bad2d5e922acf88f13f0934)
+Message-Id: <20190403112830.13099-1-jferlan@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ src/qemu/qemu_process.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index 485e455a44..6945d76b18 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -81,6 +81,7 @@
+ #include "netdev_bandwidth_conf.h"
+ #include "virresctrl.h"
+ #include "virvsock.h"
++#include "viridentity.h"
+ 
+ #define VIR_FROM_THIS VIR_FROM_QEMU
+ 
+@@ -7621,6 +7622,7 @@ qemuProcessRefreshCPU(virQEMUDriverPtr driver,
+ struct qemuProcessReconnectData {
+     virQEMUDriverPtr driver;
+     virDomainObjPtr obj;
++    virIdentityPtr identity;
+ };
+ /*
+  * Open an existing VM's monitor, re-detect VCPU threads
+@@ -7657,6 +7659,8 @@ qemuProcessReconnect(void *opaque)
+     virCapsPtr caps = NULL;
+     bool retry = true;
+ 
++    virIdentitySetCurrent(data->identity);
++    virObjectUnref(data->identity);
+     VIR_FREE(data);
+ 
+     qemuDomainObjRestoreJob(obj, &oldjob);
+@@ -7878,6 +7882,7 @@ qemuProcessReconnect(void *opaque)
+     virObjectUnref(cfg);
+     virObjectUnref(caps);
+     virNWFilterUnlockFilterUpdates();
++    virIdentitySetCurrent(NULL);
+     return;
+ 
+  error:
+@@ -7915,6 +7920,7 @@ qemuProcessReconnectHelper(virDomainObjPtr obj,
+ 
+     memcpy(data, src, sizeof(*data));
+     data->obj = obj;
++    data->identity = virIdentityGetCurrent();
+ 
+     virNWFilterReadLockFilterUpdates();
+ 
+@@ -7938,6 +7944,7 @@ qemuProcessReconnectHelper(virDomainObjPtr obj,
+ 
+         virDomainObjEndAPI(&obj);
+         virNWFilterUnlockFilterUpdates();
++        virObjectUnref(data->identity);
+         VIR_FREE(data);
+         return -1;
+     }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Set-job-statsType-for-external-memory-snapshot.patch b/SOURCES/libvirt-qemu-Set-job-statsType-for-external-memory-snapshot.patch
new file mode 100644
index 0000000..d4114bd
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Set-job-statsType-for-external-memory-snapshot.patch
@@ -0,0 +1,44 @@
+From f0ca7633386d603fb49f6445af3bfce464310887 Mon Sep 17 00:00:00 2001
+Message-Id: <f0ca7633386d603fb49f6445af3bfce464310887@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Thu, 4 Apr 2019 11:16:16 +0200
+Subject: [PATCH] qemu: Set job statsType for external memory snapshot
+
+Any job which is able to provide statistics that can be queried via
+virDomainGetJob{Stats,Info} has to set an appropriate statsType.
+
+Without a proper statsType qemuDomainJobInfoToParams and
+qemuDomainJobInfoToInfo have no idea what statistics should be sent to
+the API caller.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1688774
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+(cherry picked from commit 1c2a9260e865af8ad7dde9cdd21515800d1864e7)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1690703
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <0c6c01d9917a35259f5f6aabf39483ff2bde6461.1554369361.git.jdenemar@redhat.com>
+Reviewed-by: Andrea Bolognani <abologna@redhat.com>
+---
+ src/qemu/qemu_driver.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index 99d0dad911..6ab1aa28c5 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -15230,6 +15230,8 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
+         if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0))
+             goto cleanup;
+ 
++        priv->job.current->statsType = QEMU_DOMAIN_JOB_STATS_TYPE_SAVEDUMP;
++
+         /* allow the migration job to be cancelled or the domain to be paused */
+         qemuDomainObjSetAsyncJobMask(vm, (QEMU_JOB_DEFAULT_MASK |
+                                           JOB_MASK(QEMU_JOB_SUSPEND) |
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Set-up-EMULATOR-thread-and-cpuset.mems-before-exec-ing-qemu.patch b/SOURCES/libvirt-qemu-Set-up-EMULATOR-thread-and-cpuset.mems-before-exec-ing-qemu.patch
new file mode 100644
index 0000000..7c248ca
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Set-up-EMULATOR-thread-and-cpuset.mems-before-exec-ing-qemu.patch
@@ -0,0 +1,69 @@
+From b733703cfcc4b4e8966051ba20bed301645331d0 Mon Sep 17 00:00:00 2001
+Message-Id: <b733703cfcc4b4e8966051ba20bed301645331d0@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 18 Apr 2019 18:58:58 +0200
+Subject: [PATCH] qemu: Set up EMULATOR thread and cpuset.mems before
+ exec()-ing qemu
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1695434
+
+It's funny how this went unnoticed for such a long time. Long
+story short, if a domain is configured with
+VIR_DOMAIN_NUMATUNE_MEM_STRICT libvirt doesn't really honour
+that. This is because of 7e72ac787848 after which libvirt allowed
+qemu to allocate memory just anywhere and only after that it used
+some magic involving cpuset.memory_migrate and cpuset.mems to
+move the memory to desired NUMA nodes. This was done in order to
+work around some KVM bug where KVM would fail if there wasn't a
+DMA zone available on the NUMA node. Well, while the work around
+might stopped libvirt tickling the KVM bug it also caused a bug
+on libvirt side: if there is not enough memory on configured NUMA
+node(s) then any attempt to start a domain must fail. Because of
+the way we play with guest memory domains can start just happily.
+
+The solution is to move the child we've just forked into emulator
+cgroup, set up cpuset.mems and exec() qemu only after that.
+
+This basically reverts 7e72ac787848b7434c9 which was a workaround
+for kernel bug. This bug was apparently fixed because I've tested
+this successfully with recent kernel.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
+(cherry picked from commit 0eaa4716e1b8f6eb59d77049aed3735c3b5fbdd6)
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Message-Id: <efd9d64c94a027281c244c05f69cc9f4c31ed83b.1555606711.git.mprivozn@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_process.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index 7d04a6e226..208c64381c 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -6432,6 +6432,10 @@ qemuProcessLaunch(virConnectPtr conn,
+     if (qemuProcessInitCpuAffinity(vm) < 0)
+         goto cleanup;
+ 
++    VIR_DEBUG("Setting emulator tuning/settings");
++    if (qemuProcessSetupEmulator(vm) < 0)
++        goto cleanup;
++
+     VIR_DEBUG("Setting cgroup for external devices (if required)");
+     if (qemuSetupCgroupForExtDevices(vm, driver) < 0)
+         goto cleanup;
+@@ -6523,10 +6527,6 @@ qemuProcessLaunch(virConnectPtr conn,
+     if (qemuProcessDetectIOThreadPIDs(driver, vm, asyncJob) < 0)
+         goto cleanup;
+ 
+-    VIR_DEBUG("Setting emulator tuning/settings");
+-    if (qemuProcessSetupEmulator(vm) < 0)
+-        goto cleanup;
+-
+     VIR_DEBUG("Setting global CPU cgroup (if required)");
+     if (qemuSetupGlobalCpuCgroup(vm) < 0)
+         goto cleanup;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-Use-tmpChr-in-qemuDomainDetachChrDevice-to-build-device-string.patch b/SOURCES/libvirt-qemu-Use-tmpChr-in-qemuDomainDetachChrDevice-to-build-device-string.patch
new file mode 100644
index 0000000..aacdf47
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Use-tmpChr-in-qemuDomainDetachChrDevice-to-build-device-string.patch
@@ -0,0 +1,43 @@
+From 9a0d6a2eac4a69d548620f80ed0c71fc0cb6d415 Mon Sep 17 00:00:00 2001
+Message-Id: <9a0d6a2eac4a69d548620f80ed0c71fc0cb6d415@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:16 -0400
+Subject: [PATCH] qemu: Use @tmpChr in qemuDomainDetachChrDevice to build
+ device string
+
+So far we are passing @chr to qemuBuildChrDeviceStr. This is
+suboptimal (in fact wrong) because @chr is just parsed XML
+definition provided by user which by definition may lack some
+information. On the other hand, @tmpChr is the one that was found
+using @chr in domain definition so it contains the same amount of
+information or more.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit f538f5ed3a876c3cb67ae5b7a01f133f192aca13)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-5-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 5e11e1997a..46cafef4c2 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5594,7 +5594,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+ 
+     sa_assert(tmpChr->info.alias);
+ 
+-    if (qemuBuildChrDeviceStr(&devstr, vmdef, chr, priv->qemuCaps) < 0)
++    if (qemuBuildChrDeviceStr(&devstr, vmdef, tmpChr, priv->qemuCaps) < 0)
+         goto cleanup;
+ 
+     if (!async)
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-caps-Introduce-QEMU_EGL_HEADLESS_RENDERNODE-capability.patch b/SOURCES/libvirt-qemu-caps-Introduce-QEMU_EGL_HEADLESS_RENDERNODE-capability.patch
new file mode 100644
index 0000000..b0fb160
--- /dev/null
+++ b/SOURCES/libvirt-qemu-caps-Introduce-QEMU_EGL_HEADLESS_RENDERNODE-capability.patch
@@ -0,0 +1,81 @@
+From 6203494c845ce2c2468485274d64f4e041ad4a5b Mon Sep 17 00:00:00 2001
+Message-Id: <6203494c845ce2c2468485274d64f4e041ad4a5b@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:29 +0200
+Subject: [PATCH] qemu: caps: Introduce QEMU_EGL_HEADLESS_RENDERNODE capability
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Now that we have QAPI introspection of display types in QEMU upstream,
+we can check whether the 'rendernode' option is supported with
+egl-headless display type.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 312063b7664c992f959028ef516402ce175c3dfc)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+
+ Conflicts:
+	src/qemu/qemu_capabilities.c
+	src/qemu/qemu_capabilities.h
+	tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
+            Context - several other capabilities were not backported.
+Message-Id: <c7b6c70550d4ce83b8a692a1cd2b94f2c8aac402.1554791287.git.eskultet@redhat.com>
+
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_capabilities.c                     | 2 ++
+ src/qemu/qemu_capabilities.h                     | 1 +
+ tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 +
+ 3 files changed, 4 insertions(+)
+
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index a27ea85824..66eefae988 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -507,6 +507,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
+ 
+               /* 315 */
+               "vfio-pci.display",
++              "egl-headless.rendernode"
+     );
+ 
+ 
+@@ -1306,6 +1307,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
+     { "blockdev-add/arg-type/+qcow2/encrypt/+luks/key-secret", QEMU_CAPS_QCOW2_LUKS },
+     { "nbd-server-start/arg-type/tls-creds", QEMU_CAPS_NBD_TLS },
+     { "screendump/arg-type/device", QEMU_CAPS_SCREENDUMP_DEVICE },
++    { "query-display-options/ret-type/+egl-headless/rendernode", QEMU_CAPS_EGL_HEADLESS_RENDERNODE },
+ };
+ 
+ typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps;
+diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
+index 25ad4218e0..76916d02fa 100644
+--- a/src/qemu/qemu_capabilities.h
++++ b/src/qemu/qemu_capabilities.h
+@@ -491,6 +491,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
+ 
+     /* 315 */
+     QEMU_CAPS_VFIO_PCI_DISPLAY, /* -device vfio-pci.display */
++    QEMU_CAPS_EGL_HEADLESS_RENDERNODE, /* -display egl-headless,rendernode= */
+ 
+     QEMU_CAPS_LAST /* this must always be the last item */
+ } virQEMUCapsFlags;
+diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
+index cbeea14796..be044c6a7a 100644
+--- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
++++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
+@@ -215,6 +215,7 @@
+   <flag name='usb-storage.werror'/>
+   <flag name='egl-headless'/>
+   <flag name='vfio-pci.display'/>
++  <flag name='egl-headless.rendernode'/>
+   <version>3000092</version>
+   <kvmVersion>0</kvmVersion>
+   <microcodeVersion>441682</microcodeVersion>
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-cgroup-gfx-egl-headless-Add-the-DRI-device-into-the-cgroup-list.patch b/SOURCES/libvirt-qemu-cgroup-gfx-egl-headless-Add-the-DRI-device-into-the-cgroup-list.patch
new file mode 100644
index 0000000..54b244f
--- /dev/null
+++ b/SOURCES/libvirt-qemu-cgroup-gfx-egl-headless-Add-the-DRI-device-into-the-cgroup-list.patch
@@ -0,0 +1,52 @@
+From 2dbe8c5a7106596ae03e265adb3ba1bb49feeeda Mon Sep 17 00:00:00 2001
+Message-Id: <2dbe8c5a7106596ae03e265adb3ba1bb49feeeda@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:33 +0200
+Subject: [PATCH] qemu: cgroup: gfx: egl-headless: Add the DRI device into the
+ cgroup list
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Just like for SPICE, we need to put the render node DRI device into the
+device cgroup list so that users don't need to add it manually via
+qemu.conf file.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit dc87ee0f3e9cb7982d66230cd2d83b3577275564)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <0f769bd757581c2204c8db960699ed36fab26cef.1554791287.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_cgroup.c | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
+index c8fba7f9e6..b679238bfc 100644
+--- a/src/qemu/qemu_cgroup.c
++++ b/src/qemu/qemu_cgroup.c
+@@ -489,15 +489,11 @@ qemuSetupGraphicsCgroup(virDomainObjPtr vm,
+                         virDomainGraphicsDefPtr gfx)
+ {
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+-    const char *rendernode = gfx->data.spice.rendernode;
++    const char *rendernode = virDomainGraphicsGetRenderNode(gfx);
+     int ret;
+ 
+-    if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES))
+-        return 0;
+-
+-    if (gfx->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE ||
+-        gfx->data.spice.gl != VIR_TRISTATE_BOOL_YES ||
+-        !rendernode)
++    if (!rendernode ||
++        !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES))
+         return 0;
+ 
+     ret = virCgroupAllowDevicePath(priv->cgroup, rendernode,
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-command-Introduce-qemuBuildGraphicsEGLHeadlessCommandLine-helper.patch b/SOURCES/libvirt-qemu-command-Introduce-qemuBuildGraphicsEGLHeadlessCommandLine-helper.patch
new file mode 100644
index 0000000..0f6756a
--- /dev/null
+++ b/SOURCES/libvirt-qemu-command-Introduce-qemuBuildGraphicsEGLHeadlessCommandLine-helper.patch
@@ -0,0 +1,64 @@
+From 4f6f2054b528814285ad5bf8433721c9b8fcaff5 Mon Sep 17 00:00:00 2001
+Message-Id: <4f6f2054b528814285ad5bf8433721c9b8fcaff5@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:28 +0200
+Subject: [PATCH] qemu: command: Introduce
+ qemuBuildGraphicsEGLHeadlessCommandLine helper
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+We're going to need a bit more logic for egl-headless down the road so
+prepare a helper just like for the other display types.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit eeb7059aa3f42bcd6d42a41078e588b6b4b25c1e)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <4e0aaf4349699b0588b9eb17ad4e34f309658a72.1554791287.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_command.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
+index 52650dc46d..d60fbd4c8c 100644
+--- a/src/qemu/qemu_command.c
++++ b/src/qemu/qemu_command.c
+@@ -8195,6 +8195,19 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
+ }
+ 
+ 
++static int
++qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED,
++                                        virCommandPtr cmd,
++                                        virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED,
++                                        virDomainGraphicsDefPtr graphics ATTRIBUTE_UNUSED)
++{
++    virCommandAddArg(cmd, "-display");
++    virCommandAddArg(cmd, "egl-headless");
++
++    return 0;
++}
++
++
+ static int
+ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg,
+                              virCommandPtr cmd,
+@@ -8226,8 +8239,9 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg,
+ 
+             break;
+         case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
+-            virCommandAddArg(cmd, "-display");
+-            virCommandAddArg(cmd, "egl-headless");
++            if (qemuBuildGraphicsEGLHeadlessCommandLine(cfg, cmd,
++                                                        qemuCaps, graphics) < 0)
++                return -1;
+ 
+             break;
+         case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-command-gfx-egl-headless-Add-rendernode-option-to-the-cmdline.patch b/SOURCES/libvirt-qemu-command-gfx-egl-headless-Add-rendernode-option-to-the-cmdline.patch
new file mode 100644
index 0000000..1ab5816
--- /dev/null
+++ b/SOURCES/libvirt-qemu-command-gfx-egl-headless-Add-rendernode-option-to-the-cmdline.patch
@@ -0,0 +1,197 @@
+From 5738081ba1c0cb6453224ccd1281e5a536284a4c Mon Sep 17 00:00:00 2001
+Message-Id: <5738081ba1c0cb6453224ccd1281e5a536284a4c@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:35 +0200
+Subject: [PATCH] qemu: command: gfx: egl-headless: Add 'rendernode' option to
+ the cmdline
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Depending on whether QEMU actually supports the option, we can put the
+'rendernode' on the '-display egl-headless' cmdline.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628892
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 3163de7d0e7ae92b9f3e06479c8cd46e43ac8058)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <e38fbdd202bdda60f02eff1f5b06f1566cb8f93f.1554791287.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_command.c                       | 34 ++++++++++++++++---
+ ...egl-headless-rendernode.x86_64-latest.args | 31 +++++++++++++++++
+ .../graphics-egl-headless.x86_64-latest.args  | 31 +++++++++++++++++
+ ...play-spice-egl-headless.x86_64-latest.args |  2 +-
+ ...isplay-vnc-egl-headless.x86_64-latest.args |  2 +-
+ tests/qemuxml2argvtest.c                      |  2 ++
+ 6 files changed, 95 insertions(+), 7 deletions(-)
+ create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless-rendernode.x86_64-latest.args
+ create mode 100644 tests/qemuxml2argvdata/graphics-egl-headless.x86_64-latest.args
+
+diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
+index d60fbd4c8c..929f549a69 100644
+--- a/src/qemu/qemu_command.c
++++ b/src/qemu/qemu_command.c
+@@ -8198,13 +8198,37 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
+ static int
+ qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED,
+                                         virCommandPtr cmd,
+-                                        virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED,
+-                                        virDomainGraphicsDefPtr graphics ATTRIBUTE_UNUSED)
++                                        virQEMUCapsPtr qemuCaps,
++                                        virDomainGraphicsDefPtr graphics)
+ {
+-    virCommandAddArg(cmd, "-display");
+-    virCommandAddArg(cmd, "egl-headless");
++    int ret = -1;
++    virBuffer opt = VIR_BUFFER_INITIALIZER;
+ 
+-    return 0;
++    virBufferAddLit(&opt, "egl-headless");
++
++    if (graphics->data.egl_headless.rendernode) {
++        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_EGL_HEADLESS_RENDERNODE)) {
++            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
++                           _("This QEMU doesn't support OpenGL rendernode "
++                             "with egl-headless graphics type"));
++            goto cleanup;
++        }
++
++        virBufferAddLit(&opt, ",rendernode=");
++        virQEMUBuildBufferEscapeComma(&opt,
++                                      graphics->data.egl_headless.rendernode);
++    }
++
++    if (virBufferCheckError(&opt) < 0)
++        goto cleanup;
++
++    virCommandAddArg(cmd, "-display");
++    virCommandAddArgBuffer(cmd, &opt);
++
++    ret = 0;
++ cleanup:
++    virBufferFreeAndReset(&opt);
++    return ret;
+ }
+ 
+ 
+diff --git a/tests/qemuxml2argvdata/graphics-egl-headless-rendernode.x86_64-latest.args b/tests/qemuxml2argvdata/graphics-egl-headless-rendernode.x86_64-latest.args
+new file mode 100644
+index 0000000000..ad9079d912
+--- /dev/null
++++ b/tests/qemuxml2argvdata/graphics-egl-headless-rendernode.x86_64-latest.args
+@@ -0,0 +1,31 @@
++LC_ALL=C \
++PATH=/bin \
++HOME=/home/test \
++USER=test \
++LOGNAME=test \
++/usr/bin/qemu-system-i686 \
++-name guest=QEMUGuest1,debug-threads=on \
++-S \
++-object secret,id=masterKey0,format=raw,\
++file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
++-machine pc,accel=tcg,usb=off,dump-guest-core=off \
++-m 214 \
++-realtime mlock=off \
++-smp 1,sockets=1,cores=1,threads=1 \
++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
++-no-user-config \
++-nodefaults \
++-chardev socket,id=charmonitor,fd=1729,server,nowait \
++-mon chardev=charmonitor,id=monitor,mode=control \
++-rtc base=utc \
++-no-shutdown \
++-no-acpi \
++-boot strict=on \
++-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
++-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
++-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
++-display egl-headless,rendernode=/dev/dri/foo \
++-device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \
++-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
++resourcecontrol=deny \
++-msg timestamp=on
+diff --git a/tests/qemuxml2argvdata/graphics-egl-headless.x86_64-latest.args b/tests/qemuxml2argvdata/graphics-egl-headless.x86_64-latest.args
+new file mode 100644
+index 0000000000..ad9079d912
+--- /dev/null
++++ b/tests/qemuxml2argvdata/graphics-egl-headless.x86_64-latest.args
+@@ -0,0 +1,31 @@
++LC_ALL=C \
++PATH=/bin \
++HOME=/home/test \
++USER=test \
++LOGNAME=test \
++/usr/bin/qemu-system-i686 \
++-name guest=QEMUGuest1,debug-threads=on \
++-S \
++-object secret,id=masterKey0,format=raw,\
++file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
++-machine pc,accel=tcg,usb=off,dump-guest-core=off \
++-m 214 \
++-realtime mlock=off \
++-smp 1,sockets=1,cores=1,threads=1 \
++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
++-no-user-config \
++-nodefaults \
++-chardev socket,id=charmonitor,fd=1729,server,nowait \
++-mon chardev=charmonitor,id=monitor,mode=control \
++-rtc base=utc \
++-no-shutdown \
++-no-acpi \
++-boot strict=on \
++-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
++-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
++-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
++-display egl-headless,rendernode=/dev/dri/foo \
++-device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \
++-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
++resourcecontrol=deny \
++-msg timestamp=on
+diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
+index 0ac90c81d2..6c090ede9b 100644
+--- a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
++++ b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
+@@ -26,7 +26,7 @@ file=/tmp/lib/domain--1-QEMUGuest2/master-key.aes \
+ -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
+ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+ -spice port=0,seamless-migration=on \
+--display egl-headless \
++-display egl-headless,rendernode=/dev/dri/foo \
+ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,\
+ vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
+ -device vfio-pci,id=hostdev0,\
+diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
+index cdf545d0e0..b07fb86db5 100644
+--- a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
++++ b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
+@@ -26,7 +26,7 @@ file=/tmp/lib/domain--1-QEMUGuest2/master-key.aes \
+ -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
+ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+ -vnc 127.0.0.1:0 \
+--display egl-headless \
++-display egl-headless,rendernode=/dev/dri/foo \
+ -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,\
+ vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
+ -device vfio-pci,id=hostdev0,\
+diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
+index f76856dc5f..a29e63d950 100644
+--- a/tests/qemuxml2argvtest.c
++++ b/tests/qemuxml2argvtest.c
+@@ -1177,6 +1177,8 @@ mymain(void)
+     DO_TEST("graphics-egl-headless",
+             QEMU_CAPS_EGL_HEADLESS,
+             QEMU_CAPS_DEVICE_CIRRUS_VGA);
++    DO_TEST_CAPS_LATEST("graphics-egl-headless");
++    DO_TEST_CAPS_LATEST("graphics-egl-headless-rendernode");
+ 
+     DO_TEST("graphics-vnc", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA);
+     DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-domain-egl-headless-Add-the-DRI-device-into-the-namespace.patch b/SOURCES/libvirt-qemu-domain-egl-headless-Add-the-DRI-device-into-the-namespace.patch
new file mode 100644
index 0000000..b81dd54
--- /dev/null
+++ b/SOURCES/libvirt-qemu-domain-egl-headless-Add-the-DRI-device-into-the-namespace.patch
@@ -0,0 +1,46 @@
+From 5b08e3b39e250b822c918fa90a33889b37a48e75 Mon Sep 17 00:00:00 2001
+Message-Id: <5b08e3b39e250b822c918fa90a33889b37a48e75@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:32 +0200
+Subject: [PATCH] qemu: domain: egl-headless: Add the DRI device into the
+ namespace
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Just like for SPICE, we need to put the DRI device into the namespace,
+otherwise it will be left out from the DAC relabeling process.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 53ca6fa4eacb9e519710dacf237997b813f892d2)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <be1a212b440349c207623e5865a373319c49c412.1554791287.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_domain.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
+index 112958f64a..76f48d6f83 100644
+--- a/src/qemu/qemu_domain.c
++++ b/src/qemu/qemu_domain.c
+@@ -11472,11 +11472,9 @@ qemuDomainSetupGraphics(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED,
+                         virDomainGraphicsDefPtr gfx,
+                         const struct qemuDomainCreateDeviceData *data)
+ {
+-    const char *rendernode = gfx->data.spice.rendernode;
++    const char *rendernode = virDomainGraphicsGetRenderNode(gfx);
+ 
+-    if (gfx->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE ||
+-        gfx->data.spice.gl != VIR_TRISTATE_BOOL_YES ||
+-        !rendernode)
++    if (!rendernode)
+         return 0;
+ 
+     return qemuDomainCreateDevice(rendernode, data, false);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-domain-gfx-Fix-shadowing-of-a-function-argument-in-validation.patch b/SOURCES/libvirt-qemu-domain-gfx-Fix-shadowing-of-a-function-argument-in-validation.patch
new file mode 100644
index 0000000..e1e2782
--- /dev/null
+++ b/SOURCES/libvirt-qemu-domain-gfx-Fix-shadowing-of-a-function-argument-in-validation.patch
@@ -0,0 +1,40 @@
+From 15126024468aba26fbd4a21145c8ef9456535bee Mon Sep 17 00:00:00 2001
+Message-Id: <15126024468aba26fbd4a21145c8ef9456535bee@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:37 +0200
+Subject: [PATCH] qemu: domain: gfx: Fix shadowing of a function argument in
+ validation
+
+Since the code was never run, it would have been very hard to spot this
+mistake, especially since the compiler can't really warn about it.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 414c51b7a11cc52c4276c7220d0b973c57c725d6)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <0298fbe0dd26d9463c69aaf2b6ecf295d0fc22e2.1554791287.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_domain.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
+index 76f48d6f83..81699110fc 100644
+--- a/src/qemu/qemu_domain.c
++++ b/src/qemu/qemu_domain.c
+@@ -5570,9 +5570,7 @@ qemuDomainDeviceDefValidateGraphics(const virDomainGraphicsDef *graphics,
+     size_t i;
+ 
+     for (i = 0; i < def->ngraphics; i++) {
+-        graphics = def->graphics[i];
+-
+-        if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS) {
++        if (def->graphics[i]->type == VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS) {
+             have_egl_headless = true;
+             break;
+         }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-fix-device-name-passed-to-error-report.patch b/SOURCES/libvirt-qemu-fix-device-name-passed-to-error-report.patch
new file mode 100644
index 0000000..ba50413
--- /dev/null
+++ b/SOURCES/libvirt-qemu-fix-device-name-passed-to-error-report.patch
@@ -0,0 +1,37 @@
+From 9ebcf7ce815178f32496e996d6fba45cdcfe4f06 Mon Sep 17 00:00:00 2001
+Message-Id: <9ebcf7ce815178f32496e996d6fba45cdcfe4f06@dist-git>
+From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:23 -0400
+Subject: [PATCH] qemu: fix device name passed to error report
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit fe2bd0210e80c94513291c7db927697bf5e7841b)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-12-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 36840f977e..b5ccaf4021 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5415,7 +5415,7 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+     if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+                        _("cannot hot unplug multifunction PCI device: %s"),
+-                       dev->data.disk->dst);
++                       detach->ifname);
+         goto cleanup;
+     }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-fix-up-permissions-for-pre-created-UNIX-sockets.patch b/SOURCES/libvirt-qemu-fix-up-permissions-for-pre-created-UNIX-sockets.patch
index 29c60fd..d98d38c 100644
--- a/SOURCES/libvirt-qemu-fix-up-permissions-for-pre-created-UNIX-sockets.patch
+++ b/SOURCES/libvirt-qemu-fix-up-permissions-for-pre-created-UNIX-sockets.patch
@@ -46,5 +46,5 @@ index f2b64ed720..98b554627e 100644
  
   error:
 -- 
-2.19.0
+2.21.0
 
diff --git a/SOURCES/libvirt-qemu-hotplug-Don-t-generate-alias-when-detaching-controllers.patch b/SOURCES/libvirt-qemu-hotplug-Don-t-generate-alias-when-detaching-controllers.patch
new file mode 100644
index 0000000..d84da67
--- /dev/null
+++ b/SOURCES/libvirt-qemu-hotplug-Don-t-generate-alias-when-detaching-controllers.patch
@@ -0,0 +1,43 @@
+From 624a93ae0bd5d4a11223d5704722d0095d88c28c Mon Sep 17 00:00:00 2001
+Message-Id: <624a93ae0bd5d4a11223d5704722d0095d88c28c@dist-git>
+From: Peter Krempa <pkrempa@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:14 -0400
+Subject: [PATCH] qemu: hotplug: Don't generate alias when detaching
+ controllers
+
+qemuDomainDetachControllerDevice contained code which implied that alias
+might be NULL when detaching the disk and tried to generate it. This is
+no longer possible so we can remove the code.
+
+Signed-off-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit c86735e2d85bf0e7ce8e08ce0b24d5627020ab0e)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-3-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 15d845e7b8..5e11e1997a 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4912,11 +4912,6 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+         goto cleanup;
+     }
+ 
+-    if (!detach->info.alias) {
+-        if (qemuAssignDeviceControllerAlias(vm->def, priv->qemuCaps, detach) < 0)
+-            goto cleanup;
+-    }
+-
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-hotplug-Don-t-generate-alias-when-detaching-disk.patch b/SOURCES/libvirt-qemu-hotplug-Don-t-generate-alias-when-detaching-disk.patch
new file mode 100644
index 0000000..b225fe4
--- /dev/null
+++ b/SOURCES/libvirt-qemu-hotplug-Don-t-generate-alias-when-detaching-disk.patch
@@ -0,0 +1,45 @@
+From fd6730d460560af166d953e8daf8b68df84e030e Mon Sep 17 00:00:00 2001
+Message-Id: <fd6730d460560af166d953e8daf8b68df84e030e@dist-git>
+From: Peter Krempa <pkrempa@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:13 -0400
+Subject: [PATCH] qemu: hotplug: Don't generate alias when detaching disk
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It should be impossible to lack an alias in the domain definition. Other
+disk types don't generate it so remove it here as well.
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+
+Signed-off-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 2bd9db9659f58864b01f7f51b414e54f45d8d368)
+
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-2-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 397a2bdde2..15d845e7b8 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4685,11 +4685,6 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
+         goto cleanup;
+     }
+ 
+-    if (!detach->info.alias) {
+-        if (qemuAssignDeviceDiskAlias(vm->def, detach) < 0)
+-            goto cleanup;
+-    }
+-
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-hotplug-Merge-virtio-and-non-virtio-disk-unplug-code.patch b/SOURCES/libvirt-qemu-hotplug-Merge-virtio-and-non-virtio-disk-unplug-code.patch
new file mode 100644
index 0000000..3e34ca1
--- /dev/null
+++ b/SOURCES/libvirt-qemu-hotplug-Merge-virtio-and-non-virtio-disk-unplug-code.patch
@@ -0,0 +1,108 @@
+From a0b96a992d89ee5243ad56974979a0ccc0df788a Mon Sep 17 00:00:00 2001
+Message-Id: <a0b96a992d89ee5243ad56974979a0ccc0df788a@dist-git>
+From: Peter Krempa <pkrempa@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:29 -0400
+Subject: [PATCH] qemu: hotplug: Merge virtio and non-virtio disk unplug code
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The functions do basically exactly the same thing modulo few checks.
+In case of virtio disks we check that the device is not multifunction as
+that can't be unplugged at once. In case of USB and SCSI disks we
+checked that no active block job is running.
+
+The check for running blockjobs should have also been done for virtio
+disks. By moving the multifunction check into the common function we fix
+this case and also simplify the code.
+
+Signed-off-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 0b7d544c8842841b27de0d88234148794ce4545e)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-18-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 49 ++++++++---------------------------------
+ 1 file changed, 9 insertions(+), 40 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 5e8583ae8b..ffb2e258b5 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4721,43 +4721,6 @@ qemuDomainSignalDeviceRemoval(virDomainObjPtr vm,
+ }
+ 
+ 
+-static int
+-qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
+-                                 virDomainObjPtr vm,
+-                                 virDomainDiskDefPtr detach,
+-                                 bool async)
+-{
+-    int ret = -1;
+-
+-    if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("cannot hot unplug multifunction PCI device: %s"),
+-                       detach->dst);
+-        goto cleanup;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+-
+-    if (qemuDomainDeleteDevice(vm, detach->info.alias) < 0) {
+-        if (virDomainObjIsActive(vm))
+-            virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
+-        goto cleanup;
+-    }
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveDiskDevice(driver, vm, detach);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
+-}
+-
+ static int
+ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
+                            virDomainObjPtr vm,
+@@ -4767,7 +4730,15 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
+     int ret = -1;
+ 
+     if (qemuDomainDiskBlockJobIsActive(detach))
+-        goto cleanup;
++        return -1;
++
++    if (detach->bus == VIR_DOMAIN_DISK_BUS_VIRTIO &&
++        qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
++        virReportError(VIR_ERR_OPERATION_FAILED,
++                       _("cannot hot unplug multifunction PCI device: %s"),
++                       detach->dst);
++        return -1;
++    }
+ 
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+@@ -4826,8 +4797,6 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+ 
+         switch ((virDomainDiskBus) disk->bus) {
+         case VIR_DOMAIN_DISK_BUS_VIRTIO:
+-            return qemuDomainDetachVirtioDiskDevice(driver, vm, disk, async);
+-
+         case VIR_DOMAIN_DISK_BUS_USB:
+         case VIR_DOMAIN_DISK_BUS_SCSI:
+             return qemuDomainDetachDiskDevice(driver, vm, disk, async);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-hotplug-Remove-ret-variable-in-qemuDomainDetachDeviceDiskLive.patch b/SOURCES/libvirt-qemu-hotplug-Remove-ret-variable-in-qemuDomainDetachDeviceDiskLive.patch
new file mode 100644
index 0000000..1ea9a59
--- /dev/null
+++ b/SOURCES/libvirt-qemu-hotplug-Remove-ret-variable-in-qemuDomainDetachDeviceDiskLive.patch
@@ -0,0 +1,62 @@
+From 632d110740498e0aa6828dbfdbace81847b084ff Mon Sep 17 00:00:00 2001
+Message-Id: <632d110740498e0aa6828dbfdbace81847b084ff@dist-git>
+From: Peter Krempa <pkrempa@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:26 -0400
+Subject: [PATCH] qemu: hotplug: Remove 'ret' variable in
+ qemuDomainDetachDeviceDiskLive
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+We don't have any cleanup section, we can return the value directly.
+
+Signed-off-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 70d06898128086e3daecd389db10315a3c361a60)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-15-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 1f41efa180..8047ac773f 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4811,7 +4811,6 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+                                bool async)
+ {
+     virDomainDiskDefPtr disk;
+-    int ret = -1;
+     int idx;
+ 
+     if ((idx = qemuFindDisk(vm->def, dev->data.disk->dst)) < 0) {
+@@ -4825,10 +4824,10 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+     case VIR_DOMAIN_DISK_DEVICE_DISK:
+     case VIR_DOMAIN_DISK_DEVICE_LUN:
+         if (disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO)
+-            ret = qemuDomainDetachVirtioDiskDevice(driver, vm, disk, async);
++            return qemuDomainDetachVirtioDiskDevice(driver, vm, disk, async);
+         else if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI ||
+                  disk->bus == VIR_DOMAIN_DISK_BUS_USB)
+-            ret = qemuDomainDetachDiskDevice(driver, vm, disk, async);
++            return qemuDomainDetachDiskDevice(driver, vm, disk, async);
+         else
+             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                            _("This type of disk cannot be hot unplugged"));
+@@ -4840,7 +4839,7 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+         break;
+     }
+ 
+-    return ret;
++    return -1;
+ }
+ 
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-hotplug-Use-switch-statement-for-selecting-disk-bus-function.patch b/SOURCES/libvirt-qemu-hotplug-Use-switch-statement-for-selecting-disk-bus-function.patch
new file mode 100644
index 0000000..7b18698
--- /dev/null
+++ b/SOURCES/libvirt-qemu-hotplug-Use-switch-statement-for-selecting-disk-bus-function.patch
@@ -0,0 +1,65 @@
+From f76ff96c3ea876df4f09af0ed3e75cbaf31837cf Mon Sep 17 00:00:00 2001
+Message-Id: <f76ff96c3ea876df4f09af0ed3e75cbaf31837cf@dist-git>
+From: Peter Krempa <pkrempa@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:28 -0400
+Subject: [PATCH] qemu: hotplug: Use switch statement for selecting disk bus
+ function
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit eb437cfdf8f536293e4a4f5ff0f57058b7e6988a)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-17-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 24 ++++++++++++++++++++----
+ 1 file changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index b7db65964e..5e8583ae8b 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4823,14 +4823,30 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+     switch ((virDomainDiskDevice) disk->device) {
+     case VIR_DOMAIN_DISK_DEVICE_DISK:
+     case VIR_DOMAIN_DISK_DEVICE_LUN:
+-        if (disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO)
++
++        switch ((virDomainDiskBus) disk->bus) {
++        case VIR_DOMAIN_DISK_BUS_VIRTIO:
+             return qemuDomainDetachVirtioDiskDevice(driver, vm, disk, async);
+-        else if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI ||
+-                 disk->bus == VIR_DOMAIN_DISK_BUS_USB)
++
++        case VIR_DOMAIN_DISK_BUS_USB:
++        case VIR_DOMAIN_DISK_BUS_SCSI:
+             return qemuDomainDetachDiskDevice(driver, vm, disk, async);
+-        else
++
++        case VIR_DOMAIN_DISK_BUS_IDE:
++        case VIR_DOMAIN_DISK_BUS_FDC:
++        case VIR_DOMAIN_DISK_BUS_XEN:
++        case VIR_DOMAIN_DISK_BUS_UML:
++        case VIR_DOMAIN_DISK_BUS_SATA:
++        case VIR_DOMAIN_DISK_BUS_SD:
+             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                            _("This type of disk cannot be hot unplugged"));
++            break;
++
++        case VIR_DOMAIN_DISK_BUS_LAST:
++        default:
++            virReportEnumRangeError(virDomainDiskBus, disk->bus);
++            break;
++        }
+         break;
+ 
+     case VIR_DOMAIN_DISK_DEVICE_CDROM:
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-hotplug-Use-typecasted-enum-in-qemuDomainDetachDeviceDiskLive.patch b/SOURCES/libvirt-qemu-hotplug-Use-typecasted-enum-in-qemuDomainDetachDeviceDiskLive.patch
new file mode 100644
index 0000000..42bde12
--- /dev/null
+++ b/SOURCES/libvirt-qemu-hotplug-Use-typecasted-enum-in-qemuDomainDetachDeviceDiskLive.patch
@@ -0,0 +1,61 @@
+From f77f23ddd733b005b989afbe6d28a6a7fdb88197 Mon Sep 17 00:00:00 2001
+Message-Id: <f77f23ddd733b005b989afbe6d28a6a7fdb88197@dist-git>
+From: Peter Krempa <pkrempa@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:27 -0400
+Subject: [PATCH] qemu: hotplug: Use typecasted enum in
+ qemuDomainDetachDeviceDiskLive
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use the correct type in switch and populate the missing cases.
+
+Signed-off-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit afa15d78cba36e2c6c6d6ddc5c5258b7add405ba)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-16-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 8047ac773f..b7db65964e 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4820,7 +4820,7 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+     }
+     disk = vm->def->disks[idx];
+ 
+-    switch (disk->device) {
++    switch ((virDomainDiskDevice) disk->device) {
+     case VIR_DOMAIN_DISK_DEVICE_DISK:
+     case VIR_DOMAIN_DISK_DEVICE_LUN:
+         if (disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO)
+@@ -4832,11 +4832,18 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                            _("This type of disk cannot be hot unplugged"));
+         break;
+-    default:
++
++    case VIR_DOMAIN_DISK_DEVICE_CDROM:
++    case VIR_DOMAIN_DISK_DEVICE_FLOPPY:
+         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+                        _("disk device type '%s' cannot be detached"),
+                        virDomainDiskDeviceTypeToString(disk->device));
+         break;
++
++    case VIR_DOMAIN_DISK_DEVICE_LAST:
++    default:
++        virReportEnumRangeError(virDomainDiskDevice, disk->device);
++        break;
+     }
+ 
+     return -1;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-process-spice-Pick-the-first-available-DRM-render-node.patch b/SOURCES/libvirt-qemu-process-spice-Pick-the-first-available-DRM-render-node.patch
new file mode 100644
index 0000000..e828292
--- /dev/null
+++ b/SOURCES/libvirt-qemu-process-spice-Pick-the-first-available-DRM-render-node.patch
@@ -0,0 +1,214 @@
+From 92f60bbc60e5ff60069f6d775d23f228eb3b5c78 Mon Sep 17 00:00:00 2001
+Message-Id: <92f60bbc60e5ff60069f6d775d23f228eb3b5c78@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:27 +0200
+Subject: [PATCH] qemu: process: spice: Pick the first available DRM render
+ node
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Up until now, we formatted 'rendernode=' onto QEMU cmdline only if the
+user specified it in the XML, otherwise we let QEMU do it for us. This
+causes permission issues because by default the /dev/dri/renderDX
+permissions are as follows:
+
+crw-rw----. 1 root video
+
+There's literally no reason why it shouldn't be libvirt picking the DRM
+render node instead of QEMU, that way (and because we're using
+namespaces by default), we can safely relabel the device within the
+namespace.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 27cc9f6ac187924456b658683e490f6d318ebe08)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+
+ Conflicts:
+	tests/qemuxml2argvmock.c
+            Missing context because v4.6.0-309-gd06a8ebe8f and
+            v4.6.0-311-g3411fd4db4 were not backported
+Message-Id: <be2bca27f2b84bfebbe62a699d78bd91e59e96bd.1554791287.git.eskultet@redhat.com>
+
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_process.c                       | 24 +++++++++++++-
+ src/util/virutil.h                            |  2 +-
+ ...pice-gl-auto-rendernode.x86_64-latest.args | 31 +++++++++++++++++++
+ .../graphics-spice-gl-auto-rendernode.xml     | 24 ++++++++++++++
+ tests/qemuxml2argvmock.c                      |  9 ++++++
+ tests/qemuxml2argvtest.c                      |  1 +
+ 6 files changed, 89 insertions(+), 2 deletions(-)
+ create mode 100644 tests/qemuxml2argvdata/graphics-spice-gl-auto-rendernode.x86_64-latest.args
+ create mode 100644 tests/qemuxml2argvdata/graphics-spice-gl-auto-rendernode.xml
+
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index a44f371346..465dabd8e3 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -4751,9 +4751,28 @@ qemuProcessGraphicsSetupListen(virQEMUDriverPtr driver,
+ }
+ 
+ 
++static int
++qemuProcessGraphicsSetupRenderNode(virDomainGraphicsDefPtr graphics,
++                                   virQEMUCapsPtr qemuCaps)
++{
++    if (!virDomainGraphicsNeedsAutoRenderNode(graphics))
++        return 0;
++
++    /* Don't bother picking a DRM node if QEMU doesn't support it. */
++    if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE_RENDERNODE))
++        return 0;
++
++    if (!(graphics->data.spice.rendernode = virHostGetDRMRenderNode()))
++        return -1;
++
++    return 0;
++}
++
++
+ static int
+ qemuProcessSetupGraphics(virQEMUDriverPtr driver,
+                          virDomainObjPtr vm,
++                         virQEMUCapsPtr qemuCaps,
+                          unsigned int flags)
+ {
+     virDomainGraphicsDefPtr graphics;
+@@ -4764,6 +4783,9 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver,
+     for (i = 0; i < vm->def->ngraphics; i++) {
+         graphics = vm->def->graphics[i];
+ 
++        if (qemuProcessGraphicsSetupRenderNode(graphics, qemuCaps) < 0)
++            goto cleanup;
++
+         if (qemuProcessGraphicsSetupListen(driver, graphics, vm) < 0)
+             goto cleanup;
+     }
+@@ -5924,7 +5946,7 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver,
+         goto cleanup;
+ 
+     VIR_DEBUG("Setting graphics devices");
+-    if (qemuProcessSetupGraphics(driver, vm, flags) < 0)
++    if (qemuProcessSetupGraphics(driver, vm, priv->qemuCaps, flags) < 0)
+         goto cleanup;
+ 
+     VIR_DEBUG("Create domain masterKey");
+diff --git a/src/util/virutil.h b/src/util/virutil.h
+index 284c713be4..abbbb7101e 100644
+--- a/src/util/virutil.h
++++ b/src/util/virutil.h
+@@ -218,7 +218,7 @@ unsigned long long virMemoryMaxValue(bool ulong) ATTRIBUTE_NOINLINE;
+ 
+ bool virHostHasIOMMU(void);
+ 
+-char *virHostGetDRMRenderNode(void);
++char *virHostGetDRMRenderNode(void) ATTRIBUTE_NOINLINE;
+ 
+ /**
+  * VIR_ASSIGN_IS_OVERFLOW:
+diff --git a/tests/qemuxml2argvdata/graphics-spice-gl-auto-rendernode.x86_64-latest.args b/tests/qemuxml2argvdata/graphics-spice-gl-auto-rendernode.x86_64-latest.args
+new file mode 100644
+index 0000000000..ee92e1fa5a
+--- /dev/null
++++ b/tests/qemuxml2argvdata/graphics-spice-gl-auto-rendernode.x86_64-latest.args
+@@ -0,0 +1,31 @@
++LC_ALL=C \
++PATH=/bin \
++HOME=/home/test \
++USER=test \
++LOGNAME=test \
++QEMU_AUDIO_DRV=spice \
++/usr/bin/qemu-system-i686 \
++-name guest=QEMUGuest1,debug-threads=on \
++-S \
++-object secret,id=masterKey0,format=raw,\
++file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
++-machine pc,accel=tcg,usb=off,dump-guest-core=off \
++-m 214 \
++-realtime mlock=off \
++-smp 1,sockets=1,cores=1,threads=1 \
++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
++-no-user-config \
++-nodefaults \
++-chardev socket,id=charmonitor,fd=1729,server,nowait \
++-mon chardev=charmonitor,id=monitor,mode=control \
++-rtc base=utc \
++-no-shutdown \
++-no-acpi \
++-boot strict=on \
++-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
++-spice port=0,gl=on,rendernode=/dev/dri/foo,seamless-migration=on \
++-device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \
++-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
++-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
++resourcecontrol=deny \
++-msg timestamp=on
+diff --git a/tests/qemuxml2argvdata/graphics-spice-gl-auto-rendernode.xml b/tests/qemuxml2argvdata/graphics-spice-gl-auto-rendernode.xml
+new file mode 100644
+index 0000000000..b48e7bc94e
+--- /dev/null
++++ b/tests/qemuxml2argvdata/graphics-spice-gl-auto-rendernode.xml
+@@ -0,0 +1,24 @@
++<domain type='qemu'>
++  <name>QEMUGuest1</name>
++  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
++  <memory unit='KiB'>219136</memory>
++  <currentMemory unit='KiB'>219136</currentMemory>
++  <vcpu placement='static'>1</vcpu>
++  <os>
++    <type arch='i686' machine='pc'>hvm</type>
++    <boot dev='hd'/>
++  </os>
++  <clock offset='utc'/>
++  <on_poweroff>destroy</on_poweroff>
++  <on_reboot>restart</on_reboot>
++  <on_crash>destroy</on_crash>
++  <devices>
++    <emulator>/usr/bin/qemu-system-i686</emulator>
++    <input type='mouse' bus='ps2'/>
++    <input type='keyboard' bus='ps2'/>
++    <graphics type='spice' autoport='no'>
++      <gl enable='yes'/>
++    </graphics>
++    <memballoon model='virtio'/>
++  </devices>
++</domain>
+diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
+index 4df92cf396..d826793d28 100644
+--- a/tests/qemuxml2argvmock.c
++++ b/tests/qemuxml2argvmock.c
+@@ -184,6 +184,15 @@ virNetDevRunEthernetScript(const char *ifname ATTRIBUTE_UNUSED,
+     return 0;
+ }
+ 
++char *
++virHostGetDRMRenderNode(void)
++{
++    char *dst = NULL;
++
++    ignore_value(VIR_STRDUP(dst, "/dev/dri/foo"));
++    return dst;
++}
++
+ void
+ virCommandPassFD(virCommandPtr cmd ATTRIBUTE_UNUSED,
+                  int fd ATTRIBUTE_UNUSED,
+diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
+index 693e768d66..f76856dc5f 100644
+--- a/tests/qemuxml2argvtest.c
++++ b/tests/qemuxml2argvtest.c
+@@ -1279,6 +1279,7 @@ mymain(void)
+                     QEMU_CAPS_SPICE,
+                     QEMU_CAPS_EGL_HEADLESS,
+                     QEMU_CAPS_DEVICE_QXL);
++    DO_TEST_CAPS_LATEST("graphics-spice-gl-auto-rendernode");
+ 
+     DO_TEST("input-usbmouse", NONE);
+     DO_TEST("input-usbtablet", NONE);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-require-reply-from-guest-agent-in-qemuAgentGetInterfaces.patch b/SOURCES/libvirt-qemu-require-reply-from-guest-agent-in-qemuAgentGetInterfaces.patch
new file mode 100644
index 0000000..18e3a2d
--- /dev/null
+++ b/SOURCES/libvirt-qemu-require-reply-from-guest-agent-in-qemuAgentGetInterfaces.patch
@@ -0,0 +1,52 @@
+From 7d621673b5e33c2dcd7e247f37b3d1bd298b66d8 Mon Sep 17 00:00:00 2001
+Message-Id: <7d621673b5e33c2dcd7e247f37b3d1bd298b66d8@dist-git>
+From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
+Date: Thu, 10 Jan 2019 12:49:11 +0100
+Subject: [PATCH] qemu: require reply from guest agent in
+ qemuAgentGetInterfaces
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since its introduction in commit 0977b8aa071 (released in v1.2.14)
+qemuAgentGetInterfaces calls qemuAgentCommand with needReply=false,
+which allows qemuAgentCommand to return 0 even when it did not get
+any reply from the agent.
+
+Set needReply to true, since we dereference it right after.
+
+This can be hit if libvirt is waiting for an event from the agent
+(e.g. shutdown) and the agent cannot reply in time (e.g. due to
+the guest being shut down), as reported in:
+https://bugzilla.redhat.com/show_bug.cgi?id=1663051
+
+Signed-off-by: Ján Tomko <jtomko@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit 7cfd1fbb1332ae5df678b9f41a62156cb2e88c73)
+Signed-off-by: Ján Tomko <jtomko@redhat.com>
+
+8.0: https://bugzilla.redhat.com/show_bug.cgi?id=1665000
+CVE-2019-3840
+Message-Id: <714971c077bf26ec0d1a2b7283cafb7ab253ccd5.1547120910.git.jtomko@redhat.com>
+
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_agent.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
+index 986e37b07d..d6fd02a4b6 100644
+--- a/src/qemu/qemu_agent.c
++++ b/src/qemu/qemu_agent.c
+@@ -1987,7 +1987,7 @@ qemuAgentGetInterfaces(qemuAgentPtr mon,
+     if (!(cmd = qemuAgentMakeCommand("guest-network-get-interfaces", NULL)))
+         goto cleanup;
+ 
+-    if (qemuAgentCommand(mon, cmd, &reply, false,
++    if (qemuAgentCommand(mon, cmd, &reply, true,
+                          VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK) < 0)
+         goto cleanup;
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu-use-line-breaks-in-command-line-args-written-to-log.patch b/SOURCES/libvirt-qemu-use-line-breaks-in-command-line-args-written-to-log.patch
new file mode 100644
index 0000000..75b2d74
--- /dev/null
+++ b/SOURCES/libvirt-qemu-use-line-breaks-in-command-line-args-written-to-log.patch
@@ -0,0 +1,424 @@
+From 58a67e037eefae16bf2f831de482e9070d590151 Mon Sep 17 00:00:00 2001
+Message-Id: <58a67e037eefae16bf2f831de482e9070d590151@dist-git>
+From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+Date: Tue, 21 May 2019 11:02:13 +0100
+Subject: [PATCH] qemu: use line breaks in command line args written to log
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The QEMU command line arguments are very long and currently all written
+on a single line to /var/log/libvirt/qemu/$GUEST.log. This introduces
+logic to add line breaks after every env variable and "-" optional
+argument, and every positional argument. This will create a clearer log
+file, which will in turn present better in bug reports when people cut +
+paste from the log into a bug comment.
+
+An example log file entry now looks like this:
+
+  2018-12-14 12:57:03.677+0000: starting up libvirt version: 5.0.0, qemu version: 3.0.0qemu-3.0.0-1.fc29, kernel: 4.19.5-300.fc29.x86_64, hostname: localhost.localdomain
+  LC_ALL=C \
+  PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin \
+  HOME=/home/berrange \
+  USER=berrange \
+  LOGNAME=berrange \
+  QEMU_AUDIO_DRV=none \
+  /usr/bin/qemu-system-ppc64 \
+  -name guest=guest,debug-threads=on \
+  -S \
+  -object secret,id=masterKey0,format=raw,file=/home/berrange/.config/libvirt/qemu/lib/domain-33-guest/master-key.aes \
+  -machine pseries-2.10,accel=tcg,usb=off,dump-guest-core=off \
+  -m 1024 \
+  -realtime mlock=off \
+  -smp 1,sockets=1,cores=1,threads=1 \
+  -uuid c8a74977-ab18-41d0-ae3b-4041c7fffbcd \
+  -display none \
+  -no-user-config \
+  -nodefaults \
+  -chardev socket,id=charmonitor,fd=23,server,nowait \
+  -mon chardev=charmonitor,id=monitor,mode=control \
+  -rtc base=utc \
+  -no-shutdown \
+  -boot strict=on \
+  -device qemu-xhci,id=usb,bus=pci.0,addr=0x1 \
+  -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+  -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+  -msg timestamp=on
+  2018-12-14 12:57:03.730+0000: shutting down, reason=failed
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit 07c9d6601d0b440acd13794b258bdcb570ae93f4)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1672957
+
+Conflicts:
+    src/util/vircommand.c
+    src/util/virfirewall.c
+      - Not using auto cleanup macros in old branch
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+Message-Id: <20190521100213.16875-3-berrange@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ docs/internals/command.html.in   |  2 +-
+ src/bhyve/bhyve_driver.c         |  4 +-
+ src/qemu/qemu_driver.c           |  2 +-
+ src/qemu/qemu_interface.c        |  2 +-
+ src/qemu/qemu_process.c          |  2 +-
+ src/security/security_apparmor.c |  2 +-
+ src/util/vircommand.c            | 19 ++++++++--
+ src/util/vircommand.h            |  2 +-
+ src/util/virfirewall.c           |  2 +-
+ tests/bhyvexml2argvtest.c        |  4 +-
+ tests/commanddata/test26.log     |  1 +
+ tests/commandtest.c              | 64 +++++++++++++++++++++++++++++++-
+ tests/qemuxml2argvtest.c         |  2 +-
+ tests/storagepoolxml2argvtest.c  |  2 +-
+ tests/storagevolxml2argvtest.c   |  4 +-
+ 15 files changed, 95 insertions(+), 19 deletions(-)
+ create mode 100644 tests/commanddata/test26.log
+
+diff --git a/docs/internals/command.html.in b/docs/internals/command.html.in
+index 43f51a49bb..8a9061e70f 100644
+--- a/docs/internals/command.html.in
++++ b/docs/internals/command.html.in
+@@ -426,7 +426,7 @@ dprintf(logfd, "%s: ", timestamp);
+ VIR_FREE(timestamp);
+ virCommandWriteArgLog(cmd, logfd);
+ 
+-string = virCommandToString(cmd);
++string = virCommandToString(cmd, false);
+ if (string)
+     VIR_DEBUG("about to run %s", string);
+ VIR_FREE(string);
+diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
+index 9284b51783..ae611fdb60 100644
+--- a/src/bhyve/bhyve_driver.c
++++ b/src/bhyve/bhyve_driver.c
+@@ -736,14 +736,14 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
+                                                 NULL)))
+             goto cleanup;
+ 
+-        virBufferAdd(&buf, virCommandToString(loadcmd), -1);
++        virBufferAdd(&buf, virCommandToString(loadcmd, false), -1);
+         virBufferAddChar(&buf, '\n');
+     }
+ 
+     if (!(cmd = virBhyveProcessBuildBhyveCmd(conn, def, true)))
+         goto cleanup;
+ 
+-    virBufferAdd(&buf, virCommandToString(cmd), -1);
++    virBufferAdd(&buf, virCommandToString(cmd, false), -1);
+ 
+     if (virBufferCheckError(&buf) < 0)
+         goto cleanup;
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index 3b3281c13f..704ba24215 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -7171,7 +7171,7 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
+                                             VIR_QEMU_PROCESS_START_COLD)))
+         goto cleanup;
+ 
+-    ret = virCommandToString(cmd);
++    ret = virCommandToString(cmd, false);
+ 
+  cleanup:
+     virCommandFree(cmd);
+diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
+index a3f13093f5..afef30d7cf 100644
+--- a/src/qemu/qemu_interface.c
++++ b/src/qemu/qemu_interface.c
+@@ -363,7 +363,7 @@ qemuCreateInBridgePortWithHelper(virQEMUDriverConfigPtr cfg,
+         char ebuf[1024];
+         char *errstr = NULL;
+ 
+-        if (!(cmdstr = virCommandToString(cmd)))
++        if (!(cmdstr = virCommandToString(cmd, false)))
+             goto cleanup;
+         virCommandAbort(cmd);
+ 
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index 8811aefb95..2795796166 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -4327,7 +4327,7 @@ qemuLogOperation(virDomainObjPtr vm,
+         goto cleanup;
+ 
+     if (cmd) {
+-        char *args = virCommandToString(cmd);
++        char *args = virCommandToString(cmd, true);
+         qemuDomainLogContextWrite(logCtxt, "%s\n", args);
+         VIR_FREE(args);
+     }
+diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
+index cb41df71a9..bb1742a686 100644
+--- a/src/security/security_apparmor.c
++++ b/src/security/security_apparmor.c
+@@ -661,7 +661,7 @@ AppArmorSetSecurityChildProcessLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
+     if ((profile_name = get_profile_name(def)) == NULL)
+         goto cleanup;
+ 
+-    cmd_str = virCommandToString(cmd);
++    cmd_str = virCommandToString(cmd, false);
+     VIR_DEBUG("Changing AppArmor profile to %s on %s", profile_name, cmd_str);
+     virCommandSetAppArmorProfile(cmd, profile_name);
+     rc = 0;
+diff --git a/src/util/vircommand.c b/src/util/vircommand.c
+index 68cf63c28a..f539bafab6 100644
+--- a/src/util/vircommand.c
++++ b/src/util/vircommand.c
+@@ -1971,6 +1971,7 @@ virCommandWriteArgLog(virCommandPtr cmd, int logfd)
+ /**
+  * virCommandToString:
+  * @cmd: the command to convert
++ * @linebreaks: true to break line after each env var or option
+  *
+  * Call after adding all arguments and environment settings, but
+  * before Run/RunAsync, to return a string representation of the
+@@ -1980,10 +1981,11 @@ virCommandWriteArgLog(virCommandPtr cmd, int logfd)
+  * Caller is responsible for freeing the resulting string.
+  */
+ char *
+-virCommandToString(virCommandPtr cmd)
++virCommandToString(virCommandPtr cmd, bool linebreaks)
+ {
+     size_t i;
+     virBuffer buf = VIR_BUFFER_INITIALIZER;
++    bool prevopt = false;
+ 
+     /* Cannot assume virCommandRun will be called; so report the error
+      * now.  If virCommandRun is called, it will report the same error. */
+@@ -2012,11 +2014,22 @@ virCommandToString(virCommandPtr cmd)
+         virBufferAdd(&buf, cmd->env[i], eq - cmd->env[i]);
+         virBufferEscapeShell(&buf, eq);
+         virBufferAddChar(&buf, ' ');
++        if (linebreaks)
++            virBufferAddLit(&buf, "\\\n");
+     }
+     virBufferEscapeShell(&buf, cmd->args[0]);
+     for (i = 1; i < cmd->nargs; i++) {
+         virBufferAddChar(&buf, ' ');
++        if (linebreaks) {
++            /* Line break if this is a --arg or if
++             * the previous arg was a positional option
++             */
++            if (cmd->args[i][0] == '-' ||
++                !prevopt)
++                virBufferAddLit(&buf, "\\\n");
++        }
+         virBufferEscapeShell(&buf, cmd->args[i]);
++        prevopt = (cmd->args[i][0] == '-');
+     }
+ 
+     if (virBufferCheckError(&buf) < 0)
+@@ -2459,7 +2472,7 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
+         goto cleanup;
+     }
+ 
+-    str = virCommandToString(cmd);
++    str = virCommandToString(cmd, false);
+     if (dryRunBuffer || dryRunCallback) {
+         dryRunStatus = 0;
+         if (!str) {
+@@ -2599,7 +2612,7 @@ virCommandWait(virCommandPtr cmd, int *exitstatus)
+         if (exitstatus && (cmd->rawStatus || WIFEXITED(status))) {
+             *exitstatus = cmd->rawStatus ? status : WEXITSTATUS(status);
+         } else if (status) {
+-            char *str = virCommandToString(cmd);
++            char *str = virCommandToString(cmd, false);
+             char *st = virProcessTranslateStatus(status);
+             bool haveErrMsg = cmd->errbuf && *cmd->errbuf && (*cmd->errbuf)[0];
+ 
+diff --git a/src/util/vircommand.h b/src/util/vircommand.h
+index 883e212959..5ea2998f77 100644
+--- a/src/util/vircommand.h
++++ b/src/util/vircommand.h
+@@ -171,7 +171,7 @@ void virCommandSetPreExecHook(virCommandPtr cmd,
+ void virCommandWriteArgLog(virCommandPtr cmd,
+                            int logfd);
+ 
+-char *virCommandToString(virCommandPtr cmd) ATTRIBUTE_RETURN_CHECK;
++char *virCommandToString(virCommandPtr cmd, bool linebreaks) ATTRIBUTE_RETURN_CHECK;
+ 
+ int virCommandExec(virCommandPtr cmd, gid_t *groups, int ngroups) ATTRIBUTE_RETURN_CHECK;
+ 
+diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c
+index 10c370a2ae..79c2ef87e2 100644
+--- a/src/util/virfirewall.c
++++ b/src/util/virfirewall.c
+@@ -703,7 +703,7 @@ virFirewallApplyRuleDirect(virFirewallRulePtr rule,
+         if (ignoreErrors) {
+             VIR_DEBUG("Ignoring error running command");
+         } else {
+-            char *args = virCommandToString(cmd);
++            char *args = virCommandToString(cmd, false);
+             virReportError(VIR_ERR_INTERNAL_ERROR,
+                            _("Failed to apply firewall rules %s: %s"),
+                            NULLSTR(args), NULLSTR(error));
+diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
+index 6d5f19e2c6..d1b486fa64 100644
+--- a/tests/bhyvexml2argvtest.c
++++ b/tests/bhyvexml2argvtest.c
+@@ -68,13 +68,13 @@ static int testCompareXMLToArgvFiles(const char *xml,
+         goto out;
+     }
+ 
+-    if (!(actualargv = virCommandToString(cmd)))
++    if (!(actualargv = virCommandToString(cmd, false)))
+         goto out;
+ 
+     if (actualdm != NULL)
+         virTrimSpaces(actualdm, NULL);
+ 
+-    if (!(actualld = virCommandToString(ldcmd)))
++    if (!(actualld = virCommandToString(ldcmd, false)))
+         goto out;
+ 
+     if (virTestCompareToFile(actualargv, cmdline) < 0)
+diff --git a/tests/commanddata/test26.log b/tests/commanddata/test26.log
+new file mode 100644
+index 0000000000..db0d424875
+--- /dev/null
++++ b/tests/commanddata/test26.log
+@@ -0,0 +1 @@
++A=B C=D  E true --foo bar --oooh -f --wizz eek eek -w -z -l --mmm flash bang wallop
+diff --git a/tests/commandtest.c b/tests/commandtest.c
+index 744a387aa0..4edef6157a 100644
+--- a/tests/commandtest.c
++++ b/tests/commandtest.c
+@@ -633,7 +633,7 @@ static int test16(const void *unused ATTRIBUTE_UNUSED)
+     virCommandAddArg(cmd, "F");
+     virCommandAddArg(cmd, "G  H");
+ 
+-    if ((outactual = virCommandToString(cmd)) == NULL) {
++    if ((outactual = virCommandToString(cmd, false)) == NULL) {
+         printf("Cannot convert to string: %s\n", virGetLastErrorMessage());
+         goto cleanup;
+     }
+@@ -1138,6 +1138,67 @@ static int test25(const void *unused ATTRIBUTE_UNUSED)
+ }
+ 
+ 
++/*
++ * Don't run program; rather, log what would be run.
++ */
++static int test26(const void *unused ATTRIBUTE_UNUSED)
++{
++    virCommandPtr cmd = virCommandNew("true");
++    char *outactual = NULL;
++    const char *outexpect =
++        "A=B \\\n"
++        "C='D  E' \\\n"
++        "true \\\n"
++        "--foo bar \\\n"
++        "--oooh \\\n"
++        "-f \\\n"
++        "--wizz 'eek eek' \\\n"
++        "-w \\\n"
++        "-z \\\n"
++        "-l \\\n"
++        "--mmm flash \\\n"
++        "bang \\\n"
++        "wallop";
++
++    int ret = -1;
++    int fd = -1;
++
++    virCommandAddEnvPair(cmd, "A", "B");
++    virCommandAddEnvPair(cmd, "C", "D  E");
++    virCommandAddArgList(cmd, "--foo", "bar", "--oooh", "-f",
++                         "--wizz", "eek eek", "-w", "-z", "-l",
++                         "--mmm", "flash", "bang", "wallop",
++                         NULL);
++
++    if ((outactual = virCommandToString(cmd, true)) == NULL) {
++        printf("Cannot convert to string: %s\n", virGetLastErrorMessage());
++        goto cleanup;
++    }
++    if ((fd = open(abs_builddir "/commandhelper.log",
++                   O_CREAT | O_TRUNC | O_WRONLY, 0600)) < 0) {
++        printf("Cannot open log file: %s\n", strerror(errno));
++        goto cleanup;
++    }
++    virCommandWriteArgLog(cmd, fd);
++    if (VIR_CLOSE(fd) < 0) {
++        printf("Cannot close log file: %s\n", strerror(errno));
++        goto cleanup;
++    }
++
++    if (STRNEQ(outactual, outexpect)) {
++        virTestDifference(stderr, outexpect, outactual);
++        goto cleanup;
++    }
++
++    ret = checkoutput("test26", NULL);
++
++ cleanup:
++    virCommandFree(cmd);
++    VIR_FORCE_CLOSE(fd);
++    VIR_FREE(outactual);
++    return ret;
++}
++
+ static void virCommandThreadWorker(void *opaque)
+ {
+     virCommandTestDataPtr test = opaque;
+@@ -1291,6 +1352,7 @@ mymain(void)
+     DO_TEST(test23);
+     DO_TEST(test24);
+     DO_TEST(test25);
++    DO_TEST(test26);
+ 
+     virMutexLock(&test->lock);
+     if (test->running) {
+diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
+index a29e63d950..9933e4bde1 100644
+--- a/tests/qemuxml2argvtest.c
++++ b/tests/qemuxml2argvtest.c
+@@ -575,7 +575,7 @@ testCompareXMLToArgv(const void *data)
+         goto cleanup;
+     }
+ 
+-    if (!(actualargv = virCommandToString(cmd)))
++    if (!(actualargv = virCommandToString(cmd, false)))
+         goto cleanup;
+ 
+     if (virTestCompareToFile(actualargv, args) < 0)
+diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c
+index 1e48910566..19a64303a7 100644
+--- a/tests/storagepoolxml2argvtest.c
++++ b/tests/storagepoolxml2argvtest.c
+@@ -60,7 +60,7 @@ testCompareXMLToArgvFiles(bool shouldFail,
+         goto cleanup;
+     };
+ 
+-    if (!(actualCmdline = virCommandToString(cmd))) {
++    if (!(actualCmdline = virCommandToString(cmd, false))) {
+         VIR_TEST_DEBUG("pool type %d failed to get commandline\n", def->type);
+         goto cleanup;
+     }
+diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c
+index 105705f348..bc2da37410 100644
+--- a/tests/storagevolxml2argvtest.c
++++ b/tests/storagevolxml2argvtest.c
+@@ -104,14 +104,14 @@ testCompareXMLToArgvFiles(bool shouldFail,
+         }
+ 
+         if (convertStep != VIR_STORAGE_VOL_ENCRYPT_CONVERT) {
+-            if (!(actualCmdline = virCommandToString(cmd)))
++            if (!(actualCmdline = virCommandToString(cmd, false)))
+                 goto cleanup;
+         } else {
+             char *createCmdline = actualCmdline;
+             char *cvtCmdline;
+             int rc;
+ 
+-            if (!(cvtCmdline = virCommandToString(cmd)))
++            if (!(cvtCmdline = virCommandToString(cmd, false)))
+                 goto cleanup;
+ 
+             rc = virAsprintf(&actualCmdline, "%s\n%s",
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemuL-Drop-user-prefix-for-guestfwd-netdev.patch b/SOURCES/libvirt-qemuL-Drop-user-prefix-for-guestfwd-netdev.patch
new file mode 100644
index 0000000..690eefc
--- /dev/null
+++ b/SOURCES/libvirt-qemuL-Drop-user-prefix-for-guestfwd-netdev.patch
@@ -0,0 +1,98 @@
+From ce0f57787141bf49558c42a88bf2c55f27928137 Mon Sep 17 00:00:00 2001
+Message-Id: <ce0f57787141bf49558c42a88bf2c55f27928137@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:17 -0400
+Subject: [PATCH] qemuL: Drop "user-" prefix for guestfwd netdev
+
+Introduced by d86c876a66e3.
+
+There is no real need to have "user-" prefix for chardev.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 18b8f677456714f04b87525602fa2b62cd4224e1)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-6-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_command.c                                       | 2 +-
+ tests/qemuxml2argvdata/channel-guestfwd.args                  | 2 +-
+ .../qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args  | 4 ++--
+ .../qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args | 4 ++--
+ tests/qemuxml2argvdata/name-escape.args                       | 2 +-
+ 5 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
+index d372b1bd79..52650dc46d 100644
+--- a/src/qemu/qemu_command.c
++++ b/src/qemu/qemu_command.c
+@@ -10571,7 +10571,7 @@ qemuBuildChannelChrDeviceStr(char **deviceStr,
+         port = virSocketAddrGetPort(chr->target.addr);
+ 
+         if (virAsprintf(deviceStr,
+-                        "user,guestfwd=tcp:%s:%i-chardev:char%s,id=user-%s",
++                        "user,guestfwd=tcp:%s:%i-chardev:char%s,id=%s",
+                         addr, port, chr->info.alias, chr->info.alias) < 0)
+             goto cleanup;
+         break;
+diff --git a/tests/qemuxml2argvdata/channel-guestfwd.args b/tests/qemuxml2argvdata/channel-guestfwd.args
+index 6a660f7796..b4c857a6d7 100644
+--- a/tests/qemuxml2argvdata/channel-guestfwd.args
++++ b/tests/qemuxml2argvdata/channel-guestfwd.args
+@@ -25,5 +25,5 @@ server,nowait \
+ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+ -chardev pipe,id=charchannel0,path=/tmp/guestfwd \
+--netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=user-channel0 \
++-netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \
+ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
+diff --git a/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args
+index f0e718e4a2..75b65a237b 100644
+--- a/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args
++++ b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args
+@@ -26,8 +26,8 @@ server,nowait \
+ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+ -chardev socket,id=charchannel0,path=/tmp/guestfwd-listen.socket,server,nowait \
+--netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=user-channel0 \
++-netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \
+ -chardev socket,id=charchannel1,path=/tmp/guestfwd-connect.socket \
+--netdev user,guestfwd=tcp:10.0.2.1:4601-chardev:charchannel1,id=user-channel1 \
++-netdev user,guestfwd=tcp:10.0.2.1:4601-chardev:charchannel1,id=channel1 \
+ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+ -msg timestamp=on
+diff --git a/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args
+index f9b9ee5fdb..eaafe66752 100644
+--- a/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args
++++ b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args
+@@ -27,9 +27,9 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+ -chardev socket,id=charchannel0,fd=1729,server,nowait \
+--netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=user-channel0 \
++-netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \
+ -chardev socket,id=charchannel1,path=/tmp/guestfwd-connect.socket \
+--netdev user,guestfwd=tcp:10.0.2.1:4601-chardev:charchannel1,id=user-channel1 \
++-netdev user,guestfwd=tcp:10.0.2.1:4601-chardev:charchannel1,id=channel1 \
+ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+ resourcecontrol=deny \
+diff --git a/tests/qemuxml2argvdata/name-escape.args b/tests/qemuxml2argvdata/name-escape.args
+index 382b8a1a9e..cbf594e808 100644
+--- a/tests/qemuxml2argvdata/name-escape.args
++++ b/tests/qemuxml2argvdata/name-escape.args
+@@ -37,7 +37,7 @@ cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \
+ -chardev file,id=charserial1,path=/tmp/serial.log,,foo,append=on \
+ -device isa-serial,chardev=charserial1,id=serial1 \
+ -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \
+--netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=user-channel0 \
++-netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=channel0 \
+ -vnc unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \
+ -spice unix,addr=/tmp/lib/domain--1-foo=1,,bar=2/spice.sock,gl=on,\
+ rendernode=/dev/dri/foo,,bar \
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-Assume-chardev-alias-always-exists-in-qemuDomainDetachChrDevice.patch b/SOURCES/libvirt-qemu_hotplug-Assume-chardev-alias-always-exists-in-qemuDomainDetachChrDevice.patch
new file mode 100644
index 0000000..6b6fd65
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-Assume-chardev-alias-always-exists-in-qemuDomainDetachChrDevice.patch
@@ -0,0 +1,43 @@
+From a2f60e6e90112f4bf4a8c2e68d76f472c88b7074 Mon Sep 17 00:00:00 2001
+Message-Id: <a2f60e6e90112f4bf4a8c2e68d76f472c88b7074@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:22 -0400
+Subject: [PATCH] qemu_hotplug: Assume chardev alias always exists in
+ qemuDomainDetachChrDevice
+
+The @tmpChr is looked up in domain definition based on user
+provided chardev XML. Therefore, the alias must have been
+allocated already when domain was started up.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 5657e22212c54651a9e098ceb79c5522d55e0114)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-11-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index d4444bbb5d..36840f977e 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5607,11 +5607,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+     guestfwd = tmpChr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
+                tmpChr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD;
+ 
+-    if (!tmpChr->info.alias && qemuAssignDeviceChrAlias(vmdef, tmpChr, -1) < 0)
+-        goto cleanup;
+-
+-    sa_assert(tmpChr->info.alias);
+-
+     if (!async && !guestfwd)
+         qemuDomainMarkDeviceForRemoval(vm, &tmpChr->info);
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-Attach-guestfwd-using-netdev_add.patch b/SOURCES/libvirt-qemu_hotplug-Attach-guestfwd-using-netdev_add.patch
new file mode 100644
index 0000000..04182b6
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-Attach-guestfwd-using-netdev_add.patch
@@ -0,0 +1,65 @@
+From 7b795534a39ad44d93ff1864ed98071c1f5bf6af Mon Sep 17 00:00:00 2001
+Message-Id: <7b795534a39ad44d93ff1864ed98071c1f5bf6af@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:18 -0400
+Subject: [PATCH] qemu_hotplug: Attach guestfwd using netdev_add
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1624204
+
+The guestfwd channels are -netdevs really. Hotplug them as such.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 903315dc8ffeb2af651207f090a53526decabc92)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-7-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 20 +++++++++++++++-----
+ 1 file changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 46cafef4c2..680c06c1ed 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -1753,10 +1753,14 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
+     char *tlsAlias = NULL;
+     const char *secAlias = NULL;
+     bool need_release = false;
++    bool guestfwd = false;
+ 
+-    if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
+-        qemuDomainPrepareChannel(chr, priv->channelTargetDir) < 0)
+-        goto cleanup;
++    if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL) {
++        guestfwd = chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD;
++
++        if (qemuDomainPrepareChannel(chr, priv->channelTargetDir) < 0)
++            goto cleanup;
++    }
+ 
+     if (qemuAssignDeviceChrAlias(vmdef, chr, -1) < 0)
+         goto cleanup;
+@@ -1798,8 +1802,14 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
+         goto exit_monitor;
+     chardevAttached = true;
+ 
+-    if (qemuMonitorAddDevice(priv->mon, devstr) < 0)
+-        goto exit_monitor;
++    if (guestfwd) {
++        if (qemuMonitorAddNetdev(priv->mon, devstr,
++                                 NULL, NULL, 0, NULL, NULL, 0) < 0)
++            goto exit_monitor;
++    } else {
++        if (qemuMonitorAddDevice(priv->mon, devstr) < 0)
++            goto exit_monitor;
++    }
+ 
+     if (qemuDomainObjExitMonitor(driver, vm) < 0)
+         goto audit;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-Check-for-duplicate-drive-addresses.patch b/SOURCES/libvirt-qemu_hotplug-Check-for-duplicate-drive-addresses.patch
new file mode 100644
index 0000000..1328822
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-Check-for-duplicate-drive-addresses.patch
@@ -0,0 +1,42 @@
+From 828438e201b9d4bd4d9ff74eb9a99ceb2c54f1ed Mon Sep 17 00:00:00 2001
+Message-Id: <828438e201b9d4bd4d9ff74eb9a99ceb2c54f1ed@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 18 Apr 2019 18:43:12 +0200
+Subject: [PATCH] qemu_hotplug: Check for duplicate drive addresses
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1692296
+
+This tries to fix the same problem as f1d65853000 but it's doing
+so in a less invasive way.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
+Reviewed-by: Jim Fehlig <jfehlig@suse.com>
+(cherry picked from commit ddc72f99027b063feaf34e5fda89916b6b2c8943)
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Message-Id: <c7abbafab1f5a60724adb4b3093034835c85e14b.1555605741.git.mprivozn@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 103d3e59a7..7ad8007a3a 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -651,6 +651,12 @@ qemuDomainAttachSCSIDisk(virQEMUDriverPtr driver,
+         return -1;
+     }
+ 
++    if (virDomainSCSIDriveAddressIsUsed(vm->def, &disk->info.addr.drive)) {
++        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
++                       _("Domain already contains a disk with that address"));
++        return -1;
++    }
++
+     /* Let's make sure the disk has a controller defined and loaded before
+      * trying to add it. The controller used by the disk must exist before a
+      * qemu command line string is generated.
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-Detach-guestfwd-using-netdev_del.patch b/SOURCES/libvirt-qemu_hotplug-Detach-guestfwd-using-netdev_del.patch
new file mode 100644
index 0000000..5fd0a4e
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-Detach-guestfwd-using-netdev_del.patch
@@ -0,0 +1,139 @@
+From 9a33b0d475699d322f3e881c397143eed2dc9b3f Mon Sep 17 00:00:00 2001
+Message-Id: <9a33b0d475699d322f3e881c397143eed2dc9b3f@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:19 -0400
+Subject: [PATCH] qemu_hotplug: Detach guestfwd using netdev_del
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1624204
+
+The guestfwd channels are -netdevs really. Hotunplug them as
+such. Also, DEVICE_DELETED event is not triggered (surprisingly,
+since we're not issuing device_del rather than netdev_del) and
+associated chardev is removed automagically too. This means that
+we need to do qemuDomainRemoveChrDevice() minus monitor call to
+remove the chardev.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 112f3a8d0f324c0705326957cca4508602b25eba)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-8-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 48 ++++++++++++++++++++++++++++-------------
+ 1 file changed, 33 insertions(+), 15 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 680c06c1ed..43dec329b6 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4214,25 +4214,28 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
+ static int
+ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
+                           virDomainObjPtr vm,
+-                          virDomainChrDefPtr chr)
++                          virDomainChrDefPtr chr,
++                          bool monitor)
+ {
+     virObjectEventPtr event;
+     char *charAlias = NULL;
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+     int ret = -1;
+-    int rc;
++    int rc = 0;
+ 
+     VIR_DEBUG("Removing character device %s from domain %p %s",
+               chr->info.alias, vm, vm->def->name);
+ 
+-    if (!(charAlias = qemuAliasChardevFromDevAlias(chr->info.alias)))
+-        goto cleanup;
++    if (monitor) {
++        if (!(charAlias = qemuAliasChardevFromDevAlias(chr->info.alias)))
++            goto cleanup;
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    rc = qemuMonitorDetachCharDev(priv->mon, charAlias);
++        qemuDomainObjEnterMonitor(driver, vm);
++        rc = qemuMonitorDetachCharDev(priv->mon, charAlias);
+ 
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        goto cleanup;
++        if (qemuDomainObjExitMonitor(driver, vm) < 0)
++            goto cleanup;
++    }
+ 
+     if (rc == 0 &&
+         qemuDomainDelChardevTLSObjects(driver, vm, chr->source, charAlias) < 0)
+@@ -4526,7 +4529,7 @@ qemuDomainRemoveDevice(virQEMUDriverPtr driver,
+         break;
+ 
+     case VIR_DOMAIN_DEVICE_CHR:
+-        ret = qemuDomainRemoveChrDevice(driver, vm, dev->data.chr);
++        ret = qemuDomainRemoveChrDevice(driver, vm, dev->data.chr, true);
+         break;
+     case VIR_DOMAIN_DEVICE_RNG:
+         ret = qemuDomainRemoveRNGDevice(driver, vm, dev->data.rng);
+@@ -5590,6 +5593,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+     virDomainDefPtr vmdef = vm->def;
+     virDomainChrDefPtr tmpChr;
+     char *devstr = NULL;
++    bool guestfwd = false;
+ 
+     if (!(tmpChr = virDomainChrFind(vmdef, chr))) {
+         virReportError(VIR_ERR_DEVICE_MISSING,
+@@ -5599,6 +5603,11 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+         goto cleanup;
+     }
+ 
++    /* guestfwd channels are not really -device rather than
++     * -netdev. We need to treat them slightly differently. */
++    guestfwd = tmpChr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
++               tmpChr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD;
++
+     if (!tmpChr->info.alias && qemuAssignDeviceChrAlias(vmdef, tmpChr, -1) < 0)
+         goto cleanup;
+ 
+@@ -5607,22 +5616,31 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+     if (qemuBuildChrDeviceStr(&devstr, vmdef, tmpChr, priv->qemuCaps) < 0)
+         goto cleanup;
+ 
+-    if (!async)
++    if (!async && !guestfwd)
+         qemuDomainMarkDeviceForRemoval(vm, &tmpChr->info);
+ 
+     qemuDomainObjEnterMonitor(driver, vm);
+-    if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
+-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+-        goto cleanup;
++    if (guestfwd) {
++        if (qemuMonitorRemoveNetdev(priv->mon, tmpChr->info.alias) < 0) {
++            ignore_value(qemuDomainObjExitMonitor(driver, vm));
++            goto cleanup;
++        }
++    } else {
++        if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
++            ignore_value(qemuDomainObjExitMonitor(driver, vm));
++            goto cleanup;
++        }
+     }
+     if (qemuDomainObjExitMonitor(driver, vm) < 0)
+         goto cleanup;
+ 
+-    if (async) {
++    if (guestfwd) {
++        ret = qemuDomainRemoveChrDevice(driver, vm, tmpChr, false);
++    } else if (async) {
+         ret = 0;
+     } else {
+         if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveChrDevice(driver, vm, tmpChr);
++            ret = qemuDomainRemoveChrDevice(driver, vm, tmpChr, true);
+     }
+ 
+  cleanup:
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-Don-t-build-device-string-in-qemuDomainDetachChrDevice.patch b/SOURCES/libvirt-qemu_hotplug-Don-t-build-device-string-in-qemuDomainDetachChrDevice.patch
new file mode 100644
index 0000000..07afc41
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-Don-t-build-device-string-in-qemuDomainDetachChrDevice.patch
@@ -0,0 +1,72 @@
+From 9ab3c57972a8a9f762a3905216478e576f0966cf Mon Sep 17 00:00:00 2001
+Message-Id: <9ab3c57972a8a9f762a3905216478e576f0966cf@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:21 -0400
+Subject: [PATCH] qemu_hotplug: Don't build device string in
+ qemuDomainDetachChrDevice
+
+This is basically an old artefact from 24b0821926e when the idea
+was:
+
+1) Build device string only to see if chardev has any -device
+associated with it and thus if device_del is needed
+2) Detach chardev using chardev_del
+
+Now, that DEVICE and DEVICE_DELETED capabilities are assumed for
+every domain 1) does not make sense anymore.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 0c17685760a3ec8bf06c793d47d82dd51428451a)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-10-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 43dec329b6..d4444bbb5d 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5592,7 +5592,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+     virDomainDefPtr vmdef = vm->def;
+     virDomainChrDefPtr tmpChr;
+-    char *devstr = NULL;
+     bool guestfwd = false;
+ 
+     if (!(tmpChr = virDomainChrFind(vmdef, chr))) {
+@@ -5613,9 +5612,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+ 
+     sa_assert(tmpChr->info.alias);
+ 
+-    if (qemuBuildChrDeviceStr(&devstr, vmdef, tmpChr, priv->qemuCaps) < 0)
+-        goto cleanup;
+-
+     if (!async && !guestfwd)
+         qemuDomainMarkDeviceForRemoval(vm, &tmpChr->info);
+ 
+@@ -5626,7 +5622,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+             goto cleanup;
+         }
+     } else {
+-        if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
++        if (qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
+             ignore_value(qemuDomainObjExitMonitor(driver, vm));
+             goto cleanup;
+         }
+@@ -5646,7 +5642,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+  cleanup:
+     if (!async)
+         qemuDomainResetDeviceRemoval(vm);
+-    VIR_FREE(devstr);
+     return ret;
+ }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-Initialize-charAlias-in-qemuDomainRemoveChrDevice.patch b/SOURCES/libvirt-qemu_hotplug-Initialize-charAlias-in-qemuDomainRemoveChrDevice.patch
new file mode 100644
index 0000000..a8c4294
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-Initialize-charAlias-in-qemuDomainRemoveChrDevice.patch
@@ -0,0 +1,50 @@
+From 2aadab4741e8637196e729044893584bf4bde33f Mon Sep 17 00:00:00 2001
+Message-Id: <2aadab4741e8637196e729044893584bf4bde33f@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 25 Apr 2019 09:24:47 +0200
+Subject: [PATCH] qemu_hotplug: Initialize @charAlias in
+ qemuDomainRemoveChrDevice
+
+My change in 112f3a8d0f32 was too drastic. The @charAlias
+variable is initialized only if @monitor == true. However, it is
+used even outside of that condition, at which point it's just
+uninitialized pointer.
+
+Reported-by: John Ferlan <jferlan@redhat.com>
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 4b23f18d2c9e13ac6f33fb45dbb79931082125bb)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1658198
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <92831aceb87c1bc226a77904766f434d86f62675.1556177047.git.jdenemar@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 7ad8007a3a..ca8b0aaf62 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4364,13 +4364,12 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
+     VIR_DEBUG("Removing character device %s from domain %p %s",
+               chr->info.alias, vm, vm->def->name);
+ 
+-    if (monitor) {
+-        if (!(charAlias = qemuAliasChardevFromDevAlias(chr->info.alias)))
+-            goto cleanup;
++    if (!(charAlias = qemuAliasChardevFromDevAlias(chr->info.alias)))
++        goto cleanup;
+ 
++    if (monitor) {
+         qemuDomainObjEnterMonitor(driver, vm);
+         rc = qemuMonitorDetachCharDev(priv->mon, charAlias);
+-
+         if (qemuDomainObjExitMonitor(driver, vm) < 0)
+             goto cleanup;
+     }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-Introduce-and-use-qemuDomainDeleteDevice.patch b/SOURCES/libvirt-qemu_hotplug-Introduce-and-use-qemuDomainDeleteDevice.patch
new file mode 100644
index 0000000..9435327
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-Introduce-and-use-qemuDomainDeleteDevice.patch
@@ -0,0 +1,550 @@
+From 2c396c9f38179ca8a2428d30bc26be1bb05789c1 Mon Sep 17 00:00:00 2001
+Message-Id: <2c396c9f38179ca8a2428d30bc26be1bb05789c1@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:25 -0400
+Subject: [PATCH] qemu_hotplug: Introduce and use qemuDomainDeleteDevice
+
+The aim of this function will be to fix return value of
+qemuMonitorDelDevice() in one specific case. But that is yet to
+come. Right now this is nothing but a plain substitution.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 4cd13478ac331f5e42c926d4f2111dd89d2970a6)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+
+Conflicts: src/qemu/qemu_hotplug.c:
+   - qemuDomainDetachExtensionDevice() (erroneously) added to
+     qemuDomainDetachControllerDevice upstream, doesn't exist
+     downstream.
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-14-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 239 ++++++++++++++--------------------------
+ 1 file changed, 82 insertions(+), 157 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 963b87f798..1f41efa180 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -68,6 +68,45 @@ VIR_LOG_INIT("qemu.qemu_hotplug");
+ unsigned long long qemuDomainRemoveDeviceWaitTime = 1000ull * 5;
+ 
+ 
++/**
++ * qemuDomainDeleteDevice:
++ * @vm: domain object
++ * @alias: device to remove
++ *
++ * This is a wrapper over qemuMonitorDelDevice() plus enter/exit
++ * monitor calls.  This function MUST be used instead of plain
++ * qemuMonitorDelDevice() in all places where @alias represents a
++ * device from domain XML, i.e. caller marks the device for
++ * removal and then calls qemuDomainWaitForDeviceRemoval()
++ * followed by qemuDomainRemove*Device().
++ *
++ * For collateral devices (e.g. extension devices like zPCI) it
++ * is safe to use plain qemuMonitorDelDevice().
++ *
++ * Upon entry, @vm must be locked.
++ *
++ * Returns: 0 on success,
++ *         -1 otherwise.
++ */
++static int
++qemuDomainDeleteDevice(virDomainObjPtr vm,
++                       const char *alias)
++{
++    qemuDomainObjPrivatePtr priv = vm->privateData;
++    virQEMUDriverPtr driver = priv->driver;
++    int rc;
++
++    qemuDomainObjEnterMonitor(driver, vm);
++
++    rc = qemuMonitorDelDevice(priv->mon, alias);
++
++    if (qemuDomainObjExitMonitor(driver, vm) < 0)
++        rc = -1;
++
++    return rc;
++}
++
++
+ /**
+  * qemuHotplugPrepareDiskAccess:
+  * @driver: qemu driver struct
+@@ -4689,7 +4728,6 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
+                                  bool async)
+ {
+     int ret = -1;
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+ 
+     if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+@@ -4701,15 +4739,11 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
+-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-            goto cleanup;
+-        virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
++    if (qemuDomainDeleteDevice(vm, detach->info.alias) < 0) {
++        if (virDomainObjIsActive(vm))
++            virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
+         goto cleanup;
+     }
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        goto cleanup;
+ 
+     if (async) {
+         ret = 0;
+@@ -4731,7 +4765,6 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
+                            bool async)
+ {
+     int ret = -1;
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+ 
+     if (qemuDomainDiskBlockJobIsActive(detach))
+         goto cleanup;
+@@ -4739,15 +4772,11 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
+-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-            goto cleanup;
+-        virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
++    if (qemuDomainDeleteDevice(vm, detach->info.alias) < 0) {
++        if (virDomainObjIsActive(vm))
++            virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
+         goto cleanup;
+     }
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        goto cleanup;
+ 
+     if (async) {
+         ret = 0;
+@@ -4882,7 +4911,6 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+ {
+     int idx, ret = -1;
+     virDomainControllerDefPtr detach = NULL;
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+ 
+     if ((idx = virDomainControllerFind(vm->def,
+                                        dev->data.controller->type,
+@@ -4928,12 +4956,7 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
+-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+-        goto cleanup;
+-    }
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
++    if (qemuDomainDeleteDevice(vm, detach->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+@@ -4950,14 +4973,11 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+ }
+ 
+ static int
+-qemuDomainDetachHostPCIDevice(virQEMUDriverPtr driver,
+-                              virDomainObjPtr vm,
++qemuDomainDetachHostPCIDevice(virDomainObjPtr vm,
+                               virDomainHostdevDefPtr detach,
+                               bool async)
+ {
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+     virDomainHostdevSubsysPCIPtr pcisrc = &detach->source.subsys.u.pci;
+-    int ret;
+ 
+     if (qemuIsMultiFunctionDevice(vm->def, detach->info)) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+@@ -4970,23 +4990,14 @@ qemuDomainDetachHostPCIDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, detach->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    ret = qemuMonitorDelDevice(priv->mon, detach->info->alias);
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        ret = -1;
+-
+-    return ret;
++    return qemuDomainDeleteDevice(vm, detach->info->alias);
+ }
+ 
+ static int
+-qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver,
+-                              virDomainObjPtr vm,
++qemuDomainDetachHostUSBDevice(virDomainObjPtr vm,
+                               virDomainHostdevDefPtr detach,
+                               bool async)
+ {
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+-    int ret;
+-
+     if (!detach->info->alias) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+                        "%s", _("device cannot be detached without a device alias"));
+@@ -4996,23 +5007,14 @@ qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, detach->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    ret = qemuMonitorDelDevice(priv->mon, detach->info->alias);
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        ret = -1;
+-
+-    return ret;
++    return qemuDomainDeleteDevice(vm, detach->info->alias);
+ }
+ 
+ static int
+-qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver,
+-                               virDomainObjPtr vm,
++qemuDomainDetachHostSCSIDevice(virDomainObjPtr vm,
+                                virDomainHostdevDefPtr detach,
+                                bool async)
+ {
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+-    int ret = -1;
+-
+     if (!detach->info->alias) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+                        "%s", _("device cannot be detached without a device alias"));
+@@ -5022,24 +5024,14 @@ qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, detach->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    ret = qemuMonitorDelDevice(priv->mon, detach->info->alias);
+-
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        return -1;
+-
+-    return ret;
++    return qemuDomainDeleteDevice(vm, detach->info->alias);
+ }
+ 
+ static int
+-qemuDomainDetachSCSIVHostDevice(virQEMUDriverPtr driver,
+-                                virDomainObjPtr vm,
++qemuDomainDetachSCSIVHostDevice(virDomainObjPtr vm,
+                                 virDomainHostdevDefPtr detach,
+                                 bool async)
+ {
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+-    int ret = -1;
+-
+     if (!detach->info->alias) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+                        "%s", _("device cannot be detached without a device alias"));
+@@ -5049,25 +5041,15 @@ qemuDomainDetachSCSIVHostDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, detach->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    ret = qemuMonitorDelDevice(priv->mon, detach->info->alias);
+-
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        return -1;
+-
+-    return ret;
++    return qemuDomainDeleteDevice(vm, detach->info->alias);
+ }
+ 
+ 
+ static int
+-qemuDomainDetachMediatedDevice(virQEMUDriverPtr driver,
+-                               virDomainObjPtr vm,
++qemuDomainDetachMediatedDevice(virDomainObjPtr vm,
+                                virDomainHostdevDefPtr detach,
+                                bool async)
+ {
+-    int ret = -1;
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+-
+     if (!detach->info->alias) {
+         virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                        _("device cannot be detached without a device alias"));
+@@ -5077,12 +5059,7 @@ qemuDomainDetachMediatedDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, detach->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    ret = qemuMonitorDelDevice(priv->mon, detach->info->alias);
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        ret = -1;
+-
+-    return ret;
++    return qemuDomainDeleteDevice(vm, detach->info->alias);
+ }
+ 
+ 
+@@ -5099,19 +5076,19 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
+ 
+     switch (detach->source.subsys.type) {
+     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
+-        ret = qemuDomainDetachHostPCIDevice(driver, vm, detach, async);
++        ret = qemuDomainDetachHostPCIDevice(vm, detach, async);
+         break;
+     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
+-        ret = qemuDomainDetachHostUSBDevice(driver, vm, detach, async);
++        ret = qemuDomainDetachHostUSBDevice(vm, detach, async);
+         break;
+     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
+-        ret = qemuDomainDetachHostSCSIDevice(driver, vm, detach, async);
++        ret = qemuDomainDetachHostSCSIDevice(vm, detach, async);
+         break;
+     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
+-        ret = qemuDomainDetachSCSIVHostDevice(driver, vm, detach, async);
++        ret = qemuDomainDetachSCSIVHostDevice(vm, detach, async);
+         break;
+     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+-        ret = qemuDomainDetachMediatedDevice(driver, vm, detach, async);
++        ret = qemuDomainDetachMediatedDevice(vm, detach, async);
+         break;
+     default:
+         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+@@ -5228,7 +5205,6 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
+     int ret = -1;
+     ssize_t idx = -1;
+     virDomainShmemDefPtr shmem = NULL;
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+ 
+     if ((idx = virDomainShmemDefFind(vm->def, dev)) < 0) {
+         virReportError(VIR_ERR_DEVICE_MISSING,
+@@ -5257,12 +5233,7 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &shmem->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, shmem->info.alias) < 0) {
+-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+-        goto cleanup;
+-    }
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
++    if (qemuDomainDeleteDevice(vm, shmem->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+@@ -5287,7 +5258,6 @@ qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
+ {
+     int ret = -1;
+     virDomainWatchdogDefPtr watchdog = vm->def->watchdog;
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+ 
+     if (!watchdog) {
+         virReportError(VIR_ERR_DEVICE_MISSING, "%s",
+@@ -5318,12 +5288,7 @@ qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &watchdog->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, watchdog->info.alias) < 0) {
+-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+-        goto cleanup;
+-    }
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
++    if (qemuDomainDeleteDevice(vm, watchdog->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+@@ -5347,7 +5312,6 @@ qemuDomainDetachRedirdevDevice(virQEMUDriverPtr driver,
+                                bool async)
+ {
+     int ret = -1;
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+     virDomainRedirdevDefPtr tmpRedirdevDef;
+     ssize_t idx;
+ 
+@@ -5368,12 +5332,7 @@ qemuDomainDetachRedirdevDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &tmpRedirdevDef->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, tmpRedirdevDef->info.alias) < 0) {
+-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+-        goto cleanup;
+-    }
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
++    if (qemuDomainDeleteDevice(vm, tmpRedirdevDef->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+@@ -5398,7 +5357,6 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+ {
+     int detachidx, ret = -1;
+     virDomainNetDefPtr detach = NULL;
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+ 
+     if ((detachidx = virDomainNetFindIdx(vm->def, dev->data.net)) < 0)
+         goto cleanup;
+@@ -5439,15 +5397,11 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
+-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-            goto cleanup;
+-        virDomainAuditNet(vm, detach, NULL, "detach", false);
++    if (qemuDomainDeleteDevice(vm, detach->info.alias) < 0) {
++        if (virDomainObjIsActive(vm))
++            virDomainAuditNet(vm, detach, NULL, "detach", false);
+         goto cleanup;
+     }
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        goto cleanup;
+ 
+     if (async) {
+         ret = 0;
+@@ -5610,20 +5564,19 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+     if (!async && !guestfwd)
+         qemuDomainMarkDeviceForRemoval(vm, &tmpChr->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+     if (guestfwd) {
+-        if (qemuMonitorRemoveNetdev(priv->mon, tmpChr->info.alias) < 0) {
+-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
++        int rc;
++        qemuDomainObjEnterMonitor(driver, vm);
++        rc = qemuMonitorRemoveNetdev(priv->mon, tmpChr->info.alias);
++        if (qemuDomainObjExitMonitor(driver, vm) < 0)
++            rc = -1;
++
++        if (rc < 0)
+             goto cleanup;
+-        }
+     } else {
+-        if (qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
+-            ignore_value(qemuDomainObjExitMonitor(driver, vm));
++        if (qemuDomainDeleteDevice(vm, tmpChr->info.alias) < 0)
+             goto cleanup;
+-        }
+     }
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        goto cleanup;
+ 
+     if (guestfwd) {
+         ret = qemuDomainRemoveChrDevice(driver, vm, tmpChr, false);
+@@ -5647,10 +5600,8 @@ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
+                           virDomainRNGDefPtr rng,
+                           bool async)
+ {
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+     ssize_t idx;
+     virDomainRNGDefPtr tmpRNG;
+-    int rc;
+     int ret = -1;
+ 
+     if ((idx = virDomainRNGFind(vm->def, rng)) < 0) {
+@@ -5672,9 +5623,7 @@ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &tmpRNG->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    rc = qemuMonitorDelDevice(priv->mon, tmpRNG->info.alias);
+-    if (qemuDomainObjExitMonitor(driver, vm) || rc < 0)
++    if (qemuDomainDeleteDevice(vm, tmpRNG->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+@@ -5697,10 +5646,8 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
+                              virDomainMemoryDefPtr memdef,
+                              bool async)
+ {
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+     virDomainMemoryDefPtr mem;
+     int idx;
+-    int rc;
+     int ret = -1;
+ 
+     qemuDomainMemoryDeviceAlignSize(vm->def, memdef);
+@@ -5724,9 +5671,7 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &mem->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    rc = qemuMonitorDelDevice(priv->mon, mem->info.alias);
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
++    if (qemuDomainDeleteDevice(vm, mem->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+@@ -5831,15 +5776,9 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver,
+ 
+     qemuDomainMarkDeviceAliasForRemoval(vm, vcpupriv->alias);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-
+-    rc = qemuMonitorDelDevice(qemuDomainGetMonitor(vm), vcpupriv->alias);
+-
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        goto cleanup;
+-
+-    if (rc < 0) {
+-        virDomainAuditVcpu(vm, oldvcpus, oldvcpus - nvcpus, "update", false);
++    if (qemuDomainDeleteDevice(vm, vcpupriv->alias) < 0) {
++        if (virDomainObjIsActive(vm))
++            virDomainAuditVcpu(vm, oldvcpus, oldvcpus - nvcpus, "update", false);
+         goto cleanup;
+     }
+ 
+@@ -6409,8 +6348,6 @@ qemuDomainDetachInputDevice(virDomainObjPtr vm,
+                             virDomainInputDefPtr def,
+                             bool async)
+ {
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+-    virQEMUDriverPtr driver = priv->driver;
+     virDomainInputDefPtr input;
+     int ret = -1;
+     int idx;
+@@ -6440,12 +6377,7 @@ qemuDomainDetachInputDevice(virDomainObjPtr vm,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &input->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, input->info.alias) < 0) {
+-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+-        goto cleanup;
+-    }
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
++    if (qemuDomainDeleteDevice(vm, input->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+@@ -6467,8 +6399,6 @@ qemuDomainDetachVsockDevice(virDomainObjPtr vm,
+                             virDomainVsockDefPtr dev,
+                             bool async)
+ {
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+-    virQEMUDriverPtr driver = priv->driver;
+     virDomainVsockDefPtr vsock = vm->def->vsock;
+     int ret = -1;
+ 
+@@ -6483,12 +6413,7 @@ qemuDomainDetachVsockDevice(virDomainObjPtr vm,
+     if (!async)
+         qemuDomainMarkDeviceForRemoval(vm, &vsock->info);
+ 
+-    qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, vsock->info.alias) < 0) {
+-        ignore_value(qemuDomainObjExitMonitor(driver, vm));
+-        goto cleanup;
+-    }
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
++    if (qemuDomainDeleteDevice(vm, vsock->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-Properly-check-for-qemuMonitorDelDevice-retval.patch b/SOURCES/libvirt-qemu_hotplug-Properly-check-for-qemuMonitorDelDevice-retval.patch
new file mode 100644
index 0000000..96a707d
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-Properly-check-for-qemuMonitorDelDevice-retval.patch
@@ -0,0 +1,63 @@
+From b947ae5274f9a4227f81f13a7973958daeb8d922 Mon Sep 17 00:00:00 2001
+Message-Id: <b947ae5274f9a4227f81f13a7973958daeb8d922@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:24 -0400
+Subject: [PATCH] qemu_hotplug: Properly check for qemuMonitorDelDevice retval
+
+Luckily, the function returns only 0 or -1 so all the checks work
+as expected. Anyway, our rule is that a positive value means
+success so if the function ever returns a positive value these
+checks will fail. Make them check for a negative value properly.
+
+At the same time fix qemuDomainDetachExtensionDevice() reval
+check. It is somewhat related to the aim of this patch.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit 8b71b0c727398469b95d025e3ec92b881969412f)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+
+Conflicts: src/qemu/qemu_hotplug.c - qemuDomainDetachExtensionDevice() was added
+                           upstream
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-13-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index b5ccaf4021..963b87f798 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4929,7 +4929,7 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+         qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+ 
+     qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, detach->info.alias)) {
++    if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
+         ignore_value(qemuDomainObjExitMonitor(driver, vm));
+         goto cleanup;
+     }
+@@ -6441,7 +6441,7 @@ qemuDomainDetachInputDevice(virDomainObjPtr vm,
+         qemuDomainMarkDeviceForRemoval(vm, &input->info);
+ 
+     qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, input->info.alias)) {
++    if (qemuMonitorDelDevice(priv->mon, input->info.alias) < 0) {
+         ignore_value(qemuDomainObjExitMonitor(driver, vm));
+         goto cleanup;
+     }
+@@ -6484,7 +6484,7 @@ qemuDomainDetachVsockDevice(virDomainObjPtr vm,
+         qemuDomainMarkDeviceForRemoval(vm, &vsock->info);
+ 
+     qemuDomainObjEnterMonitor(driver, vm);
+-    if (qemuMonitorDelDevice(priv->mon, vsock->info.alias)) {
++    if (qemuMonitorDelDevice(priv->mon, vsock->info.alias) < 0) {
+         ignore_value(qemuDomainObjExitMonitor(driver, vm));
+         goto cleanup;
+     }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-audit-all-auditable-device-types-in-qemuDomainRemoveAuditDevice.patch b/SOURCES/libvirt-qemu_hotplug-audit-all-auditable-device-types-in-qemuDomainRemoveAuditDevice.patch
new file mode 100644
index 0000000..e90a6cf
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-audit-all-auditable-device-types-in-qemuDomainRemoveAuditDevice.patch
@@ -0,0 +1,72 @@
+From e751617f83b01eab5799049bc080ab893ae213d9 Mon Sep 17 00:00:00 2001
+Message-Id: <e751617f83b01eab5799049bc080ab893ae213d9@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:50 -0400
+Subject: [PATCH] qemu_hotplug: audit *all* auditable device types in
+ qemuDomainRemoveAuditDevice
+
+Although all hotpluggable devices other than lease, controller,
+watchdof, and vsock can be audited, and *are* audited when an unplug
+is successful, only disk, net, and hostdev were actually being audited
+on failure.
+
+This patch corrects that omission.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 444c5e7c432961c7ecd59b2627dfb69ce787a22a)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-39-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 27 ++++++++++++++++++---------
+ 1 file changed, 18 insertions(+), 9 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 482111c46e..390fc36cf6 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4665,19 +4665,28 @@ qemuDomainRemoveAuditDevice(virDomainObjPtr vm,
+     case VIR_DOMAIN_DEVICE_HOSTDEV:
+         virDomainAuditHostdev(vm, detach->data.hostdev, "detach", success);
+         break;
+-
+     case VIR_DOMAIN_DEVICE_INPUT:
++        virDomainAuditInput(vm, detach->data.input, "detach", success);
++        break;
+     case VIR_DOMAIN_DEVICE_CHR:
++        virDomainAuditChardev(vm, detach->data.chr, NULL, "detach", success);
++        break;
+     case VIR_DOMAIN_DEVICE_RNG:
+-    case VIR_DOMAIN_DEVICE_MEMORY:
+-    case VIR_DOMAIN_DEVICE_SHMEM:
+-    case VIR_DOMAIN_DEVICE_REDIRDEV:
+-       /*
+-        * These devices are supposed to be audited, but current code
+-        * doesn't audit on failure to remove the device.
+-        */
+-       break;
++        virDomainAuditRNG(vm, detach->data.rng, NULL, "detach", success);
++        break;
++    case VIR_DOMAIN_DEVICE_MEMORY: {
++        unsigned long long oldmem = virDomainDefGetMemoryTotal(vm->def);
++        unsigned long long newmem = oldmem - detach->data.memory->size;
+ 
++        virDomainAuditMemory(vm, oldmem, newmem, "update", success);
++        break;
++    }
++    case VIR_DOMAIN_DEVICE_SHMEM:
++        virDomainAuditShmem(vm, detach->data.shmem, "detach", success);
++        break;
++    case VIR_DOMAIN_DEVICE_REDIRDEV:
++        virDomainAuditRedirdev(vm, detach->data.redirdev, "detach", success);
++        break;
+ 
+     case VIR_DOMAIN_DEVICE_LEASE:
+     case VIR_DOMAIN_DEVICE_CONTROLLER:
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-consolidate-all-common-detach-code-in-qemuDomainDetachDeviceLive.patch b/SOURCES/libvirt-qemu_hotplug-consolidate-all-common-detach-code-in-qemuDomainDetachDeviceLive.patch
new file mode 100644
index 0000000..66610ac
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-consolidate-all-common-detach-code-in-qemuDomainDetachDeviceLive.patch
@@ -0,0 +1,807 @@
+From d16f6dc87b5122c6d14ffb52a7276aef8f14049c Mon Sep 17 00:00:00 2001
+Message-Id: <d16f6dc87b5122c6d14ffb52a7276aef8f14049c@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:51 -0400
+Subject: [PATCH] qemu_hotplug: consolidate all common detach code in
+ qemuDomainDetachDeviceLive
+
+Now that all the qemuDomainDetachPrep*() functions look nearly
+identical at the end, we can put one copy of that identical code in
+qemuDomainDetachDeviceLive() at the point after the individual prep
+functions have been called, and remove the duplicated code from all
+the prep functions. The code to locate the target "detach" device
+based on the "match" device remains, as do all device-type-specific
+validations.
+
+Unfortunately there are a few things going on at once in this patch,
+which makes it a bit more difficult to follow than the others; it was
+just impossible to do the changes in stages and still have a
+buildable/testable tree at each step.
+
+The other changes of note:
+
+* The individual prep functions no longer need their driver or async
+  args, so those are removed, as are the local "ret" variables, since
+  in all cases the functions just directly return -1 or 0.
+
+* Some of the prep functions were checking for a valid alias and/or
+  for attempts to detach a multifunction PCI device, but not all. In
+  fact, both checks are valid (or at least harmless) for *all* device
+  types, so they are removed from the prep functions, and done a
+  single time in the common function.
+
+  (any attempts to *create* an alias when there isn't one has been
+  removed, since that is doomed to failure anyway; the only way the
+  device wouldn't have an alias is if 1) the domain was created by
+  calling virsh qemu-attach to attach an existing qemu process to
+  libvirt, and 2) the qemu command that started said process used "old
+  style" arguments for creating devices that didn't have any device
+  ids. Even if we constructed a device id for one of these devices,
+  qemu wouldn't recognize it in the device_del command anyway, so we
+  may as well fail earlier with "device missing alias" rather than
+  failing later with "couldn't delete device net0".)
+
+* Only one type of device has shutdown code that must not be called
+  until after *all* validation of the device is done (including
+  checking for multifunction PCI and valid alias, which is done in the
+  toplevel common code). For this reason, the Net function has been
+  split in two, with the 2nd half (qemuDomainDetachShutdownNet())
+  called from the common function, right before sending the delete
+  command to qemu.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit dd60bd62d3ad60b564168f56b05f4c9354af4bd3)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-40-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 480 ++++++++++++----------------------------
+ 1 file changed, 142 insertions(+), 338 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 390fc36cf6..27d09d173b 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4650,7 +4650,7 @@ qemuDomainRemoveRedirdevDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-static void ATTRIBUTE_UNUSED
++static void
+ qemuDomainRemoveAuditDevice(virDomainObjPtr vm,
+                             virDomainDeviceDefPtr detach,
+                             bool success)
+@@ -4902,15 +4902,12 @@ qemuFindDisk(virDomainDefPtr def, const char *dst)
+ }
+ 
+ static int
+-qemuDomainDetachPrepDisk(virQEMUDriverPtr driver,
+-                         virDomainObjPtr vm,
++qemuDomainDetachPrepDisk(virDomainObjPtr vm,
+                          virDomainDiskDefPtr match,
+-                         virDomainDiskDefPtr *detach,
+-                         bool async)
++                         virDomainDiskDefPtr *detach)
+ {
+     virDomainDiskDefPtr disk;
+     int idx;
+-    int ret = -1;
+ 
+     if ((idx = qemuFindDisk(vm->def, match->dst)) < 0) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+@@ -4962,34 +4959,7 @@ qemuDomainDetachPrepDisk(virQEMUDriverPtr driver,
+     if (qemuDomainDiskBlockJobIsActive(disk))
+         return -1;
+ 
+-    if (disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO &&
+-        qemuIsMultiFunctionDevice(vm->def, &disk->info)) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("cannot hot unplug multifunction PCI device: %s"),
+-                       disk->dst);
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &disk->info);
+-
+-    if (qemuDomainDeleteDevice(vm, disk->info.alias) < 0) {
+-        if (virDomainObjIsActive(vm))
+-            virDomainAuditDisk(vm, disk->src, NULL, "detach", false);
+-        goto cleanup;
+-    }
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveDiskDevice(driver, vm, disk);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
++    return 0;
+ }
+ 
+ 
+@@ -5054,13 +5024,11 @@ static bool qemuDomainControllerIsBusy(virDomainObjPtr vm,
+ }
+ 
+ static int
+-qemuDomainDetachPrepController(virQEMUDriverPtr driver,
+-                               virDomainObjPtr vm,
++qemuDomainDetachPrepController(virDomainObjPtr vm,
+                                virDomainControllerDefPtr match,
+-                               virDomainControllerDefPtr *detach,
+-                               bool async)
++                               virDomainControllerDefPtr *detach)
+ {
+-    int idx, ret = -1;
++    int idx;
+     virDomainControllerDefPtr controller = NULL;
+ 
+     if (match->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
+@@ -5075,50 +5043,26 @@ qemuDomainDetachPrepController(virQEMUDriverPtr driver,
+                        _("controller %s:%d not found"),
+                        virDomainControllerTypeToString(match->type),
+                        match->idx);
+-        goto cleanup;
++        return -1;
+     }
+ 
+     *detach = controller = vm->def->controllers[idx];
+ 
+-    if (qemuIsMultiFunctionDevice(vm->def, &controller->info)) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       "%s", _("cannot hot unplug multifunction PCI device"));
+-        goto cleanup;
+-    }
+-
+     if (qemuDomainControllerIsBusy(vm, controller)) {
+         virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                        _("device cannot be detached: device is busy"));
+-        goto cleanup;
++        return -1;
+     }
+ 
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &controller->info);
+-
+-    if (qemuDomainDeleteDevice(vm, controller->info.alias) < 0)
+-        goto cleanup;
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveControllerDevice(driver, vm, controller);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
++    return 0;
+ }
+ 
+ 
+ /* search for a hostdev matching dev and detach it */
+ static int
+-qemuDomainDetachPrepHostdev(virQEMUDriverPtr driver,
+-                            virDomainObjPtr vm,
++qemuDomainDetachPrepHostdev(virDomainObjPtr vm,
+                             virDomainHostdevDefPtr match,
+-                            virDomainHostdevDefPtr *detach,
+-                            bool async)
++                            virDomainHostdevDefPtr *detach)
+ {
+     virDomainHostdevSubsysPtr subsys = &match->source.subsys;
+     virDomainHostdevSubsysUSBPtr usbsrc = &subsys->u.usb;
+@@ -5127,7 +5071,6 @@ qemuDomainDetachPrepHostdev(virQEMUDriverPtr driver,
+     virDomainHostdevSubsysMediatedDevPtr mdevsrc = &subsys->u.mdev;
+     virDomainHostdevDefPtr hostdev = NULL;
+     int idx;
+-    int ret = -1;
+ 
+     if (match->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
+         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+@@ -5190,54 +5133,15 @@ qemuDomainDetachPrepHostdev(virQEMUDriverPtr driver,
+         return -1;
+     }
+ 
+-    if (qemuIsMultiFunctionDevice(vm->def, hostdev->info)) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("cannot hot unplug multifunction PCI device with guest address: "
+-                         "%.4x:%.2x:%.2x.%.1x"),
+-                       hostdev->info->addr.pci.domain, hostdev->info->addr.pci.bus,
+-                       hostdev->info->addr.pci.slot, hostdev->info->addr.pci.function);
+-        return -1;
+-    }
+-
+-    if (!hostdev->info->alias) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       "%s", _("device cannot be detached without a device alias"));
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, hostdev->info);
+-
+-    if (qemuDomainDeleteDevice(vm, hostdev->info->alias) < 0) {
+-        if (virDomainObjIsActive(vm))
+-            virDomainAuditHostdev(vm, hostdev, "detach", false);
+-        goto cleanup;
+-    }
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveHostDevice(driver, vm, hostdev);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-
+-    return ret;
+-
++    return 0;
+ }
+ 
+ 
+ static int
+-qemuDomainDetachPrepShmem(virQEMUDriverPtr driver,
+-                          virDomainObjPtr vm,
++qemuDomainDetachPrepShmem(virDomainObjPtr vm,
+                           virDomainShmemDefPtr match,
+-                          virDomainShmemDefPtr *detach,
+-                          bool async)
++                          virDomainShmemDefPtr *detach)
+ {
+-    int ret = -1;
+     ssize_t idx = -1;
+     virDomainShmemDefPtr shmem = NULL;
+ 
+@@ -5265,34 +5169,15 @@ qemuDomainDetachPrepShmem(virQEMUDriverPtr driver,
+         return -1;
+     }
+ 
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &shmem->info);
+-
+-    if (qemuDomainDeleteDevice(vm, shmem->info.alias) < 0)
+-        goto cleanup;
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveShmemDevice(driver, vm, shmem);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
++    return 0;
+ }
+ 
+ 
+ static int
+-qemuDomainDetachPrepWatchdog(virQEMUDriverPtr driver,
+-                             virDomainObjPtr vm,
++qemuDomainDetachPrepWatchdog(virDomainObjPtr vm,
+                              virDomainWatchdogDefPtr match,
+-                             virDomainWatchdogDefPtr *detach,
+-                             bool async)
++                             virDomainWatchdogDefPtr *detach)
+ {
+-    int ret = -1;
+     virDomainWatchdogDefPtr watchdog;
+ 
+     *detach = watchdog = vm->def->watchdog;
+@@ -5323,34 +5208,15 @@ qemuDomainDetachPrepWatchdog(virQEMUDriverPtr driver,
+         return -1;
+     }
+ 
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &watchdog->info);
+-
+-    if (qemuDomainDeleteDevice(vm, watchdog->info.alias) < 0)
+-        goto cleanup;
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveWatchdog(driver, vm, watchdog);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
++    return 0;
+ }
+ 
+ 
+ static int
+-qemuDomainDetachPrepRedirdev(virQEMUDriverPtr driver,
+-                             virDomainObjPtr vm,
++qemuDomainDetachPrepRedirdev(virDomainObjPtr vm,
+                              virDomainRedirdevDefPtr match,
+-                             virDomainRedirdevDefPtr *detach,
+-                             bool async)
++                             virDomainRedirdevDefPtr *detach)
+ {
+-    int ret = -1;
+     virDomainRedirdevDefPtr redirdev;
+     ssize_t idx;
+ 
+@@ -5362,59 +5228,41 @@ qemuDomainDetachPrepRedirdev(virQEMUDriverPtr driver,
+ 
+     *detach = redirdev = vm->def->redirdevs[idx];
+ 
+-    if (!redirdev->info.alias) {
+-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+-                       _("alias not set for redirdev device"));
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &redirdev->info);
+-
+-    if (qemuDomainDeleteDevice(vm, redirdev->info.alias) < 0)
+-        goto cleanup;
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveRedirdevDevice(driver, vm, redirdev);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
++    return 0;
+ }
+ 
+ 
+ static int
+-qemuDomainDetachPrepNet(virQEMUDriverPtr driver,
+-                        virDomainObjPtr vm,
++qemuDomainDetachPrepNet(virDomainObjPtr vm,
+                         virDomainNetDefPtr match,
+-                        virDomainNetDefPtr *detach,
+-                        bool async)
++                        virDomainNetDefPtr *detach)
+ {
+-    int detachidx, ret = -1;
++    int detachidx;
+     virDomainNetDefPtr net = NULL;
+ 
+     if ((detachidx = virDomainNetFindIdx(vm->def, match)) < 0)
+-        goto cleanup;
++        return -1;
+ 
+     *detach = net = vm->def->nets[detachidx];
+ 
+-    if (qemuIsMultiFunctionDevice(vm->def, &net->info)) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("cannot hot unplug multifunction PCI device: %s"),
+-                       net->ifname);
+-        goto cleanup;
+-    }
++    return 0;
++}
+ 
+-    if (!net->info.alias) {
+-        if (qemuAssignDeviceNetAlias(vm->def, net, -1) < 0)
+-            goto cleanup;
+-    }
+ 
++static void
++qemuDomainDetachShutdownNet(virDomainNetDefPtr net)
++{
++/*
++ * These operations are in a separate function from
++ * qemuDomainDetachPrepNet() because they can't be done until after
++ * we've validated that this device really can be removed - in
++ * particular we need to check for multifunction PCI devices and
++ * presence of a device alias, which isn't done until *after* the
++ * return from qemuDomainDetachPrepNet(). Since we've already passed
++ * the "point of no return", we ignore any errors, and trudge ahead
++ * with shutting down and detaching the device even if there is an
++ * error in one of these functions.
++ */
+     if (virDomainNetGetActualBandwidth(net) &&
+         virNetDevSupportBandwidth(virDomainNetGetActualType(net)) &&
+         virNetDevBandwidthClear(net->ifname) < 0)
+@@ -5426,32 +5274,6 @@ qemuDomainDetachPrepNet(virQEMUDriverPtr driver,
+      * the parent device offline)
+      */
+     ignore_value(qemuInterfaceStopDevice(net));
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &net->info);
+-
+-    if (qemuDomainDeleteDevice(vm, net->info.alias) < 0) {
+-        if (virDomainObjIsActive(vm)) {
+-            /* the audit message has a different format for hostdev network devices */
+-            if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_HOSTDEV)
+-                virDomainAuditHostdev(vm, virDomainNetGetActualHostdev(net), "detach", false);
+-            else
+-                virDomainAuditNet(vm, net, NULL, "detach", false);
+-        }
+-        goto cleanup;
+-    }
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveNetDevice(driver, vm, net);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
+ }
+ 
+ 
+@@ -5514,15 +5336,12 @@ qemuDomainDetachDeviceChr(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainDetachPrepRNG(virQEMUDriverPtr driver,
+-                        virDomainObjPtr vm,
++qemuDomainDetachPrepRNG(virDomainObjPtr vm,
+                         virDomainRNGDefPtr match,
+-                        virDomainRNGDefPtr *detach,
+-                        bool async)
++                        virDomainRNGDefPtr *detach)
+ {
+     ssize_t idx;
+     virDomainRNGDefPtr rng;
+-    int ret = -1;
+ 
+     if ((idx = virDomainRNGFind(vm->def, match)) < 0) {
+         virReportError(VIR_ERR_DEVICE_MISSING,
+@@ -5534,42 +5353,17 @@ qemuDomainDetachPrepRNG(virQEMUDriverPtr driver,
+ 
+     *detach = rng = vm->def->rngs[idx];
+ 
+-    if (!rng->info.alias) {
+-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+-                       _("alias not set for RNG device"));
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &rng->info);
+-
+-    if (qemuDomainDeleteDevice(vm, rng->info.alias) < 0)
+-        goto cleanup;
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveRNGDevice(driver, vm, rng);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
++    return 0;
+ }
+ 
+ 
+ static int
+-qemuDomainDetachPrepMemory(virQEMUDriverPtr driver,
+-                           virDomainObjPtr vm,
++qemuDomainDetachPrepMemory(virDomainObjPtr vm,
+                            virDomainMemoryDefPtr match,
+-                           virDomainMemoryDefPtr *detach,
+-                           bool async)
++                           virDomainMemoryDefPtr *detach)
+ {
+     virDomainMemoryDefPtr mem;
+     int idx;
+-    int ret = -1;
+ 
+     qemuDomainMemoryDeviceAlignSize(vm->def, match);
+ 
+@@ -5583,40 +5377,16 @@ qemuDomainDetachPrepMemory(virQEMUDriverPtr driver,
+ 
+     *detach = mem = vm->def->mems[idx];
+ 
+-    if (!mem->info.alias) {
+-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+-                       _("alias for the memory device was not found"));
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &mem->info);
+-
+-    if (qemuDomainDeleteDevice(vm, mem->info.alias) < 0)
+-        goto cleanup;
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveMemoryDevice(driver, vm, mem);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
++    return 0;
+ }
+ 
+ 
+ static int
+ qemuDomainDetachPrepInput(virDomainObjPtr vm,
+                           virDomainInputDefPtr match,
+-                          virDomainInputDefPtr *detach,
+-                          bool async)
++                          virDomainInputDefPtr *detach)
+ {
+     virDomainInputDefPtr input;
+-    int ret = -1;
+     int idx;
+ 
+     if ((idx = virDomainInputDefFind(vm->def, match)) < 0) {
+@@ -5641,35 +5411,16 @@ qemuDomainDetachPrepInput(virDomainObjPtr vm,
+         break;
+     }
+ 
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &input->info);
+-
+-    if (qemuDomainDeleteDevice(vm, input->info.alias) < 0)
+-        goto cleanup;
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveInputDevice(vm, input);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
++    return 0;
+ }
+ 
+ 
+ static int
+ qemuDomainDetachPrepVsock(virDomainObjPtr vm,
+                           virDomainVsockDefPtr match,
+-                          virDomainVsockDefPtr *detach,
+-                          bool async)
++                          virDomainVsockDefPtr *detach)
+ {
+     virDomainVsockDefPtr vsock;
+-    int ret = -1;
+-
+ 
+     *detach = vsock = vm->def->vsock;
+     if (!vsock ||
+@@ -5679,23 +5430,7 @@ qemuDomainDetachPrepVsock(virDomainObjPtr vm,
+         return -1;
+     }
+ 
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &vsock->info);
+-
+-    if (qemuDomainDeleteDevice(vm, vsock->info.alias) < 0)
+-        goto cleanup;
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveVsockDevice(vm, vsock);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
++    return 0;
+ }
+ 
+ 
+@@ -5730,6 +5465,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+                            bool async)
+ {
+     virDomainDeviceDef detach = { .type = match->type };
++    virDomainDeviceInfoPtr info = NULL;
+     int ret = -1;
+ 
+     switch ((virDomainDeviceType)match->type) {
+@@ -5752,68 +5488,68 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+          * assure it is okay to detach the device.
+          */
+     case VIR_DOMAIN_DEVICE_DISK:
+-        if (qemuDomainDetachPrepDisk(driver, vm, match->data.disk,
+-                                     &detach.data.disk, async) < 0) {
++        if (qemuDomainDetachPrepDisk(vm, match->data.disk,
++                                     &detach.data.disk) < 0) {
+             return -1;
+         }
+         break;
+     case VIR_DOMAIN_DEVICE_CONTROLLER:
+-        if (qemuDomainDetachPrepController(driver, vm, match->data.controller,
+-                                           &detach.data.controller, async) < 0) {
++        if (qemuDomainDetachPrepController(vm, match->data.controller,
++                                           &detach.data.controller) < 0) {
+             return -1;
+         }
+         break;
+     case VIR_DOMAIN_DEVICE_NET:
+-        if (qemuDomainDetachPrepNet(driver, vm, match->data.net,
+-                                    &detach.data.net, async) < 0) {
++        if (qemuDomainDetachPrepNet(vm, match->data.net,
++                                    &detach.data.net) < 0) {
+             return -1;
+         }
+         break;
+     case VIR_DOMAIN_DEVICE_HOSTDEV:
+-        if (qemuDomainDetachPrepHostdev(driver, vm, match->data.hostdev,
+-                                        &detach.data.hostdev, async) < 0) {
++        if (qemuDomainDetachPrepHostdev(vm, match->data.hostdev,
++                                        &detach.data.hostdev) < 0) {
+             return -1;
+         }
+         break;
+     case VIR_DOMAIN_DEVICE_RNG:
+-        if (qemuDomainDetachPrepRNG(driver, vm, match->data.rng,
+-                                    &detach.data.rng, async) < 0) {
++        if (qemuDomainDetachPrepRNG(vm, match->data.rng,
++                                    &detach.data.rng) < 0) {
+             return -1;
+         }
+         break;
+     case VIR_DOMAIN_DEVICE_MEMORY:
+-        if (qemuDomainDetachPrepMemory(driver, vm, match->data.memory,
+-                                       &detach.data.memory, async) < 0) {
++        if (qemuDomainDetachPrepMemory(vm, match->data.memory,
++                                       &detach.data.memory) < 0) {
+             return -1;
+         }
+         break;
+     case VIR_DOMAIN_DEVICE_SHMEM:
+-        if (qemuDomainDetachPrepShmem(driver, vm, match->data.shmem,
+-                                      &detach.data.shmem, async) < 0) {
++        if (qemuDomainDetachPrepShmem(vm, match->data.shmem,
++                                      &detach.data.shmem) < 0) {
+             return -1;
+         }
+         break;
+     case VIR_DOMAIN_DEVICE_WATCHDOG:
+-        if (qemuDomainDetachPrepWatchdog(driver, vm, match->data.watchdog,
+-                                         &detach.data.watchdog, async) < 0) {
++        if (qemuDomainDetachPrepWatchdog(vm, match->data.watchdog,
++                                         &detach.data.watchdog) < 0) {
+             return -1;
+         }
+         break;
+     case VIR_DOMAIN_DEVICE_INPUT:
+         if (qemuDomainDetachPrepInput(vm, match->data.input,
+-                                      &detach.data.input, async) < 0) {
++                                      &detach.data.input) < 0) {
+             return -1;
+         }
+         break;
+     case VIR_DOMAIN_DEVICE_REDIRDEV:
+-        if (qemuDomainDetachPrepRedirdev(driver, vm, match->data.redirdev,
+-                                         &detach.data.redirdev, async) < 0) {
++        if (qemuDomainDetachPrepRedirdev(vm, match->data.redirdev,
++                                         &detach.data.redirdev) < 0) {
+             return -1;
+         }
+         break;
+     case VIR_DOMAIN_DEVICE_VSOCK:
+         if (qemuDomainDetachPrepVsock(vm, match->data.vsock,
+-                                      &detach.data.vsock, async) < 0) {
++                                      &detach.data.vsock) < 0) {
+             return -1;
+         }
+         break;
+@@ -5837,7 +5573,75 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+         return -1;
+     }
+ 
+-    ret = 0;
++    /* "detach" now points to the actual device we want to detach */
++
++    if (!(info = virDomainDeviceGetInfo(&detach))) {
++        /*
++         * This should never happen, since all of the device types in
++         * the switch cases that end with a "break" instead of a
++         * return have a virDeviceInfo in them.
++         */
++        virReportError(VIR_ERR_INTERNAL_ERROR,
++                       _("device of type '%s' has no device info"),
++                       virDomainDeviceTypeToString(detach.type));
++        return -1;
++    }
++
++
++    /* Make generic validation checks common to all device types */
++
++    if (!info->alias) {
++        virReportError(VIR_ERR_INTERNAL_ERROR,
++                       _("Cannot detach %s device with no alias"),
++                       virDomainDeviceTypeToString(detach.type));
++        return -1;
++    }
++
++    if (qemuIsMultiFunctionDevice(vm->def, info)) {
++        virReportError(VIR_ERR_OPERATION_FAILED,
++                       _("cannot hot unplug %s device with multifunction PCI guest address: "
++                         "%.4x:%.2x:%.2x.%.1x"),
++                       virDomainDeviceTypeToString(detach.type),
++                       info->addr.pci.domain, info->addr.pci.bus,
++                       info->addr.pci.slot, info->addr.pci.function);
++        return -1;
++    }
++
++
++    /*
++     * Do any device-specific shutdown that should be
++     * done after all validation checks, but before issuing the qemu
++     * command to delete the device. For now, the only type of device
++     * that has such shutdown needs is the net device.
++     */
++    if (detach.type == VIR_DOMAIN_DEVICE_NET)
++        qemuDomainDetachShutdownNet(detach.data.net);
++
++
++    /*
++     * Issue the qemu monitor command to delete the device (based on
++     * its alias), and optionally wait a short time in case the
++     * DEVICE_DELETED event arrives from qemu right away.
++     */
++    if (!async)
++        qemuDomainMarkDeviceForRemoval(vm, info);
++
++    if (qemuDomainDeleteDevice(vm, info->alias) < 0) {
++        if (virDomainObjIsActive(vm))
++            qemuDomainRemoveAuditDevice(vm, &detach, false);
++        goto cleanup;
++    }
++
++    if (async) {
++        ret = 0;
++    } else {
++        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
++            ret = qemuDomainRemoveDevice(driver, vm, &detach);
++    }
++
++ cleanup:
++    if (!async)
++        qemuDomainResetDeviceRemoval(vm);
+ 
+     return ret;
+ }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-delay-sending-DEVICE_REMOVED-event-until-after-all-teardown.patch b/SOURCES/libvirt-qemu_hotplug-delay-sending-DEVICE_REMOVED-event-until-after-all-teardown.patch
new file mode 100644
index 0000000..369ae98
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-delay-sending-DEVICE_REMOVED-event-until-after-all-teardown.patch
@@ -0,0 +1,427 @@
+From ac1770917c5f6020ccb5b6247f3eeb9f50a67903 Mon Sep 17 00:00:00 2001
+Message-Id: <ac1770917c5f6020ccb5b6247f3eeb9f50a67903@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:53 -0400
+Subject: [PATCH] qemu_hotplug: delay sending DEVICE_REMOVED event until after
+ *all* teardown
+
+The VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event is sent after qemu has
+responded to a device_del command with a DEVICE_DELETED event. Before
+queuing the event, *some* of the final teardown of the device's
+trappings in libvirt is done, but not *all* of it. As a result, an
+application may receive and process the DEVICE_REMOVED event before
+libvirt has really finished with it.
+
+Usually this doesn't cause a problem, but it can - in the case of the
+bug report referenced below, vdsm is assigning a PCI device to a guest
+with managed='no', using livirt's virNodeDeviceDetachFlags() and
+virNodeDeviceReAttach() APIs. Immediately after receiving a
+DEVICE_REMOVED event from libvirt signalling that the device had been
+successfully unplugged, vdsm would cal virNodeDeviceReAttach() to
+unbind the device from vfio-pci and rebind it to the host driverm but
+because the event was received before libvirt had completely finished
+processing the removal, that device was still on the "activeDevs"
+list, and so virNodeDeviceReAttach() failed.
+
+Experimentation with additional debug logs proved that libvirt would
+always end up dispatching the DEVICE_REMOVED event before it had
+removed the device from activeDevs (with a *much* greater difference
+with managed='yes', since in that case the re-binding of the device
+occurred after queuing the device).
+
+Although the case of hostdev devices is the most extreme (since there
+is so much involved in tearing down the device), *all* device types
+suffer from the same problem - the DEVICE_REMOVED event is queued very
+early in the qemuDomainRemove*Device() function for all of them,
+resulting in a possibility of any application receiving the event
+before libvirt has really finished with the device.
+
+The solution is to save the device's alias (which is the only piece of
+info from the device object that is needed for the event) at the
+beginning of processing the device removal, and then queue the event
+as a final act before returning. Since all of the
+qemuDomainRemove*Device() functions (except
+qemuDomainRemoveChrDevice()) are now called exclusively from
+qemuDomainRemoveDevice() (which selects which of the subordinates to
+call in a switch statement based on the type of device), the shortest
+route to a solution is to doing the saving of alias, and later
+queueing of the event, in the higher level qemuDomainRemoveDevice(),
+and just completely remove the event-related code from all the
+subordinate functions.
+
+The single exception to this, as mentioned before, is
+qemuDomainRemoveChrDevice(), which is still called from somewhere
+other than qemuDomainRemoveDevice() (and has a separate arg used to
+trigger different behavior when the chr device has targetType ==
+GUESTFWD), so it must keep its original behavior intact, and must be
+treated differently by qemuDomainRemoveDevice() (similar to the way
+that qemuDomainDetachDeviceLive() treats chr and lease devices
+differently from all the others).
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 78b03a7770f1822458be3e0769538dfc92b34803)
+
+Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+
+Conflicts:
+  src/qemu/qemu_hotplug.c:
+    * some code around a removed event queuing had been
+      moved into a helper function upstream.
+
+    * upstream patch used VIR_AUTOFREE, which isn't in 4.5.0
+
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-42-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 145 +++++++++++++++++++---------------------
+ 1 file changed, 70 insertions(+), 75 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index ff88a827dd..103d3e59a7 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -3905,7 +3905,6 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
+ {
+     qemuDomainStorageSourcePrivatePtr diskPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src);
+     virDomainDeviceDef dev;
+-    virObjectEventPtr event;
+     size_t i;
+     const char *src = virDomainDiskGetSource(disk);
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+@@ -3972,9 +3971,6 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
+ 
+     virDomainAuditDisk(vm, disk->src, NULL, "detach", true);
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, disk->info.alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+-
+     if (prManaged && !prUsed)
+         qemuProcessKillManagedPRDaemon(vm);
+ 
+@@ -4003,19 +3999,14 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainRemoveControllerDevice(virQEMUDriverPtr driver,
+-                                 virDomainObjPtr vm,
++qemuDomainRemoveControllerDevice(virDomainObjPtr vm,
+                                  virDomainControllerDefPtr controller)
+ {
+-    virObjectEventPtr event;
+     size_t i;
+ 
+     VIR_DEBUG("Removing controller %s from domain %p %s",
+               controller->info.alias, vm, vm->def->name);
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, controller->info.alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+-
+     for (i = 0; i < vm->def->ncontrollers; i++) {
+         if (vm->def->controllers[i] == controller) {
+             virDomainControllerRemove(vm->def, i);
+@@ -4037,7 +4028,6 @@ qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver,
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+     unsigned long long oldmem = virDomainDefGetMemoryTotal(vm->def);
+     unsigned long long newmem = oldmem - mem->size;
+-    virObjectEventPtr event;
+     char *backendAlias = NULL;
+     int rc;
+     int idx;
+@@ -4059,9 +4049,6 @@ qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver,
+     if (rc < 0)
+         return -1;
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, mem->info.alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+-
+     if ((idx = virDomainMemoryFindByDef(vm->def, mem)) >= 0)
+         virDomainMemoryRemove(vm->def, idx);
+ 
+@@ -4141,7 +4128,6 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
+ {
+     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+     virDomainNetDefPtr net = NULL;
+-    virObjectEventPtr event;
+     size_t i;
+     int ret = -1;
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+@@ -4185,9 +4171,6 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
+             goto cleanup;
+     }
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, hostdev->info->alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+-
+     if (hostdev->parent.type == VIR_DOMAIN_DEVICE_NET) {
+         net = hostdev->parent.data.net;
+ 
+@@ -4266,7 +4249,6 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
+ {
+     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+-    virObjectEventPtr event;
+     char *hostnet_name = NULL;
+     char *charDevAlias = NULL;
+     size_t i;
+@@ -4322,9 +4304,6 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
+ 
+     virDomainAuditNet(vm, net, NULL, "detach", true);
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, net->info.alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+-
+     for (i = 0; i < vm->def->nnets; i++) {
+         if (vm->def->nets[i] == net) {
+             virDomainNetRemove(vm->def, i);
+@@ -4408,11 +4387,16 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
+     if (qemuDomainNamespaceTeardownChardev(vm, chr) < 0)
+         VIR_WARN("Unable to remove chr device from /dev");
+ 
++    qemuDomainReleaseDeviceAddress(vm, &chr->info, NULL);
++    qemuDomainChrRemove(vm->def, chr);
++
++    /* The caller does not emit the event, so we must do it here. Note
++     * that the event should be reported only after all backend
++     * teardown is completed.
++     */
+     event = virDomainEventDeviceRemovedNewFromObj(vm, chr->info.alias);
+     virObjectEventStateQueue(driver->domainEventState, event);
+ 
+-    qemuDomainReleaseDeviceAddress(vm, &chr->info, NULL);
+-    qemuDomainChrRemove(vm->def, chr);
+     virDomainChrDefFree(chr);
+     ret = 0;
+ 
+@@ -4427,7 +4411,6 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
+                           virDomainObjPtr vm,
+                           virDomainRNGDefPtr rng)
+ {
+-    virObjectEventPtr event;
+     char *charAlias = NULL;
+     char *objAlias = NULL;
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+@@ -4469,9 +4452,6 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
+     if (qemuDomainNamespaceTeardownRNG(vm, rng) < 0)
+         VIR_WARN("Unable to remove RNG device from /dev");
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, rng->info.alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+-
+     if ((idx = virDomainRNGFind(vm->def, rng)) >= 0)
+         virDomainRNGRemove(vm->def, idx);
+     qemuDomainReleaseDeviceAddress(vm, &rng->info, NULL);
+@@ -4496,7 +4476,6 @@ qemuDomainRemoveShmemDevice(virQEMUDriverPtr driver,
+     char *charAlias = NULL;
+     char *memAlias = NULL;
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+-    virObjectEventPtr event = NULL;
+ 
+     VIR_DEBUG("Removing shmem device %s from domain %p %s",
+               shmem->info.alias, vm, vm->def->name);
+@@ -4524,9 +4503,6 @@ qemuDomainRemoveShmemDevice(virQEMUDriverPtr driver,
+     if (rc < 0)
+         goto cleanup;
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, shmem->info.alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+-
+     if ((idx = virDomainShmemDefFind(vm->def, shmem)) >= 0)
+         virDomainShmemDefRemove(vm->def, idx);
+     qemuDomainReleaseDeviceAddress(vm, &shmem->info, NULL);
+@@ -4542,17 +4518,12 @@ qemuDomainRemoveShmemDevice(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainRemoveWatchdog(virQEMUDriverPtr driver,
+-                         virDomainObjPtr vm,
++qemuDomainRemoveWatchdog(virDomainObjPtr vm,
+                          virDomainWatchdogDefPtr watchdog)
+ {
+-    virObjectEventPtr event = NULL;
+-
+     VIR_DEBUG("Removing watchdog %s from domain %p %s",
+               watchdog->info.alias, vm, vm->def->name);
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, watchdog->info.alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+     qemuDomainReleaseDeviceAddress(vm, &watchdog->info, NULL);
+     virDomainWatchdogDefFree(vm->def->watchdog);
+     vm->def->watchdog = NULL;
+@@ -4564,16 +4535,11 @@ static int
+ qemuDomainRemoveInputDevice(virDomainObjPtr vm,
+                             virDomainInputDefPtr dev)
+ {
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+-    virQEMUDriverPtr driver = priv->driver;
+-    virObjectEventPtr event = NULL;
+     size_t i;
+ 
+     VIR_DEBUG("Removing input device %s from domain %p %s",
+               dev->info.alias, vm, vm->def->name);
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, dev->info.alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+     for (i = 0; i < vm->def->ninputs; i++) {
+         if (vm->def->inputs[i] == dev)
+             break;
+@@ -4598,15 +4564,9 @@ static int
+ qemuDomainRemoveVsockDevice(virDomainObjPtr vm,
+                             virDomainVsockDefPtr dev)
+ {
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+-    virQEMUDriverPtr driver = priv->driver;
+-    virObjectEventPtr event = NULL;
+-
+     VIR_DEBUG("Removing vsock device %s from domain %p %s",
+               dev->info.alias, vm, vm->def->name);
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, dev->info.alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+     qemuDomainReleaseDeviceAddress(vm, &dev->info, NULL);
+     virDomainVsockDefFree(vm->def->vsock);
+     vm->def->vsock = NULL;
+@@ -4620,7 +4580,6 @@ qemuDomainRemoveRedirdevDevice(virQEMUDriverPtr driver,
+                                virDomainRedirdevDefPtr dev)
+ {
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+-    virObjectEventPtr event;
+     char *charAlias = NULL;
+     ssize_t idx;
+     int ret = -1;
+@@ -4645,9 +4604,6 @@ qemuDomainRemoveRedirdevDevice(virQEMUDriverPtr driver,
+ 
+     virDomainAuditRedirdev(vm, dev, "detach", true);
+ 
+-    event = virDomainEventDeviceRemovedNewFromObj(vm, dev->info.alias);
+-    virObjectEventStateQueue(driver->domainEventState, event);
+-
+     if ((idx = virDomainRedirdevDefFind(vm->def, dev)) >= 0)
+         virDomainRedirdevDefRemove(vm->def, idx);
+     qemuDomainReleaseDeviceAddress(vm, &dev->info, NULL);
+@@ -4730,50 +4686,81 @@ qemuDomainRemoveDevice(virQEMUDriverPtr driver,
+                        virDomainObjPtr vm,
+                        virDomainDeviceDefPtr dev)
+ {
++    virDomainDeviceInfoPtr info;
++    virObjectEventPtr event;
++    char *alias = NULL;
+     int ret = -1;
++
++    /*
++     * save the alias to use when sending a DEVICE_REMOVED event after
++     * all other teardown is complete
++     */
++    if ((info = virDomainDeviceGetInfo(dev)) &&
++        VIR_STRDUP(alias, info->alias) < 0) {
++        goto cleanup;;
++    }
++    info = NULL;
++
+     switch ((virDomainDeviceType)dev->type) {
++    case VIR_DOMAIN_DEVICE_CHR:
++        /* We must return directly after calling
++         * qemuDomainRemoveChrDevice because it is called directly
++         * from other places, so it must be completely self-contained
++         * and can't take advantage of any common code at the end of
++         * qemuDomainRemoveDevice().
++         */
++        ret = qemuDomainRemoveChrDevice(driver, vm, dev->data.chr, true);
++        goto cleanup;
++
++        /*
++         * all of the following qemuDomainRemove*Device() functions
++         * are (and must be) only called from this function, so any
++         * code that is common to them all can be pulled out and put
++         * into this function.
++         */
+     case VIR_DOMAIN_DEVICE_DISK:
+-        ret = qemuDomainRemoveDiskDevice(driver, vm, dev->data.disk);
++        if (qemuDomainRemoveDiskDevice(driver, vm, dev->data.disk) < 0)
++            goto cleanup;
+         break;
+     case VIR_DOMAIN_DEVICE_CONTROLLER:
+-        ret = qemuDomainRemoveControllerDevice(driver, vm, dev->data.controller);
++        if (qemuDomainRemoveControllerDevice(vm, dev->data.controller) < 0)
++            goto cleanup;
+         break;
+     case VIR_DOMAIN_DEVICE_NET:
+-        ret = qemuDomainRemoveNetDevice(driver, vm, dev->data.net);
++        if (qemuDomainRemoveNetDevice(driver, vm, dev->data.net) < 0)
++            goto cleanup;
+         break;
+     case VIR_DOMAIN_DEVICE_HOSTDEV:
+-        ret = qemuDomainRemoveHostDevice(driver, vm, dev->data.hostdev);
+-        break;
+-
+-    case VIR_DOMAIN_DEVICE_CHR:
+-        ret = qemuDomainRemoveChrDevice(driver, vm, dev->data.chr, true);
++        if (qemuDomainRemoveHostDevice(driver, vm, dev->data.hostdev) < 0)
++            goto cleanup;
+         break;
+     case VIR_DOMAIN_DEVICE_RNG:
+-        ret = qemuDomainRemoveRNGDevice(driver, vm, dev->data.rng);
++        if (qemuDomainRemoveRNGDevice(driver, vm, dev->data.rng) < 0)
++            goto cleanup;
+         break;
+-
+     case VIR_DOMAIN_DEVICE_MEMORY:
+-        ret = qemuDomainRemoveMemoryDevice(driver, vm, dev->data.memory);
++        if (qemuDomainRemoveMemoryDevice(driver, vm, dev->data.memory) < 0)
++            goto cleanup;
+         break;
+-
+     case VIR_DOMAIN_DEVICE_SHMEM:
+-        ret = qemuDomainRemoveShmemDevice(driver, vm, dev->data.shmem);
++        if (qemuDomainRemoveShmemDevice(driver, vm, dev->data.shmem) < 0)
++            goto cleanup;
+         break;
+-
+     case VIR_DOMAIN_DEVICE_INPUT:
+-        ret = qemuDomainRemoveInputDevice(vm, dev->data.input);
++        if (qemuDomainRemoveInputDevice(vm, dev->data.input) < 0)
++            goto cleanup;
+         break;
+-
+     case VIR_DOMAIN_DEVICE_REDIRDEV:
+-        ret = qemuDomainRemoveRedirdevDevice(driver, vm, dev->data.redirdev);
++        if (qemuDomainRemoveRedirdevDevice(driver, vm, dev->data.redirdev) < 0)
++            goto cleanup;
+         break;
+-
+     case VIR_DOMAIN_DEVICE_WATCHDOG:
+-        ret = qemuDomainRemoveWatchdog(driver, vm, dev->data.watchdog);
++        if (qemuDomainRemoveWatchdog(vm, dev->data.watchdog) < 0)
++            goto cleanup;
+         break;
+-
+     case VIR_DOMAIN_DEVICE_VSOCK:
+-        ret = qemuDomainRemoveVsockDevice(vm, dev->data.vsock);
++        if (qemuDomainRemoveVsockDevice(vm, dev->data.vsock) < 0)
++            goto cleanup;
+         break;
+ 
+     case VIR_DOMAIN_DEVICE_NONE:
+@@ -4793,8 +4780,16 @@ qemuDomainRemoveDevice(virQEMUDriverPtr driver,
+         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+                        _("don't know how to remove a %s device"),
+                        virDomainDeviceTypeToString(dev->type));
+-        break;
++        goto cleanup;
+     }
++
++    event = virDomainEventDeviceRemovedNewFromObj(vm, alias);
++    virObjectEventStateQueue(driver->domainEventState, event);
++
++    ret = 0;
++
++ cleanup:
++    VIR_FREE(alias);
+     return ret;
+ }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-don-t-call-DetachThisHostDevice-for-hostdev-network-devices.patch b/SOURCES/libvirt-qemu_hotplug-don-t-call-DetachThisHostDevice-for-hostdev-network-devices.patch
new file mode 100644
index 0000000..2ef9063
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-don-t-call-DetachThisHostDevice-for-hostdev-network-devices.patch
@@ -0,0 +1,80 @@
+From 34239068029f426da9861224d0140bb50da5f56f Mon Sep 17 00:00:00 2001
+Message-Id: <34239068029f426da9861224d0140bb50da5f56f@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:35 -0400
+Subject: [PATCH] qemu_hotplug: don't call DetachThisHostDevice for hostdev
+ network devices
+
+Back in the bad old days different device types required a different
+qemu monitor call to detach them, and so an <interface type='hostdev'>
+needed to call the function for detaching hostdevs, while other
+<interface> types could be deleted as netdevs.
+
+Times have changed, and *all* device types are detached by calling the
+common function qemuDomainDeleteDevice(vm, alias), so we don't need to
+differentiate between hostdev interfaces and the others for that
+reason.
+
+There are a few other netdev-specific functions called during
+qemuDomainDetachNetDevice() (clearing bandwidth limits, stopping the
+interface), but those turn into NOPs when type=hostdev, so they're
+safe to call for type=hostdev.
+
+The only thing that is different + not a NOP is the call to
+virDomainAudit*() when qemuDomainDeleteDevice() fails, so if we add a
+conditional for that small bit of code, we can eliminate the callout
+from qemuDomainDetachNetDevice() to qemuDomainDetachThisDevice(),
+which makes this function fit the desired pattern for merging with the
+other detach functions, and paves the way to simplifying
+qemuDomainDetachHostDevice() too.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 48a2668151c9ba3f4c94c0a4c0412a5140885ad4)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-24-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 16 +++++++---------
+ 1 file changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 18c98c59ec..ac395b9177 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5246,13 +5246,6 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+ 
+     detach = vm->def->nets[detachidx];
+ 
+-    if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
+-        ret = qemuDomainDetachThisHostDevice(driver, vm,
+-                                             virDomainNetGetActualHostdev(detach),
+-                                             async);
+-        goto cleanup;
+-    }
+-
+     if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+                        _("cannot hot unplug multifunction PCI device: %s"),
+@@ -5281,8 +5274,13 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+         qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+ 
+     if (qemuDomainDeleteDevice(vm, detach->info.alias) < 0) {
+-        if (virDomainObjIsActive(vm))
+-            virDomainAuditNet(vm, detach, NULL, "detach", false);
++        if (virDomainObjIsActive(vm)) {
++            /* the audit message has a different format for hostdev network devices */
++            if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV)
++                virDomainAuditHostdev(vm, virDomainNetGetActualHostdev(detach), "detach", false);
++            else
++                virDomainAuditNet(vm, detach, NULL, "detach", false);
++        }
+         goto cleanup;
+     }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-don-t-shutdown-net-device-until-the-guest-has-released-it.patch b/SOURCES/libvirt-qemu_hotplug-don-t-shutdown-net-device-until-the-guest-has-released-it.patch
new file mode 100644
index 0000000..8b5004d
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-don-t-shutdown-net-device-until-the-guest-has-released-it.patch
@@ -0,0 +1,110 @@
+From 7f3efe3ed7d9f6e83323f62ffd020d9762c2fef0 Mon Sep 17 00:00:00 2001
+Message-Id: <7f3efe3ed7d9f6e83323f62ffd020d9762c2fef0@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:52 -0400
+Subject: [PATCH] qemu_hotplug: don't shutdown net device until the guest has
+ released it
+
+For [some unknown reason, possibly/probably pure chance], Net devices
+have been taken offline and their bandwidth tc rules cleared as the
+very first operation when detaching the device. This is contrary to
+every other type of device, where all hostside teardown is delayed
+until we receive the DEVICE_DELETED event back from qemu, indicating
+that the guest has finished with the device.
+
+This patch delays these two operations until receipt of
+DEVICE_DELETED, which removes an ugly wart from
+qemuDomainDetachDeviceLive(), and also seems to be a more correct
+sequence of events.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 34086fc59e7c59148409d6780176e84d0f1dbfb4)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-41-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 50 +++++++++--------------------------------
+ 1 file changed, 11 insertions(+), 39 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 27d09d173b..ff88a827dd 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4287,6 +4287,17 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
+         !(charDevAlias = qemuAliasChardevFromDevAlias(net->info.alias)))
+         goto cleanup;
+ 
++    if (virDomainNetGetActualBandwidth(net) &&
++        virNetDevSupportBandwidth(virDomainNetGetActualType(net)) &&
++        virNetDevBandwidthClear(net->ifname) < 0)
++        VIR_WARN("cannot clear bandwidth setting for device : %s",
++                 net->ifname);
++
++    /* deactivate the tap/macvtap device on the host, which could also
++     * affect the parent device (e.g. macvtap passthrough mode sets
++     * the parent device offline)
++     */
++    ignore_value(qemuInterfaceStopDevice(net));
+ 
+     qemuDomainObjEnterMonitor(driver, vm);
+     if (qemuMonitorRemoveNetdev(priv->mon, hostnet_name) < 0) {
+@@ -5249,34 +5260,6 @@ qemuDomainDetachPrepNet(virDomainObjPtr vm,
+ }
+ 
+ 
+-static void
+-qemuDomainDetachShutdownNet(virDomainNetDefPtr net)
+-{
+-/*
+- * These operations are in a separate function from
+- * qemuDomainDetachPrepNet() because they can't be done until after
+- * we've validated that this device really can be removed - in
+- * particular we need to check for multifunction PCI devices and
+- * presence of a device alias, which isn't done until *after* the
+- * return from qemuDomainDetachPrepNet(). Since we've already passed
+- * the "point of no return", we ignore any errors, and trudge ahead
+- * with shutting down and detaching the device even if there is an
+- * error in one of these functions.
+- */
+-    if (virDomainNetGetActualBandwidth(net) &&
+-        virNetDevSupportBandwidth(virDomainNetGetActualType(net)) &&
+-        virNetDevBandwidthClear(net->ifname) < 0)
+-        VIR_WARN("cannot clear bandwidth setting for device : %s",
+-                 net->ifname);
+-
+-    /* deactivate the tap/macvtap device on the host, which could also
+-     * affect the parent device (e.g. macvtap passthrough mode sets
+-     * the parent device offline)
+-     */
+-    ignore_value(qemuInterfaceStopDevice(net));
+-}
+-
+-
+ static int
+ qemuDomainDetachDeviceChr(virQEMUDriverPtr driver,
+                           virDomainObjPtr vm,
+@@ -5607,17 +5590,6 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+         return -1;
+     }
+ 
+-
+-    /*
+-     * Do any device-specific shutdown that should be
+-     * done after all validation checks, but before issuing the qemu
+-     * command to delete the device. For now, the only type of device
+-     * that has such shutdown needs is the net device.
+-     */
+-    if (detach.type == VIR_DOMAIN_DEVICE_NET)
+-        qemuDomainDetachShutdownNet(detach.data.net);
+-
+-
+     /*
+      * Issue the qemu monitor command to delete the device (based on
+      * its alias), and optionally wait a short time in case the
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-eliminate-multiple-identical-qemuDomainDetachHost-Device-functions.patch b/SOURCES/libvirt-qemu_hotplug-eliminate-multiple-identical-qemuDomainDetachHost-Device-functions.patch
new file mode 100644
index 0000000..d0013bf
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-eliminate-multiple-identical-qemuDomainDetachHost-Device-functions.patch
@@ -0,0 +1,215 @@
+From 004c83f00eca921bded4786f24e962174dc71c05 Mon Sep 17 00:00:00 2001
+Message-Id: <004c83f00eca921bded4786f24e962174dc71c05@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:32 -0400
+Subject: [PATCH] qemu_hotplug: eliminate multiple identical
+ qemuDomainDetachHost*Device() functions
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There are separate Detach functions for PCI, USB, SCSI, Vhost, and
+Mediated hostdevs, but the functions are all 100% the same code,
+except that the PCI function checks for the guest side of the device
+being a PCI Multifunction device, while the other 4 check that the
+device's alias != NULL.
+
+The check for multifunction PCI devices should be done for *all*
+devices that are connected to the PCI bus in the guest, not just PCI
+hostdevs, and qemuIsMultiFunctionDevice() conveniently returns false
+if the queried device doesn't connect with PCI, so it is safe to make
+this check for all hostdev devices. (It also needs to be done for many
+other device types, but that will be addressed in a future patch).
+
+Likewise, since all hostdevs are detached by calling
+qemuDomainDeleteDevice(), which requires the device's alias, checking
+for a valid alias is a reasonable thing for PCI hostdevs too.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 287415e219fa2e477ae011ece275ab15a4be1d73)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-21-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 134 +++++++++-------------------------------
+ 1 file changed, 29 insertions(+), 105 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 2bfb5f8d54..b6fcaadd55 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4947,96 +4947,6 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+     return ret;
+ }
+ 
+-static int
+-qemuDomainDetachHostPCIDevice(virDomainObjPtr vm,
+-                              virDomainHostdevDefPtr detach,
+-                              bool async)
+-{
+-    virDomainHostdevSubsysPCIPtr pcisrc = &detach->source.subsys.u.pci;
+-
+-    if (qemuIsMultiFunctionDevice(vm->def, detach->info)) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("cannot hot unplug multifunction PCI device: %.4x:%.2x:%.2x.%.1x"),
+-                       pcisrc->addr.domain, pcisrc->addr.bus,
+-                       pcisrc->addr.slot, pcisrc->addr.function);
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, detach->info);
+-
+-    return qemuDomainDeleteDevice(vm, detach->info->alias);
+-}
+-
+-static int
+-qemuDomainDetachHostUSBDevice(virDomainObjPtr vm,
+-                              virDomainHostdevDefPtr detach,
+-                              bool async)
+-{
+-    if (!detach->info->alias) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       "%s", _("device cannot be detached without a device alias"));
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, detach->info);
+-
+-    return qemuDomainDeleteDevice(vm, detach->info->alias);
+-}
+-
+-static int
+-qemuDomainDetachHostSCSIDevice(virDomainObjPtr vm,
+-                               virDomainHostdevDefPtr detach,
+-                               bool async)
+-{
+-    if (!detach->info->alias) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       "%s", _("device cannot be detached without a device alias"));
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, detach->info);
+-
+-    return qemuDomainDeleteDevice(vm, detach->info->alias);
+-}
+-
+-static int
+-qemuDomainDetachSCSIVHostDevice(virDomainObjPtr vm,
+-                                virDomainHostdevDefPtr detach,
+-                                bool async)
+-{
+-    if (!detach->info->alias) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       "%s", _("device cannot be detached without a device alias"));
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, detach->info);
+-
+-    return qemuDomainDeleteDevice(vm, detach->info->alias);
+-}
+-
+-
+-static int
+-qemuDomainDetachMediatedDevice(virDomainObjPtr vm,
+-                               virDomainHostdevDefPtr detach,
+-                               bool async)
+-{
+-    if (!detach->info->alias) {
+-        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+-                       _("device cannot be detached without a device alias"));
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, detach->info);
+-
+-    return qemuDomainDeleteDevice(vm, detach->info->alias);
+-}
+-
+ 
+ static int
+ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
+@@ -5046,25 +4956,30 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
+ {
+     int ret = -1;
+ 
+-    if (qemuAssignDeviceHostdevAlias(vm->def, &detach->info->alias, -1) < 0)
++    if (qemuIsMultiFunctionDevice(vm->def, detach->info)) {
++        virReportError(VIR_ERR_OPERATION_FAILED,
++                       _("cannot hot unplug multifunction PCI device with guest address: "
++                         "%.4x:%.2x:%.2x.%.1x"),
++                       detach->info->addr.pci.domain, detach->info->addr.pci.bus,
++                       detach->info->addr.pci.slot, detach->info->addr.pci.function);
+         return -1;
++    }
++
++    if (!detach->info->alias) {
++        virReportError(VIR_ERR_OPERATION_FAILED,
++                       "%s", _("device cannot be detached without a device alias"));
++        return -1;
++    }
+ 
+     switch (detach->source.subsys.type) {
+     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
+-        ret = qemuDomainDetachHostPCIDevice(vm, detach, async);
+-        break;
+     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
+-        ret = qemuDomainDetachHostUSBDevice(vm, detach, async);
+-        break;
+     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
+-        ret = qemuDomainDetachHostSCSIDevice(vm, detach, async);
+-        break;
+     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
+-        ret = qemuDomainDetachSCSIVHostDevice(vm, detach, async);
+-        break;
+     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+-        ret = qemuDomainDetachMediatedDevice(vm, detach, async);
+-        break;
++       /* we support detach of all these types of hostdev */
++       break;
++
+     default:
+         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                        _("hot unplug is not supported for hostdev subsys type '%s'"),
+@@ -5072,14 +4987,23 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
+         return -1;
+     }
+ 
+-    if (ret < 0) {
++    if (!async)
++        qemuDomainMarkDeviceForRemoval(vm, detach->info);
++
++    if (qemuDomainDeleteDevice(vm, detach->info->alias) < 0) {
+         if (virDomainObjIsActive(vm))
+             virDomainAuditHostdev(vm, detach, "detach", false);
+-    } else if (!async &&
+-               (ret = qemuDomainWaitForDeviceRemoval(vm)) == 1) {
+-        ret = qemuDomainRemoveHostDevice(driver, vm, detach);
++        goto cleanup;
+     }
+ 
++    if (async) {
++        ret = 0;
++    } else {
++        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
++            ret = qemuDomainRemoveHostDevice(driver, vm, detach);
++    }
++
++ cleanup:
+     if (!async)
+         qemuDomainResetDeviceRemoval(vm);
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-eliminate-unnecessary-call-to-qemuDomainDetachNetDevice.patch b/SOURCES/libvirt-qemu_hotplug-eliminate-unnecessary-call-to-qemuDomainDetachNetDevice.patch
new file mode 100644
index 0000000..128cbc2
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-eliminate-unnecessary-call-to-qemuDomainDetachNetDevice.patch
@@ -0,0 +1,61 @@
+From 7a533f8dbc018411d53eb4436cfc584b070c232b Mon Sep 17 00:00:00 2001
+Message-Id: <7a533f8dbc018411d53eb4436cfc584b070c232b@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:33 -0400
+Subject: [PATCH] qemu_hotplug: eliminate unnecessary call to
+ qemuDomainDetachNetDevice()
+
+qemuDomainDetachHostDevice() has a check at the end that calls
+qemuDomainDetachNetDevice() in the case that the hostdev is actually a
+Net device of type='hostdev'. A long time ago when device removal was
+(supposedly but not actually) synchronous, this would cause some extra
+code to be run prior to removing the device (e.g. restoring the original MAC
+address of the device, undoing some sort of virtual port profile, etc).
+
+For quite awhile now the device removal has been asynchronous, so that
+"extra teardown" isn't handled by the detach function, but instead is
+handled by the Remove function called at a later time. The result is
+that when we call qemuDomainDetachNetDevice() from
+qemuDomainDetachHostDevice(), it ends up just calling
+qemuDomainDetachThisHostDevice() and returning, which is exactly what
+we do for all other hostdevs anyway.
+
+Based on that, remove the behavioral difference when parent.type ==
+VIR_DOMAIN_DEVICE_NET, and just call qemuDomainDetachThisHostDevice()
+for all hostdevs.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 1ed46f3a22fe8570b4237477de5d5adb5a05f455)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-22-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index b6fcaadd55..0ae944475e 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5085,13 +5085,7 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+         return -1;
+     }
+ 
+-    /* If this is a network hostdev, we need to use the higher-level detach
+-     * function so that mac address / virtualport are reset
+-     */
+-    if (detach->parent.type == VIR_DOMAIN_DEVICE_NET)
+-        return qemuDomainDetachNetDevice(driver, vm, &detach->parent, async);
+-    else
+-        return qemuDomainDetachThisHostDevice(driver, vm, detach, async);
++    return qemuDomainDetachThisHostDevice(driver, vm, detach, async);
+ }
+ 
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-make-Detach-functions-called-only-from-qemu_hotplug.c-static.patch b/SOURCES/libvirt-qemu_hotplug-make-Detach-functions-called-only-from-qemu_hotplug.c-static.patch
new file mode 100644
index 0000000..a84dd46
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-make-Detach-functions-called-only-from-qemu_hotplug.c-static.patch
@@ -0,0 +1,265 @@
+From c03d9e5f2d848a185ec262d0197d4d8dfb1f7f0e Mon Sep 17 00:00:00 2001
+Message-Id: <c03d9e5f2d848a185ec262d0197d4d8dfb1f7f0e@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:44 -0400
+Subject: [PATCH] qemu_hotplug: make Detach functions called only from
+ qemu_hotplug.c static
+
+These are no longer called from qemu_driver.c, since the function that
+called them (qemuDomainDetachDeviceLive()) has been moved to
+qemu_hotplug.c, and they are no longer called from testqemuhotplug.c
+because it now just called qemuDomainDetachDeviceLive() instead of all
+the subordinate functions.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 637d72f985e2700e88c3b3a4d4a83df9b8d6d35d)
+
+Conflicts:
+  src/qemu/qemu_hotplug.h - sentinel protecting from multiple inclusion
+                            was renamed upstream, leading to difference
+                            in context (but not in the lines that were
+                            changed)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-33-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 47 +++++++++++++++++++------------------
+ src/qemu/qemu_hotplug.h | 51 -----------------------------------------
+ 2 files changed, 25 insertions(+), 73 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index fd78f4ca01..b0f45708ae 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4837,7 +4837,7 @@ qemuFindDisk(virDomainDefPtr def, const char *dst)
+     return -1;
+ }
+ 
+-int
++static int
+ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+                                virDomainObjPtr vm,
+                                virDomainDeviceDefPtr dev,
+@@ -4988,10 +4988,11 @@ static bool qemuDomainControllerIsBusy(virDomainObjPtr vm,
+     }
+ }
+ 
+-int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+-                                     virDomainObjPtr vm,
+-                                     virDomainDeviceDefPtr dev,
+-                                     bool async)
++static int
++qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
++                                 virDomainObjPtr vm,
++                                 virDomainDeviceDefPtr dev,
++                                 bool async)
+ {
+     int idx, ret = -1;
+     virDomainControllerDefPtr detach = NULL;
+@@ -5049,10 +5050,11 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+ 
+ 
+ /* search for a hostdev matching dev and detach it */
+-int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+-                               virDomainObjPtr vm,
+-                               virDomainDeviceDefPtr dev,
+-                               bool async)
++static int
++qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
++                           virDomainObjPtr vm,
++                           virDomainDeviceDefPtr dev,
++                           bool async)
+ {
+     virDomainHostdevDefPtr hostdev = dev->data.hostdev;
+     virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys;
+@@ -5164,7 +5166,7 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-int
++static int
+ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
+                             virDomainObjPtr vm,
+                             virDomainShmemDefPtr dev,
+@@ -5218,7 +5220,7 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-int
++static int
+ qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
+                          virDomainObjPtr vm,
+                          virDomainWatchdogDefPtr dev,
+@@ -5273,7 +5275,7 @@ qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-int
++static int
+ qemuDomainDetachRedirdevDevice(virQEMUDriverPtr driver,
+                                virDomainObjPtr vm,
+                                virDomainRedirdevDefPtr dev,
+@@ -5317,7 +5319,7 @@ qemuDomainDetachRedirdevDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-int
++static int
+ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+                           virDomainObjPtr vm,
+                           virDomainDeviceDefPtr dev,
+@@ -5383,10 +5385,11 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+-                              virDomainObjPtr vm,
+-                              virDomainChrDefPtr chr,
+-                              bool async)
++static int
++qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
++                          virDomainObjPtr vm,
++                          virDomainChrDefPtr chr,
++                          bool async)
+ {
+     int ret = -1;
+     qemuDomainObjPrivatePtr priv = vm->privateData;
+@@ -5440,7 +5443,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-int
++static int
+ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
+                           virDomainObjPtr vm,
+                           virDomainRNGDefPtr rng,
+@@ -5486,7 +5489,7 @@ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-int
++static int
+ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
+                              virDomainObjPtr vm,
+                              virDomainMemoryDefPtr memdef,
+@@ -5534,7 +5537,7 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-int
++static int
+ qemuDomainDetachInputDevice(virDomainObjPtr vm,
+                             virDomainInputDefPtr def,
+                             bool async)
+@@ -5585,7 +5588,7 @@ qemuDomainDetachInputDevice(virDomainObjPtr vm,
+ }
+ 
+ 
+-int
++static int
+ qemuDomainDetachVsockDevice(virDomainObjPtr vm,
+                             virDomainVsockDefPtr dev,
+                             bool async)
+@@ -5621,7 +5624,7 @@ qemuDomainDetachVsockDevice(virDomainObjPtr vm,
+ }
+ 
+ 
+-int
++static int
+ qemuDomainDetachLease(virQEMUDriverPtr driver,
+                       virDomainObjPtr vm,
+                       virDomainLeaseDefPtr lease)
+diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
+index 30b6fcc074..e8e4934db8 100644
+--- a/src/qemu/qemu_hotplug.h
++++ b/src/qemu/qemu_hotplug.h
+@@ -81,10 +81,6 @@ int qemuDomainFindGraphicsIndex(virDomainDefPtr def,
+ int qemuDomainAttachMemory(virQEMUDriverPtr driver,
+                            virDomainObjPtr vm,
+                            virDomainMemoryDefPtr mem);
+-int qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
+-                                 virDomainObjPtr vm,
+-                                 virDomainMemoryDefPtr memdef,
+-                                 bool async);
+ int qemuDomainChangeGraphics(virQEMUDriverPtr driver,
+                              virDomainObjPtr vm,
+                              virDomainGraphicsDefPtr dev);
+@@ -101,35 +97,6 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
+                                  virDomainObjPtr vm,
+                                  virDomainNetDefPtr dev,
+                                  int linkstate);
+-int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+-                                   virDomainObjPtr vm,
+-                                   virDomainDeviceDefPtr dev,
+-                                   bool async);
+-int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+-                                     virDomainObjPtr vm,
+-                                     virDomainDeviceDefPtr dev,
+-                                     bool async);
+-int qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+-                              virDomainObjPtr vm,
+-                              virDomainDeviceDefPtr dev,
+-                              bool async);
+-int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+-                               virDomainObjPtr vm,
+-                               virDomainDeviceDefPtr dev,
+-                               bool async);
+-int qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
+-                                virDomainObjPtr vm,
+-                                virDomainShmemDefPtr dev,
+-                                bool async);
+-int qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
+-                             virDomainObjPtr vm,
+-                             virDomainWatchdogDefPtr watchdog,
+-                             bool async);
+-
+-int qemuDomainDetachRedirdevDevice(virQEMUDriverPtr driver,
+-                                   virDomainObjPtr vm,
+-                                   virDomainRedirdevDefPtr dev,
+-                                   bool async);
+ 
+ int qemuDomainAttachInputDevice(virQEMUDriverPtr driver,
+                                 virDomainObjPtr vm,
+@@ -142,23 +109,12 @@ int qemuDomainAttachVsockDevice(virQEMUDriverPtr driver,
+ int qemuDomainAttachLease(virQEMUDriverPtr driver,
+                           virDomainObjPtr vm,
+                           virDomainLeaseDefPtr lease);
+-int qemuDomainDetachLease(virQEMUDriverPtr driver,
+-                          virDomainObjPtr vm,
+-                          virDomainLeaseDefPtr lease);
+ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
+                               virDomainObjPtr vm,
+                               virDomainChrDefPtr chr);
+-int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+-                              virDomainObjPtr vm,
+-                              virDomainChrDefPtr chr,
+-                              bool async);
+ int qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
+                               virDomainObjPtr vm,
+                               virDomainRNGDefPtr rng);
+-int qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
+-                              virDomainObjPtr vm,
+-                              virDomainRNGDefPtr rng,
+-                              bool async);
+ 
+ int qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+                                virDomainDeviceDefPtr dev,
+@@ -198,11 +154,4 @@ int qemuDomainSetVcpuInternal(virQEMUDriverPtr driver,
+                               virBitmapPtr vcpus,
+                               bool state);
+ 
+-int qemuDomainDetachInputDevice(virDomainObjPtr vm,
+-                                virDomainInputDefPtr def,
+-                                bool async);
+-
+-int qemuDomainDetachVsockDevice(virDomainObjPtr vm,
+-                                virDomainVsockDefPtr dev,
+-                                bool async);
+ #endif /* __QEMU_HOTPLUG_H__ */
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-merge-qemuDomainDetachThisHostDevice-into-qemuDomainDetachHostDevice.patch b/SOURCES/libvirt-qemu_hotplug-merge-qemuDomainDetachThisHostDevice-into-qemuDomainDetachHostDevice.patch
new file mode 100644
index 0000000..98aaaab
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-merge-qemuDomainDetachThisHostDevice-into-qemuDomainDetachHostDevice.patch
@@ -0,0 +1,153 @@
+From ff34df48cc7f197877034c319409c11f4a3b794e Mon Sep 17 00:00:00 2001
+Message-Id: <ff34df48cc7f197877034c319409c11f4a3b794e@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:36 -0400
+Subject: [PATCH] qemu_hotplug: merge qemuDomainDetachThisHostDevice into
+ qemuDomainDetachHostDevice
+
+It's now only called from one place, and combining the two functions
+highlights the similarity with Detach functions for other device
+types.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 6be2414820a23663f9e6b7b4ed510ebbf3126307)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-25-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 101 +++++++++++++++-------------------------
+ 1 file changed, 38 insertions(+), 63 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index ac395b9177..8a3946a6e2 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4938,68 +4938,6 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-static int
+-qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
+-                               virDomainObjPtr vm,
+-                               virDomainHostdevDefPtr detach,
+-                               bool async)
+-{
+-    int ret = -1;
+-
+-    if (qemuIsMultiFunctionDevice(vm->def, detach->info)) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("cannot hot unplug multifunction PCI device with guest address: "
+-                         "%.4x:%.2x:%.2x.%.1x"),
+-                       detach->info->addr.pci.domain, detach->info->addr.pci.bus,
+-                       detach->info->addr.pci.slot, detach->info->addr.pci.function);
+-        return -1;
+-    }
+-
+-    if (!detach->info->alias) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       "%s", _("device cannot be detached without a device alias"));
+-        return -1;
+-    }
+-
+-    switch (detach->source.subsys.type) {
+-    case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
+-    case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
+-    case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
+-    case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
+-    case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+-       /* we support detach of all these types of hostdev */
+-       break;
+-
+-    default:
+-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+-                       _("hot unplug is not supported for hostdev subsys type '%s'"),
+-                       virDomainHostdevSubsysTypeToString(detach->source.subsys.type));
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, detach->info);
+-
+-    if (qemuDomainDeleteDevice(vm, detach->info->alias) < 0) {
+-        if (virDomainObjIsActive(vm))
+-            virDomainAuditHostdev(vm, detach, "detach", false);
+-        goto cleanup;
+-    }
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveHostDevice(driver, vm, detach);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-
+-    return ret;
+-}
+-
+ /* search for a hostdev matching dev and detach it */
+ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+                                virDomainObjPtr vm,
+@@ -5014,6 +4952,7 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+     virDomainHostdevSubsysMediatedDevPtr mdevsrc = &subsys->u.mdev;
+     virDomainHostdevDefPtr detach = NULL;
+     int idx;
++    int ret = -1;
+ 
+     if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
+         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+@@ -5075,7 +5014,43 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+         return -1;
+     }
+ 
+-    return qemuDomainDetachThisHostDevice(driver, vm, detach, async);
++    if (qemuIsMultiFunctionDevice(vm->def, detach->info)) {
++        virReportError(VIR_ERR_OPERATION_FAILED,
++                       _("cannot hot unplug multifunction PCI device with guest address: "
++                         "%.4x:%.2x:%.2x.%.1x"),
++                       detach->info->addr.pci.domain, detach->info->addr.pci.bus,
++                       detach->info->addr.pci.slot, detach->info->addr.pci.function);
++        return -1;
++    }
++
++    if (!detach->info->alias) {
++        virReportError(VIR_ERR_OPERATION_FAILED,
++                       "%s", _("device cannot be detached without a device alias"));
++        return -1;
++    }
++
++    if (!async)
++        qemuDomainMarkDeviceForRemoval(vm, detach->info);
++
++    if (qemuDomainDeleteDevice(vm, detach->info->alias) < 0) {
++        if (virDomainObjIsActive(vm))
++            virDomainAuditHostdev(vm, detach, "detach", false);
++        goto cleanup;
++    }
++
++    if (async) {
++        ret = 0;
++    } else {
++        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
++            ret = qemuDomainRemoveHostDevice(driver, vm, detach);
++    }
++
++ cleanup:
++    if (!async)
++        qemuDomainResetDeviceRemoval(vm);
++
++    return ret;
++
+ }
+ 
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-move-Attach-Detach-Lease-functions-with-others-of-same-type.patch b/SOURCES/libvirt-qemu_hotplug-move-Attach-Detach-Lease-functions-with-others-of-same-type.patch
new file mode 100644
index 0000000..ccea4aa
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-move-Attach-Detach-Lease-functions-with-others-of-same-type.patch
@@ -0,0 +1,150 @@
+From e40f255c06b69af3bc9df5d0e6cbd0eb253e0650 Mon Sep 17 00:00:00 2001
+Message-Id: <e40f255c06b69af3bc9df5d0e6cbd0eb253e0650@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:39 -0400
+Subject: [PATCH] qemu_hotplug: move (Attach|Detach)Lease functions with others
+ of same type
+
+The Attach and Detach Lease functions were together in the middle of
+the Detach functions. Put them at the end of their respective
+sections, since they behave differently from the other attach/detach
+functions (DetachLease doesn't use qemuDomainDeleteDevice(), and is
+always synchronous).
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 015e71c54ddf8d133905a85514239b21bc7e552e)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-28-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 96 +++++++++++++++++++++--------------------
+ 1 file changed, 50 insertions(+), 46 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 77237a895e..d55a68e4ad 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -2980,6 +2980,32 @@ qemuDomainAttachVsockDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
++int
++qemuDomainAttachLease(virQEMUDriverPtr driver,
++                      virDomainObjPtr vm,
++                      virDomainLeaseDefPtr lease)
++{
++    int ret = -1;
++    virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
++
++    if (virDomainLeaseInsertPreAlloc(vm->def) < 0)
++        goto cleanup;
++
++    if (virDomainLockLeaseAttach(driver->lockManager, cfg->uri,
++                                 vm, lease) < 0) {
++        virDomainLeaseInsertPreAlloced(vm->def, NULL);
++        goto cleanup;
++    }
++
++    virDomainLeaseInsertPreAlloced(vm->def, lease);
++    ret = 0;
++
++ cleanup:
++    virObjectUnref(cfg);
++    return ret;
++}
++
++
+ static int
+ qemuDomainChangeNetBridge(virDomainObjPtr vm,
+                           virDomainNetDefPtr olddev,
+@@ -5350,52 +5376,6 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-int qemuDomainAttachLease(virQEMUDriverPtr driver,
+-                          virDomainObjPtr vm,
+-                          virDomainLeaseDefPtr lease)
+-{
+-    int ret = -1;
+-    virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+-
+-    if (virDomainLeaseInsertPreAlloc(vm->def) < 0)
+-        goto cleanup;
+-
+-    if (virDomainLockLeaseAttach(driver->lockManager, cfg->uri,
+-                                 vm, lease) < 0) {
+-        virDomainLeaseInsertPreAlloced(vm->def, NULL);
+-        goto cleanup;
+-    }
+-
+-    virDomainLeaseInsertPreAlloced(vm->def, lease);
+-    ret = 0;
+-
+- cleanup:
+-    virObjectUnref(cfg);
+-    return ret;
+-}
+-
+-int qemuDomainDetachLease(virQEMUDriverPtr driver,
+-                          virDomainObjPtr vm,
+-                          virDomainLeaseDefPtr lease)
+-{
+-    virDomainLeaseDefPtr det_lease;
+-    int idx;
+-
+-    if ((idx = virDomainLeaseIndex(vm->def, lease)) < 0) {
+-        virReportError(VIR_ERR_INVALID_ARG,
+-                       _("Lease %s in lockspace %s does not exist"),
+-                       lease->key, NULLSTR(lease->lockspace));
+-        return -1;
+-    }
+-
+-    if (virDomainLockLeaseDetach(driver->lockManager, vm, lease) < 0)
+-        return -1;
+-
+-    det_lease = virDomainLeaseRemoveAt(vm->def, idx);
+-    virDomainLeaseDefFree(det_lease);
+-    return 0;
+-}
+-
+ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+                               virDomainObjPtr vm,
+                               virDomainChrDefPtr chr,
+@@ -5634,6 +5614,30 @@ qemuDomainDetachVsockDevice(virDomainObjPtr vm,
+ }
+ 
+ 
++int
++qemuDomainDetachLease(virQEMUDriverPtr driver,
++                      virDomainObjPtr vm,
++                      virDomainLeaseDefPtr lease)
++{
++    virDomainLeaseDefPtr det_lease;
++    int idx;
++
++    if ((idx = virDomainLeaseIndex(vm->def, lease)) < 0) {
++        virReportError(VIR_ERR_INVALID_ARG,
++                       _("Lease %s in lockspace %s does not exist"),
++                       lease->key, NULLSTR(lease->lockspace));
++        return -1;
++    }
++
++    if (virDomainLockLeaseDetach(driver->lockManager, vm, lease) < 0)
++        return -1;
++
++    det_lease = virDomainLeaseRemoveAt(vm->def, idx);
++    virDomainLeaseDefFree(det_lease);
++    return 0;
++}
++
++
+ static int
+ qemuDomainRemoveVcpu(virQEMUDriverPtr driver,
+                      virDomainObjPtr vm,
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-move-almost-all-qemuDomainDetach-functions-together.patch b/SOURCES/libvirt-qemu_hotplug-move-almost-all-qemuDomainDetach-functions-together.patch
new file mode 100644
index 0000000..6849e5f
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-move-almost-all-qemuDomainDetach-functions-together.patch
@@ -0,0 +1,215 @@
+From efbfb47fa2b48ea4879a8897a2613963658adb89 Mon Sep 17 00:00:00 2001
+Message-Id: <efbfb47fa2b48ea4879a8897a2613963658adb89@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:38 -0400
+Subject: [PATCH] qemu_hotplug: move (almost) all qemuDomainDetach*() functions
+ together
+
+There were two outliers at the end of the file beyond the Vcpu
+functions.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 5a8ffaec768ce25ef74eb398968e0b84b878a249)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-27-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 174 ++++++++++++++++++++--------------------
+ 1 file changed, 87 insertions(+), 87 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index d80b9b005b..77237a895e 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5547,6 +5547,93 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
++int
++qemuDomainDetachInputDevice(virDomainObjPtr vm,
++                            virDomainInputDefPtr def,
++                            bool async)
++{
++    virDomainInputDefPtr input;
++    int ret = -1;
++    int idx;
++
++    if ((idx = virDomainInputDefFind(vm->def, def)) < 0) {
++        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
++                       _("matching input device not found"));
++        return -1;
++    }
++    input = vm->def->inputs[idx];
++
++    switch ((virDomainInputBus) input->bus) {
++    case VIR_DOMAIN_INPUT_BUS_PS2:
++    case VIR_DOMAIN_INPUT_BUS_XEN:
++    case VIR_DOMAIN_INPUT_BUS_PARALLELS:
++        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
++                       _("input device on bus '%s' cannot be detached"),
++                       virDomainInputBusTypeToString(input->bus));
++        return -1;
++
++    case VIR_DOMAIN_INPUT_BUS_LAST:
++    case VIR_DOMAIN_INPUT_BUS_USB:
++    case VIR_DOMAIN_INPUT_BUS_VIRTIO:
++        break;
++    }
++
++    if (!async)
++        qemuDomainMarkDeviceForRemoval(vm, &input->info);
++
++    if (qemuDomainDeleteDevice(vm, input->info.alias) < 0)
++        goto cleanup;
++
++    if (async) {
++        ret = 0;
++    } else {
++        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
++            ret = qemuDomainRemoveInputDevice(vm, input);
++    }
++
++ cleanup:
++    if (!async)
++        qemuDomainResetDeviceRemoval(vm);
++    return ret;
++}
++
++
++int
++qemuDomainDetachVsockDevice(virDomainObjPtr vm,
++                            virDomainVsockDefPtr dev,
++                            bool async)
++{
++    virDomainVsockDefPtr vsock = vm->def->vsock;
++    int ret = -1;
++
++
++    if (!vsock ||
++        !virDomainVsockDefEquals(dev, vsock)) {
++        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
++                       _("matching vsock device not found"));
++        return -1;
++    }
++
++    if (!async)
++        qemuDomainMarkDeviceForRemoval(vm, &vsock->info);
++
++    if (qemuDomainDeleteDevice(vm, vsock->info.alias) < 0)
++        goto cleanup;
++
++    if (async) {
++        ret = 0;
++    } else {
++        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
++            ret = qemuDomainRemoveVsockDevice(vm, vsock);
++    }
++
++ cleanup:
++    if (!async)
++        qemuDomainResetDeviceRemoval(vm);
++    return ret;
++}
++
++
+ static int
+ qemuDomainRemoveVcpu(virQEMUDriverPtr driver,
+                      virDomainObjPtr vm,
+@@ -6200,90 +6287,3 @@ qemuDomainSetVcpuInternal(virQEMUDriverPtr driver,
+     virObjectUnref(cfg);
+     return ret;
+ }
+-
+-
+-int
+-qemuDomainDetachInputDevice(virDomainObjPtr vm,
+-                            virDomainInputDefPtr def,
+-                            bool async)
+-{
+-    virDomainInputDefPtr input;
+-    int ret = -1;
+-    int idx;
+-
+-    if ((idx = virDomainInputDefFind(vm->def, def)) < 0) {
+-        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+-                       _("matching input device not found"));
+-        return -1;
+-    }
+-    input = vm->def->inputs[idx];
+-
+-    switch ((virDomainInputBus) input->bus) {
+-    case VIR_DOMAIN_INPUT_BUS_PS2:
+-    case VIR_DOMAIN_INPUT_BUS_XEN:
+-    case VIR_DOMAIN_INPUT_BUS_PARALLELS:
+-        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+-                       _("input device on bus '%s' cannot be detached"),
+-                       virDomainInputBusTypeToString(input->bus));
+-        return -1;
+-
+-    case VIR_DOMAIN_INPUT_BUS_LAST:
+-    case VIR_DOMAIN_INPUT_BUS_USB:
+-    case VIR_DOMAIN_INPUT_BUS_VIRTIO:
+-        break;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &input->info);
+-
+-    if (qemuDomainDeleteDevice(vm, input->info.alias) < 0)
+-        goto cleanup;
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveInputDevice(vm, input);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
+-}
+-
+-
+-int
+-qemuDomainDetachVsockDevice(virDomainObjPtr vm,
+-                            virDomainVsockDefPtr dev,
+-                            bool async)
+-{
+-    virDomainVsockDefPtr vsock = vm->def->vsock;
+-    int ret = -1;
+-
+-
+-    if (!vsock ||
+-        !virDomainVsockDefEquals(dev, vsock)) {
+-        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+-                       _("matching vsock device not found"));
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &vsock->info);
+-
+-    if (qemuDomainDeleteDevice(vm, vsock->info.alias) < 0)
+-        goto cleanup;
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveVsockDevice(vm, vsock);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
+-}
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-move-qemuDomainChangeGraphicsPasswords.patch b/SOURCES/libvirt-qemu_hotplug-move-qemuDomainChangeGraphicsPasswords.patch
new file mode 100644
index 0000000..91a2ed2
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-move-qemuDomainChangeGraphicsPasswords.patch
@@ -0,0 +1,195 @@
+From 71278b86a232d83e0e848b61514b9886e7e2697f Mon Sep 17 00:00:00 2001
+Message-Id: <71278b86a232d83e0e848b61514b9886e7e2697f@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:37 -0400
+Subject: [PATCH] qemu_hotplug: move qemuDomainChangeGraphicsPasswords()
+
+It was sitting down in the middle of all the qemuDomainDetach*()
+functions. Move it up with the rest of the qemuDomain*Graphics*()
+functions.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 036a4521f3c539c58bb5706b4710db0f1a16eec6)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-26-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 151 ++++++++++++++++++++--------------------
+ 1 file changed, 77 insertions(+), 74 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 8a3946a6e2..d80b9b005b 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -3574,6 +3574,83 @@ qemuDomainFindGraphicsIndex(virDomainDefPtr def,
+     return -1;
+ }
+ 
++
++int
++qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
++                                  virDomainObjPtr vm,
++                                  int type,
++                                  virDomainGraphicsAuthDefPtr auth,
++                                  const char *defaultPasswd,
++                                  int asyncJob)
++{
++    qemuDomainObjPrivatePtr priv = vm->privateData;
++    time_t now = time(NULL);
++    const char *expire;
++    char *validTo = NULL;
++    const char *connected = NULL;
++    const char *password;
++    int ret = -1;
++    virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
++
++    if (!auth->passwd && !defaultPasswd) {
++        ret = 0;
++        goto cleanup;
++    }
++    password = auth->passwd ? auth->passwd : defaultPasswd;
++
++    if (auth->connected)
++        connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
++
++    if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
++        goto cleanup;
++    ret = qemuMonitorSetPassword(priv->mon, type, password, connected);
++
++    if (ret == -2) {
++        if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
++            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++                           _("Graphics password only supported for VNC"));
++            ret = -1;
++        } else {
++            ret = qemuMonitorSetVNCPassword(priv->mon, password);
++        }
++    }
++    if (ret != 0)
++        goto end_job;
++
++    if (password[0] == '\0' ||
++        (auth->expires && auth->validTo <= now)) {
++        expire = "now";
++    } else if (auth->expires) {
++        if (virAsprintf(&validTo, "%lu", (unsigned long)auth->validTo) < 0)
++            goto end_job;
++        expire = validTo;
++    } else {
++        expire = "never";
++    }
++
++    ret = qemuMonitorExpirePassword(priv->mon, type, expire);
++
++    if (ret == -2) {
++        /* XXX we could fake this with a timer */
++        if (auth->expires) {
++            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++                           _("Expiry of passwords is not supported"));
++            ret = -1;
++        } else {
++            ret = 0;
++        }
++    }
++
++ end_job:
++    if (qemuDomainObjExitMonitor(driver, vm) < 0)
++        ret = -1;
++ cleanup:
++    VIR_FREE(validTo);
++    virObjectUnref(cfg);
++    return ret;
++}
++
++
+ int
+ qemuDomainChangeGraphics(virQEMUDriverPtr driver,
+                          virDomainObjPtr vm,
+@@ -5272,80 +5349,6 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+     return ret;
+ }
+ 
+-int
+-qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
+-                                  virDomainObjPtr vm,
+-                                  int type,
+-                                  virDomainGraphicsAuthDefPtr auth,
+-                                  const char *defaultPasswd,
+-                                  int asyncJob)
+-{
+-    qemuDomainObjPrivatePtr priv = vm->privateData;
+-    time_t now = time(NULL);
+-    const char *expire;
+-    char *validTo = NULL;
+-    const char *connected = NULL;
+-    const char *password;
+-    int ret = -1;
+-    virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+-
+-    if (!auth->passwd && !defaultPasswd) {
+-        ret = 0;
+-        goto cleanup;
+-    }
+-    password = auth->passwd ? auth->passwd : defaultPasswd;
+-
+-    if (auth->connected)
+-        connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
+-
+-    if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+-        goto cleanup;
+-    ret = qemuMonitorSetPassword(priv->mon, type, password, connected);
+-
+-    if (ret == -2) {
+-        if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
+-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+-                           _("Graphics password only supported for VNC"));
+-            ret = -1;
+-        } else {
+-            ret = qemuMonitorSetVNCPassword(priv->mon, password);
+-        }
+-    }
+-    if (ret != 0)
+-        goto end_job;
+-
+-    if (password[0] == '\0' ||
+-        (auth->expires && auth->validTo <= now)) {
+-        expire = "now";
+-    } else if (auth->expires) {
+-        if (virAsprintf(&validTo, "%lu", (unsigned long)auth->validTo) < 0)
+-            goto end_job;
+-        expire = validTo;
+-    } else {
+-        expire = "never";
+-    }
+-
+-    ret = qemuMonitorExpirePassword(priv->mon, type, expire);
+-
+-    if (ret == -2) {
+-        /* XXX we could fake this with a timer */
+-        if (auth->expires) {
+-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+-                           _("Expiry of passwords is not supported"));
+-            ret = -1;
+-        } else {
+-            ret = 0;
+-        }
+-    }
+-
+- end_job:
+-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
+-        ret = -1;
+- cleanup:
+-    VIR_FREE(validTo);
+-    virObjectUnref(cfg);
+-    return ret;
+-}
+ 
+ int qemuDomainAttachLease(virQEMUDriverPtr driver,
+                           virDomainObjPtr vm,
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-move-qemuDomainDetachDeviceLive-to-qemu_hotplug.c.patch b/SOURCES/libvirt-qemu_hotplug-move-qemuDomainDetachDeviceLive-to-qemu_hotplug.c.patch
new file mode 100644
index 0000000..f6e5e55
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-move-qemuDomainDetachDeviceLive-to-qemu_hotplug.c.patch
@@ -0,0 +1,263 @@
+From 5d41ed96da86e3557eef2573d6973f56d43a8574 Mon Sep 17 00:00:00 2001
+Message-Id: <5d41ed96da86e3557eef2573d6973f56d43a8574@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:40 -0400
+Subject: [PATCH] qemu_hotplug: move qemuDomainDetachDeviceLive() to
+ qemu_hotplug.c
+
+This function is going to take on some of the functionality of its
+subordinate functions, which all live in qemu_hotplug.c.
+
+qemuDomainDetachDeviceControllerLive() is only called from
+qemuDomainDetachDeviceLive() (and will soon be merged into
+qemuDomainDetachControllerDevice(), which is in qemu_hotplug.c), so
+it is also moved.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 6a9c3fbade1d5479f4893a0f31293f13ad8bf229)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-29-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_driver.c  | 95 ----------------------------------------
+ src/qemu/qemu_hotplug.c | 97 +++++++++++++++++++++++++++++++++++++++++
+ src/qemu/qemu_hotplug.h |  5 +++
+ 3 files changed, 102 insertions(+), 95 deletions(-)
+
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index 6ab1aa28c5..4cdc68a83a 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -7736,101 +7736,6 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
+     return ret;
+ }
+ 
+-static int
+-qemuDomainDetachDeviceControllerLive(virQEMUDriverPtr driver,
+-                                     virDomainObjPtr vm,
+-                                     virDomainDeviceDefPtr dev,
+-                                     bool async)
+-{
+-    virDomainControllerDefPtr cont = dev->data.controller;
+-    int ret = -1;
+-
+-    switch (cont->type) {
+-    case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
+-        ret = qemuDomainDetachControllerDevice(driver, vm, dev, async);
+-        break;
+-    default :
+-        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+-                       _("'%s' controller cannot be hot unplugged."),
+-                       virDomainControllerTypeToString(cont->type));
+-    }
+-    return ret;
+-}
+-
+-static int
+-qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+-                           virDomainDeviceDefPtr dev,
+-                           virQEMUDriverPtr driver,
+-                           bool async)
+-{
+-    int ret = -1;
+-
+-    switch ((virDomainDeviceType)dev->type) {
+-    case VIR_DOMAIN_DEVICE_DISK:
+-        ret = qemuDomainDetachDeviceDiskLive(driver, vm, dev, async);
+-        break;
+-    case VIR_DOMAIN_DEVICE_CONTROLLER:
+-        ret = qemuDomainDetachDeviceControllerLive(driver, vm, dev, async);
+-        break;
+-    case VIR_DOMAIN_DEVICE_LEASE:
+-        ret = qemuDomainDetachLease(driver, vm, dev->data.lease);
+-        break;
+-    case VIR_DOMAIN_DEVICE_NET:
+-        ret = qemuDomainDetachNetDevice(driver, vm, dev, async);
+-        break;
+-    case VIR_DOMAIN_DEVICE_HOSTDEV:
+-        ret = qemuDomainDetachHostDevice(driver, vm, dev, async);
+-        break;
+-    case VIR_DOMAIN_DEVICE_CHR:
+-        ret = qemuDomainDetachChrDevice(driver, vm, dev->data.chr, async);
+-        break;
+-    case VIR_DOMAIN_DEVICE_RNG:
+-        ret = qemuDomainDetachRNGDevice(driver, vm, dev->data.rng, async);
+-        break;
+-    case VIR_DOMAIN_DEVICE_MEMORY:
+-        ret = qemuDomainDetachMemoryDevice(driver, vm, dev->data.memory, async);
+-        break;
+-    case VIR_DOMAIN_DEVICE_SHMEM:
+-        ret = qemuDomainDetachShmemDevice(driver, vm, dev->data.shmem, async);
+-        break;
+-    case VIR_DOMAIN_DEVICE_WATCHDOG:
+-        ret = qemuDomainDetachWatchdog(driver, vm, dev->data.watchdog, async);
+-        break;
+-    case VIR_DOMAIN_DEVICE_INPUT:
+-        ret = qemuDomainDetachInputDevice(vm, dev->data.input, async);
+-        break;
+-    case VIR_DOMAIN_DEVICE_REDIRDEV:
+-        ret = qemuDomainDetachRedirdevDevice(driver, vm, dev->data.redirdev, async);
+-        break;
+-
+-    case VIR_DOMAIN_DEVICE_VSOCK:
+-        ret = qemuDomainDetachVsockDevice(vm, dev->data.vsock, async);
+-        break;
+-
+-    case VIR_DOMAIN_DEVICE_FS:
+-    case VIR_DOMAIN_DEVICE_SOUND:
+-    case VIR_DOMAIN_DEVICE_VIDEO:
+-    case VIR_DOMAIN_DEVICE_GRAPHICS:
+-    case VIR_DOMAIN_DEVICE_HUB:
+-    case VIR_DOMAIN_DEVICE_SMARTCARD:
+-    case VIR_DOMAIN_DEVICE_MEMBALLOON:
+-    case VIR_DOMAIN_DEVICE_NVRAM:
+-    case VIR_DOMAIN_DEVICE_NONE:
+-    case VIR_DOMAIN_DEVICE_TPM:
+-    case VIR_DOMAIN_DEVICE_PANIC:
+-    case VIR_DOMAIN_DEVICE_IOMMU:
+-    case VIR_DOMAIN_DEVICE_LAST:
+-        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+-                       _("live detach of device '%s' is not supported"),
+-                       virDomainDeviceTypeToString(dev->type));
+-        break;
+-    }
+-
+-    if (ret == 0)
+-        ret = qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE);
+-
+-    return ret;
+-}
+ 
+ static int
+ qemuDomainChangeDiskLive(virDomainObjPtr vm,
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index d55a68e4ad..930f8d3358 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5638,6 +5638,103 @@ qemuDomainDetachLease(virQEMUDriverPtr driver,
+ }
+ 
+ 
++static int
++qemuDomainDetachDeviceControllerLive(virQEMUDriverPtr driver,
++                                     virDomainObjPtr vm,
++                                     virDomainDeviceDefPtr dev,
++                                     bool async)
++{
++    virDomainControllerDefPtr cont = dev->data.controller;
++    int ret = -1;
++
++    switch (cont->type) {
++    case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
++        ret = qemuDomainDetachControllerDevice(driver, vm, dev, async);
++        break;
++    default :
++        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
++                       _("'%s' controller cannot be hot unplugged."),
++                       virDomainControllerTypeToString(cont->type));
++    }
++    return ret;
++}
++
++int
++qemuDomainDetachDeviceLive(virDomainObjPtr vm,
++                           virDomainDeviceDefPtr dev,
++                           virQEMUDriverPtr driver,
++                           bool async)
++{
++    int ret = -1;
++
++    switch ((virDomainDeviceType)dev->type) {
++    case VIR_DOMAIN_DEVICE_DISK:
++        ret = qemuDomainDetachDeviceDiskLive(driver, vm, dev, async);
++        break;
++    case VIR_DOMAIN_DEVICE_CONTROLLER:
++        ret = qemuDomainDetachDeviceControllerLive(driver, vm, dev, async);
++        break;
++    case VIR_DOMAIN_DEVICE_LEASE:
++        ret = qemuDomainDetachLease(driver, vm, dev->data.lease);
++        break;
++    case VIR_DOMAIN_DEVICE_NET:
++        ret = qemuDomainDetachNetDevice(driver, vm, dev, async);
++        break;
++    case VIR_DOMAIN_DEVICE_HOSTDEV:
++        ret = qemuDomainDetachHostDevice(driver, vm, dev, async);
++        break;
++    case VIR_DOMAIN_DEVICE_CHR:
++        ret = qemuDomainDetachChrDevice(driver, vm, dev->data.chr, async);
++        break;
++    case VIR_DOMAIN_DEVICE_RNG:
++        ret = qemuDomainDetachRNGDevice(driver, vm, dev->data.rng, async);
++        break;
++    case VIR_DOMAIN_DEVICE_MEMORY:
++        ret = qemuDomainDetachMemoryDevice(driver, vm, dev->data.memory, async);
++        break;
++    case VIR_DOMAIN_DEVICE_SHMEM:
++        ret = qemuDomainDetachShmemDevice(driver, vm, dev->data.shmem, async);
++        break;
++    case VIR_DOMAIN_DEVICE_WATCHDOG:
++        ret = qemuDomainDetachWatchdog(driver, vm, dev->data.watchdog, async);
++        break;
++    case VIR_DOMAIN_DEVICE_INPUT:
++        ret = qemuDomainDetachInputDevice(vm, dev->data.input, async);
++        break;
++    case VIR_DOMAIN_DEVICE_REDIRDEV:
++        ret = qemuDomainDetachRedirdevDevice(driver, vm, dev->data.redirdev, async);
++        break;
++
++    case VIR_DOMAIN_DEVICE_VSOCK:
++        ret = qemuDomainDetachVsockDevice(vm, dev->data.vsock, async);
++        break;
++
++    case VIR_DOMAIN_DEVICE_FS:
++    case VIR_DOMAIN_DEVICE_SOUND:
++    case VIR_DOMAIN_DEVICE_VIDEO:
++    case VIR_DOMAIN_DEVICE_GRAPHICS:
++    case VIR_DOMAIN_DEVICE_HUB:
++    case VIR_DOMAIN_DEVICE_SMARTCARD:
++    case VIR_DOMAIN_DEVICE_MEMBALLOON:
++    case VIR_DOMAIN_DEVICE_NVRAM:
++    case VIR_DOMAIN_DEVICE_NONE:
++    case VIR_DOMAIN_DEVICE_TPM:
++    case VIR_DOMAIN_DEVICE_PANIC:
++    case VIR_DOMAIN_DEVICE_IOMMU:
++    case VIR_DOMAIN_DEVICE_LAST:
++        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
++                       _("live detach of device '%s' is not supported"),
++                       virDomainDeviceTypeToString(dev->type));
++        break;
++    }
++
++    if (ret == 0)
++        ret = qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE);
++
++    return ret;
++}
++
++
+ static int
+ qemuDomainRemoveVcpu(virQEMUDriverPtr driver,
+                      virDomainObjPtr vm,
+diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
+index 0297e42a98..30b6fcc074 100644
+--- a/src/qemu/qemu_hotplug.h
++++ b/src/qemu/qemu_hotplug.h
+@@ -160,6 +160,11 @@ int qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
+                               virDomainRNGDefPtr rng,
+                               bool async);
+ 
++int qemuDomainDetachDeviceLive(virDomainObjPtr vm,
++                               virDomainDeviceDefPtr dev,
++                               virQEMUDriverPtr driver,
++                               bool async);
++
+ void qemuDomainRemoveVcpuAlias(virQEMUDriverPtr driver,
+                                virDomainObjPtr vm,
+                                const char *alias);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-new-function-qemuDomainRemoveAuditDevice.patch b/SOURCES/libvirt-qemu_hotplug-new-function-qemuDomainRemoveAuditDevice.patch
new file mode 100644
index 0000000..2b0fa36
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-new-function-qemuDomainRemoveAuditDevice.patch
@@ -0,0 +1,101 @@
+From a69ce7395989807eefad14ff7c66540d621bd303 Mon Sep 17 00:00:00 2001
+Message-Id: <a69ce7395989807eefad14ff7c66540d621bd303@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:49 -0400
+Subject: [PATCH] qemu_hotplug: new function qemuDomainRemoveAuditDevice()
+
+This function can be called with a virDomainDevicePtr and whether or
+not the removal was successful, and it will call the appropriate
+virDomainAudit*() function with the appropriate args for whatever type
+of device it's given (or do nothing, if that's appropriate). This
+permits generalizing some code that currently has a separate copy for
+each type of device.
+
+NB: Although the function initially will be called only with
+success=false, that has been made an argument so that in the future
+(when the qemuDomainRemove*Device() functions have had their common
+functionality consolidated into qemuDomainRemoveDevice()), this new
+common code can call qemuDomainRemoveAuditDevice() for all types.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit b914e0eca385b52ede39b1b046bc9bf7a4fbbc2a)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-38-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 55 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index dea881fd0b..482111c46e 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4650,6 +4650,61 @@ qemuDomainRemoveRedirdevDevice(virQEMUDriverPtr driver,
+ }
+ 
+ 
++static void ATTRIBUTE_UNUSED
++qemuDomainRemoveAuditDevice(virDomainObjPtr vm,
++                            virDomainDeviceDefPtr detach,
++                            bool success)
++{
++    switch ((virDomainDeviceType)detach->type) {
++    case VIR_DOMAIN_DEVICE_DISK:
++        virDomainAuditDisk(vm, detach->data.disk->src, NULL, "detach", success);
++        break;
++    case VIR_DOMAIN_DEVICE_NET:
++        virDomainAuditNet(vm, detach->data.net, NULL, "detach", success);
++        break;
++    case VIR_DOMAIN_DEVICE_HOSTDEV:
++        virDomainAuditHostdev(vm, detach->data.hostdev, "detach", success);
++        break;
++
++    case VIR_DOMAIN_DEVICE_INPUT:
++    case VIR_DOMAIN_DEVICE_CHR:
++    case VIR_DOMAIN_DEVICE_RNG:
++    case VIR_DOMAIN_DEVICE_MEMORY:
++    case VIR_DOMAIN_DEVICE_SHMEM:
++    case VIR_DOMAIN_DEVICE_REDIRDEV:
++       /*
++        * These devices are supposed to be audited, but current code
++        * doesn't audit on failure to remove the device.
++        */
++       break;
++
++
++    case VIR_DOMAIN_DEVICE_LEASE:
++    case VIR_DOMAIN_DEVICE_CONTROLLER:
++    case VIR_DOMAIN_DEVICE_WATCHDOG:
++    case VIR_DOMAIN_DEVICE_VSOCK:
++        /* These devices don't have associated audit logs */
++        break;
++
++    case VIR_DOMAIN_DEVICE_FS:
++    case VIR_DOMAIN_DEVICE_SOUND:
++    case VIR_DOMAIN_DEVICE_VIDEO:
++    case VIR_DOMAIN_DEVICE_GRAPHICS:
++    case VIR_DOMAIN_DEVICE_HUB:
++    case VIR_DOMAIN_DEVICE_SMARTCARD:
++    case VIR_DOMAIN_DEVICE_MEMBALLOON:
++    case VIR_DOMAIN_DEVICE_NVRAM:
++    case VIR_DOMAIN_DEVICE_NONE:
++    case VIR_DOMAIN_DEVICE_TPM:
++    case VIR_DOMAIN_DEVICE_PANIC:
++    case VIR_DOMAIN_DEVICE_IOMMU:
++    case VIR_DOMAIN_DEVICE_LAST:
++        /* libvirt doesn't yet support detaching these devices */
++        break;
++    }
++}
++
++
+ int
+ qemuDomainRemoveDevice(virQEMUDriverPtr driver,
+                        virDomainObjPtr vm,
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-pull-qemuDomainUpdateDeviceList-out-of-qemuDomainDetachDeviceLive.patch b/SOURCES/libvirt-qemu_hotplug-pull-qemuDomainUpdateDeviceList-out-of-qemuDomainDetachDeviceLive.patch
new file mode 100644
index 0000000..1c0a323
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-pull-qemuDomainUpdateDeviceList-out-of-qemuDomainDetachDeviceLive.patch
@@ -0,0 +1,108 @@
+From 6cd6434ab5772a1b42cbacc02b894e51bc26056c Mon Sep 17 00:00:00 2001
+Message-Id: <6cd6434ab5772a1b42cbacc02b894e51bc26056c@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:42 -0400
+Subject: [PATCH] qemu_hotplug: pull qemuDomainUpdateDeviceList out of
+ qemuDomainDetachDeviceLive
+
+qemuDomainDetachDeviceLive() is called from two places in
+qemu_driver.c, and qemuDomainUpdateDeviceList() is called from the
+end of qemuDomainDetachDeviceLive(), which is now in qemu_hotplug.c
+
+This patch replaces the single call to qemuDomainUpdateDeviceList()
+with two calls to it immediately after return from
+qemuDomainDetachDeviceLive(). This is only done if the return from
+that function is exactly 0, in order to exactly preserve previous
+behavior.
+
+Removing that one call from qemuDomainDetachDeviceList() will permit
+us to call it from the test driver hotplug test, replacing the
+separate calls to qemuDomainDetachDeviceDiskLive(),
+qemuDomainDetachChrDevice(), qemuDomainDetachShmemDevice() and
+qemuDomainDetachWatchdog(). We want to do this so that part of the
+common functionality of those three functions (and the rest of the
+device-specific Detach functions) can be pulled up into
+qemuDomainDetachDeviceLive() without breaking the test. (This is done
+in the next patch).
+
+NB: Almost certainly this is "not the best place" to call
+qemuDomainUpdateDeviceList() (actually, it is provably the *wrong*
+place), since it's purpose is to retrieve an "up to date" list of
+aliases for all devices from qemu, and if the guest OS hasn't yet
+processed the detach request, the now-being-removed device may still
+be on that list. It would arguably be better to instead call
+qemuDomainUpdateDevicesList() later during the response to the
+DEVICE_DELETED event for the device. But removing the call from the
+current point in the detach could have some unforeseen ill effect due
+to changed timing, so the change to move it into
+qemuDomainRemove*Device() will be done in a separate patch (in order
+to make it easily revertible in case it causes a regression).
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit b20494186578fb779547b714fff77f07e2ca03ea)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-31-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_driver.c  | 14 ++++++++++++--
+ src/qemu/qemu_hotplug.c |  3 ---
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index 4cdc68a83a..e11f57a56a 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -8681,8 +8681,14 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
+     }
+ 
+     if (flags & VIR_DOMAIN_AFFECT_LIVE) {
+-        if (qemuDomainDetachDeviceLive(vm, dev_copy, driver, false) < 0)
++        int rc;
++
++        if ((rc = qemuDomainDetachDeviceLive(vm, dev_copy, driver, false)) < 0)
+             goto cleanup;
++
++        if (rc == 0 && qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
++            goto cleanup;
++
+         /*
+          * update domain status forcibly because the domain status may be
+          * changed even if we failed to attach the device. For example,
+@@ -8759,11 +8765,15 @@ qemuDomainDetachDeviceAliasLiveAndConfig(virQEMUDriverPtr driver,
+ 
+     if (def) {
+         virDomainDeviceDef dev;
++        int rc;
+ 
+         if (virDomainDefFindDevice(def, alias, &dev, true) < 0)
+             goto cleanup;
+ 
+-        if (qemuDomainDetachDeviceLive(vm, &dev, driver, true) < 0)
++        if ((rc = qemuDomainDetachDeviceLive(vm, &dev, driver, true)) < 0)
++            goto cleanup;
++
++        if (rc == 0 && qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
+             goto cleanup;
+     }
+ 
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 1b15116a9f..fd78f4ca01 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5714,9 +5714,6 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+         break;
+     }
+ 
+-    if (ret == 0)
+-        ret = qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE);
+-
+     return ret;
+ }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-refactor-qemuDomainDetachDiskLive-and-qemuDomainDetachDiskDevice.patch b/SOURCES/libvirt-qemu_hotplug-refactor-qemuDomainDetachDiskLive-and-qemuDomainDetachDiskDevice.patch
new file mode 100644
index 0000000..1343067
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-refactor-qemuDomainDetachDiskLive-and-qemuDomainDetachDiskDevice.patch
@@ -0,0 +1,177 @@
+From dea1270caa9ade77248eb0be00a4316a9968a2d9 Mon Sep 17 00:00:00 2001
+Message-Id: <dea1270caa9ade77248eb0be00a4316a9968a2d9@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:34 -0400
+Subject: [PATCH] qemu_hotplug: refactor qemuDomainDetachDiskLive and
+ qemuDomainDetachDiskDevice
+
+qemuDomainDetachDiskDevice() is only called from one place. Moving the
+contents of the function to that place makes
+qemuDomainDetachDiskLive() more similar to the other Detach functions
+called by the toplevel qemuDomainDetachDevice().
+
+The goal is to make each of the device-type-specific functions do this:
+
+  1) find the exact device
+  2) do any device-specific validation
+  3) do general validation
+  4) do device-specific shutdown (only needed for net devices)
+  5) do the common block of code to send device_del to qemu, then
+     optionally wait for a corresponding DEVICE_DELETED event from
+     qemu.
+
+with the final aim being that only items 1 & 2 will remain in each
+device-type-specific function, while 3 & 5 (which are the same for
+almost every type) will be de-duplicated and moved to the toplevel
+function that calls all of these (qemuDomainDetachDeviceLive(), which
+will also contain a callout to the one instance of (4) (netdev).
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit ac442713e6aa1b1087d095796f9c35fd372a0511)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-23-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 84 ++++++++++++++++++-----------------------
+ 1 file changed, 37 insertions(+), 47 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 0ae944475e..18c98c59ec 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4721,47 +4721,6 @@ qemuDomainSignalDeviceRemoval(virDomainObjPtr vm,
+ }
+ 
+ 
+-static int
+-qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
+-                           virDomainObjPtr vm,
+-                           virDomainDiskDefPtr detach,
+-                           bool async)
+-{
+-    int ret = -1;
+-
+-    if (qemuDomainDiskBlockJobIsActive(detach))
+-        return -1;
+-
+-    if (detach->bus == VIR_DOMAIN_DISK_BUS_VIRTIO &&
+-        qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("cannot hot unplug multifunction PCI device: %s"),
+-                       detach->dst);
+-        return -1;
+-    }
+-
+-    if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &detach->info);
+-
+-    if (qemuDomainDeleteDevice(vm, detach->info.alias) < 0) {
+-        if (virDomainObjIsActive(vm))
+-            virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
+-        goto cleanup;
+-    }
+-
+-    if (async) {
+-        ret = 0;
+-    } else {
+-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveDiskDevice(driver, vm, detach);
+-    }
+-
+- cleanup:
+-    if (!async)
+-        qemuDomainResetDeviceRemoval(vm);
+-    return ret;
+-}
+-
+ static int
+ qemuFindDisk(virDomainDefPtr def, const char *dst)
+ {
+@@ -4783,6 +4742,7 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+ {
+     virDomainDiskDefPtr disk;
+     int idx;
++    int ret = -1;
+ 
+     if ((idx = qemuFindDisk(vm->def, dev->data.disk->dst)) < 0) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+@@ -4799,7 +4759,7 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+         case VIR_DOMAIN_DISK_BUS_VIRTIO:
+         case VIR_DOMAIN_DISK_BUS_USB:
+         case VIR_DOMAIN_DISK_BUS_SCSI:
+-            return qemuDomainDetachDiskDevice(driver, vm, disk, async);
++            break;
+ 
+         case VIR_DOMAIN_DISK_BUS_IDE:
+         case VIR_DOMAIN_DISK_BUS_FDC:
+@@ -4809,12 +4769,12 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+         case VIR_DOMAIN_DISK_BUS_SD:
+             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                            _("This type of disk cannot be hot unplugged"));
+-            break;
++            return -1;
+ 
+         case VIR_DOMAIN_DISK_BUS_LAST:
+         default:
+             virReportEnumRangeError(virDomainDiskBus, disk->bus);
+-            break;
++            return -1;
+         }
+         break;
+ 
+@@ -4823,15 +4783,45 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+                        _("disk device type '%s' cannot be detached"),
+                        virDomainDiskDeviceTypeToString(disk->device));
+-        break;
++        return -1;
+ 
+     case VIR_DOMAIN_DISK_DEVICE_LAST:
+     default:
+         virReportEnumRangeError(virDomainDiskDevice, disk->device);
+-        break;
++        return -1;
+     }
+ 
+-    return -1;
++    if (qemuDomainDiskBlockJobIsActive(disk))
++        return -1;
++
++    if (disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO &&
++        qemuIsMultiFunctionDevice(vm->def, &disk->info)) {
++        virReportError(VIR_ERR_OPERATION_FAILED,
++                       _("cannot hot unplug multifunction PCI device: %s"),
++                       disk->dst);
++        return -1;
++    }
++
++    if (!async)
++        qemuDomainMarkDeviceForRemoval(vm, &disk->info);
++
++    if (qemuDomainDeleteDevice(vm, disk->info.alias) < 0) {
++        if (virDomainObjIsActive(vm))
++            virDomainAuditDisk(vm, disk->src, NULL, "detach", false);
++        goto cleanup;
++    }
++
++    if (async) {
++        ret = 0;
++    } else {
++        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
++            ret = qemuDomainRemoveDiskDevice(driver, vm, disk);
++    }
++
++ cleanup:
++    if (!async)
++        qemuDomainResetDeviceRemoval(vm);
++    return ret;
+ }
+ 
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-remove-extra-function-in-middle-of-DetachController-call-chain.patch b/SOURCES/libvirt-qemu_hotplug-remove-extra-function-in-middle-of-DetachController-call-chain.patch
new file mode 100644
index 0000000..f9aa95f
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-remove-extra-function-in-middle-of-DetachController-call-chain.patch
@@ -0,0 +1,85 @@
+From 2c69082662aaa4892434bcd16c764029f707ae0d Mon Sep 17 00:00:00 2001
+Message-Id: <2c69082662aaa4892434bcd16c764029f707ae0d@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:41 -0400
+Subject: [PATCH] qemu_hotplug: remove extra function in middle of
+ DetachController call chain
+
+qemuDomainDetachDeviceControllerLive() just checks if the controller
+type is SCSI, and then either returns failure, or calls
+qemuDomainDetachControllerDevice().
+
+Instead, lets just check for type != SCSI at the top of the latter
+function, and call it directly.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit e4d96324b48b8aab864212382390a5c4a40970d2)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-30-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 30 ++++++++----------------------
+ 1 file changed, 8 insertions(+), 22 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 930f8d3358..1b15116a9f 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4996,6 +4996,13 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+     int idx, ret = -1;
+     virDomainControllerDefPtr detach = NULL;
+ 
++    if (dev->data.controller->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
++        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
++                       _("'%s' controller cannot be hot unplugged."),
++                       virDomainControllerTypeToString(dev->data.controller->type));
++        return -1;
++    }
++
+     if ((idx = virDomainControllerFind(vm->def,
+                                        dev->data.controller->type,
+                                        dev->data.controller->idx)) < 0) {
+@@ -5638,27 +5645,6 @@ qemuDomainDetachLease(virQEMUDriverPtr driver,
+ }
+ 
+ 
+-static int
+-qemuDomainDetachDeviceControllerLive(virQEMUDriverPtr driver,
+-                                     virDomainObjPtr vm,
+-                                     virDomainDeviceDefPtr dev,
+-                                     bool async)
+-{
+-    virDomainControllerDefPtr cont = dev->data.controller;
+-    int ret = -1;
+-
+-    switch (cont->type) {
+-    case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
+-        ret = qemuDomainDetachControllerDevice(driver, vm, dev, async);
+-        break;
+-    default :
+-        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+-                       _("'%s' controller cannot be hot unplugged."),
+-                       virDomainControllerTypeToString(cont->type));
+-    }
+-    return ret;
+-}
+-
+ int
+ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+                            virDomainDeviceDefPtr dev,
+@@ -5672,7 +5658,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+         ret = qemuDomainDetachDeviceDiskLive(driver, vm, dev, async);
+         break;
+     case VIR_DOMAIN_DEVICE_CONTROLLER:
+-        ret = qemuDomainDetachDeviceControllerLive(driver, vm, dev, async);
++        ret = qemuDomainDetachControllerDevice(driver, vm, dev, async);
+         break;
+     case VIR_DOMAIN_DEVICE_LEASE:
+         ret = qemuDomainDetachLease(driver, vm, dev->data.lease);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-remove-unnecessary-check-for-valid-PCI-address.patch b/SOURCES/libvirt-qemu_hotplug-remove-unnecessary-check-for-valid-PCI-address.patch
new file mode 100644
index 0000000..101dfde
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-remove-unnecessary-check-for-valid-PCI-address.patch
@@ -0,0 +1,69 @@
+From 9eba70b364bae88085b524d528ac71cb4337e57c Mon Sep 17 00:00:00 2001
+Message-Id: <9eba70b364bae88085b524d528ac71cb4337e57c@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:30 -0400
+Subject: [PATCH] qemu_hotplug: remove unnecessary check for valid PCI address
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When support for hotplug/unplug of SCSI controllers was added way back
+in December 2009 (commit da9d937b), unplug was handled by calling the
+now-extinct function qemuMonitorRemovePCIDevice(), which required a
+PCI address as an argument. At the same time, the idea of every device
+in the config having a PCI address apparently was not yet fully
+implemented, because the author of the patch including a check for a
+valid PCI address in the device object.
+
+These days, all PCI devices are guaranteed to have a valid PCI
+address. But more important than that, we no longer detach devices by
+PCI address, but instead use qemuDomainDeleteDevice(), which
+identifies the device by its alias. So checking for a valid PCI
+address is just pointless extra code that obscures the high level of
+similarity between all the individual qemuDomainDetach*Device()
+functions.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 155064e0ed53b13701ff176c3f92605b1a850a9d)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-19-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index ffb2e258b5..39e40e2740 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4915,22 +4915,6 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+ 
+     detach = vm->def->controllers[idx];
+ 
+-    if (detach->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
+-        detach->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW &&
+-        detach->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("device with '%s' address cannot be detached"),
+-                       virDomainDeviceAddressTypeToString(detach->info.type));
+-        goto cleanup;
+-    }
+-
+-    if (!virDomainDeviceAddressIsValid(&detach->info, detach->info.type)) {
+-        virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("device with invalid '%s' address cannot be detached"),
+-                       virDomainDeviceAddressTypeToString(detach->info.type));
+-        goto cleanup;
+-    }
+-
+     if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+                        _("cannot hot unplug multifunction PCI device: %s"),
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-rename-Chr-and-Lease-Detach-functions.patch b/SOURCES/libvirt-qemu_hotplug-rename-Chr-and-Lease-Detach-functions.patch
new file mode 100644
index 0000000..8d8b95e
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-rename-Chr-and-Lease-Detach-functions.patch
@@ -0,0 +1,64 @@
+From a3a6757726ad16eb0bdb528c700f982f3145a483 Mon Sep 17 00:00:00 2001
+Message-Id: <a3a6757726ad16eb0bdb528c700f982f3145a483@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:48 -0400
+Subject: [PATCH] qemu_hotplug: rename Chr and Lease Detach functions
+
+qemuDomainDetachDeviceChr and qemuDomainDetachDeviceLease are more
+consistent with each other.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit e1949c7045377e7b32f0f8ed7c76539b1b5d50da)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-37-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 693b8878b5..dea881fd0b 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5392,7 +5392,7 @@ qemuDomainDetachPrepNet(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
++qemuDomainDetachDeviceChr(virQEMUDriverPtr driver,
+                           virDomainObjPtr vm,
+                           virDomainChrDefPtr chr,
+                           bool async)
+@@ -5636,9 +5636,9 @@ qemuDomainDetachPrepVsock(virDomainObjPtr vm,
+ 
+ 
+ static int
+-qemuDomainDetachLease(virQEMUDriverPtr driver,
+-                      virDomainObjPtr vm,
+-                      virDomainLeaseDefPtr lease)
++qemuDomainDetachDeviceLease(virQEMUDriverPtr driver,
++                            virDomainObjPtr vm,
++                            virDomainLeaseDefPtr lease)
+ {
+     virDomainLeaseDefPtr det_lease;
+     int idx;
+@@ -5675,10 +5675,10 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+          * Detach functions.
+          */
+     case VIR_DOMAIN_DEVICE_LEASE:
+-        return qemuDomainDetachLease(driver, vm, match->data.lease);
++        return qemuDomainDetachDeviceLease(driver, vm, match->data.lease);
+ 
+     case VIR_DOMAIN_DEVICE_CHR:
+-        return qemuDomainDetachChrDevice(driver, vm, match->data.chr, async);
++        return qemuDomainDetachDeviceChr(driver, vm, match->data.chr, async);
+ 
+         /*
+          * All the other device types follow a very similar pattern -
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-rename-a-virDomainDeviceInfoPtr-to-avoid-confusion.patch b/SOURCES/libvirt-qemu_hotplug-rename-a-virDomainDeviceInfoPtr-to-avoid-confusion.patch
new file mode 100644
index 0000000..e78587a
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-rename-a-virDomainDeviceInfoPtr-to-avoid-confusion.patch
@@ -0,0 +1,46 @@
+From d1c6b7242e843843fbf6c961047440c7983b142f Mon Sep 17 00:00:00 2001
+Message-Id: <d1c6b7242e843843fbf6c961047440c7983b142f@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:31 -0400
+Subject: [PATCH] qemu_hotplug: rename a virDomainDeviceInfoPtr to avoid
+ confusion
+
+Having an InfoPtr named "dev" made my brain hurt. Renaming it to
+"info" gives one less thing to confuse when looking at the code.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 1c2866a1f6087837688c3c2beea08753dc6871d0)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-20-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 39e40e2740..2bfb5f8d54 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -3784,12 +3784,12 @@ static int qemuComparePCIDevice(virDomainDefPtr def ATTRIBUTE_UNUSED,
+ }
+ 
+ static bool qemuIsMultiFunctionDevice(virDomainDefPtr def,
+-                                      virDomainDeviceInfoPtr dev)
++                                      virDomainDeviceInfoPtr info)
+ {
+-    if (dev->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)
++    if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)
+         return false;
+ 
+-    if (virDomainDeviceInfoIterate(def, qemuComparePCIDevice, dev) < 0)
++    if (virDomainDeviceInfoIterate(def, qemuComparePCIDevice, info) < 0)
+         return true;
+     return false;
+ }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-rename-dev-to-match-in-qemuDomainDetachDeviceLive.patch b/SOURCES/libvirt-qemu_hotplug-rename-dev-to-match-in-qemuDomainDetachDeviceLive.patch
new file mode 100644
index 0000000..f980744
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-rename-dev-to-match-in-qemuDomainDetachDeviceLive.patch
@@ -0,0 +1,123 @@
+From b0664bfa45b1615cab1c66d502018e1c23d32529 Mon Sep 17 00:00:00 2001
+Message-Id: <b0664bfa45b1615cab1c66d502018e1c23d32529@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:45 -0400
+Subject: [PATCH] qemu_hotplug: rename dev to match in
+ qemuDomainDetachDeviceLive
+
+I'm about to add a second virDomainDeviceDef to this function that
+will point to the actual device in the domain object. while this is
+just a partially filled-in example of what to look for. Naming it
+match will make the code easier to follow.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit c4d6a121a8e903dc8d012d6737fd308b3ddec31a)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-34-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 32 ++++++++++++++++----------------
+ src/qemu/qemu_hotplug.h |  2 +-
+ 2 files changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index b0f45708ae..a655fc391f 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5650,52 +5650,52 @@ qemuDomainDetachLease(virQEMUDriverPtr driver,
+ 
+ int
+ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+-                           virDomainDeviceDefPtr dev,
++                           virDomainDeviceDefPtr match,
+                            virQEMUDriverPtr driver,
+                            bool async)
+ {
+     int ret = -1;
+ 
+-    switch ((virDomainDeviceType)dev->type) {
++    switch ((virDomainDeviceType)match->type) {
+     case VIR_DOMAIN_DEVICE_DISK:
+-        ret = qemuDomainDetachDeviceDiskLive(driver, vm, dev, async);
++        ret = qemuDomainDetachDeviceDiskLive(driver, vm, match, async);
+         break;
+     case VIR_DOMAIN_DEVICE_CONTROLLER:
+-        ret = qemuDomainDetachControllerDevice(driver, vm, dev, async);
++        ret = qemuDomainDetachControllerDevice(driver, vm, match, async);
+         break;
+     case VIR_DOMAIN_DEVICE_LEASE:
+-        ret = qemuDomainDetachLease(driver, vm, dev->data.lease);
++        ret = qemuDomainDetachLease(driver, vm, match->data.lease);
+         break;
+     case VIR_DOMAIN_DEVICE_NET:
+-        ret = qemuDomainDetachNetDevice(driver, vm, dev, async);
++        ret = qemuDomainDetachNetDevice(driver, vm, match, async);
+         break;
+     case VIR_DOMAIN_DEVICE_HOSTDEV:
+-        ret = qemuDomainDetachHostDevice(driver, vm, dev, async);
++        ret = qemuDomainDetachHostDevice(driver, vm, match, async);
+         break;
+     case VIR_DOMAIN_DEVICE_CHR:
+-        ret = qemuDomainDetachChrDevice(driver, vm, dev->data.chr, async);
++        ret = qemuDomainDetachChrDevice(driver, vm, match->data.chr, async);
+         break;
+     case VIR_DOMAIN_DEVICE_RNG:
+-        ret = qemuDomainDetachRNGDevice(driver, vm, dev->data.rng, async);
++        ret = qemuDomainDetachRNGDevice(driver, vm, match->data.rng, async);
+         break;
+     case VIR_DOMAIN_DEVICE_MEMORY:
+-        ret = qemuDomainDetachMemoryDevice(driver, vm, dev->data.memory, async);
++        ret = qemuDomainDetachMemoryDevice(driver, vm, match->data.memory, async);
+         break;
+     case VIR_DOMAIN_DEVICE_SHMEM:
+-        ret = qemuDomainDetachShmemDevice(driver, vm, dev->data.shmem, async);
++        ret = qemuDomainDetachShmemDevice(driver, vm, match->data.shmem, async);
+         break;
+     case VIR_DOMAIN_DEVICE_WATCHDOG:
+-        ret = qemuDomainDetachWatchdog(driver, vm, dev->data.watchdog, async);
++        ret = qemuDomainDetachWatchdog(driver, vm, match->data.watchdog, async);
+         break;
+     case VIR_DOMAIN_DEVICE_INPUT:
+-        ret = qemuDomainDetachInputDevice(vm, dev->data.input, async);
++        ret = qemuDomainDetachInputDevice(vm, match->data.input, async);
+         break;
+     case VIR_DOMAIN_DEVICE_REDIRDEV:
+-        ret = qemuDomainDetachRedirdevDevice(driver, vm, dev->data.redirdev, async);
++        ret = qemuDomainDetachRedirdevDevice(driver, vm, match->data.redirdev, async);
+         break;
+ 
+     case VIR_DOMAIN_DEVICE_VSOCK:
+-        ret = qemuDomainDetachVsockDevice(vm, dev->data.vsock, async);
++        ret = qemuDomainDetachVsockDevice(vm, match->data.vsock, async);
+         break;
+ 
+     case VIR_DOMAIN_DEVICE_FS:
+@@ -5713,7 +5713,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+     case VIR_DOMAIN_DEVICE_LAST:
+         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+                        _("live detach of device '%s' is not supported"),
+-                       virDomainDeviceTypeToString(dev->type));
++                       virDomainDeviceTypeToString(match->type));
+         break;
+     }
+ 
+diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
+index e8e4934db8..699d61877f 100644
+--- a/src/qemu/qemu_hotplug.h
++++ b/src/qemu/qemu_hotplug.h
+@@ -117,7 +117,7 @@ int qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
+                               virDomainRNGDefPtr rng);
+ 
+ int qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+-                               virDomainDeviceDefPtr dev,
++                               virDomainDeviceDefPtr match,
+                                virQEMUDriverPtr driver,
+                                bool async);
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-separate-Chr-Lease-from-other-devices-in-DetachDevice-switch.patch b/SOURCES/libvirt-qemu_hotplug-separate-Chr-Lease-from-other-devices-in-DetachDevice-switch.patch
new file mode 100644
index 0000000..185dc09
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-separate-Chr-Lease-from-other-devices-in-DetachDevice-switch.patch
@@ -0,0 +1,94 @@
+From ff7bc70a5e5d7aaf354ce501653beb82429030fe Mon Sep 17 00:00:00 2001
+Message-Id: <ff7bc70a5e5d7aaf354ce501653beb82429030fe@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:46 -0400
+Subject: [PATCH] qemu_hotplug: separate Chr|Lease from other devices in
+ DetachDevice switch
+
+The Chr and Lease devices have detach code that is too different from
+the other device types to handle with common functionality (which will
+soon be added at the end of qemuDomainDetachDeviceLive(). In order to
+make this difference obvious, move the cases for those two device
+types to the top of the switch statement in
+qemuDomainDetachDeviceLive(), have the cases return immediately so the
+future common code at the end of the function will be skipped, and
+also include some hopefully helpful comments to remind future
+maintainers why these two device types are treated differently.
+
+Any attempt to detach an unsupported device type should also skip the
+future common code at the end of the function, so the case for
+unsupported types is similarly changed from a simple break to a return
+-1.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit 2ec6faea798b2a7d8986b7a958e781b54d8a8070)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-35-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 26 +++++++++++++++++++-------
+ 1 file changed, 19 insertions(+), 7 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index a655fc391f..9c0ee1c6a5 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -5657,24 +5657,36 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+     int ret = -1;
+ 
+     switch ((virDomainDeviceType)match->type) {
++        /*
++         * lease and chr devices don't follow the standard pattern of
++         * the others, so they must have their own self-contained
++         * Detach functions.
++         */
++    case VIR_DOMAIN_DEVICE_LEASE:
++        return qemuDomainDetachLease(driver, vm, match->data.lease);
++
++    case VIR_DOMAIN_DEVICE_CHR:
++        return qemuDomainDetachChrDevice(driver, vm, match->data.chr, async);
++
++        /*
++         * All the other device types follow a very similar pattern -
++         * First we call type-specific functions to 1) locate the
++         * device we want to detach (based on the prototype device in
++         * match) and 2) do any device-type-specific validation to
++         * assure it is okay to detach the device.
++         */
+     case VIR_DOMAIN_DEVICE_DISK:
+         ret = qemuDomainDetachDeviceDiskLive(driver, vm, match, async);
+         break;
+     case VIR_DOMAIN_DEVICE_CONTROLLER:
+         ret = qemuDomainDetachControllerDevice(driver, vm, match, async);
+         break;
+-    case VIR_DOMAIN_DEVICE_LEASE:
+-        ret = qemuDomainDetachLease(driver, vm, match->data.lease);
+-        break;
+     case VIR_DOMAIN_DEVICE_NET:
+         ret = qemuDomainDetachNetDevice(driver, vm, match, async);
+         break;
+     case VIR_DOMAIN_DEVICE_HOSTDEV:
+         ret = qemuDomainDetachHostDevice(driver, vm, match, async);
+         break;
+-    case VIR_DOMAIN_DEVICE_CHR:
+-        ret = qemuDomainDetachChrDevice(driver, vm, match->data.chr, async);
+-        break;
+     case VIR_DOMAIN_DEVICE_RNG:
+         ret = qemuDomainDetachRNGDevice(driver, vm, match->data.rng, async);
+         break;
+@@ -5714,7 +5726,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+                        _("live detach of device '%s' is not supported"),
+                        virDomainDeviceTypeToString(match->type));
+-        break;
++        return -1;
+     }
+ 
+     return ret;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemu_hotplug-standardize-the-names-args-calling-of-qemuDomainDetach.patch b/SOURCES/libvirt-qemu_hotplug-standardize-the-names-args-calling-of-qemuDomainDetach.patch
new file mode 100644
index 0000000..9a5f560
--- /dev/null
+++ b/SOURCES/libvirt-qemu_hotplug-standardize-the-names-args-calling-of-qemuDomainDetach.patch
@@ -0,0 +1,692 @@
+From 14c62fbf0a1ed27ab12ba439afd0d2e7c55996f2 Mon Sep 17 00:00:00 2001
+Message-Id: <14c62fbf0a1ed27ab12ba439afd0d2e7c55996f2@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:47 -0400
+Subject: [PATCH] qemu_hotplug: standardize the names/args/calling of
+ qemuDomainDetach*()
+
+Most of these functions will soon contain only some setup for
+detaching the device, not the detach code proper (since that code is
+identical for these devices). Their device specific functions are all
+being renamed to qemuDomainDetachPrep*(), where * is the
+name of that device's data member in the virDomainDeviceDef
+object.
+
+Since there will be other code in qemuDomainDetachDeviceLive() after
+the calls to qemuDomainDetachPrep*() that could still fail, we no
+longer directly set "ret" with the return code from
+qemuDomainDetachPrep*() functions, but simply return -1 on
+failure, and wait until the end of qemuDomainDetachDeviceLive() to set
+ret = 0.
+
+Along with the rename, qemuDomainDetachPrep*() functions are also
+given similar arglists, including an arg called "match" that points to
+the proto-object of the device we want to delete, and another arg
+"detach" that is used to return a pointer to the actual object that
+will be (for now *has been*) detached. To make sure these new args
+aren't confused with existing local pointers that sometimes had the
+same name (detach), the local pointer to the device is now named after
+the device type ("controller", "disk", etc). These point to the same
+place as (*detach)->data.blah, it's just easier on the eyes to have,
+e.g., "disk->dst" rather than "(*detach)->data.disk-dst".
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit b6a53bf9079bc9ef2dc3f8b85ff5c84da14b9a0a)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-36-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/qemu/qemu_hotplug.c | 316 +++++++++++++++++++++++-----------------
+ 1 file changed, 181 insertions(+), 135 deletions(-)
+
+diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
+index 9c0ee1c6a5..693b8878b5 100644
+--- a/src/qemu/qemu_hotplug.c
++++ b/src/qemu/qemu_hotplug.c
+@@ -4838,21 +4838,22 @@ qemuFindDisk(virDomainDefPtr def, const char *dst)
+ }
+ 
+ static int
+-qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
+-                               virDomainObjPtr vm,
+-                               virDomainDeviceDefPtr dev,
+-                               bool async)
++qemuDomainDetachPrepDisk(virQEMUDriverPtr driver,
++                         virDomainObjPtr vm,
++                         virDomainDiskDefPtr match,
++                         virDomainDiskDefPtr *detach,
++                         bool async)
+ {
+     virDomainDiskDefPtr disk;
+     int idx;
+     int ret = -1;
+ 
+-    if ((idx = qemuFindDisk(vm->def, dev->data.disk->dst)) < 0) {
++    if ((idx = qemuFindDisk(vm->def, match->dst)) < 0) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("disk %s not found"), dev->data.disk->dst);
++                       _("disk %s not found"), match->dst);
+         return -1;
+     }
+-    disk = vm->def->disks[idx];
++    *detach = disk = vm->def->disks[idx];
+ 
+     switch ((virDomainDiskDevice) disk->device) {
+     case VIR_DOMAIN_DISK_DEVICE_DISK:
+@@ -4989,57 +4990,55 @@ static bool qemuDomainControllerIsBusy(virDomainObjPtr vm,
+ }
+ 
+ static int
+-qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+-                                 virDomainObjPtr vm,
+-                                 virDomainDeviceDefPtr dev,
+-                                 bool async)
++qemuDomainDetachPrepController(virQEMUDriverPtr driver,
++                               virDomainObjPtr vm,
++                               virDomainControllerDefPtr match,
++                               virDomainControllerDefPtr *detach,
++                               bool async)
+ {
+     int idx, ret = -1;
+-    virDomainControllerDefPtr detach = NULL;
++    virDomainControllerDefPtr controller = NULL;
+ 
+-    if (dev->data.controller->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
++    if (match->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
+         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+                        _("'%s' controller cannot be hot unplugged."),
+-                       virDomainControllerTypeToString(dev->data.controller->type));
++                       virDomainControllerTypeToString(match->type));
+         return -1;
+     }
+ 
+-    if ((idx = virDomainControllerFind(vm->def,
+-                                       dev->data.controller->type,
+-                                       dev->data.controller->idx)) < 0) {
++    if ((idx = virDomainControllerFind(vm->def, match->type, match->idx)) < 0) {
+         virReportError(VIR_ERR_DEVICE_MISSING,
+                        _("controller %s:%d not found"),
+-                       virDomainControllerTypeToString(dev->data.controller->type),
+-                       dev->data.controller->idx);
++                       virDomainControllerTypeToString(match->type),
++                       match->idx);
+         goto cleanup;
+     }
+ 
+-    detach = vm->def->controllers[idx];
++    *detach = controller = vm->def->controllers[idx];
+ 
+-    if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
++    if (qemuIsMultiFunctionDevice(vm->def, &controller->info)) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+-                       _("cannot hot unplug multifunction PCI device: %s"),
+-                       dev->data.disk->dst);
++                       "%s", _("cannot hot unplug multifunction PCI device"));
+         goto cleanup;
+     }
+ 
+-    if (qemuDomainControllerIsBusy(vm, detach)) {
++    if (qemuDomainControllerIsBusy(vm, controller)) {
+         virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                        _("device cannot be detached: device is busy"));
+         goto cleanup;
+     }
+ 
+     if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &detach->info);
++        qemuDomainMarkDeviceForRemoval(vm, &controller->info);
+ 
+-    if (qemuDomainDeleteDevice(vm, detach->info.alias) < 0)
++    if (qemuDomainDeleteDevice(vm, controller->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+         ret = 0;
+     } else {
+         if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveControllerDevice(driver, vm, detach);
++            ret = qemuDomainRemoveControllerDevice(driver, vm, controller);
+     }
+ 
+  cleanup:
+@@ -5051,29 +5050,30 @@ qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
+ 
+ /* search for a hostdev matching dev and detach it */
+ static int
+-qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+-                           virDomainObjPtr vm,
+-                           virDomainDeviceDefPtr dev,
+-                           bool async)
++qemuDomainDetachPrepHostdev(virQEMUDriverPtr driver,
++                            virDomainObjPtr vm,
++                            virDomainHostdevDefPtr match,
++                            virDomainHostdevDefPtr *detach,
++                            bool async)
+ {
+-    virDomainHostdevDefPtr hostdev = dev->data.hostdev;
+-    virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys;
++    virDomainHostdevSubsysPtr subsys = &match->source.subsys;
+     virDomainHostdevSubsysUSBPtr usbsrc = &subsys->u.usb;
+     virDomainHostdevSubsysPCIPtr pcisrc = &subsys->u.pci;
+     virDomainHostdevSubsysSCSIPtr scsisrc = &subsys->u.scsi;
+     virDomainHostdevSubsysMediatedDevPtr mdevsrc = &subsys->u.mdev;
+-    virDomainHostdevDefPtr detach = NULL;
++    virDomainHostdevDefPtr hostdev = NULL;
+     int idx;
+     int ret = -1;
+ 
+-    if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
++    if (match->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
+         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                        _("hot unplug is not supported for hostdev mode '%s'"),
+-                       virDomainHostdevModeTypeToString(hostdev->mode));
++                       virDomainHostdevModeTypeToString(match->mode));
+         return -1;
+     }
+ 
+-    idx = virDomainHostdevFind(vm->def, hostdev, &detach);
++    idx = virDomainHostdevFind(vm->def, match, &hostdev);
++    *detach = hostdev;
+ 
+     if (idx < 0) {
+         switch (subsys->type) {
+@@ -5126,27 +5126,27 @@ qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+         return -1;
+     }
+ 
+-    if (qemuIsMultiFunctionDevice(vm->def, detach->info)) {
++    if (qemuIsMultiFunctionDevice(vm->def, hostdev->info)) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+                        _("cannot hot unplug multifunction PCI device with guest address: "
+                          "%.4x:%.2x:%.2x.%.1x"),
+-                       detach->info->addr.pci.domain, detach->info->addr.pci.bus,
+-                       detach->info->addr.pci.slot, detach->info->addr.pci.function);
++                       hostdev->info->addr.pci.domain, hostdev->info->addr.pci.bus,
++                       hostdev->info->addr.pci.slot, hostdev->info->addr.pci.function);
+         return -1;
+     }
+ 
+-    if (!detach->info->alias) {
++    if (!hostdev->info->alias) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+                        "%s", _("device cannot be detached without a device alias"));
+         return -1;
+     }
+ 
+     if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, detach->info);
++        qemuDomainMarkDeviceForRemoval(vm, hostdev->info);
+ 
+-    if (qemuDomainDeleteDevice(vm, detach->info->alias) < 0) {
++    if (qemuDomainDeleteDevice(vm, hostdev->info->alias) < 0) {
+         if (virDomainObjIsActive(vm))
+-            virDomainAuditHostdev(vm, detach, "detach", false);
++            virDomainAuditHostdev(vm, hostdev, "detach", false);
+         goto cleanup;
+     }
+ 
+@@ -5154,7 +5154,7 @@ qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+         ret = 0;
+     } else {
+         if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveHostDevice(driver, vm, detach);
++            ret = qemuDomainRemoveHostDevice(driver, vm, hostdev);
+     }
+ 
+  cleanup:
+@@ -5167,24 +5167,25 @@ qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
+-                            virDomainObjPtr vm,
+-                            virDomainShmemDefPtr dev,
+-                            bool async)
++qemuDomainDetachPrepShmem(virQEMUDriverPtr driver,
++                          virDomainObjPtr vm,
++                          virDomainShmemDefPtr match,
++                          virDomainShmemDefPtr *detach,
++                          bool async)
+ {
+     int ret = -1;
+     ssize_t idx = -1;
+     virDomainShmemDefPtr shmem = NULL;
+ 
+-    if ((idx = virDomainShmemDefFind(vm->def, dev)) < 0) {
++    if ((idx = virDomainShmemDefFind(vm->def, match)) < 0) {
+         virReportError(VIR_ERR_DEVICE_MISSING,
+                        _("model '%s' shmem device not present "
+                          "in domain configuration"),
+-                       virDomainShmemModelTypeToString(dev->model));
++                       virDomainShmemModelTypeToString(match->model));
+         return -1;
+     }
+ 
+-    shmem = vm->def->shmems[idx];
++    *detach = shmem = vm->def->shmems[idx];
+ 
+     switch ((virDomainShmemModel)shmem->model) {
+     case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_PLAIN:
+@@ -5221,13 +5222,16 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
+-                         virDomainObjPtr vm,
+-                         virDomainWatchdogDefPtr dev,
+-                         bool async)
++qemuDomainDetachPrepWatchdog(virQEMUDriverPtr driver,
++                             virDomainObjPtr vm,
++                             virDomainWatchdogDefPtr match,
++                             virDomainWatchdogDefPtr *detach,
++                             bool async)
+ {
+     int ret = -1;
+-    virDomainWatchdogDefPtr watchdog = vm->def->watchdog;
++    virDomainWatchdogDefPtr watchdog;
++
++    *detach = watchdog = vm->def->watchdog;
+ 
+     if (!watchdog) {
+         virReportError(VIR_ERR_DEVICE_MISSING, "%s",
+@@ -5238,9 +5242,9 @@ qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
+     /* While domains can have up to one watchdog, the one supplied by the user
+      * doesn't necessarily match the one domain has. Refuse to detach in such
+      * case. */
+-    if (!(watchdog->model == dev->model &&
+-          watchdog->action == dev->action &&
+-          virDomainDeviceInfoAddressIsEqual(&dev->info, &watchdog->info))) {
++    if (!(watchdog->model == match->model &&
++          watchdog->action == match->action &&
++          virDomainDeviceInfoAddressIsEqual(&match->info, &watchdog->info))) {
+         virReportError(VIR_ERR_DEVICE_MISSING,
+                        _("model '%s' watchdog device not present "
+                          "in domain configuration"),
+@@ -5276,40 +5280,41 @@ qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainDetachRedirdevDevice(virQEMUDriverPtr driver,
+-                               virDomainObjPtr vm,
+-                               virDomainRedirdevDefPtr dev,
+-                               bool async)
++qemuDomainDetachPrepRedirdev(virQEMUDriverPtr driver,
++                             virDomainObjPtr vm,
++                             virDomainRedirdevDefPtr match,
++                             virDomainRedirdevDefPtr *detach,
++                             bool async)
+ {
+     int ret = -1;
+-    virDomainRedirdevDefPtr tmpRedirdevDef;
++    virDomainRedirdevDefPtr redirdev;
+     ssize_t idx;
+ 
+-    if ((idx = virDomainRedirdevDefFind(vm->def, dev)) < 0) {
++    if ((idx = virDomainRedirdevDefFind(vm->def, match)) < 0) {
+         virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                        _("no matching redirdev was not found"));
+         return -1;
+     }
+ 
+-    tmpRedirdevDef = vm->def->redirdevs[idx];
++    *detach = redirdev = vm->def->redirdevs[idx];
+ 
+-    if (!tmpRedirdevDef->info.alias) {
++    if (!redirdev->info.alias) {
+         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("alias not set for redirdev device"));
+         return -1;
+     }
+ 
+     if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &tmpRedirdevDef->info);
++        qemuDomainMarkDeviceForRemoval(vm, &redirdev->info);
+ 
+-    if (qemuDomainDeleteDevice(vm, tmpRedirdevDef->info.alias) < 0)
++    if (qemuDomainDeleteDevice(vm, redirdev->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+         ret = 0;
+     } else {
+         if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveRedirdevDevice(driver, vm, tmpRedirdevDef);
++            ret = qemuDomainRemoveRedirdevDevice(driver, vm, redirdev);
+     }
+ 
+  cleanup:
+@@ -5320,53 +5325,54 @@ qemuDomainDetachRedirdevDevice(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+-                          virDomainObjPtr vm,
+-                          virDomainDeviceDefPtr dev,
+-                          bool async)
++qemuDomainDetachPrepNet(virQEMUDriverPtr driver,
++                        virDomainObjPtr vm,
++                        virDomainNetDefPtr match,
++                        virDomainNetDefPtr *detach,
++                        bool async)
+ {
+     int detachidx, ret = -1;
+-    virDomainNetDefPtr detach = NULL;
++    virDomainNetDefPtr net = NULL;
+ 
+-    if ((detachidx = virDomainNetFindIdx(vm->def, dev->data.net)) < 0)
++    if ((detachidx = virDomainNetFindIdx(vm->def, match)) < 0)
+         goto cleanup;
+ 
+-    detach = vm->def->nets[detachidx];
++    *detach = net = vm->def->nets[detachidx];
+ 
+-    if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
++    if (qemuIsMultiFunctionDevice(vm->def, &net->info)) {
+         virReportError(VIR_ERR_OPERATION_FAILED,
+                        _("cannot hot unplug multifunction PCI device: %s"),
+-                       detach->ifname);
++                       net->ifname);
+         goto cleanup;
+     }
+ 
+-    if (!detach->info.alias) {
+-        if (qemuAssignDeviceNetAlias(vm->def, detach, -1) < 0)
++    if (!net->info.alias) {
++        if (qemuAssignDeviceNetAlias(vm->def, net, -1) < 0)
+             goto cleanup;
+     }
+ 
+-    if (virDomainNetGetActualBandwidth(detach) &&
+-        virNetDevSupportBandwidth(virDomainNetGetActualType(detach)) &&
+-        virNetDevBandwidthClear(detach->ifname) < 0)
++    if (virDomainNetGetActualBandwidth(net) &&
++        virNetDevSupportBandwidth(virDomainNetGetActualType(net)) &&
++        virNetDevBandwidthClear(net->ifname) < 0)
+         VIR_WARN("cannot clear bandwidth setting for device : %s",
+-                 detach->ifname);
++                 net->ifname);
+ 
+     /* deactivate the tap/macvtap device on the host, which could also
+      * affect the parent device (e.g. macvtap passthrough mode sets
+      * the parent device offline)
+      */
+-    ignore_value(qemuInterfaceStopDevice(detach));
++    ignore_value(qemuInterfaceStopDevice(net));
+ 
+     if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &detach->info);
++        qemuDomainMarkDeviceForRemoval(vm, &net->info);
+ 
+-    if (qemuDomainDeleteDevice(vm, detach->info.alias) < 0) {
++    if (qemuDomainDeleteDevice(vm, net->info.alias) < 0) {
+         if (virDomainObjIsActive(vm)) {
+             /* the audit message has a different format for hostdev network devices */
+-            if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV)
+-                virDomainAuditHostdev(vm, virDomainNetGetActualHostdev(detach), "detach", false);
++            if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_HOSTDEV)
++                virDomainAuditHostdev(vm, virDomainNetGetActualHostdev(net), "detach", false);
+             else
+-                virDomainAuditNet(vm, detach, NULL, "detach", false);
++                virDomainAuditNet(vm, net, NULL, "detach", false);
+         }
+         goto cleanup;
+     }
+@@ -5375,7 +5381,7 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
+         ret = 0;
+     } else {
+         if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveNetDevice(driver, vm, detach);
++            ret = qemuDomainRemoveNetDevice(driver, vm, net);
+     }
+ 
+  cleanup:
+@@ -5444,42 +5450,43 @@ qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
+-                          virDomainObjPtr vm,
+-                          virDomainRNGDefPtr rng,
+-                          bool async)
++qemuDomainDetachPrepRNG(virQEMUDriverPtr driver,
++                        virDomainObjPtr vm,
++                        virDomainRNGDefPtr match,
++                        virDomainRNGDefPtr *detach,
++                        bool async)
+ {
+     ssize_t idx;
+-    virDomainRNGDefPtr tmpRNG;
++    virDomainRNGDefPtr rng;
+     int ret = -1;
+ 
+-    if ((idx = virDomainRNGFind(vm->def, rng)) < 0) {
++    if ((idx = virDomainRNGFind(vm->def, match)) < 0) {
+         virReportError(VIR_ERR_DEVICE_MISSING,
+                        _("model '%s' RNG device not present "
+                          "in domain configuration"),
+-                       virDomainRNGBackendTypeToString(rng->model));
++                       virDomainRNGBackendTypeToString(match->model));
+         return -1;
+     }
+ 
+-    tmpRNG = vm->def->rngs[idx];
++    *detach = rng = vm->def->rngs[idx];
+ 
+-    if (!tmpRNG->info.alias) {
++    if (!rng->info.alias) {
+         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("alias not set for RNG device"));
+         return -1;
+     }
+ 
+     if (!async)
+-        qemuDomainMarkDeviceForRemoval(vm, &tmpRNG->info);
++        qemuDomainMarkDeviceForRemoval(vm, &rng->info);
+ 
+-    if (qemuDomainDeleteDevice(vm, tmpRNG->info.alias) < 0)
++    if (qemuDomainDeleteDevice(vm, rng->info.alias) < 0)
+         goto cleanup;
+ 
+     if (async) {
+         ret = 0;
+     } else {
+         if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+-            ret = qemuDomainRemoveRNGDevice(driver, vm, tmpRNG);
++            ret = qemuDomainRemoveRNGDevice(driver, vm, rng);
+     }
+ 
+  cleanup:
+@@ -5490,26 +5497,27 @@ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
+-                             virDomainObjPtr vm,
+-                             virDomainMemoryDefPtr memdef,
+-                             bool async)
++qemuDomainDetachPrepMemory(virQEMUDriverPtr driver,
++                           virDomainObjPtr vm,
++                           virDomainMemoryDefPtr match,
++                           virDomainMemoryDefPtr *detach,
++                           bool async)
+ {
+     virDomainMemoryDefPtr mem;
+     int idx;
+     int ret = -1;
+ 
+-    qemuDomainMemoryDeviceAlignSize(vm->def, memdef);
++    qemuDomainMemoryDeviceAlignSize(vm->def, match);
+ 
+-    if ((idx = virDomainMemoryFindByDef(vm->def, memdef)) < 0) {
++    if ((idx = virDomainMemoryFindByDef(vm->def, match)) < 0) {
+         virReportError(VIR_ERR_DEVICE_MISSING,
+                        _("model '%s' memory device not present "
+                          "in the domain configuration"),
+-                       virDomainMemoryModelTypeToString(memdef->model));
++                       virDomainMemoryModelTypeToString(match->model));
+         return -1;
+     }
+ 
+-    mem = vm->def->mems[idx];
++    *detach = mem = vm->def->mems[idx];
+ 
+     if (!mem->info.alias) {
+         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+@@ -5538,20 +5546,21 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
+ 
+ 
+ static int
+-qemuDomainDetachInputDevice(virDomainObjPtr vm,
+-                            virDomainInputDefPtr def,
+-                            bool async)
++qemuDomainDetachPrepInput(virDomainObjPtr vm,
++                          virDomainInputDefPtr match,
++                          virDomainInputDefPtr *detach,
++                          bool async)
+ {
+     virDomainInputDefPtr input;
+     int ret = -1;
+     int idx;
+ 
+-    if ((idx = virDomainInputDefFind(vm->def, def)) < 0) {
++    if ((idx = virDomainInputDefFind(vm->def, match)) < 0) {
+         virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                        _("matching input device not found"));
+         return -1;
+     }
+-    input = vm->def->inputs[idx];
++    *detach = input = vm->def->inputs[idx];
+ 
+     switch ((virDomainInputBus) input->bus) {
+     case VIR_DOMAIN_INPUT_BUS_PS2:
+@@ -5589,16 +5598,18 @@ qemuDomainDetachInputDevice(virDomainObjPtr vm,
+ 
+ 
+ static int
+-qemuDomainDetachVsockDevice(virDomainObjPtr vm,
+-                            virDomainVsockDefPtr dev,
+-                            bool async)
++qemuDomainDetachPrepVsock(virDomainObjPtr vm,
++                          virDomainVsockDefPtr match,
++                          virDomainVsockDefPtr *detach,
++                          bool async)
+ {
+-    virDomainVsockDefPtr vsock = vm->def->vsock;
++    virDomainVsockDefPtr vsock;
+     int ret = -1;
+ 
+ 
++    *detach = vsock = vm->def->vsock;
+     if (!vsock ||
+-        !virDomainVsockDefEquals(dev, vsock)) {
++        !virDomainVsockDefEquals(match, vsock)) {
+         virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                        _("matching vsock device not found"));
+         return -1;
+@@ -5654,6 +5665,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+                            virQEMUDriverPtr driver,
+                            bool async)
+ {
++    virDomainDeviceDef detach = { .type = match->type };
+     int ret = -1;
+ 
+     switch ((virDomainDeviceType)match->type) {
+@@ -5676,38 +5688,70 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+          * assure it is okay to detach the device.
+          */
+     case VIR_DOMAIN_DEVICE_DISK:
+-        ret = qemuDomainDetachDeviceDiskLive(driver, vm, match, async);
++        if (qemuDomainDetachPrepDisk(driver, vm, match->data.disk,
++                                     &detach.data.disk, async) < 0) {
++            return -1;
++        }
+         break;
+     case VIR_DOMAIN_DEVICE_CONTROLLER:
+-        ret = qemuDomainDetachControllerDevice(driver, vm, match, async);
++        if (qemuDomainDetachPrepController(driver, vm, match->data.controller,
++                                           &detach.data.controller, async) < 0) {
++            return -1;
++        }
+         break;
+     case VIR_DOMAIN_DEVICE_NET:
+-        ret = qemuDomainDetachNetDevice(driver, vm, match, async);
++        if (qemuDomainDetachPrepNet(driver, vm, match->data.net,
++                                    &detach.data.net, async) < 0) {
++            return -1;
++        }
+         break;
+     case VIR_DOMAIN_DEVICE_HOSTDEV:
+-        ret = qemuDomainDetachHostDevice(driver, vm, match, async);
++        if (qemuDomainDetachPrepHostdev(driver, vm, match->data.hostdev,
++                                        &detach.data.hostdev, async) < 0) {
++            return -1;
++        }
+         break;
+     case VIR_DOMAIN_DEVICE_RNG:
+-        ret = qemuDomainDetachRNGDevice(driver, vm, match->data.rng, async);
++        if (qemuDomainDetachPrepRNG(driver, vm, match->data.rng,
++                                    &detach.data.rng, async) < 0) {
++            return -1;
++        }
+         break;
+     case VIR_DOMAIN_DEVICE_MEMORY:
+-        ret = qemuDomainDetachMemoryDevice(driver, vm, match->data.memory, async);
++        if (qemuDomainDetachPrepMemory(driver, vm, match->data.memory,
++                                       &detach.data.memory, async) < 0) {
++            return -1;
++        }
+         break;
+     case VIR_DOMAIN_DEVICE_SHMEM:
+-        ret = qemuDomainDetachShmemDevice(driver, vm, match->data.shmem, async);
++        if (qemuDomainDetachPrepShmem(driver, vm, match->data.shmem,
++                                      &detach.data.shmem, async) < 0) {
++            return -1;
++        }
+         break;
+     case VIR_DOMAIN_DEVICE_WATCHDOG:
+-        ret = qemuDomainDetachWatchdog(driver, vm, match->data.watchdog, async);
++        if (qemuDomainDetachPrepWatchdog(driver, vm, match->data.watchdog,
++                                         &detach.data.watchdog, async) < 0) {
++            return -1;
++        }
+         break;
+     case VIR_DOMAIN_DEVICE_INPUT:
+-        ret = qemuDomainDetachInputDevice(vm, match->data.input, async);
++        if (qemuDomainDetachPrepInput(vm, match->data.input,
++                                      &detach.data.input, async) < 0) {
++            return -1;
++        }
+         break;
+     case VIR_DOMAIN_DEVICE_REDIRDEV:
+-        ret = qemuDomainDetachRedirdevDevice(driver, vm, match->data.redirdev, async);
++        if (qemuDomainDetachPrepRedirdev(driver, vm, match->data.redirdev,
++                                         &detach.data.redirdev, async) < 0) {
++            return -1;
++        }
+         break;
+-
+     case VIR_DOMAIN_DEVICE_VSOCK:
+-        ret = qemuDomainDetachVsockDevice(vm, match->data.vsock, async);
++        if (qemuDomainDetachPrepVsock(vm, match->data.vsock,
++                                      &detach.data.vsock, async) < 0) {
++            return -1;
++        }
+         break;
+ 
+     case VIR_DOMAIN_DEVICE_FS:
+@@ -5729,6 +5773,8 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+         return -1;
+     }
+ 
++    ret = 0;
++
+     return ret;
+ }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemuargv2xmltest-Use-mocked-virQEMUCapsProbeHostCPU.patch b/SOURCES/libvirt-qemuargv2xmltest-Use-mocked-virQEMUCapsProbeHostCPU.patch
new file mode 100644
index 0000000..cf4f91b
--- /dev/null
+++ b/SOURCES/libvirt-qemuargv2xmltest-Use-mocked-virQEMUCapsProbeHostCPU.patch
@@ -0,0 +1,57 @@
+From ba181c8056ee3e31fccf1d4d0e5d5e2c8cf44385 Mon Sep 17 00:00:00 2001
+Message-Id: <ba181c8056ee3e31fccf1d4d0e5d5e2c8cf44385@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Tue, 4 Jun 2019 13:04:28 +0200
+Subject: [PATCH] qemuargv2xmltest: Use mocked virQEMUCapsProbeHostCPU
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The qemuTestParseCapabilitiesArch call would eventually lead to the host
+CPU being probed via virCPUGetHost. Let's divert this to a mocked
+version already used by the qemuxml2argvtest.
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit 02c1d3a6e1d24a777254f4dceeaf54942db7f871)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <8f9d0381acd27b583cb3dc0f6294d4c8c5bdfce6.1559646067.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ tests/Makefile.am        | 3 ++-
+ tests/qemuargv2xmltest.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 4d0b4f9509..f871a8a102 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -592,7 +592,8 @@ qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
+ qemuargv2xmltest_SOURCES = \
+ 	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
+ 	testutils.c testutils.h
+-qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
++qemuargv2xmltest_LDADD = libqemutestdriver.la \
++	$(LDADDS)
+ 
+ qemumonitorjsontest_SOURCES = \
+ 	qemumonitorjsontest.c \
+diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
+index cb010268c4..62e2013f79 100644
+--- a/tests/qemuargv2xmltest.c
++++ b/tests/qemuargv2xmltest.c
+@@ -298,7 +298,8 @@ mymain(void)
+     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
+ }
+ 
+-VIR_TEST_MAIN(mymain)
++VIR_TEST_MAIN_PRELOAD(mymain,
++                      abs_builddir "/.libs/qemucpumock.so")
+ 
+ #else
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemuhotplugtest-Don-t-plug-a-SCSI-disk-at-unit-7.patch b/SOURCES/libvirt-qemuhotplugtest-Don-t-plug-a-SCSI-disk-at-unit-7.patch
new file mode 100644
index 0000000..6c115eb
--- /dev/null
+++ b/SOURCES/libvirt-qemuhotplugtest-Don-t-plug-a-SCSI-disk-at-unit-7.patch
@@ -0,0 +1,75 @@
+From 39913e84c19c6e0b94c1084c31db89d3c71998b9 Mon Sep 17 00:00:00 2001
+Message-Id: <39913e84c19c6e0b94c1084c31db89d3c71998b9@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 18 Apr 2019 18:43:11 +0200
+Subject: [PATCH] qemuhotplugtest: Don't plug a SCSI disk at unit 7
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1692296
+
+Unit number 7 is kind of special. It's reserved for SCSI
+controller. The comment in virDomainSCSIDriveAddressIsUsed()
+summarizes that pretty nicely. Libvirt would never generate
+such address.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
+Reviewed-by: Jim Fehlig <jfehlig@suse.com>
+(cherry picked from commit ee2c5ef39fd91345893904433c6f458685543af5)
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+
+Conflicts:
+tests/qemuhotplugtest.c - Context because of 8bac3f7591f
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Message-Id: <0fd182e53c8493b4d7ac2aa8d9bdae5baad52948.1555605741.git.mprivozn@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ tests/qemuhotplugtest.c                                       | 2 +-
+ tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml      | 2 +-
+ ...uhotplug-base-without-scsi-controller-live+disk-scsi-2.xml | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
+index f27fdbbb09..bc199685c6 100644
+--- a/tests/qemuhotplugtest.c
++++ b/tests/qemuhotplugtest.c
+@@ -833,7 +833,7 @@ mymain(void)
+                    "__com.redhat_drive_del", QMP_NOT_FOUND,
+                    "human-monitor-command", HMP(""));
+     DO_TEST_DETACH("base-with-scsi-controller-live", "disk-scsi-2", false, false,
+-                   "device_del", QMP_DEVICE_DELETED("scsi3-0-5-7") QMP_OK,
++                   "device_del", QMP_DEVICE_DELETED("scsi3-0-5-6") QMP_OK,
+                    "__com.redhat_drive_del", QMP_NOT_FOUND,
+                    "human-monitor-command", HMP(""));
+ 
+diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml b/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml
+index 3a847fbda6..876afb182f 100644
+--- a/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml
++++ b/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml
+@@ -2,7 +2,7 @@
+   <driver name='qemu' type='raw' cache='none'/>
+   <source file='/dev/null'/>
+   <target dev='sdf' bus='scsi'/>
+-  <address type='drive' controller='3' bus='0' target='5' unit='7'/>
++  <address type='drive' controller='3' bus='0' target='5' unit='6'/>
+   <readonly/>
+   <shareable/>
+ </disk>
+diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml
+index d35fea6f5f..72b5174825 100644
+--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml
++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml
+@@ -26,8 +26,8 @@
+       <target dev='sdf' bus='scsi'/>
+       <readonly/>
+       <shareable/>
+-      <alias name='scsi3-0-5-7'/>
+-      <address type='drive' controller='3' bus='0' target='5' unit='7'/>
++      <alias name='scsi3-0-5-6'/>
++      <address type='drive' controller='3' bus='0' target='5' unit='6'/>
+     </disk>
+     <controller type='usb' index='0'>
+       <alias name='usb'/>
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-qemuhotplugtest-Test-guestfwd-attach-and-detach.patch b/SOURCES/libvirt-qemuhotplugtest-Test-guestfwd-attach-and-detach.patch
new file mode 100644
index 0000000..bc5e197
--- /dev/null
+++ b/SOURCES/libvirt-qemuhotplugtest-Test-guestfwd-attach-and-detach.patch
@@ -0,0 +1,117 @@
+From 2d5ad41293c4b5d5e2dbffc61ba6d922648a3206 Mon Sep 17 00:00:00 2001
+Message-Id: <2d5ad41293c4b5d5e2dbffc61ba6d922648a3206@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:20 -0400
+Subject: [PATCH] qemuhotplugtest: Test guestfwd attach and detach
+
+Previous two commits demonstrate a hole in our test scenario.
+Fix that.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 17ddfd420a0dbcdd3f76fbecf7428acb301db188)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-9-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ tests/qemuhotplugtest.c                       |  6 ++
+ .../qemuhotplug-guestfwd.xml                  |  4 ++
+ .../qemuhotplug-base-live+guestfwd.xml        | 55 +++++++++++++++++++
+ 3 files changed, 65 insertions(+)
+ create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-guestfwd.xml
+ create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-live+guestfwd.xml
+
+diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
+index cddedf768e..afaf706d27 100644
+--- a/tests/qemuhotplugtest.c
++++ b/tests/qemuhotplugtest.c
+@@ -925,6 +925,12 @@ mymain(void)
+     DO_TEST_DETACH("base-live", "watchdog-user-alias-full", false, false,
+                    "device_del", QMP_OK);
+ 
++    DO_TEST_ATTACH("base-live", "guestfwd", false, true,
++                   "chardev-add", QMP_OK,
++                   "netdev_add", QMP_OK);
++    DO_TEST_DETACH("base-live", "guestfwd", false, false,
++                   "netdev_del", QMP_OK);
++
+ #define DO_TEST_CPU_GROUP(prefix, vcpus, modernhp, expectfail) \
+     do { \
+         cpudata.test = prefix; \
+diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-guestfwd.xml b/tests/qemuhotplugtestdevices/qemuhotplug-guestfwd.xml
+new file mode 100644
+index 0000000000..c67dbdb8df
+--- /dev/null
++++ b/tests/qemuhotplugtestdevices/qemuhotplug-guestfwd.xml
+@@ -0,0 +1,4 @@
++<channel type='unix'>
++  <source mode='bind' path='/tmp/guestfwd'/>
++  <target type='guestfwd' address='10.0.2.1' port='4600'/>
++</channel>
+diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+guestfwd.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+guestfwd.xml
+new file mode 100644
+index 0000000000..8d7294123b
+--- /dev/null
++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+guestfwd.xml
+@@ -0,0 +1,55 @@
++<domain type='kvm' id='7'>
++  <name>hotplug</name>
++  <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
++  <memory unit='KiB'>4194304</memory>
++  <currentMemory unit='KiB'>4194304</currentMemory>
++  <vcpu placement='static'>4</vcpu>
++  <os>
++    <type arch='x86_64' machine='pc'>hvm</type>
++    <boot dev='hd'/>
++  </os>
++  <features>
++    <acpi/>
++    <apic/>
++    <pae/>
++  </features>
++  <clock offset='utc'/>
++  <on_poweroff>destroy</on_poweroff>
++  <on_reboot>restart</on_reboot>
++  <on_crash>restart</on_crash>
++  <devices>
++    <emulator>/usr/bin/qemu-system-x86_64</emulator>
++    <controller type='usb' index='0'>
++      <alias name='usb'/>
++      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
++    </controller>
++    <controller type='ide' index='0'>
++      <alias name='ide'/>
++      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
++    </controller>
++    <controller type='scsi' index='0' model='virtio-scsi'>
++      <alias name='scsi0'/>
++      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
++    </controller>
++    <controller type='pci' index='0' model='pci-root'>
++      <alias name='pci'/>
++    </controller>
++    <controller type='virtio-serial' index='0'>
++      <alias name='virtio-serial0'/>
++      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
++    </controller>
++    <channel type='unix'>
++      <source mode='bind' path='/tmp/guestfwd'/>
++      <target type='guestfwd' address='10.0.2.1' port='4600'/>
++      <alias name='channel0'/>
++    </channel>
++    <input type='mouse' bus='ps2'>
++      <alias name='input0'/>
++    </input>
++    <input type='keyboard' bus='ps2'>
++      <alias name='input1'/>
++    </input>
++    <memballoon model='none'/>
++  </devices>
++  <seclabel type='none' model='none'/>
++</domain>
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-resctrl-Do-not-calculate-free-bandwidth-for-MBA.patch b/SOURCES/libvirt-resctrl-Do-not-calculate-free-bandwidth-for-MBA.patch
new file mode 100644
index 0000000..3921c59
--- /dev/null
+++ b/SOURCES/libvirt-resctrl-Do-not-calculate-free-bandwidth-for-MBA.patch
@@ -0,0 +1,133 @@
+From bef145fd9b22a310ce7ab8e4cd033bcbe9d40fa9 Mon Sep 17 00:00:00 2001
+Message-Id: <bef145fd9b22a310ce7ab8e4cd033bcbe9d40fa9@dist-git>
+From: Martin Kletzander <mkletzan@redhat.com>
+Date: Mon, 15 Apr 2019 17:33:02 +0200
+Subject: [PATCH] resctrl: Do not calculate free bandwidth for MBA
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+For CAT we calculate unallocated parts of the cache, however with MBA this does
+not make sense as the purpose of that is to limit the bandwidth and the setting
+is only proportional relative to bandwidth settings for other groups.
+
+This means it makes sense to set the values to 100% even if there are other
+groups with some allocations and that we don't need to find the available
+(unallocated) bandwidth in all the groups.
+
+Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
+(cherry picked from commit 408aeebcef1e81e55bebb4f2d47403d04ee16c0f)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <75b61f0528c91997bf86e6e65b6f4673bad44d75.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 52 ++++++++++++-------------------------------
+ 1 file changed, 14 insertions(+), 38 deletions(-)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index 4b5442f879..f5e4bef7dc 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -1509,22 +1509,6 @@ virResctrlAllocSubtract(virResctrlAllocPtr dst,
+ }
+ 
+ 
+-static void
+-virResctrlMemoryBandwidthSubtract(virResctrlAllocPtr free,
+-                                  virResctrlAllocPtr used)
+-{
+-    size_t i;
+-
+-    if (!used->mem_bw)
+-        return;
+-
+-    for (i = 0; i < used->mem_bw->nbandwidths; i++) {
+-        if (used->mem_bw->bandwidths[i])
+-            *(free->mem_bw->bandwidths[i]) -= *(used->mem_bw->bandwidths[i]);
+-    }
+-}
+-
+-
+ static virResctrlAllocPtr
+ virResctrlAllocNewFromInfo(virResctrlInfoPtr info)
+ {
+@@ -1588,15 +1572,18 @@ virResctrlAllocNewFromInfo(virResctrlInfoPtr info)
+ }
+ 
+ /*
+- * This function creates an allocation that represents all unused parts of
+- * all caches and memory bandwidth in the system. It uses virResctrlInfo
+- * for creating a new full allocation with all bits set (using the
+- * virResctrlAllocNewFromInfo()), sets memory bandwidth 100%, and then scans
+- * for all allocations under /sys/fs/resctrl and subtracts each one of them
+- * from it. That way it can then return an allocation with only bit set
+- * being those that are not mentioned in any other allocation for CAT and
+- * available memory bandwidth for MBA. It is used for two things, calculating
+- * the masks and bandwidth available when creating allocations and from tests.
++ * This function creates an allocation that represents all unused parts of all
++ * caches in the system.  It uses virResctrlInfo for creating a new full
++ * allocation with all bits set (using virResctrlAllocNewFromInfo()) and then
++ * scans for all allocations under /sys/fs/resctrl and subtracts each one of
++ * them from it.  That way it can then return an allocation with only bit set
++ * being those that are not mentioned in any other allocation.  It is used for
++ * two things, a) calculating the masks when creating allocations and b) from
++ * tests.
++ *
++ * MBA (Memory Bandwidth Allocation) is not taken into account as it is a
++ * limiting setting, not an allocating one.  The way it works is also vastly
++ * different from CAT.
+  */
+ virResctrlAllocPtr
+ virResctrlAllocGetUnused(virResctrlInfoPtr resctrl)
+@@ -1642,7 +1629,6 @@ virResctrlAllocGetUnused(virResctrlInfoPtr resctrl)
+             goto error;
+         }
+ 
+-        virResctrlMemoryBandwidthSubtract(ret, alloc);
+         virResctrlAllocSubtract(ret, alloc);
+         virObjectUnref(alloc);
+         alloc = NULL;
+@@ -1795,12 +1781,10 @@ virResctrlAllocFindUnused(virResctrlAllocPtr alloc,
+ 
+ static int
+ virResctrlAllocMemoryBandwidth(virResctrlInfoPtr resctrl,
+-                               virResctrlAllocPtr alloc,
+-                               virResctrlAllocPtr free)
++                               virResctrlAllocPtr alloc)
+ {
+     size_t i;
+     virResctrlAllocMemBWPtr mem_bw_alloc = alloc->mem_bw;
+-    virResctrlAllocMemBWPtr mem_bw_free = free->mem_bw;
+     virResctrlInfoMemBWPtr mem_bw_info = resctrl->membw_info;
+ 
+     if (!mem_bw_alloc)
+@@ -1840,14 +1824,6 @@ virResctrlAllocMemoryBandwidth(virResctrlInfoPtr resctrl,
+                            i, mem_bw_info->max_id);
+             return -1;
+         }
+-        if (*(mem_bw_alloc->bandwidths[i]) > *(mem_bw_free->bandwidths[i])) {
+-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+-                           _("Not enough room for allocation of %u%% "
+-                             "bandwidth on node %zd, available bandwidth %u%%"),
+-                           *(mem_bw_alloc->bandwidths[i]), i,
+-                           *(mem_bw_free->bandwidths[i]));
+-            return -1;
+-        }
+     }
+     return 0;
+ }
+@@ -1914,7 +1890,7 @@ virResctrlAllocAssign(virResctrlInfoPtr resctrl,
+     if (!alloc_default)
+         goto cleanup;
+ 
+-    if (virResctrlAllocMemoryBandwidth(resctrl, alloc, alloc_free) < 0)
++    if (virResctrlAllocMemoryBandwidth(resctrl, alloc) < 0)
+         goto cleanup;
+ 
+     if (virResctrlAllocCopyMasks(alloc, alloc_default) < 0)
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-resctrl-Fix-testing-line.patch b/SOURCES/libvirt-resctrl-Fix-testing-line.patch
new file mode 100644
index 0000000..013540f
--- /dev/null
+++ b/SOURCES/libvirt-resctrl-Fix-testing-line.patch
@@ -0,0 +1,42 @@
+From 7a31fe25a7f1d7d365ff95c3bc79b143e2f0ea7d Mon Sep 17 00:00:00 2001
+Message-Id: <7a31fe25a7f1d7d365ff95c3bc79b143e2f0ea7d@dist-git>
+From: Martin Kletzander <mkletzan@redhat.com>
+Date: Mon, 15 Apr 2019 17:33:04 +0200
+Subject: [PATCH] resctrl: Fix testing line
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Forgot to remove this before pushing.
+
+Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
+(cherry picked from commit bf8c8755dc8a6d53632b90aa79ba546594714264)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <3c5d0ef57e44fffbf46a266a45cca7f858be03d8.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index 92953dadf9..f44d1cde8b 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -1852,10 +1852,8 @@ virResctrlAllocCopyMemBW(virResctrlAllocPtr dst,
+         return -1;
+ 
+     for (i = 0; i < src_bw->nbandwidths; i++) {
+-        if (dst_bw->bandwidths[i]) {
+-            *dst_bw->bandwidths[i] = 123;
++        if (dst_bw->bandwidths[i])
+             continue;
+-        }
+         if (VIR_ALLOC(dst_bw->bandwidths[i]) < 0)
+             return -1;
+         *dst_bw->bandwidths[i] = *src_bw->bandwidths[i];
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-resctrl-Set-MBA-defaults-properly.patch b/SOURCES/libvirt-resctrl-Set-MBA-defaults-properly.patch
new file mode 100644
index 0000000..9611dfc
--- /dev/null
+++ b/SOURCES/libvirt-resctrl-Set-MBA-defaults-properly.patch
@@ -0,0 +1,87 @@
+From 893e9283b1ff2334309ab96e6bdf1ac2d325ad22 Mon Sep 17 00:00:00 2001
+Message-Id: <893e9283b1ff2334309ab96e6bdf1ac2d325ad22@dist-git>
+From: Martin Kletzander <mkletzan@redhat.com>
+Date: Mon, 15 Apr 2019 17:33:03 +0200
+Subject: [PATCH] resctrl: Set MBA defaults properly
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Similarly to CAT, when you set some values in an group, remove the group and
+recreate it, the previous values will be kept there.  In order to not get values
+from a previous setting (a previous VM, for example), we need to set them to
+sensible defaults.  The same way we do that for CAT, just set the same values as
+the default group has.
+
+Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
+(cherry picked from commit ceb6725d945490a7153cf8b10ad3cd972d3f1c16)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <25defb79bad13f027d7125e70f2cc6b09f817474.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 39 +++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 39 insertions(+)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index f5e4bef7dc..92953dadf9 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -1829,6 +1829,42 @@ virResctrlAllocMemoryBandwidth(virResctrlInfoPtr resctrl,
+ }
+ 
+ 
++static int
++virResctrlAllocCopyMemBW(virResctrlAllocPtr dst,
++                         virResctrlAllocPtr src)
++{
++    size_t i = 0;
++    virResctrlAllocMemBWPtr dst_bw = NULL;
++    virResctrlAllocMemBWPtr src_bw = src->mem_bw;
++
++    if (!src->mem_bw)
++        return 0;
++
++    if (!dst->mem_bw &&
++        VIR_ALLOC(dst->mem_bw) < 0)
++        return -1;
++
++    dst_bw = dst->mem_bw;
++
++    if (src_bw->nbandwidths > dst_bw->nbandwidths &&
++        VIR_EXPAND_N(dst_bw->bandwidths, dst_bw->nbandwidths,
++                     src_bw->nbandwidths - dst_bw->nbandwidths) < 0)
++        return -1;
++
++    for (i = 0; i < src_bw->nbandwidths; i++) {
++        if (dst_bw->bandwidths[i]) {
++            *dst_bw->bandwidths[i] = 123;
++            continue;
++        }
++        if (VIR_ALLOC(dst_bw->bandwidths[i]) < 0)
++            return -1;
++        *dst_bw->bandwidths[i] = *src_bw->bandwidths[i];
++    }
++
++    return 0;
++}
++
++
+ static int
+ virResctrlAllocCopyMasks(virResctrlAllocPtr dst,
+                          virResctrlAllocPtr src)
+@@ -1896,6 +1932,9 @@ virResctrlAllocAssign(virResctrlInfoPtr resctrl,
+     if (virResctrlAllocCopyMasks(alloc, alloc_default) < 0)
+         goto cleanup;
+ 
++    if (virResctrlAllocCopyMemBW(alloc, alloc_default) < 0)
++        goto cleanup;
++
+     for (level = 0; level < alloc->nlevels; level++) {
+         virResctrlAllocPerLevelPtr a_level = alloc->levels[level];
+         virResctrlAllocPerLevelPtr f_level = NULL;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-security-dac-also-label-listen-UNIX-sockets.patch b/SOURCES/libvirt-security-dac-also-label-listen-UNIX-sockets.patch
index bbd9d0e..6dfe1f3 100644
--- a/SOURCES/libvirt-security-dac-also-label-listen-UNIX-sockets.patch
+++ b/SOURCES/libvirt-security-dac-also-label-listen-UNIX-sockets.patch
@@ -61,5 +61,5 @@ index 4b623dcf39..74c70dd092 100644
                                             dev_source->data.nix.path,
                                             user, group) < 0)
 -- 
-2.19.0
+2.21.0
 
diff --git a/SOURCES/libvirt-security-dac-gfx-egl-headless-Relabel-the-DRI-device.patch b/SOURCES/libvirt-security-dac-gfx-egl-headless-Relabel-the-DRI-device.patch
new file mode 100644
index 0000000..cda58ef
--- /dev/null
+++ b/SOURCES/libvirt-security-dac-gfx-egl-headless-Relabel-the-DRI-device.patch
@@ -0,0 +1,70 @@
+From 98189cd7e622bb89ee4916307c1287d97487233a Mon Sep 17 00:00:00 2001
+Message-Id: <98189cd7e622bb89ee4916307c1287d97487233a@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:34 +0200
+Subject: [PATCH] security: dac: gfx: egl-headless: Relabel the DRI device
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Just like for SPICE, we need to change the permissions on the DRI device
+used as the @rendernode for egl-headless graphics type.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit ae00e73cfe91b76849712fb7d928cfefef39a6eb)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+
+ Conflicts:
+	src/security/security_dac.c
+            v4.7.0-58-g3ac7793ad1 was not backported
+Message-Id: <f564d1859c197fb7477e49ce801124e0cc2d506f.1554791287.git.eskultet@redhat.com>
+
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/security/security_dac.c | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/src/security/security_dac.c b/src/security/security_dac.c
+index 74c70dd092..cc2ed10157 100644
+--- a/src/security/security_dac.c
++++ b/src/security/security_dac.c
+@@ -1419,11 +1419,16 @@ virSecurityDACSetGraphicsLabel(virSecurityManagerPtr mgr,
+                                virDomainGraphicsDefPtr gfx)
+ 
+ {
++    const char *rendernode = virDomainGraphicsGetRenderNode(gfx);
+     virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr);
+     virSecurityLabelDefPtr seclabel;
+     uid_t user;
+     gid_t group;
+ 
++    /* There's nothing to relabel */
++    if (!rendernode)
++        return 0;
++
+     /* Skip chowning the shared render file if namespaces are disabled */
+     if (!priv->mountNamespace)
+         return 0;
+@@ -1435,14 +1440,8 @@ virSecurityDACSetGraphicsLabel(virSecurityManagerPtr mgr,
+     if (virSecurityDACGetIds(seclabel, priv, &user, &group, NULL, NULL) < 0)
+         return -1;
+ 
+-    if (gfx->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
+-        gfx->data.spice.gl == VIR_TRISTATE_BOOL_YES &&
+-        gfx->data.spice.rendernode) {
+-        if (virSecurityDACSetOwnership(priv, NULL,
+-                                       gfx->data.spice.rendernode,
+-                                       user, group) < 0)
+-            return -1;
+-    }
++    if (virSecurityDACSetOwnership(priv, NULL, rendernode, user, group) < 0)
++        return -1;
+ 
+     return 0;
+ }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-src-Document-autostart-for-session-demon.patch b/SOURCES/libvirt-src-Document-autostart-for-session-demon.patch
new file mode 100644
index 0000000..b924f44
--- /dev/null
+++ b/SOURCES/libvirt-src-Document-autostart-for-session-demon.patch
@@ -0,0 +1,46 @@
+From 47ef8016cca25db8da44b13df031afba739be066 Mon Sep 17 00:00:00 2001
+Message-Id: <47ef8016cca25db8da44b13df031afba739be066@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Wed, 3 Apr 2019 12:38:58 +0200
+Subject: [PATCH] src: Document autostart for session demon
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1501450
+
+The autostart under session daemon might not behave as you'd
+expect it to behave. This patch is inspired by latest
+libvirt-users discussion:
+
+https://www.redhat.com/archives/libvirt-users/2018-December/msg00047.html
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit 61b4e8aaf1bce07f282c152de556c3d6aa8d65be)
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Message-Id: <44fd61a0ba2340e2c3802e42e6fbae08e6750a1d.1554287931.git.mprivozn@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ src/libvirt-domain.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
+index ad0ded9ee3..5f7f0bfeba 100644
+--- a/src/libvirt-domain.c
++++ b/src/libvirt-domain.c
+@@ -6690,6 +6690,11 @@ virDomainCreateWithFiles(virDomainPtr domain, unsigned int nfiles,
+  * configured to be automatically started when the host
+  * machine boots.
+  *
++ * Please note that this might result in unexpected behaviour if
++ * used for some session URIs. Since the session daemon is started
++ * with --timeout it comes and goes and as it does so it
++ * autostarts domains which might have been shut off recently.
++ *
+  * Returns -1 in case of error, 0 in case of success
+  */
+ int
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-storage-Add-default-mount-options-for-fs-netfs-storage-pools.patch b/SOURCES/libvirt-storage-Add-default-mount-options-for-fs-netfs-storage-pools.patch
new file mode 100644
index 0000000..156548e
--- /dev/null
+++ b/SOURCES/libvirt-storage-Add-default-mount-options-for-fs-netfs-storage-pools.patch
@@ -0,0 +1,313 @@
+From 5b0a3757656c53186fa27ebb8b562ba3e5b7bd69 Mon Sep 17 00:00:00 2001
+Message-Id: <5b0a3757656c53186fa27ebb8b562ba3e5b7bd69@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 09:12:19 -0400
+Subject: [PATCH] storage: Add default mount options for fs/netfs storage pools
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+Modify the command generation to add some default options to the
+fs/netfs storage pools based on the OS type. For Linux, it'll be
+the "nodev, nosuid, noexec". For FreeBSD, it'll be "nosuid, noexec".
+For others, just leave the options alone.
+
+Modify the storagepoolxml2argvtest to handle the fact that the
+same input XML could generate different output XML based on whether
+Linux, FreeBSD, or other was being built.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit f00cde7f1133fee96dc13a80d7f402c704346974)
+
+Resolved conflict in tests/storagepoolxml2argvtest.c since commit
+a15fe1247dfea01b301a825f9b66d09999d059aa is not present downstream.
+
+Resolved build issue in src/storage/storage_util.c since the VIR_AUTOFREE
+is not present downstream.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Message-Id: <20190403131219.16385-8-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/storage/storage_util.c                    | 38 +++++++++++++--
+ .../pool-fs-freebsd.argv                      |  1 +
+ .../pool-fs-linux.argv                        |  1 +
+ .../pool-netfs-auto-freebsd.argv              |  1 +
+ .../pool-netfs-auto-linux.argv                |  1 +
+ .../pool-netfs-cifs-freebsd.argv              |  1 +
+ .../pool-netfs-cifs-linux.argv                |  1 +
+ .../pool-netfs-freebsd.argv                   |  1 +
+ .../pool-netfs-gluster-freebsd.argv           |  2 +
+ .../pool-netfs-gluster-linux.argv             |  2 +
+ .../pool-netfs-linux.argv                     |  1 +
+ tests/storagepoolxml2argvtest.c               | 48 +++++++++++++++----
+ 12 files changed, 86 insertions(+), 12 deletions(-)
+ create mode 100644 tests/storagepoolxml2argvdata/pool-fs-freebsd.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-fs-linux.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-auto-freebsd.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-auto-linux.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-cifs-freebsd.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-cifs-linux.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-freebsd.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-gluster-freebsd.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-gluster-linux.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-linux.argv
+
+diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
+index 70ce600581..48117bef62 100644
+--- a/src/storage/storage_util.c
++++ b/src/storage/storage_util.c
+@@ -36,6 +36,11 @@
+ # ifndef FS_NOCOW_FL
+ #  define FS_NOCOW_FL                     0x00800000 /* Do not cow file */
+ # endif
++# define default_mount_opts "nodev,nosuid,noexec"
++#elif defined(__FreeBSD__)
++# define default_mount_opts "nosuid,noexec"
++#else
++# define default_mount_opts ""
+ #endif
+ 
+ #if WITH_BLKID
+@@ -4245,12 +4250,36 @@ virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool)
+ }
+ 
+ 
++static void
++virStorageBackendFileSystemMountAddOptions(virCommandPtr cmd,
++                                           const char *providedOpts)
++{
++    char *mountOpts = NULL;
++    virBuffer buf = VIR_BUFFER_INITIALIZER;
++
++    if (*default_mount_opts != '\0')
++        virBufferAsprintf(&buf, "%s,", default_mount_opts);
++
++    if (providedOpts)
++        virBufferAsprintf(&buf, "%s,", providedOpts);
++
++    virBufferTrim(&buf, ",", -1);
++    mountOpts = virBufferContentAndReset(&buf);
++
++    if (mountOpts)
++        virCommandAddArgList(cmd, "-o", mountOpts, NULL);
++
++    VIR_FREE(mountOpts);
++}
++
++
+ static void
+ virStorageBackendFileSystemMountNFSArgs(virCommandPtr cmd,
+                                         const char *src,
+                                         virStoragePoolDefPtr def)
+ {
+     virCommandAddArgList(cmd, src, def->target.path, NULL);
++    virStorageBackendFileSystemMountAddOptions(cmd, NULL);
+ }
+ 
+ 
+@@ -4262,8 +4291,8 @@ virStorageBackendFileSystemMountGlusterArgs(virCommandPtr cmd,
+     const char *fmt;
+ 
+     fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
+-    virCommandAddArgList(cmd, "-t", fmt, src, "-o", "direct-io-mode=1",
+-                         def->target.path, NULL);
++    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
++    virStorageBackendFileSystemMountAddOptions(cmd, "direct-io-mode=1");
+ }
+ 
+ 
+@@ -4275,8 +4304,8 @@ virStorageBackendFileSystemMountCIFSArgs(virCommandPtr cmd,
+     const char *fmt;
+ 
+     fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
+-    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path,
+-                         "-o", "guest", NULL);
++    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
++    virStorageBackendFileSystemMountAddOptions(cmd, "guest");
+ }
+ 
+ 
+@@ -4292,6 +4321,7 @@ virStorageBackendFileSystemMountDefaultArgs(virCommandPtr cmd,
+     else
+         fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
+     virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
++    virStorageBackendFileSystemMountAddOptions(cmd, NULL);
+ }
+ 
+ 
+diff --git a/tests/storagepoolxml2argvdata/pool-fs-freebsd.argv b/tests/storagepoolxml2argvdata/pool-fs-freebsd.argv
+new file mode 100644
+index 0000000000..a35d73e254
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-fs-freebsd.argv
+@@ -0,0 +1 @@
++mount -t ext3 /dev/sda6 /mnt -o nosuid,noexec
+diff --git a/tests/storagepoolxml2argvdata/pool-fs-linux.argv b/tests/storagepoolxml2argvdata/pool-fs-linux.argv
+new file mode 100644
+index 0000000000..19543f442d
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-fs-linux.argv
+@@ -0,0 +1 @@
++mount -t ext3 /dev/sda6 /mnt -o nodev,nosuid,noexec
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-auto-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-auto-freebsd.argv
+new file mode 100644
+index 0000000000..39e5c97aed
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-auto-freebsd.argv
+@@ -0,0 +1 @@
++mount localhost:/var/lib/libvirt/images /mnt -o nosuid,noexec
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-auto-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-auto-linux.argv
+new file mode 100644
+index 0000000000..1f82d3d29c
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-auto-linux.argv
+@@ -0,0 +1 @@
++mount localhost:/var/lib/libvirt/images /mnt -o nodev,nosuid,noexec
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-cifs-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-cifs-freebsd.argv
+new file mode 100644
+index 0000000000..d72749a032
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-cifs-freebsd.argv
+@@ -0,0 +1 @@
++mount -t cifs //example.com/samba_share /mnt/cifs -o nosuid,noexec,guest
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-cifs-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-cifs-linux.argv
+new file mode 100644
+index 0000000000..85aa9cf23f
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-cifs-linux.argv
+@@ -0,0 +1 @@
++mount -t cifs //example.com/samba_share /mnt/cifs -o nodev,nosuid,noexec,guest
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-freebsd.argv
+new file mode 100644
+index 0000000000..05c1951f32
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-freebsd.argv
+@@ -0,0 +1 @@
++mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nosuid,noexec
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-gluster-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-gluster-freebsd.argv
+new file mode 100644
+index 0000000000..700107d78e
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-gluster-freebsd.argv
+@@ -0,0 +1,2 @@
++mount -t glusterfs example.com:/volume /mnt/gluster -o nosuid,noexec,\
++direct-io-mode=1
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-gluster-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-gluster-linux.argv
+new file mode 100644
+index 0000000000..9535c8a1b9
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-gluster-linux.argv
+@@ -0,0 +1,2 @@
++mount -t glusterfs example.com:/volume /mnt/gluster -o nodev,nosuid,noexec,\
++direct-io-mode=1
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-linux.argv
+new file mode 100644
+index 0000000000..22fafd7b32
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-linux.argv
+@@ -0,0 +1 @@
++mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nodev,nosuid,noexec
+diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c
+index 3bf2c3b003..0ea8b3b94c 100644
+--- a/tests/storagepoolxml2argvtest.c
++++ b/tests/storagepoolxml2argvtest.c
+@@ -86,6 +86,8 @@ testCompareXMLToArgvFiles(bool shouldFail,
+ struct testInfo {
+     bool shouldFail;
+     const char *pool;
++    bool linuxOut;
++    bool freebsdOut;
+ };
+ 
+ static int
+@@ -100,9 +102,19 @@ testCompareXMLToArgvHelper(const void *data)
+                     abs_srcdir, info->pool) < 0)
+         goto cleanup;
+ 
+-    if (virAsprintf(&cmdline, "%s/storagepoolxml2argvdata/%s.argv",
+-                    abs_srcdir, info->pool) < 0 && !info->shouldFail)
+-        goto cleanup;
++    if (info->linuxOut) {
++        if (virAsprintf(&cmdline, "%s/storagepoolxml2argvdata/%s-linux.argv",
++                        abs_srcdir, info->pool) < 0 && !info->shouldFail)
++            goto cleanup;
++    } else if (info->freebsdOut) {
++        if (virAsprintf(&cmdline, "%s/storagepoolxml2argvdata/%s-freebsd.argv",
++                        abs_srcdir, info->pool) < 0 && !info->shouldFail)
++            goto cleanup;
++    } else {
++        if (virAsprintf(&cmdline, "%s/storagepoolxml2argvdata/%s.argv",
++                        abs_srcdir, info->pool) < 0 && !info->shouldFail)
++            goto cleanup;
++    }
+ 
+     result = testCompareXMLToArgvFiles(info->shouldFail, poolxml, cmdline);
+ 
+@@ -119,9 +131,9 @@ mymain(void)
+ {
+     int ret = 0;
+ 
+-#define DO_TEST_FULL(shouldFail, pool) \
++#define DO_TEST_FULL(shouldFail, pool, linuxOut, freebsdOut) \
+     do { \
+-        struct testInfo info = { shouldFail, pool }; \
++        struct testInfo info = { shouldFail, pool, linuxOut, freebsdOut }; \
+         if (virTestRun("Storage Pool XML-2-argv " pool, \
+                        testCompareXMLToArgvHelper, &info) < 0) \
+             ret = -1; \
+@@ -129,14 +141,19 @@ mymain(void)
+     while (0);
+ 
+ #define DO_TEST(pool, ...) \
+-    DO_TEST_FULL(false, pool)
++    DO_TEST_FULL(false, pool, false, false)
+ 
+ #define DO_TEST_FAIL(pool, ...) \
+-    DO_TEST_FULL(true, pool)
++    DO_TEST_FULL(true, pool, false, false)
++
++#define DO_TEST_LINUX(pool, ...) \
++    DO_TEST_FULL(false, pool, true, false)
++
++#define DO_TEST_FREEBSD(pool, ...) \
++    DO_TEST_FULL(false, pool, false, true)
+ 
+     DO_TEST_FAIL("pool-dir");
+     DO_TEST_FAIL("pool-dir-naming");
+-    DO_TEST("pool-fs");
+     DO_TEST_FAIL("pool-logical");
+     DO_TEST_FAIL("pool-logical-nopath");
+     DO_TEST_FAIL("pool-logical-create");
+@@ -145,10 +162,25 @@ mymain(void)
+     DO_TEST_FAIL("pool-disk-device-nopartsep");
+     DO_TEST_FAIL("pool-iscsi");
+     DO_TEST_FAIL("pool-iscsi-auth");
++#ifdef __linux__
++    DO_TEST_LINUX("pool-fs");
++    DO_TEST_LINUX("pool-netfs");
++    DO_TEST_LINUX("pool-netfs-auto");
++    DO_TEST_LINUX("pool-netfs-gluster");
++    DO_TEST_LINUX("pool-netfs-cifs");
++#elif defined(__FreeBSD__)
++    DO_TEST_FREEBSD("pool-fs");
++    DO_TEST_FREEBSD("pool-netfs");
++    DO_TEST_FREEBSD("pool-netfs-auto");
++    DO_TEST_FREEBSD("pool-netfs-gluster");
++    DO_TEST_FREEBSD("pool-netfs-cifs");
++#else
++    DO_TEST("pool-fs");
+     DO_TEST("pool-netfs");
+     DO_TEST("pool-netfs-auto");
+     DO_TEST("pool-netfs-gluster");
+     DO_TEST("pool-netfs-cifs");
++#endif
+     DO_TEST_FAIL("pool-scsi");
+     DO_TEST_FAIL("pool-scsi-type-scsi-host");
+     DO_TEST_FAIL("pool-scsi-type-fc-host");
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-storage-Add-the-nfsvers-to-the-command-line.patch b/SOURCES/libvirt-storage-Add-the-nfsvers-to-the-command-line.patch
new file mode 100644
index 0000000..cf1ae89
--- /dev/null
+++ b/SOURCES/libvirt-storage-Add-the-nfsvers-to-the-command-line.patch
@@ -0,0 +1,147 @@
+From 8e9adc7c2b4e7b6e09ae45b8b31bac0696f99ee1 Mon Sep 17 00:00:00 2001
+Message-Id: <8e9adc7c2b4e7b6e09ae45b8b31bac0696f99ee1@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 09:57:29 -0400
+Subject: [PATCH] storage: Add the nfsvers to the command line
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+If protocolVer present, add the -o nfsvers=# to the command
+line for the NFS Storage Pool
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit 3d3647e14f680015495f0f4650df8a2c1e230ec8)
+
+Resolve a build issue since VIR_AUTOFREE is not present downstream.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Message-Id: <20190403135730.2551-2-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/storage/storage_util.c                    | 21 +++++++++++++------
+ .../pool-netfs-protocol-ver-freebsd.argv      |  1 +
+ .../pool-netfs-protocol-ver-linux.argv        |  2 ++
+ .../pool-netfs-protocol-ver.argv              |  1 +
+ tests/storagepoolxml2argvtest.c               |  3 +++
+ 5 files changed, 22 insertions(+), 6 deletions(-)
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-freebsd.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-protocol-ver.argv
+
+diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
+index 48117bef62..b0bea21e88 100644
+--- a/src/storage/storage_util.c
++++ b/src/storage/storage_util.c
+@@ -4276,10 +4276,11 @@ virStorageBackendFileSystemMountAddOptions(virCommandPtr cmd,
+ static void
+ virStorageBackendFileSystemMountNFSArgs(virCommandPtr cmd,
+                                         const char *src,
+-                                        virStoragePoolDefPtr def)
++                                        virStoragePoolDefPtr def,
++                                        const char *nfsVers)
+ {
+     virCommandAddArgList(cmd, src, def->target.path, NULL);
+-    virStorageBackendFileSystemMountAddOptions(cmd, NULL);
++    virStorageBackendFileSystemMountAddOptions(cmd, nfsVers);
+ }
+ 
+ 
+@@ -4312,7 +4313,8 @@ virStorageBackendFileSystemMountCIFSArgs(virCommandPtr cmd,
+ static void
+ virStorageBackendFileSystemMountDefaultArgs(virCommandPtr cmd,
+                                             const char *src,
+-                                            virStoragePoolDefPtr def)
++                                            virStoragePoolDefPtr def,
++                                            const char *nfsVers)
+ {
+     const char *fmt;
+ 
+@@ -4321,7 +4323,7 @@ virStorageBackendFileSystemMountDefaultArgs(virCommandPtr cmd,
+     else
+         fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
+     virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
+-    virStorageBackendFileSystemMountAddOptions(cmd, NULL);
++    virStorageBackendFileSystemMountAddOptions(cmd, nfsVers);
+ }
+ 
+ 
+@@ -4339,15 +4341,22 @@ virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
+     bool cifsfs = (def->type == VIR_STORAGE_POOL_NETFS &&
+                    def->source.format == VIR_STORAGE_POOL_NETFS_CIFS);
+     virCommandPtr cmd = NULL;
++    char *nfsVers = NULL;
++
++    if (def->type == VIR_STORAGE_POOL_NETFS && def->source.protocolVer > 0 &&
++        virAsprintf(&nfsVers, "nfsvers=%u", def->source.protocolVer) < 0)
++        return NULL;
+ 
+     cmd = virCommandNew(MOUNT);
+     if (netauto)
+-        virStorageBackendFileSystemMountNFSArgs(cmd, src, def);
++        virStorageBackendFileSystemMountNFSArgs(cmd, src, def, nfsVers);
+     else if (glusterfs)
+         virStorageBackendFileSystemMountGlusterArgs(cmd, src, def);
+     else if (cifsfs)
+         virStorageBackendFileSystemMountCIFSArgs(cmd, src, def);
+     else
+-        virStorageBackendFileSystemMountDefaultArgs(cmd, src, def);
++        virStorageBackendFileSystemMountDefaultArgs(cmd, src, def, nfsVers);
++
++    VIR_FREE(nfsVers);
+     return cmd;
+ }
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-freebsd.argv
+new file mode 100644
+index 0000000000..59d09d2e5d
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-freebsd.argv
+@@ -0,0 +1 @@
++mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nosuid,noexec,nfsvers=3
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv
+new file mode 100644
+index 0000000000..c819a089d2
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv
+@@ -0,0 +1,2 @@
++mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nodev,nosuid,noexec,\
++nfsvers=3
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver.argv b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver.argv
+new file mode 100644
+index 0000000000..f26656d5b8
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver.argv
+@@ -0,0 +1 @@
++mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nfsvers=3
+diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c
+index 0ea8b3b94c..1e48910566 100644
+--- a/tests/storagepoolxml2argvtest.c
++++ b/tests/storagepoolxml2argvtest.c
+@@ -166,18 +166,21 @@ mymain(void)
+     DO_TEST_LINUX("pool-fs");
+     DO_TEST_LINUX("pool-netfs");
+     DO_TEST_LINUX("pool-netfs-auto");
++    DO_TEST_LINUX("pool-netfs-protocol-ver");
+     DO_TEST_LINUX("pool-netfs-gluster");
+     DO_TEST_LINUX("pool-netfs-cifs");
+ #elif defined(__FreeBSD__)
+     DO_TEST_FREEBSD("pool-fs");
+     DO_TEST_FREEBSD("pool-netfs");
+     DO_TEST_FREEBSD("pool-netfs-auto");
++    DO_TEST_FREEBSD("pool-netfs-protocol-ver");
+     DO_TEST_FREEBSD("pool-netfs-gluster");
+     DO_TEST_FREEBSD("pool-netfs-cifs");
+ #else
+     DO_TEST("pool-fs");
+     DO_TEST("pool-netfs");
+     DO_TEST("pool-netfs-auto");
++    DO_TEST("pool-netfs-protocol-ver");
+     DO_TEST("pool-netfs-gluster");
+     DO_TEST("pool-netfs-cifs");
+ #endif
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-storage-Allow-for-inputvol-to-have-any-format-for-encryption.patch b/SOURCES/libvirt-storage-Allow-for-inputvol-to-have-any-format-for-encryption.patch
new file mode 100644
index 0000000..867dcfa
--- /dev/null
+++ b/SOURCES/libvirt-storage-Allow-for-inputvol-to-have-any-format-for-encryption.patch
@@ -0,0 +1,136 @@
+From 995cc8106fcc01dfae64113fd62cb37ab36895d4 Mon Sep 17 00:00:00 2001
+Message-Id: <995cc8106fcc01dfae64113fd62cb37ab36895d4@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 07:35:46 -0400
+Subject: [PATCH] storage: Allow for inputvol to have any format for encryption
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1613737
+
+Commit 39cef12a9 altered/fixed the inputvol processing to create
+a multistep process when using an inputvol to create an encrypted
+output volume; however, it unnecessarily assumed/restricted the
+inputvol to be of 'raw' format only.
+
+Modify the processing code to allow the inputvol format to be checked
+and used in order to create the encrypted volume.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+ACKed-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit 80414718587ab8dd97025ec9145f30fa1a3654ed)
+Message-Id: <20190403113547.29231-3-jferlan@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ src/storage/storage_util.c                    | 14 ++++++++++++-
+ .../luks-convert-qcow2.argv                   |  9 ++++++++
+ tests/storagevolxml2argvtest.c                |  4 ++++
+ tests/storagevolxml2xmlin/vol-file-qcow2.xml  | 21 +++++++++++++++++++
+ 4 files changed, 47 insertions(+), 1 deletion(-)
+ create mode 100644 tests/storagevolxml2argvdata/luks-convert-qcow2.argv
+ create mode 100644 tests/storagevolxml2xmlin/vol-file-qcow2.xml
+
+diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
+index 54e778490d..ed0179d78e 100644
+--- a/src/storage/storage_util.c
++++ b/src/storage/storage_util.c
+@@ -692,6 +692,7 @@ storagePloopResize(virStorageVolDefPtr vol,
+ struct _virStorageBackendQemuImgInfo {
+     int format;
+     const char *type;
++    const char *inputType;
+     const char *path;
+     unsigned long long size_arg;
+     unsigned long long allocation;
+@@ -1014,6 +1015,15 @@ virStorageBackendCreateQemuImgSetInfo(virStoragePoolObjPtr pool,
+         return -1;
+     }
+ 
++    if (inputvol &&
++        !(info->inputType =
++          virStorageFileFormatTypeToString(inputvol->target.format))) {
++        virReportError(VIR_ERR_INTERNAL_ERROR,
++                       _("unknown inputvol storage vol type %d"),
++                       inputvol->target.format);
++        return -1;
++    }
++
+     if (info->preallocate && info->format != VIR_STORAGE_FILE_QCOW2) {
+         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                        _("metadata preallocation only available with qcow2"));
+@@ -1073,6 +1083,7 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
+     struct _virStorageBackendQemuImgInfo info = {
+         .format = vol->target.format,
+         .type = NULL,
++        .inputType = NULL,
+         .path = vol->target.path,
+         .allocation = vol->target.allocation,
+         .encryption = !!vol->target.encryption,
+@@ -1145,7 +1156,8 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
+             virCommandAddArgFormat(cmd, "%lluK", info.size_arg);
+     } else {
+         /* source */
+-        virCommandAddArgFormat(cmd, "driver=raw,file.filename=%s",
++        virCommandAddArgFormat(cmd, "driver=%s,file.filename=%s",
++                               info.inputType ? info.inputType : "raw",
+                                info.inputPath);
+ 
+         /* dest */
+diff --git a/tests/storagevolxml2argvdata/luks-convert-qcow2.argv b/tests/storagevolxml2argvdata/luks-convert-qcow2.argv
+new file mode 100644
+index 0000000000..9124f5f27c
+--- /dev/null
++++ b/tests/storagevolxml2argvdata/luks-convert-qcow2.argv
+@@ -0,0 +1,9 @@
++qemu-img create -f luks \
++--object secret,id=OtherDemo.img_encrypt0,file=/path/to/secretFile \
++-o key-secret=OtherDemo.img_encrypt0 \
++/var/lib/libvirt/images/OtherDemo.img 5242880K
++qemu-img convert --image-opts -n --target-image-opts \
++--object secret,id=OtherDemo.img_encrypt0,file=/path/to/secretFile \
++driver=qcow2,file.filename=/var/lib/libvirt/images/sparse-qcow2.img \
++driver=luks,file.filename=/var/lib/libvirt/images/OtherDemo.img,\
++key-secret=OtherDemo.img_encrypt0
+diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c
+index b795f83aee..6a9a080dd1 100644
+--- a/tests/storagevolxml2argvtest.c
++++ b/tests/storagevolxml2argvtest.c
+@@ -284,6 +284,10 @@ mymain(void)
+             "pool-dir", "vol-file",
+             "luks-convert", 0);
+ 
++    DO_TEST("pool-dir", "vol-luks-convert",
++            "pool-dir", "vol-file-qcow2",
++            "luks-convert-qcow2", 0);
++
+     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
+ }
+ 
+diff --git a/tests/storagevolxml2xmlin/vol-file-qcow2.xml b/tests/storagevolxml2xmlin/vol-file-qcow2.xml
+new file mode 100644
+index 0000000000..025e7e0239
+--- /dev/null
++++ b/tests/storagevolxml2xmlin/vol-file-qcow2.xml
+@@ -0,0 +1,21 @@
++<volume>
++  <name>sparse-qcow2.img</name>
++  <source/>
++  <capacity unit="TiB">1</capacity>
++  <allocation unit="bytes">0</allocation>
++  <target>
++    <path>/var/lib/libvirt/images/sparse-qcow2.img</path>
++    <format type="qcow2"/>
++    <permissions>
++      <mode>0</mode>
++      <owner>0744</owner>
++      <group>0</group>
++      <label>virt_image_t</label>
++    </permissions>
++    <timestamps>
++      <atime>1341933637.273190990</atime>
++      <mtime>1341930622.047245868</mtime>
++      <ctime>1341930622.047245868</ctime>
++    </timestamps>
++  </target>
++</volume>
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-storage-Allow-inputvol-to-be-encrypted.patch b/SOURCES/libvirt-storage-Allow-inputvol-to-be-encrypted.patch
new file mode 100644
index 0000000..e7f324f
--- /dev/null
+++ b/SOURCES/libvirt-storage-Allow-inputvol-to-be-encrypted.patch
@@ -0,0 +1,344 @@
+From c0b494d6286eea41873c1754ea4c85c3ac1294da Mon Sep 17 00:00:00 2001
+Message-Id: <c0b494d6286eea41873c1754ea4c85c3ac1294da@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 07:35:47 -0400
+Subject: [PATCH] storage: Allow inputvol to be encrypted
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1613737
+
+When processing the inputvol for encryption, we need to handle
+the case where the inputvol is encrypted. This then allows for
+the encrypted inputvol to be used either for an output encrypted
+volume or an output volume of some XML provided type.
+
+Add tests to show the various conversion options when either input
+or output is encrypted. This includes when both are encrypted.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+ACKed-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit b975afc72504e636ec538ea119bee9a0cd7b63d8)
+Message-Id: <20190403113547.29231-4-jferlan@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ src/storage/storage_util.c                    | 64 ++++++++++++++++---
+ src/storage/storage_util.h                    |  1 +
+ .../luks-convert-encrypt.argv                 | 11 ++++
+ .../luks-convert-encrypt2fileqcow2.argv       |  7 ++
+ .../luks-convert-encrypt2fileraw.argv         |  7 ++
+ tests/storagevolxml2argvtest.c                | 15 ++++-
+ tests/storagevolxml2xmlin/vol-encrypt1.xml    | 21 ++++++
+ tests/storagevolxml2xmlin/vol-encrypt2.xml    | 21 ++++++
+ 8 files changed, 138 insertions(+), 9 deletions(-)
+ create mode 100644 tests/storagevolxml2argvdata/luks-convert-encrypt.argv
+ create mode 100644 tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv
+ create mode 100644 tests/storagevolxml2argvdata/luks-convert-encrypt2fileraw.argv
+ create mode 100644 tests/storagevolxml2xmlin/vol-encrypt1.xml
+ create mode 100644 tests/storagevolxml2xmlin/vol-encrypt2.xml
+
+diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
+index ed0179d78e..637b90fac1 100644
+--- a/src/storage/storage_util.c
++++ b/src/storage/storage_util.c
+@@ -1077,6 +1077,7 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
+                                          unsigned int flags,
+                                          const char *create_tool,
+                                          const char *secretPath,
++                                         const char *inputSecretPath,
+                                          virStorageVolEncryptConvertStep convertStep)
+ {
+     virCommandPtr cmd = NULL;
+@@ -1094,6 +1095,8 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
+         .secretAlias = NULL,
+     };
+     virStorageEncryptionPtr enc = vol->target.encryption;
++    char *inputSecretAlias = NULL;
++    virStorageEncryptionPtr inputenc = inputvol ? inputvol->target.encryption : NULL;
+     virStorageEncryptionInfoDefPtr encinfo = NULL;
+ 
+     virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, NULL);
+@@ -1107,6 +1110,12 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
+         goto error;
+     }
+ 
++    if (inputenc && inputenc->format != VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
++        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
++                       _("encryption format of inputvol must be LUKS"));
++        goto error;
++    }
++
+     if (virStorageBackendCreateQemuImgSetInfo(pool, vol, inputvol,
+                                               convertStep, &info) < 0)
+         goto error;
+@@ -1146,6 +1155,20 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
+         encinfo = &enc->encinfo;
+     }
+ 
++    if (inputenc && convertStep == VIR_STORAGE_VOL_ENCRYPT_CONVERT) {
++        if (!inputSecretPath) {
++            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++                           _("path to inputvol secret data file is required"));
++            goto error;
++        }
++        if (virAsprintf(&inputSecretAlias, "%s_encrypt0",
++                        inputvol->name) < 0)
++            goto error;
++        if (storageBackendCreateQemuImgSecretObject(cmd, inputSecretPath,
++                                                    inputSecretAlias) < 0)
++            goto error;
++    }
++
+     if (convertStep != VIR_STORAGE_VOL_ENCRYPT_CONVERT) {
+         if (storageBackendCreateQemuImgSetOptions(cmd, encinfo, info) < 0)
+             goto error;
+@@ -1156,20 +1179,33 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
+             virCommandAddArgFormat(cmd, "%lluK", info.size_arg);
+     } else {
+         /* source */
+-        virCommandAddArgFormat(cmd, "driver=%s,file.filename=%s",
+-                               info.inputType ? info.inputType : "raw",
+-                               info.inputPath);
++        if (inputenc)
++            virCommandAddArgFormat(cmd,
++                                   "driver=luks,file.filename=%s,key-secret=%s",
++                                   info.inputPath, inputSecretAlias);
++        else
++            virCommandAddArgFormat(cmd, "driver=%s,file.filename=%s",
++                                   info.inputType ? info.inputType : "raw",
++                                   info.inputPath);
+ 
+         /* dest */
+-        virCommandAddArgFormat(cmd, "driver=%s,file.filename=%s,key-secret=%s",
+-                               info.type, info.path, info.secretAlias);
++        if (enc)
++            virCommandAddArgFormat(cmd,
++                                   "driver=%s,file.filename=%s,key-secret=%s",
++                                   info.type, info.path, info.secretAlias);
++        else
++            virCommandAddArgFormat(cmd, "driver=%s,file.filename=%s",
++                                   info.type, info.path);
++
+     }
+     VIR_FREE(info.secretAlias);
++    VIR_FREE(inputSecretAlias);
+ 
+     return cmd;
+ 
+  error:
+     VIR_FREE(info.secretAlias);
++    VIR_FREE(inputSecretAlias);
+     virCommandFree(cmd);
+     return NULL;
+ }
+@@ -1255,6 +1291,7 @@ storageBackendDoCreateQemuImg(virStoragePoolObjPtr pool,
+                               unsigned int flags,
+                               const char *create_tool,
+                               const char *secretPath,
++                              const char *inputSecretPath,
+                               virStorageVolEncryptConvertStep convertStep)
+ {
+     int ret;
+@@ -1262,7 +1299,8 @@ storageBackendDoCreateQemuImg(virStoragePoolObjPtr pool,
+ 
+     cmd = virStorageBackendCreateQemuImgCmdFromVol(pool, vol, inputvol,
+                                                    flags, create_tool,
+-                                                   secretPath, convertStep);
++                                                   secretPath, inputSecretPath,
++                                                   convertStep);
+     if (!cmd)
+         return -1;
+ 
+@@ -1283,6 +1321,7 @@ storageBackendCreateQemuImg(virStoragePoolObjPtr pool,
+     int ret = -1;
+     char *create_tool;
+     char *secretPath = NULL;
++    char *inputSecretPath = NULL;
+     virStorageVolEncryptConvertStep convertStep = VIR_STORAGE_VOL_ENCRYPT_NONE;
+ 
+     virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, -1);
+@@ -1299,16 +1338,21 @@ storageBackendCreateQemuImg(virStoragePoolObjPtr pool,
+         !(secretPath = storageBackendCreateQemuImgSecretPath(pool, vol)))
+         goto cleanup;
+ 
++    if (inputvol && inputvol->target.encryption &&
++        !(inputSecretPath = storageBackendCreateQemuImgSecretPath(pool,
++                                                                  inputvol)))
++        goto cleanup;
++
+     /* Using an input file for encryption requires a multi-step process
+      * to create an image of the same size as the inputvol and then to
+      * convert the inputvol afterwards. */
+-    if (secretPath && inputvol)
++    if ((secretPath || inputSecretPath) && inputvol)
+         convertStep = VIR_STORAGE_VOL_ENCRYPT_CREATE;
+ 
+     do {
+         ret = storageBackendDoCreateQemuImg(pool, vol, inputvol, flags,
+                                             create_tool, secretPath,
+-                                            convertStep);
++                                            inputSecretPath, convertStep);
+ 
+         /* Failure to convert, attempt to delete what we created */
+         if (ret < 0 && convertStep == VIR_STORAGE_VOL_ENCRYPT_CONVERT)
+@@ -1330,6 +1374,10 @@ storageBackendCreateQemuImg(virStoragePoolObjPtr pool,
+         unlink(secretPath);
+         VIR_FREE(secretPath);
+     }
++    if (inputSecretPath) {
++        unlink(inputSecretPath);
++        VIR_FREE(inputSecretPath);
++    }
+     VIR_FREE(create_tool);
+     return ret;
+ }
+diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h
+index 6fc8e8972c..58b991c772 100644
+--- a/src/storage/storage_util.h
++++ b/src/storage/storage_util.h
+@@ -167,6 +167,7 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
+                                          unsigned int flags,
+                                          const char *create_tool,
+                                          const char *secretPath,
++                                         const char *inputSecretPath,
+                                          virStorageVolEncryptConvertStep convertStep);
+ 
+ int virStorageBackendSCSIFindLUs(virStoragePoolObjPtr pool,
+diff --git a/tests/storagevolxml2argvdata/luks-convert-encrypt.argv b/tests/storagevolxml2argvdata/luks-convert-encrypt.argv
+new file mode 100644
+index 0000000000..b2ad16b7cb
+--- /dev/null
++++ b/tests/storagevolxml2argvdata/luks-convert-encrypt.argv
+@@ -0,0 +1,11 @@
++qemu-img create -f luks \
++--object secret,id=encrypt2.img_encrypt0,file=/path/to/secretFile \
++-o key-secret=encrypt2.img_encrypt0 \
++/var/lib/libvirt/images/encrypt2.img 5242880K
++qemu-img convert --image-opts -n --target-image-opts \
++--object secret,id=encrypt2.img_encrypt0,file=/path/to/secretFile \
++--object secret,id=encrypt1.img_encrypt0,file=/path/to/inputSecretFile \
++driver=luks,file.filename=/var/lib/libvirt/images/encrypt1.img,\
++key-secret=encrypt1.img_encrypt0 \
++driver=luks,file.filename=/var/lib/libvirt/images/encrypt2.img,\
++key-secret=encrypt2.img_encrypt0
+diff --git a/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv b/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv
+new file mode 100644
+index 0000000000..82cb364b61
+--- /dev/null
++++ b/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv
+@@ -0,0 +1,7 @@
++qemu-img create -f qcow2 \
++-o compat=0.10 /var/lib/libvirt/images/sparse-qcow2.img 1073741824K
++qemu-img convert --image-opts -n --target-image-opts \
++--object secret,id=encrypt2.img_encrypt0,file=/path/to/inputSecretFile \
++driver=luks,file.filename=/var/lib/libvirt/images/encrypt2.img,\
++key-secret=encrypt2.img_encrypt0 \
++driver=qcow2,file.filename=/var/lib/libvirt/images/sparse-qcow2.img
+diff --git a/tests/storagevolxml2argvdata/luks-convert-encrypt2fileraw.argv b/tests/storagevolxml2argvdata/luks-convert-encrypt2fileraw.argv
+new file mode 100644
+index 0000000000..2661c345a8
+--- /dev/null
++++ b/tests/storagevolxml2argvdata/luks-convert-encrypt2fileraw.argv
+@@ -0,0 +1,7 @@
++qemu-img create -f raw \
++/var/lib/libvirt/images/sparse.img 1073741824K
++qemu-img convert --image-opts -n --target-image-opts \
++--object secret,id=encrypt2.img_encrypt0,file=/path/to/inputSecretFile \
++driver=luks,file.filename=/var/lib/libvirt/images/encrypt2.img,\
++key-secret=encrypt2.img_encrypt0 \
++driver=raw,file.filename=/var/lib/libvirt/images/sparse.img
+diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c
+index 6a9a080dd1..105705f348 100644
+--- a/tests/storagevolxml2argvtest.c
++++ b/tests/storagevolxml2argvtest.c
+@@ -85,7 +85,7 @@ testCompareXMLToArgvFiles(bool shouldFail,
+      * convert the inputvol afterwards. Since we only care about the
+      * command line we have to copy code from storageBackendCreateQemuImg
+      * and adjust it for the test needs. */
+-    if (inputvol && vol->target.encryption)
++    if (inputvol && (vol->target.encryption || inputvol->target.encryption))
+         convertStep = VIR_STORAGE_VOL_ENCRYPT_CREATE;
+ 
+     do {
+@@ -93,6 +93,7 @@ testCompareXMLToArgvFiles(bool shouldFail,
+                                                        inputvol, flags,
+                                                        create_tool,
+                                                        "/path/to/secretFile",
++                                                       "/path/to/inputSecretFile",
+                                                        convertStep);
+         if (!cmd) {
+             if (shouldFail) {
+@@ -288,6 +289,18 @@ mymain(void)
+             "pool-dir", "vol-file-qcow2",
+             "luks-convert-qcow2", 0);
+ 
++    DO_TEST("pool-dir", "vol-encrypt2",
++            "pool-dir", "vol-encrypt1",
++            "luks-convert-encrypt", 0);
++
++    DO_TEST("pool-dir", "vol-file",
++            "pool-dir", "vol-encrypt2",
++            "luks-convert-encrypt2fileraw", 0);
++
++    DO_TEST("pool-dir", "vol-file-qcow2",
++            "pool-dir", "vol-encrypt2",
++            "luks-convert-encrypt2fileqcow2", 0);
++
+     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
+ }
+ 
+diff --git a/tests/storagevolxml2xmlin/vol-encrypt1.xml b/tests/storagevolxml2xmlin/vol-encrypt1.xml
+new file mode 100644
+index 0000000000..681734dc7b
+--- /dev/null
++++ b/tests/storagevolxml2xmlin/vol-encrypt1.xml
+@@ -0,0 +1,21 @@
++<volume>
++  <name>encrypt1.img</name>
++  <key>/var/lib/libvirt/images/encrypt1.img</key>
++  <source>
++  </source>
++  <capacity unit="G">5</capacity>
++  <allocation>294912</allocation>
++  <target>
++    <path>/var/lib/libvirt/images/encrypt1.img</path>
++    <format type='raw'/>
++    <permissions>
++      <mode>0644</mode>
++      <owner>0</owner>
++      <group>0</group>
++      <label>unconfined_u:object_r:virt_image_t:s0</label>
++    </permissions>
++    <encryption format='luks'>
++      <secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/>
++    </encryption>
++  </target>
++</volume>
+diff --git a/tests/storagevolxml2xmlin/vol-encrypt2.xml b/tests/storagevolxml2xmlin/vol-encrypt2.xml
+new file mode 100644
+index 0000000000..0507d3b9e6
+--- /dev/null
++++ b/tests/storagevolxml2xmlin/vol-encrypt2.xml
+@@ -0,0 +1,21 @@
++<volume>
++  <name>encrypt2.img</name>
++  <key>/var/lib/libvirt/images/encrypt2.img</key>
++  <source>
++  </source>
++  <capacity unit="G">5</capacity>
++  <allocation>294912</allocation>
++  <target>
++    <path>/var/lib/libvirt/images/encrypt2.img</path>
++    <format type='raw'/>
++    <permissions>
++      <mode>0644</mode>
++      <owner>0</owner>
++      <group>0</group>
++      <label>unconfined_u:object_r:virt_image_t:s0</label>
++    </permissions>
++    <encryption format='luks'>
++      <secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709af480'/>
++    </encryption>
++  </target>
++</volume>
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-storage-Extract-out-mount-command-creation-for-FS-Backend.patch b/SOURCES/libvirt-storage-Extract-out-mount-command-creation-for-FS-Backend.patch
new file mode 100644
index 0000000..e5eecfe
--- /dev/null
+++ b/SOURCES/libvirt-storage-Extract-out-mount-command-creation-for-FS-Backend.patch
@@ -0,0 +1,124 @@
+From 2098b067ec805170011979646c52c8dbbda943c3 Mon Sep 17 00:00:00 2001
+Message-Id: <2098b067ec805170011979646c52c8dbbda943c3@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 09:12:13 -0400
+Subject: [PATCH] storage: Extract out mount command creation for FS Backend
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+Extract out the code that is used to create the MOUNT command
+for starting the pool. We can use this for Storage Pool XML
+to Argv testing to ensure code changes don't alter how a
+storage pool is started.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+ACKed-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit 1bebb904fe2f8f51b29efe28bbe91d708f142ade)
+Message-Id: <20190403131219.16385-2-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/storage/storage_backend_fs.c | 70 +++++++++++++++++++-------------
+ 1 file changed, 41 insertions(+), 29 deletions(-)
+
+diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
+index 8983738210..4015271419 100644
+--- a/src/storage/storage_backend_fs.c
++++ b/src/storage/storage_backend_fs.c
+@@ -333,19 +333,11 @@ virStorageBackendFileSystemIsMounted(virStoragePoolObjPtr pool)
+     return ret;
+ }
+ 
+-/**
+- * @pool storage pool to mount
+- *
+- * Ensure that a FS storage pool is mounted on its target location.
+- * If already mounted, this is a no-op
+- *
+- * Returns 0 if successfully mounted, -1 on error
+- */
+-static int
+-virStorageBackendFileSystemMount(virStoragePoolObjPtr pool)
++
++static virCommandPtr
++virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
++                                    const char *src)
+ {
+-    virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
+-    char *src = NULL;
+     /* 'mount -t auto' doesn't seem to auto determine nfs (or cifs),
+      *  while plain 'mount' does. We have to craft separate argvs to
+      *  accommodate this */
+@@ -356,23 +348,6 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool)
+     bool cifsfs = (def->type == VIR_STORAGE_POOL_NETFS &&
+                    def->source.format == VIR_STORAGE_POOL_NETFS_CIFS);
+     virCommandPtr cmd = NULL;
+-    int ret = -1;
+-    int rc;
+-
+-    if (virStorageBackendFileSystemIsValid(pool) < 0)
+-        return -1;
+-
+-    if ((rc = virStorageBackendFileSystemIsMounted(pool)) < 0)
+-        return -1;
+-
+-    /* Short-circuit if already mounted */
+-    if (rc == 1) {
+-        VIR_INFO("Target '%s' is already mounted", def->target.path);
+-        return 0;
+-    }
+-
+-    if (!(src = virStorageBackendFileSystemGetPoolSource(pool)))
+-        return -1;
+ 
+     if (netauto)
+         cmd = virCommandNewArgList(MOUNT,
+@@ -407,6 +382,43 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool)
+                                    def->target.path,
+                                    NULL);
+ 
++    return cmd;
++}
++
++
++/**
++ * @pool storage pool to mount
++ *
++ * Ensure that a FS storage pool is mounted on its target location.
++ * If already mounted, this is a no-op
++ *
++ * Returns 0 if successfully mounted, -1 on error
++ */
++static int
++virStorageBackendFileSystemMount(virStoragePoolObjPtr pool)
++{
++    virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
++    char *src = NULL;
++    virCommandPtr cmd = NULL;
++    int ret = -1;
++    int rc;
++
++    if (virStorageBackendFileSystemIsValid(pool) < 0)
++        return -1;
++
++    if ((rc = virStorageBackendFileSystemIsMounted(pool)) < 0)
++        return -1;
++
++    /* Short-circuit if already mounted */
++    if (rc == 1) {
++        VIR_INFO("Target '%s' is already mounted", def->target.path);
++        return 0;
++    }
++
++    if (!(src = virStorageBackendFileSystemGetPoolSource(pool)))
++        return -1;
++
++    cmd = virStorageBackendFileSystemMountCmd(def, src);
+     if (virCommandRun(cmd, NULL) < 0)
+         goto cleanup;
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-storage-Fetch-a-unique-key-for-vHBA-NPIV-LUNs.patch b/SOURCES/libvirt-storage-Fetch-a-unique-key-for-vHBA-NPIV-LUNs.patch
index 05a4638..e45c602 100644
--- a/SOURCES/libvirt-storage-Fetch-a-unique-key-for-vHBA-NPIV-LUNs.patch
+++ b/SOURCES/libvirt-storage-Fetch-a-unique-key-for-vHBA-NPIV-LUNs.patch
@@ -1,5 +1,5 @@
-From 5e8bad9479e999bf9dd704ec29f83427b260c587 Mon Sep 17 00:00:00 2001
-Message-Id: <5e8bad9479e999bf9dd704ec29f83427b260c587@dist-git>
+From 95c8eb63a3078bfd4a568b02898be2be91e3cd95 Mon Sep 17 00:00:00 2001
+Message-Id: <95c8eb63a3078bfd4a568b02898be2be91e3cd95@dist-git>
 From: John Ferlan <jferlan@redhat.com>
 Date: Tue, 12 Mar 2019 13:55:59 -0400
 Subject: [PATCH] storage: Fetch a unique key for vHBA/NPIV LUNs
diff --git a/SOURCES/libvirt-storage-Move-FS-backend-mount-creation-command-helper.patch b/SOURCES/libvirt-storage-Move-FS-backend-mount-creation-command-helper.patch
new file mode 100644
index 0000000..debe320
--- /dev/null
+++ b/SOURCES/libvirt-storage-Move-FS-backend-mount-creation-command-helper.patch
@@ -0,0 +1,164 @@
+From 648ffa72001e1bb6d26a71f4a0be38042bab9242 Mon Sep 17 00:00:00 2001
+Message-Id: <648ffa72001e1bb6d26a71f4a0be38042bab9242@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 09:12:14 -0400
+Subject: [PATCH] storage: Move FS backend mount creation command helper
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+Move virStorageBackendFileSystemMountCmd to storage_util so that
+it can be used by the test harness.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+ACKed-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit 728b9ed61abe3fea101dd4dddddeb9a530babc6a)
+Message-Id: <20190403131219.16385-3-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/storage/storage_backend_fs.c | 52 --------------------------------
+ src/storage/storage_util.c       | 52 ++++++++++++++++++++++++++++++++
+ src/storage/storage_util.h       |  4 +++
+ 3 files changed, 56 insertions(+), 52 deletions(-)
+
+diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
+index 4015271419..4acdb43e0d 100644
+--- a/src/storage/storage_backend_fs.c
++++ b/src/storage/storage_backend_fs.c
+@@ -334,58 +334,6 @@ virStorageBackendFileSystemIsMounted(virStoragePoolObjPtr pool)
+ }
+ 
+ 
+-static virCommandPtr
+-virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
+-                                    const char *src)
+-{
+-    /* 'mount -t auto' doesn't seem to auto determine nfs (or cifs),
+-     *  while plain 'mount' does. We have to craft separate argvs to
+-     *  accommodate this */
+-    bool netauto = (def->type == VIR_STORAGE_POOL_NETFS &&
+-                    def->source.format == VIR_STORAGE_POOL_NETFS_AUTO);
+-    bool glusterfs = (def->type == VIR_STORAGE_POOL_NETFS &&
+-                      def->source.format == VIR_STORAGE_POOL_NETFS_GLUSTERFS);
+-    bool cifsfs = (def->type == VIR_STORAGE_POOL_NETFS &&
+-                   def->source.format == VIR_STORAGE_POOL_NETFS_CIFS);
+-    virCommandPtr cmd = NULL;
+-
+-    if (netauto)
+-        cmd = virCommandNewArgList(MOUNT,
+-                                   src,
+-                                   def->target.path,
+-                                   NULL);
+-    else if (glusterfs)
+-        cmd = virCommandNewArgList(MOUNT,
+-                                   "-t",
+-                                   virStoragePoolFormatFileSystemNetTypeToString(def->source.format),
+-                                   src,
+-                                   "-o",
+-                                   "direct-io-mode=1",
+-                                   def->target.path,
+-                                   NULL);
+-    else if (cifsfs)
+-        cmd = virCommandNewArgList(MOUNT,
+-                                   "-t",
+-                                   virStoragePoolFormatFileSystemNetTypeToString(def->source.format),
+-                                   src,
+-                                   def->target.path,
+-                                   "-o",
+-                                   "guest",
+-                                   NULL);
+-    else
+-        cmd = virCommandNewArgList(MOUNT,
+-                                   "-t",
+-                                   (def->type == VIR_STORAGE_POOL_FS ?
+-                                    virStoragePoolFormatFileSystemTypeToString(def->source.format) :
+-                                    virStoragePoolFormatFileSystemNetTypeToString(def->source.format)),
+-                                   src,
+-                                   def->target.path,
+-                                   NULL);
+-
+-    return cmd;
+-}
+-
+-
+ /**
+  * @pool storage pool to mount
+  *
+diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
+index 637b90fac1..327b500b6b 100644
+--- a/src/storage/storage_util.c
++++ b/src/storage/storage_util.c
+@@ -4210,3 +4210,55 @@ virStorageBackendZeroPartitionTable(const char *path,
+     return storageBackendVolWipeLocalFile(path, VIR_STORAGE_VOL_WIPE_ALG_ZERO,
+                                           size, true);
+ }
++
++
++virCommandPtr
++virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
++                                    const char *src)
++{
++    /* 'mount -t auto' doesn't seem to auto determine nfs (or cifs),
++     *  while plain 'mount' does. We have to craft separate argvs to
++     *  accommodate this */
++    bool netauto = (def->type == VIR_STORAGE_POOL_NETFS &&
++                    def->source.format == VIR_STORAGE_POOL_NETFS_AUTO);
++    bool glusterfs = (def->type == VIR_STORAGE_POOL_NETFS &&
++                      def->source.format == VIR_STORAGE_POOL_NETFS_GLUSTERFS);
++    bool cifsfs = (def->type == VIR_STORAGE_POOL_NETFS &&
++                   def->source.format == VIR_STORAGE_POOL_NETFS_CIFS);
++    virCommandPtr cmd = NULL;
++
++    if (netauto)
++        cmd = virCommandNewArgList(MOUNT,
++                                   src,
++                                   def->target.path,
++                                   NULL);
++    else if (glusterfs)
++        cmd = virCommandNewArgList(MOUNT,
++                                   "-t",
++                                   virStoragePoolFormatFileSystemNetTypeToString(def->source.format),
++                                   src,
++                                   "-o",
++                                   "direct-io-mode=1",
++                                   def->target.path,
++                                   NULL);
++    else if (cifsfs)
++        cmd = virCommandNewArgList(MOUNT,
++                                   "-t",
++                                   virStoragePoolFormatFileSystemNetTypeToString(def->source.format),
++                                   src,
++                                   def->target.path,
++                                   "-o",
++                                   "guest",
++                                   NULL);
++    else
++        cmd = virCommandNewArgList(MOUNT,
++                                   "-t",
++                                   (def->type == VIR_STORAGE_POOL_FS ?
++                                    virStoragePoolFormatFileSystemTypeToString(def->source.format) :
++                                    virStoragePoolFormatFileSystemNetTypeToString(def->source.format)),
++                                   src,
++                                   def->target.path,
++                                   NULL);
++
++    return cmd;
++}
+diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h
+index 58b991c772..5b0baf56c4 100644
+--- a/src/storage/storage_util.h
++++ b/src/storage/storage_util.h
+@@ -177,4 +177,8 @@ int
+ virStorageBackendZeroPartitionTable(const char *path,
+                                     unsigned long long size);
+ 
++virCommandPtr
++virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
++                                    const char *src);
++
+ #endif /* __VIR_STORAGE_UTIL_H__ */
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-storage-Move-virStorageBackendFileSystemGetPoolSource.patch b/SOURCES/libvirt-storage-Move-virStorageBackendFileSystemGetPoolSource.patch
new file mode 100644
index 0000000..e017205
--- /dev/null
+++ b/SOURCES/libvirt-storage-Move-virStorageBackendFileSystemGetPoolSource.patch
@@ -0,0 +1,129 @@
+From 7dcfd278c8139fe25f3cb5a2efd5c440ad8d2321 Mon Sep 17 00:00:00 2001
+Message-Id: <7dcfd278c8139fe25f3cb5a2efd5c440ad8d2321@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 09:12:15 -0400
+Subject: [PATCH] storage: Move virStorageBackendFileSystemGetPoolSource
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+Move into storage_util for reuse by test harness
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+ACKed-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit 1f6ca26d72c17d51fd713c72eeac5c1900153bc0)
+Message-Id: <20190403131219.16385-4-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/storage/storage_backend_fs.c | 33 --------------------------------
+ src/storage/storage_util.c       | 33 ++++++++++++++++++++++++++++++++
+ src/storage/storage_util.h       |  3 +++
+ 3 files changed, 36 insertions(+), 33 deletions(-)
+
+diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
+index 4acdb43e0d..7bb61aa4ae 100644
+--- a/src/storage/storage_backend_fs.c
++++ b/src/storage/storage_backend_fs.c
+@@ -248,39 +248,6 @@ virStorageBackendFileSystemIsValid(virStoragePoolObjPtr pool)
+ }
+ 
+ 
+-/**
+- * virStorageBackendFileSystemGetPoolSource
+- * @pool: storage pool object pointer
+- *
+- * Allocate/return a string representing the FS storage pool source.
+- * It is up to the caller to VIR_FREE the allocated string
+- */
+-static char *
+-virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool)
+-{
+-    virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
+-    char *src = NULL;
+-
+-    if (def->type == VIR_STORAGE_POOL_NETFS) {
+-        if (def->source.format == VIR_STORAGE_POOL_NETFS_CIFS) {
+-            if (virAsprintf(&src, "//%s/%s",
+-                            def->source.hosts[0].name,
+-                            def->source.dir) < 0)
+-                return NULL;
+-        } else {
+-            if (virAsprintf(&src, "%s:%s",
+-                            def->source.hosts[0].name,
+-                            def->source.dir) < 0)
+-                return NULL;
+-        }
+-    } else {
+-        if (VIR_STRDUP(src, def->source.devices[0].path) < 0)
+-            return NULL;
+-    }
+-    return src;
+-}
+-
+-
+ /**
+  * @pool storage pool to check for status
+  *
+diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
+index 327b500b6b..ccbc2c925c 100644
+--- a/src/storage/storage_util.c
++++ b/src/storage/storage_util.c
+@@ -4212,6 +4212,39 @@ virStorageBackendZeroPartitionTable(const char *path,
+ }
+ 
+ 
++/**
++ * virStorageBackendFileSystemGetPoolSource
++ * @pool: storage pool object pointer
++ *
++ * Allocate/return a string representing the FS storage pool source.
++ * It is up to the caller to VIR_FREE the allocated string
++ */
++char *
++virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool)
++{
++    virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
++    char *src = NULL;
++
++    if (def->type == VIR_STORAGE_POOL_NETFS) {
++        if (def->source.format == VIR_STORAGE_POOL_NETFS_CIFS) {
++            if (virAsprintf(&src, "//%s/%s",
++                            def->source.hosts[0].name,
++                            def->source.dir) < 0)
++                return NULL;
++        } else {
++            if (virAsprintf(&src, "%s:%s",
++                            def->source.hosts[0].name,
++                            def->source.dir) < 0)
++                return NULL;
++        }
++    } else {
++        if (VIR_STRDUP(src, def->source.devices[0].path) < 0)
++            return NULL;
++    }
++    return src;
++}
++
++
+ virCommandPtr
+ virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
+                                     const char *src)
+diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h
+index 5b0baf56c4..28b3e0b9c9 100644
+--- a/src/storage/storage_util.h
++++ b/src/storage/storage_util.h
+@@ -177,6 +177,9 @@ int
+ virStorageBackendZeroPartitionTable(const char *path,
+                                     unsigned long long size);
+ 
++char *
++virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool);
++
+ virCommandPtr
+ virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
+                                     const char *src);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-storage-Remove-secretPath-from-_virStorageBackendQemuImgInfo.patch b/SOURCES/libvirt-storage-Remove-secretPath-from-_virStorageBackendQemuImgInfo.patch
new file mode 100644
index 0000000..ede72c1
--- /dev/null
+++ b/SOURCES/libvirt-storage-Remove-secretPath-from-_virStorageBackendQemuImgInfo.patch
@@ -0,0 +1,60 @@
+From 41651c5fbe6712dcca09cfc875af4d16c0f9fd68 Mon Sep 17 00:00:00 2001
+Message-Id: <41651c5fbe6712dcca09cfc875af4d16c0f9fd68@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 07:35:45 -0400
+Subject: [PATCH] storage: Remove secretPath from _virStorageBackendQemuImgInfo
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1613737
+
+There's really no need for it to be there since it's only ever
+used inside virStorageBackendCreateQemuImgCmdFromVol
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+ACKed-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit f6aa977fab1108e652ab8c360a651045c727d02e)
+Message-Id: <20190403113547.29231-2-jferlan@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ src/storage/storage_util.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
+index 19e6e0544b..54e778490d 100644
+--- a/src/storage/storage_util.c
++++ b/src/storage/storage_util.c
+@@ -709,7 +709,6 @@ struct _virStorageBackendQemuImgInfo {
+     int inputFormat;
+ 
+     char *secretAlias;
+-    const char *secretPath;
+ };
+ 
+ 
+@@ -1081,7 +1080,6 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
+         .compat = vol->target.compat,
+         .features = vol->target.features,
+         .nocow = vol->target.nocow,
+-        .secretPath = secretPath,
+         .secretAlias = NULL,
+     };
+     virStorageEncryptionPtr enc = vol->target.encryption;
+@@ -1124,14 +1122,14 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
+         virCommandAddArgList(cmd, "-b", info.backingPath, NULL);
+ 
+     if (enc) {
+-        if (!info.secretPath) {
++        if (!secretPath) {
+             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("path to secret data file is required"));
+             goto error;
+         }
+         if (virAsprintf(&info.secretAlias, "%s_encrypt0", vol->name) < 0)
+             goto error;
+-        if (storageBackendCreateQemuImgSecretObject(cmd, info.secretPath,
++        if (storageBackendCreateQemuImgSecretObject(cmd, secretPath,
+                                                     info.secretAlias) < 0)
+             goto error;
+         encinfo = &enc->encinfo;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-storage-Rework-virStorageBackendFileSystemMountCmd.patch b/SOURCES/libvirt-storage-Rework-virStorageBackendFileSystemMountCmd.patch
new file mode 100644
index 0000000..e9319d0
--- /dev/null
+++ b/SOURCES/libvirt-storage-Rework-virStorageBackendFileSystemMountCmd.patch
@@ -0,0 +1,134 @@
+From e6545c2acc9a3626572cbf937c1d7eba62362e3b Mon Sep 17 00:00:00 2001
+Message-Id: <e6545c2acc9a3626572cbf937c1d7eba62362e3b@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 09:12:18 -0400
+Subject: [PATCH] storage: Rework virStorageBackendFileSystemMountCmd
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+Let's create helpers for each style of command line created. This
+primarily is easier on the eyes rather than the large multi line
+if-then-else-else clause used, but may also be useful if in the
+future any particular pool needs to add to the command line based
+on pool xml format.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+ACKed-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit b663d4329ca844b1bdb536acaa2ae338bf435f74)
+Message-Id: <20190403131219.16385-7-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/storage/storage_util.c | 84 +++++++++++++++++++++++++-------------
+ 1 file changed, 55 insertions(+), 29 deletions(-)
+
+diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
+index ccbc2c925c..70ce600581 100644
+--- a/src/storage/storage_util.c
++++ b/src/storage/storage_util.c
+@@ -4245,6 +4245,56 @@ virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool)
+ }
+ 
+ 
++static void
++virStorageBackendFileSystemMountNFSArgs(virCommandPtr cmd,
++                                        const char *src,
++                                        virStoragePoolDefPtr def)
++{
++    virCommandAddArgList(cmd, src, def->target.path, NULL);
++}
++
++
++static void
++virStorageBackendFileSystemMountGlusterArgs(virCommandPtr cmd,
++                                            const char *src,
++                                            virStoragePoolDefPtr def)
++{
++    const char *fmt;
++
++    fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
++    virCommandAddArgList(cmd, "-t", fmt, src, "-o", "direct-io-mode=1",
++                         def->target.path, NULL);
++}
++
++
++static void
++virStorageBackendFileSystemMountCIFSArgs(virCommandPtr cmd,
++                                         const char *src,
++                                         virStoragePoolDefPtr def)
++{
++    const char *fmt;
++
++    fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
++    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path,
++                         "-o", "guest", NULL);
++}
++
++
++static void
++virStorageBackendFileSystemMountDefaultArgs(virCommandPtr cmd,
++                                            const char *src,
++                                            virStoragePoolDefPtr def)
++{
++    const char *fmt;
++
++    if (def->type == VIR_STORAGE_POOL_FS)
++        fmt = virStoragePoolFormatFileSystemTypeToString(def->source.format);
++    else
++        fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
++    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
++}
++
++
+ virCommandPtr
+ virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
+                                     const char *src)
+@@ -4260,38 +4310,14 @@ virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def,
+                    def->source.format == VIR_STORAGE_POOL_NETFS_CIFS);
+     virCommandPtr cmd = NULL;
+ 
++    cmd = virCommandNew(MOUNT);
+     if (netauto)
+-        cmd = virCommandNewArgList(MOUNT,
+-                                   src,
+-                                   def->target.path,
+-                                   NULL);
++        virStorageBackendFileSystemMountNFSArgs(cmd, src, def);
+     else if (glusterfs)
+-        cmd = virCommandNewArgList(MOUNT,
+-                                   "-t",
+-                                   virStoragePoolFormatFileSystemNetTypeToString(def->source.format),
+-                                   src,
+-                                   "-o",
+-                                   "direct-io-mode=1",
+-                                   def->target.path,
+-                                   NULL);
++        virStorageBackendFileSystemMountGlusterArgs(cmd, src, def);
+     else if (cifsfs)
+-        cmd = virCommandNewArgList(MOUNT,
+-                                   "-t",
+-                                   virStoragePoolFormatFileSystemNetTypeToString(def->source.format),
+-                                   src,
+-                                   def->target.path,
+-                                   "-o",
+-                                   "guest",
+-                                   NULL);
++        virStorageBackendFileSystemMountCIFSArgs(cmd, src, def);
+     else
+-        cmd = virCommandNewArgList(MOUNT,
+-                                   "-t",
+-                                   (def->type == VIR_STORAGE_POOL_FS ?
+-                                    virStoragePoolFormatFileSystemTypeToString(def->source.format) :
+-                                    virStoragePoolFormatFileSystemNetTypeToString(def->source.format)),
+-                                   src,
+-                                   def->target.path,
+-                                   NULL);
+-
++        virStorageBackendFileSystemMountDefaultArgs(cmd, src, def);
+     return cmd;
+ }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-storage-Rework-virStorageBackendSCSISerial.patch b/SOURCES/libvirt-storage-Rework-virStorageBackendSCSISerial.patch
index c8437b8..0f85662 100644
--- a/SOURCES/libvirt-storage-Rework-virStorageBackendSCSISerial.patch
+++ b/SOURCES/libvirt-storage-Rework-virStorageBackendSCSISerial.patch
@@ -1,5 +1,5 @@
-From 4b841d996f9e1181e6a0614eb0bc9a35d5f7c372 Mon Sep 17 00:00:00 2001
-Message-Id: <4b841d996f9e1181e6a0614eb0bc9a35d5f7c372@dist-git>
+From 5d93906d3a51691be4c0d3cf29d4650f090cc0e1 Mon Sep 17 00:00:00 2001
+Message-Id: <5d93906d3a51691be4c0d3cf29d4650f090cc0e1@dist-git>
 From: John Ferlan <jferlan@redhat.com>
 Date: Tue, 12 Mar 2019 13:55:57 -0400
 Subject: [PATCH] storage: Rework virStorageBackendSCSISerial
diff --git a/SOURCES/libvirt-test-caps-Add-capabilities-for-QEMU-3.1.0.patch b/SOURCES/libvirt-test-caps-Add-capabilities-for-QEMU-3.1.0.patch
new file mode 100644
index 0000000..64840e7
--- /dev/null
+++ b/SOURCES/libvirt-test-caps-Add-capabilities-for-QEMU-3.1.0.patch
@@ -0,0 +1,24474 @@
+From 75438101eac292921d2a1361a05bd298feea193d Mon Sep 17 00:00:00 2001
+Message-Id: <75438101eac292921d2a1361a05bd298feea193d@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:22 +0200
+Subject: [PATCH] test: caps: Add capabilities for QEMU 3.1.0
+
+These are based on QEMU v3.1.0-rc2-41-g4822f1ee9e.
+
+Acked-by: Peter Krempa <pkrempa@redhat.com>
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+(cherry picked from commit 9c4afbda3456c7c0ba14bb1f596f9e9a148597fc)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <a5f88812cfdedba61607a578b66de3500f42a6b0.1554791287.git.eskultet@redhat.com>
+
+FIXUP: Adjust the QEMU 3.1.0 replies file for downstream purposes
+
+This needs to be squashed into the commit which cherry-picks the 3.1.0
+capabilities. This patch adds a few legacy QMP commands which were
+already deprecated but downstream libvirt still probes it. At the same
+time QMP command 'memory-backend-memfd' had to be deleted completely as
+it was messing the command numbering significantly (more than what
+usually happens).
+Message-Id: <3998391491f9390d27585b58d991e088ee0cdc90.1554791287.git.eskultet@redhat.com>
+
+FIXUP: Adjust the QEMU 3.1.0 caps XML for downstream purposes
+
+This needs to be squashed into the commit which cherry-picked the 3.1.0
+capabilities.
+Message-Id: <44eaff8f5c558e391db49a171323b05f14cc6278.1554791287.git.eskultet@redhat.com>
+
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ .../caps_3.1.0.x86_64.replies                 | 23024 ++++++++++++++++
+ .../caps_3.1.0.x86_64.xml                     |  1382 +
+ tests/qemucapabilitiestest.c                  |     1 +
+ 3 files changed, 24407 insertions(+)
+ create mode 100644 tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies
+ create mode 100644 tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
+
+diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies
+new file mode 100644
+index 0000000000..b5677b5d5d
+--- /dev/null
++++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies
+@@ -0,0 +1,23024 @@
++{
++  "execute": "qmp_capabilities",
++  "id": "libvirt-1"
++}
++
++{
++  "return": {
++  },
++  "id": "libvirt-1"
++}
++
++{
++  "execute": "query-version",
++  "id": "libvirt-2"
++}
++
++{
++  "return": {
++    "qemu": {
++      "micro": 92,
++      "minor": 0,
++      "major": 3
++    },
++    "package": "v3.1.0-rc2-48-g039d4e3df0"
++  },
++  "id": "libvirt-2"
++}
++
++{
++  "execute": "query-target",
++  "id": "libvirt-3"
++}
++
++{
++  "return": {
++    "arch": "x86_64"
++  },
++  "id": "libvirt-3"
++}
++
++{
++  "execute": "query-commands",
++  "id": "libvirt-4"
++}
++
++{
++  "return": [
++    {
++      "name": "netdev_add"
++    },
++    {
++      "name": "device_add"
++    },
++    {
++      "name": "query-qmp-schema"
++    },
++    {
++      "name": "set-numa-node"
++    },
++    {
++      "name": "query-sev-capabilities"
++    },
++    {
++      "name": "query-sev-launch-measure"
++    },
++    {
++      "name": "query-sev"
++    },
++    {
++      "name": "query-vm-generation-id"
++    },
++    {
++      "name": "query-hotpluggable-cpus"
++    },
++    {
++      "name": "xen-load-devices-state"
++    },
++    {
++      "name": "rtc-reset-reinjection"
++    },
++    {
++      "name": "query-acpi-ospm-status"
++    },
++    {
++      "name": "query-memory-devices"
++    },
++    {
++      "name": "query-memdev"
++    },
++    {
++      "name": "query-command-line-options"
++    },
++    {
++      "name": "query-target"
++    },
++    {
++      "name": "query-fdsets"
++    },
++    {
++      "name": "remove-fd"
++    },
++    {
++      "name": "add-fd"
++    },
++    {
++      "name": "query-cpu-model-expansion"
++    },
++    {
++      "name": "query-cpu-definitions"
++    },
++    {
++      "name": "query-memory-size-summary"
++    },
++    {
++      "name": "query-machines"
++    },
++    {
++      "name": "closefd"
++    },
++    {
++      "name": "getfd"
++    },
++    {
++      "name": "object-del"
++    },
++    {
++      "name": "object-add"
++    },
++    {
++      "name": "query-dump-guest-memory-capability"
++    },
++    {
++      "name": "query-dump"
++    },
++    {
++      "name": "dump-guest-memory"
++    },
++    {
++      "name": "device_del"
++    },
++    {
++      "name": "xen-set-global-dirty-log"
++    },
++    {
++      "name": "qom-list-properties"
++    },
++    {
++      "name": "device-list-properties"
++    },
++    {
++      "name": "qom-list-types"
++    },
++    {
++      "name": "change"
++    },
++    {
++      "name": "qom-set"
++    },
++    {
++      "name": "qom-get"
++    },
++    {
++      "name": "qom-list"
++    },
++    {
++      "name": "human-monitor-command"
++    },
++    {
++      "name": "balloon"
++    },
++    {
++      "name": "inject-nmi"
++    },
++    {
++      "name": "system_wakeup"
++    },
++    {
++      "name": "x-exit-preconfig"
++    },
++    {
++      "name": "cont"
++    },
++    {
++      "name": "pmemsave"
++    },
++    {
++      "name": "memsave"
++    },
++    {
++      "name": "cpu-add"
++    },
++    {
++      "name": "system_powerdown"
++    },
++    {
++      "name": "system_reset"
++    },
++    {
++      "name": "stop"
++    },
++    {
++      "name": "quit"
++    },
++    {
++      "name": "query-pci"
++    },
++    {
++      "name": "query-balloon"
++    },
++    {
++      "name": "query-iothreads"
++    },
++    {
++      "name": "query-cpus-fast"
++    },
++    {
++      "name": "query-cpus"
++    },
++    {
++      "name": "query-events"
++    },
++    {
++      "name": "query-uuid"
++    },
++    {
++      "name": "query-kvm"
++    },
++    {
++      "name": "query-name"
++    },
++    {
++      "name": "add_client"
++    },
++    {
++      "name": "query-commands"
++    },
++    {
++      "name": "query-version"
++    },
++    {
++      "name": "qmp_capabilities"
++    },
++    {
++      "name": "trace-event-set-state"
++    },
++    {
++      "name": "trace-event-get-state"
++    },
++    {
++      "name": "transaction"
++    },
++    {
++      "name": "migrate-pause"
++    },
++    {
++      "name": "migrate-recover"
++    },
++    {
++      "name": "query-colo-status"
++    },
++    {
++      "name": "xen-colo-do-checkpoint"
++    },
++    {
++      "name": "query-xen-replication-status"
++    },
++    {
++      "name": "xen-set-replication"
++    },
++    {
++      "name": "xen-save-devices-state"
++    },
++    {
++      "name": "migrate-incoming"
++    },
++    {
++      "name": "migrate"
++    },
++    {
++      "name": "query-migrate-cache-size"
++    },
++    {
++      "name": "migrate-set-cache-size"
++    },
++    {
++      "name": "migrate_set_speed"
++    },
++    {
++      "name": "migrate_set_downtime"
++    },
++    {
++      "name": "migrate-continue"
++    },
++    {
++      "name": "migrate_cancel"
++    },
++    {
++      "name": "x-colo-lost-heartbeat"
++    },
++    {
++      "name": "migrate-start-postcopy"
++    },
++    {
++      "name": "client_migrate_info"
++    },
++    {
++      "name": "query-migrate-parameters"
++    },
++    {
++      "name": "migrate-set-parameters"
++    },
++    {
++      "name": "query-migrate-capabilities"
++    },
++    {
++      "name": "migrate-set-capabilities"
++    },
++    {
++      "name": "query-migrate"
++    },
++    {
++      "name": "query-display-options"
++    },
++    {
++      "name": "input-send-event"
++    },
++    {
++      "name": "send-key"
++    },
++    {
++      "name": "query-mice"
++    },
++    {
++      "name": "change-vnc-password"
++    },
++    {
++      "name": "query-vnc-servers"
++    },
++    {
++      "name": "query-vnc"
++    },
++    {
++      "name": "query-spice"
++    },
++    {
++      "name": "screendump"
++    },
++    {
++      "name": "expire_password"
++    },
++    {
++      "name": "set_password"
++    },
++    {
++      "name": "query-tpm"
++    },
++    {
++      "name": "query-tpm-types"
++    },
++    {
++      "name": "query-tpm-models"
++    },
++    {
++      "name": "query-rocker-of-dpa-groups"
++    },
++    {
++      "name": "query-rocker-of-dpa-flows"
++    },
++    {
++      "name": "query-rocker-ports"
++    },
++    {
++      "name": "query-rocker"
++    },
++    {
++      "name": "query-rx-filter"
++    },
++    {
++      "name": "netdev_del"
++    },
++    {
++      "name": "set_link"
++    },
++    {
++      "name": "chardev-send-break"
++    },
++    {
++      "name": "chardev-remove"
++    },
++    {
++      "name": "chardev-change"
++    },
++    {
++      "name": "chardev-add"
++    },
++    {
++      "name": "ringbuf-read"
++    },
++    {
++      "name": "ringbuf-write"
++    },
++    {
++      "name": "query-chardev-backends"
++    },
++    {
++      "name": "query-chardev"
++    },
++    {
++      "name": "nbd-server-stop"
++    },
++    {
++      "name": "x-nbd-server-add-bitmap"
++    },
++    {
++      "name": "nbd-server-remove"
++    },
++    {
++      "name": "nbd-server-add"
++    },
++    {
++      "name": "nbd-server-start"
++    },
++    {
++      "name": "eject"
++    },
++    {
++      "name": "blockdev-snapshot-delete-internal-sync"
++    },
++    {
++      "name": "blockdev-snapshot-internal-sync"
++    },
++    {
++      "name": "query-pr-managers"
++    },
++    {
++      "name": "x-blockdev-set-iothread"
++    },
++    {
++      "name": "x-blockdev-change"
++    },
++    {
++      "name": "block-set-write-threshold"
++    },
++    {
++      "name": "blockdev-change-medium"
++    },
++    {
++      "name": "blockdev-insert-medium"
++    },
++    {
++      "name": "blockdev-remove-medium"
++    },
++    {
++      "name": "blockdev-close-tray"
++    },
++    {
++      "name": "blockdev-open-tray"
++    },
++    {
++      "name": "blockdev-create"
++    },
++    {
++      "name": "blockdev-del"
++    },
++    {
++      "name": "blockdev-add"
++    },
++    {
++      "name": "block-job-finalize"
++    },
++    {
++      "name": "block-job-dismiss"
++    },
++    {
++      "name": "block-job-complete"
++    },
++    {
++      "name": "block-job-resume"
++    },
++    {
++      "name": "block-job-pause"
++    },
++    {
++      "name": "block-job-cancel"
++    },
++    {
++      "name": "block-job-set-speed"
++    },
++    {
++      "name": "block-stream"
++    },
++    {
++      "name": "block_set_io_throttle"
++    },
++    {
++      "name": "blockdev-mirror"
++    },
++    {
++      "name": "x-debug-block-dirty-bitmap-sha256"
++    },
++    {
++      "name": "x-block-dirty-bitmap-merge"
++    },
++    {
++      "name": "x-block-dirty-bitmap-disable"
++    },
++    {
++      "name": "x-block-dirty-bitmap-enable"
++    },
++    {
++      "name": "block-dirty-bitmap-clear"
++    },
++    {
++      "name": "block-dirty-bitmap-remove"
++    },
++    {
++      "name": "block-dirty-bitmap-add"
++    },
++    {
++      "name": "drive-mirror"
++    },
++    {
++      "name": "query-named-block-nodes"
++    },
++    {
++      "name": "blockdev-backup"
++    },
++    {
++      "name": "drive-backup"
++    },
++    {
++      "name": "block-commit"
++    },
++    {
++      "name": "change-backing-file"
++    },
++    {
++      "name": "blockdev-snapshot"
++    },
++    {
++      "name": "blockdev-snapshot-sync"
++    },
++    {
++      "name": "block_resize"
++    },
++    {
++      "name": "block_passwd"
++    },
++    {
++      "name": "query-block-jobs"
++    },
++    {
++      "name": "query-blockstats"
++    },
++    {
++      "name": "query-block"
++    },
++    {
++      "name": "x-block-latency-histogram-set"
++    },
++    {
++      "name": "query-jobs"
++    },
++    {
++      "name": "job-finalize"
++    },
++    {
++      "name": "job-dismiss"
++    },
++    {
++      "name": "job-complete"
++    },
++    {
++      "name": "job-cancel"
++    },
++    {
++      "name": "job-resume"
++    },
++    {
++      "name": "job-pause"
++    },
++    {
++      "name": "watchdog-set-action"
++    },
++    {
++      "name": "query-status"
++    }
++  ],
++  "id": "libvirt-4"
++}
++
++{
++  "execute": "add-fd",
++  "arguments": {
++    "fdset-id": 0,
++    "opaque": "/dev/null"
++  },
++  "id": "libvirt-5"
++}
++
++{
++  "return": {
++    "fd": 17,
++    "fdset-id": 0
++  },
++  "id": "libvirt-5"
++}
++
++{
++  "execute": "block-commit",
++  "arguments": {
++    "device": "bogus"
++  },
++  "id": "libvirt-6"
++}
++
++{
++  "id": "libvirt-6",
++  "error": {
++    "class": "DeviceNotFound",
++    "desc": "Device 'bogus' not found"
++  }
++}
++
++{
++  "execute": "query-kvm",
++  "id": "libvirt-7"
++}
++
++{
++  "return": {
++    "enabled": true,
++    "present": true
++  },
++  "id": "libvirt-7"
++}
++
++{
++  "execute": "query-events",
++  "id": "libvirt-8"
++}
++
++{
++  "return": [
++    {
++      "name": "COMMAND_DROPPED"
++    },
++    {
++      "name": "RTC_CHANGE"
++    },
++    {
++      "name": "ACPI_DEVICE_OST"
++    },
++    {
++      "name": "MEM_UNPLUG_ERROR"
++    },
++    {
++      "name": "DUMP_COMPLETED"
++    },
++    {
++      "name": "DEVICE_DELETED"
++    },
++    {
++      "name": "BALLOON_CHANGE"
++    },
++    {
++      "name": "COLO_EXIT"
++    },
++    {
++      "name": "MIGRATION_PASS"
++    },
++    {
++      "name": "MIGRATION"
++    },
++    {
++      "name": "VNC_DISCONNECTED"
++    },
++    {
++      "name": "VNC_INITIALIZED"
++    },
++    {
++      "name": "VNC_CONNECTED"
++    },
++    {
++      "name": "SPICE_MIGRATE_COMPLETED"
++    },
++    {
++      "name": "SPICE_DISCONNECTED"
++    },
++    {
++      "name": "SPICE_INITIALIZED"
++    },
++    {
++      "name": "SPICE_CONNECTED"
++    },
++    {
++      "name": "NIC_RX_FILTER_CHANGED"
++    },
++    {
++      "name": "VSERPORT_CHANGE"
++    },
++    {
++      "name": "QUORUM_REPORT_BAD"
++    },
++    {
++      "name": "QUORUM_FAILURE"
++    },
++    {
++      "name": "PR_MANAGER_STATUS_CHANGED"
++    },
++    {
++      "name": "DEVICE_TRAY_MOVED"
++    },
++    {
++      "name": "BLOCK_WRITE_THRESHOLD"
++    },
++    {
++      "name": "BLOCK_JOB_PENDING"
++    },
++    {
++      "name": "BLOCK_JOB_READY"
++    },
++    {
++      "name": "BLOCK_JOB_ERROR"
++    },
++    {
++      "name": "BLOCK_JOB_CANCELLED"
++    },
++    {
++      "name": "BLOCK_JOB_COMPLETED"
++    },
++    {
++      "name": "BLOCK_IO_ERROR"
++    },
++    {
++      "name": "BLOCK_IMAGE_CORRUPTED"
++    },
++    {
++      "name": "JOB_STATUS_CHANGE"
++    },
++    {
++      "name": "GUEST_PANICKED"
++    },
++    {
++      "name": "WATCHDOG"
++    },
++    {
++      "name": "WAKEUP"
++    },
++    {
++      "name": "SUSPEND_DISK"
++    },
++    {
++      "name": "SUSPEND"
++    },
++    {
++      "name": "RESUME"
++    },
++    {
++      "name": "STOP"
++    },
++    {
++      "name": "RESET"
++    },
++    {
++      "name": "POWERDOWN"
++    },
++    {
++      "name": "SHUTDOWN"
++    }
++  ],
++  "id": "libvirt-8"
++}
++
++{
++  "execute": "qom-list-types",
++  "id": "libvirt-9"
++}
++
++{
++  "return": [
++    {
++      "name": "vhost-vsock-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "scsi-generic",
++      "parent": "scsi-device"
++    },
++    {
++      "name": "qio-channel-tls",
++      "parent": "qio-channel"
++    },
++    {
++      "name": "scsi-hd",
++      "parent": "scsi-disk-base"
++    },
++    {
++      "name": "pc-0.10-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "usb-bot",
++      "parent": "usb-storage-dev"
++    },
++    {
++      "name": "chardev-null",
++      "parent": "chardev"
++    },
++    {
++      "name": "chardev-parallel",
++      "parent": "chardev"
++    },
++    {
++      "name": "qemu-xhci",
++      "parent": "base-xhci"
++    },
++    {
++      "name": "lsi53c895a",
++      "parent": "pci-device"
++    },
++    {
++      "name": "kvm-ioapic",
++      "parent": "ioapic-common"
++    },
++    {
++      "name": "virtio-keyboard-pci",
++      "parent": "virtio-input-hid-pci"
++    },
++    {
++      "name": "i440FX",
++      "parent": "pci-device"
++    },
++    {
++      "name": "ide-hd",
++      "parent": "ide-device"
++    },
++    {
++      "name": "Opteron_G1-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "kvm64-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "virtio-net-device",
++      "parent": "virtio-device"
++    },
++    {
++      "name": "kvm-i8259",
++      "parent": "pic-common"
++    },
++    {
++      "name": "chardev-pty",
++      "parent": "chardev"
++    },
++    {
++      "name": "SUNW,fdtwo",
++      "parent": "base-sysbus-fdc"
++    },
++    {
++      "name": "isa-pcspk",
++      "parent": "isa-device"
++    },
++    {
++      "name": "Haswell-IBRS-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "loader",
++      "parent": "device"
++    },
++    {
++      "name": "filter-rewriter",
++      "parent": "netfilter"
++    },
++    {
++      "name": "virtio-serial-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "Nehalem-IBRS-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pc-0.12-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "pcie-root-port",
++      "parent": "pcie-root-port-base"
++    },
++    {
++      "name": "virtio-crypto-device",
++      "parent": "virtio-device"
++    },
++    {
++      "name": "usb-host",
++      "parent": "usb-device"
++    },
++    {
++      "name": "Icelake-Client-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pc-0.11-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "usb-bt-dongle",
++      "parent": "usb-device"
++    },
++    {
++      "name": "igd-passthrough-isa-bridge",
++      "parent": "pci-device"
++    },
++    {
++      "name": "qemu64-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "PIIX3-xen",
++      "parent": "pci-piix3"
++    },
++    {
++      "name": "virtio-input-host-pci",
++      "parent": "virtio-input-pci"
++    },
++    {
++      "name": "pc-i440fx-2.10-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "phenom-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "e1000",
++      "parent": "e1000-base"
++    },
++    {
++      "name": "ICH9-LPC",
++      "parent": "pci-device"
++    },
++    {
++      "name": "pc-i440fx-1.4-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "ich9-usb-uhci6",
++      "parent": "pci-uhci-usb"
++    },
++    {
++      "name": "sysbus-ahci",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "ich9-usb-uhci4",
++      "parent": "pci-uhci-usb"
++    },
++    {
++      "name": "pc-q35-2.6-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "usb-mtp",
++      "parent": "usb-device"
++    },
++    {
++      "name": "ccid-card-emulated",
++      "parent": "ccid-card"
++    },
++    {
++      "name": "ich9-usb-uhci5",
++      "parent": "pci-uhci-usb"
++    },
++    {
++      "name": "chardev-spicevmc",
++      "parent": "chardev-spice"
++    },
++    {
++      "name": "ich9-usb-uhci3",
++      "parent": "pci-uhci-usb"
++    },
++    {
++      "name": "ich9-usb-uhci2",
++      "parent": "pci-uhci-usb"
++    },
++    {
++      "name": "ich9-usb-uhci1",
++      "parent": "pci-uhci-usb"
++    },
++    {
++      "name": "tls-creds-psk",
++      "parent": "tls-creds"
++    },
++    {
++      "name": "tpci200",
++      "parent": "pci-device"
++    },
++    {
++      "name": "memory-backend-file",
++      "parent": "memory-backend"
++    },
++    {
++      "name": "pc-q35-2.5-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "AMDVI-PCI",
++      "parent": "pci-device"
++    },
++    {
++      "name": "rtl8139",
++      "parent": "pci-device"
++    },
++    {
++      "name": "chardev-hci",
++      "parent": "chardev"
++    },
++    {
++      "name": "pc-q35-2.4-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "pc-i440fx-3.1-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "megasas",
++      "parent": "megasas-base"
++    },
++    {
++      "name": "base-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "container",
++      "parent": "object"
++    },
++    {
++      "name": "qxl-vga",
++      "parent": "pci-qxl"
++    },
++    {
++      "name": "scsi-block",
++      "parent": "scsi-disk-base"
++    },
++    {
++      "name": "Opteron_G2-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "unimplemented-device",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "pc-i440fx-3.0-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "scsi-cd",
++      "parent": "scsi-disk-base"
++    },
++    {
++      "name": "pxb-bus",
++      "parent": "PCI"
++    },
++    {
++      "name": "pc-0.14-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "accel",
++      "parent": "object"
++    },
++    {
++      "name": "pc-i440fx-2.12-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "floppy-bus",
++      "parent": "bus"
++    },
++    {
++      "name": "usb-audio",
++      "parent": "usb-device"
++    },
++    {
++      "name": "virtio-vga",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "vmware-svga",
++      "parent": "pci-device"
++    },
++    {
++      "name": "isa-serial",
++      "parent": "isa-device"
++    },
++    {
++      "name": "pc-0.13-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "vhost-scsi-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "virtio-serial-device",
++      "parent": "virtio-device"
++    },
++    {
++      "name": "isa-debug-exit",
++      "parent": "isa-device"
++    },
++    {
++      "name": "chardev-gdb",
++      "parent": "chardev"
++    },
++    {
++      "name": "fdc37m81x-superio",
++      "parent": "isa-superio"
++    },
++    {
++      "name": "pc-testdev",
++      "parent": "isa-device"
++    },
++    {
++      "name": "Haswell-noTSX-IBRS-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pr-manager-helper",
++      "parent": "pr-manager"
++    },
++    {
++      "name": "fw_cfg_mem",
++      "parent": "fw_cfg"
++    },
++    {
++      "name": "tls-creds-anon",
++      "parent": "tls-creds"
++    },
++    {
++      "name": "pc-q35-2.8-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "ide-cd",
++      "parent": "ide-device"
++    },
++    {
++      "name": "usb-uas",
++      "parent": "usb-device"
++    },
++    {
++      "name": "pc-i440fx-2.11-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "pc-i440fx-1.6-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "chardev-socket",
++      "parent": "chardev"
++    },
++    {
++      "name": "virtio-balloon-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "iothread",
++      "parent": "object"
++    },
++    {
++      "name": "filter-redirector",
++      "parent": "netfilter"
++    },
++    {
++      "name": "sb16",
++      "parent": "isa-device"
++    },
++    {
++      "name": "486-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pc-q35-2.7-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "pc-i440fx-1.5-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "chardev-mux",
++      "parent": "chardev"
++    },
++    {
++      "name": "bochs-display",
++      "parent": "pci-device"
++    },
++    {
++      "name": "usb-ccid",
++      "parent": "usb-device"
++    },
++    {
++      "name": "isa-cirrus-vga",
++      "parent": "isa-device"
++    },
++    {
++      "name": "qio-channel-rdma",
++      "parent": "qio-channel"
++    },
++    {
++      "name": "vhost-vsock-device",
++      "parent": "virtio-device"
++    },
++    {
++      "name": "sdhci-pci",
++      "parent": "pci-device"
++    },
++    {
++      "name": "virtio-input-host-device",
++      "parent": "virtio-input-device"
++    },
++    {
++      "name": "i82559er",
++      "parent": "pci-device"
++    },
++    {
++      "name": "pci-bridge",
++      "parent": "base-pci-bridge"
++    },
++    {
++      "name": "cs4231a",
++      "parent": "isa-device"
++    },
++    {
++      "name": "ivshmem-doorbell",
++      "parent": "ivshmem-common"
++    },
++    {
++      "name": "chardev-udp",
++      "parent": "chardev"
++    },
++    {
++      "name": "virtio-rng-device",
++      "parent": "virtio-device"
++    },
++    {
++      "name": "isa-parallel",
++      "parent": "isa-device"
++    },
++    {
++      "name": "piix4-ide",
++      "parent": "pci-ide"
++    },
++    {
++      "name": "adlib",
++      "parent": "isa-device"
++    },
++    {
++      "name": "pc-0.15-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "kvmvapic",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "hda-micro",
++      "parent": "hda-audio"
++    },
++    {
++      "name": "pci-bridge-seat",
++      "parent": "pci-bridge"
++    },
++    {
++      "name": "dc390",
++      "parent": "am53c974"
++    },
++    {
++      "name": "qemu,register",
++      "parent": "device"
++    },
++    {
++      "name": "IDE",
++      "parent": "bus"
++    },
++    {
++      "name": "fw_cfg_io",
++      "parent": "fw_cfg"
++    },
++    {
++      "name": "tpm-crb",
++      "parent": "device"
++    },
++    {
++      "name": "memory-backend-ram",
++      "parent": "memory-backend"
++    },
++    {
++      "name": "am53c974",
++      "parent": "pci-device"
++    },
++    {
++      "name": "virtio-blk-device",
++      "parent": "virtio-device"
++    },
++    {
++      "name": "nvdimm",
++      "parent": "pc-dimm"
++    },
++    {
++      "name": "KnightsMill-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "mc146818rtc",
++      "parent": "isa-device"
++    },
++    {
++      "name": "qio-channel-websock",
++      "parent": "qio-channel"
++    },
++    {
++      "name": "qio-channel-file",
++      "parent": "qio-channel"
++    },
++    {
++      "name": "chardev-msmouse",
++      "parent": "chardev"
++    },
++    {
++      "name": "chardev-pipe",
++      "parent": "chardev-fd"
++    },
++    {
++      "name": "pc-q35-2.9-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "pc-i440fx-1.7-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "cryptodev-backend-builtin",
++      "parent": "cryptodev-backend"
++    },
++    {
++      "name": "hda-output",
++      "parent": "hda-audio"
++    },
++    {
++      "name": "chardev-spiceport",
++      "parent": "chardev-spice"
++    },
++    {
++      "name": "VGA",
++      "parent": "pci-vga"
++    },
++    {
++      "name": "vfio-pci-nohotplug",
++      "parent": "vfio-pci"
++    },
++    {
++      "name": "sga",
++      "parent": "isa-device"
++    },
++    {
++      "name": "i8257",
++      "parent": "isa-device"
++    },
++    {
++      "name": "qio-net-listener",
++      "parent": "object"
++    },
++    {
++      "name": "port92",
++      "parent": "isa-device"
++    },
++    {
++      "name": "mptsas1068",
++      "parent": "pci-device"
++    },
++    {
++      "name": "edu",
++      "parent": "pci-device"
++    },
++    {
++      "name": "virtio-mouse-pci",
++      "parent": "virtio-input-hid-pci"
++    },
++    {
++      "name": "Skylake-Client-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "ICH9 SMB",
++      "parent": "pci-device"
++    },
++    {
++      "name": "Broadwell-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "vfio-pci-igd-lpc-bridge",
++      "parent": "pci-device"
++    },
++    {
++      "name": "HDA",
++      "parent": "bus"
++    },
++    {
++      "name": "n270-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pcm3680_pci",
++      "parent": "pci-device"
++    },
++    {
++      "name": "usb-redir",
++      "parent": "usb-device"
++    },
++    {
++      "name": "floppy",
++      "parent": "device"
++    },
++    {
++      "name": "qemu:memory-region",
++      "parent": "object"
++    },
++    {
++      "name": "mioe3680_pci",
++      "parent": "pci-device"
++    },
++    {
++      "name": "sysbus-ohci",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "chardev-ringbuf",
++      "parent": "chardev"
++    },
++    {
++      "name": "max-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "can-bus",
++      "parent": "object"
++    },
++    {
++      "name": "qtest-accel",
++      "parent": "accel"
++    },
++    {
++      "name": "qio-channel-command",
++      "parent": "qio-channel"
++    },
++    {
++      "name": "pxb-host",
++      "parent": "pci-host-bridge"
++    },
++    {
++      "name": "IvyBridge-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "xio3130-downstream",
++      "parent": "pcie-slot"
++    },
++    {
++      "name": "virtio-gpu-device",
++      "parent": "virtio-device"
++    },
++    {
++      "name": "virtio-blk-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "cirrus-vga",
++      "parent": "pci-device"
++    },
++    {
++      "name": "isa-ipmi-kcs",
++      "parent": "isa-device"
++    },
++    {
++      "name": "kvmclock",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "cryptodev-vhost-user",
++      "parent": "cryptodev-backend"
++    },
++    {
++      "name": "Opteron_G3-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "lsi53c810",
++      "parent": "lsi53c895a"
++    },
++    {
++      "name": "System",
++      "parent": "bus"
++    },
++    {
++      "name": "Westmere-IBRS-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "Cascadelake-Server-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "usb-serial",
++      "parent": "usb-serial-dev"
++    },
++    {
++      "name": "vt82c686b-usb-uhci",
++      "parent": "pci-uhci-usb"
++    },
++    {
++      "name": "chardev-braille",
++      "parent": "chardev"
++    },
++    {
++      "name": "chardev-file",
++      "parent": "chardev-fd"
++    },
++    {
++      "name": "intel-iommu",
++      "parent": "x86-iommu"
++    },
++    {
++      "name": "pc-q35-2.10-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "tpm-tis",
++      "parent": "isa-device"
++    },
++    {
++      "name": "PCIE",
++      "parent": "PCI"
++    },
++    {
++      "name": "pcie-pci-bridge",
++      "parent": "base-pci-bridge"
++    },
++    {
++      "name": "ccid-card-passthru",
++      "parent": "ccid-card"
++    },
++    {
++      "name": "qio-dns-resolver",
++      "parent": "object"
++    },
++    {
++      "name": "vhost-user-blk-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "virtio-serial-bus",
++      "parent": "bus"
++    },
++    {
++      "name": "kvm-pit",
++      "parent": "pit-common"
++    },
++    {
++      "name": "secondary-vga",
++      "parent": "pci-vga"
++    },
++    {
++      "name": "vhost-scsi",
++      "parent": "vhost-scsi-common"
++    },
++    {
++      "name": "pci-ohci",
++      "parent": "pci-device"
++    },
++    {
++      "name": "cfi.pflash01",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "usb-hub",
++      "parent": "usb-device"
++    },
++    {
++      "name": "ccid-bus",
++      "parent": "bus"
++    },
++    {
++      "name": "EPYC-IBPB-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "input-linux",
++      "parent": "object"
++    },
++    {
++      "name": "piix3-ide-xen",
++      "parent": "pci-ide"
++    },
++    {
++      "name": "vmgenid",
++      "parent": "device"
++    },
++    {
++      "name": "pc-q35-3.0-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "pci-serial",
++      "parent": "pci-device"
++    },
++    {
++      "name": "vmport",
++      "parent": "isa-device"
++    },
++    {
++      "name": "vhost-user-scsi-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "ipmi-bmc-extern",
++      "parent": "ipmi-bmc"
++    },
++    {
++      "name": "PIIX4_PM",
++      "parent": "pci-device"
++    },
++    {
++      "name": "i8042",
++      "parent": "isa-device"
++    },
++    {
++      "name": "coreduo-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "i82559c",
++      "parent": "pci-device"
++    },
++    {
++      "name": "i82559b",
++      "parent": "pci-device"
++    },
++    {
++      "name": "i82559a",
++      "parent": "pci-device"
++    },
++    {
++      "name": "pc-q35-2.12-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "SCSI",
++      "parent": "bus"
++    },
++    {
++      "name": "rocker",
++      "parent": "pci-device"
++    },
++    {
++      "name": "pcnet",
++      "parent": "pci-device"
++    },
++    {
++      "name": "rng-egd",
++      "parent": "rng-backend"
++    },
++    {
++      "name": "Skylake-Server-IBRS-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "Opteron_G4-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pc-q35-2.11-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "chardev-testdev",
++      "parent": "chardev"
++    },
++    {
++      "name": "PIIX3",
++      "parent": "pci-piix3"
++    },
++    {
++      "name": "filter-dump",
++      "parent": "netfilter"
++    },
++    {
++      "name": "migration",
++      "parent": "device"
++    },
++    {
++      "name": "vmmouse",
++      "parent": "isa-device"
++    },
++    {
++      "name": "i82558b",
++      "parent": "pci-device"
++    },
++    {
++      "name": "i82558a",
++      "parent": "pci-device"
++    },
++    {
++      "name": "ioapic",
++      "parent": "ioapic-common"
++    },
++    {
++      "name": "smbus-eeprom",
++      "parent": "smbus-device"
++    },
++    {
++      "name": "Haswell-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "i82801",
++      "parent": "pci-device"
++    },
++    {
++      "name": "tls-creds-x509",
++      "parent": "tls-creds"
++    },
++    {
++      "name": "virtio-net-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "virtio-keyboard-device",
++      "parent": "virtio-input-hid-device"
++    },
++    {
++      "name": "i82562",
++      "parent": "pci-device"
++    },
++    {
++      "name": "Haswell-noTSX-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "usb-net",
++      "parent": "usb-device"
++    },
++    {
++      "name": "tpm-passthrough",
++      "parent": "tpm-backend"
++    },
++    {
++      "name": "q35-pcihost",
++      "parent": "pcie-host-bridge"
++    },
++    {
++      "name": "amd-iommu",
++      "parent": "x86-iommu"
++    },
++    {
++      "name": "i440FX-pcihost",
++      "parent": "pci-host-bridge"
++    },
++    {
++      "name": "i82557c",
++      "parent": "pci-device"
++    },
++    {
++      "name": "i82557b",
++      "parent": "pci-device"
++    },
++    {
++      "name": "i82557a",
++      "parent": "pci-device"
++    },
++    {
++      "name": "chardev-memory",
++      "parent": "chardev-ringbuf"
++    },
++    {
++      "name": "isa-i8259",
++      "parent": "pic-common"
++    },
++    {
++      "name": "virtio-gpu-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "i82551",
++      "parent": "pci-device"
++    },
++    {
++      "name": "pc-i440fx-2.0-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "SandyBridge-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "split-irq",
++      "parent": "device"
++    },
++    {
++      "name": "usb-mouse",
++      "parent": "usb-hid"
++    },
++    {
++      "name": "sdhci-bus",
++      "parent": "sd-bus"
++    },
++    {
++      "name": "i82550",
++      "parent": "pci-device"
++    },
++    {
++      "name": "pc-q35-3.1-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "host-x86_64-cpu",
++      "parent": "max-x86_64-cpu"
++    },
++    {
++      "name": "virtio-crypto-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "ich9-usb-ehci1",
++      "parent": "pci-ehci-usb"
++    },
++    {
++      "name": "ich9-usb-ehci2",
++      "parent": "pci-ehci-usb"
++    },
++    {
++      "name": "vfio-pci",
++      "parent": "pci-device"
++    },
++    {
++      "name": "filter-mirror",
++      "parent": "netfilter"
++    },
++    {
++      "name": "isa-ide",
++      "parent": "isa-device"
++    },
++    {
++      "name": "irq",
++      "parent": "object"
++    },
++    {
++      "name": "throttle-group",
++      "parent": "object"
++    },
++    {
++      "name": "IvyBridge-IBRS-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "memory-backend-memfd",
++      "parent": "memory-backend"
++    },
++    {
++      "name": "can-host-socketcan",
++      "parent": "can-host"
++    },
++    {
++      "name": "nec-usb-xhci",
++      "parent": "base-xhci"
++    },
++    {
++      "name": "qio-channel-socket",
++      "parent": "qio-channel"
++    },
++    {
++      "name": "pvscsi",
++      "parent": "pci-device"
++    },
++    {
++      "name": "piix3-usb-uhci",
++      "parent": "pci-uhci-usb"
++    },
++    {
++      "name": "virtserialport",
++      "parent": "virtio-serial-port"
++    },
++    {
++      "name": "sd-bus",
++      "parent": "bus"
++    },
++    {
++      "name": "Opteron_G5-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "ich9-ahci",
++      "parent": "pci-device"
++    },
++    {
++      "name": "chardev-stdio",
++      "parent": "chardev-fd"
++    },
++    {
++      "name": "Skylake-Client-IBRS-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pc-dimm",
++      "parent": "device"
++    },
++    {
++      "name": "gus",
++      "parent": "isa-device"
++    },
++    {
++      "name": "hyperv-testdev",
++      "parent": "isa-device"
++    },
++    {
++      "name": "isa-vga",
++      "parent": "isa-device"
++    },
++    {
++      "name": "pc-i440fx-2.2-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "cryptodev-backend",
++      "parent": "object"
++    },
++    {
++      "name": "IndustryPack",
++      "parent": "bus"
++    },
++    {
++      "name": "pc-i440fx-2.1-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "Icelake-Server-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "or-irq",
++      "parent": "device"
++    },
++    {
++      "name": "ipmi-bmc-sim",
++      "parent": "ipmi-bmc"
++    },
++    {
++      "name": "Broadwell-noTSX-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "usb-ehci",
++      "parent": "pci-ehci-usb"
++    },
++    {
++      "name": "pentium2-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "chardev-vc",
++      "parent": "chardev"
++    },
++    {
++      "name": "virtio-rng-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "filter-replay",
++      "parent": "netfilter"
++    },
++    {
++      "name": "e1000-82545em",
++      "parent": "e1000-base"
++    },
++    {
++      "name": "chardev-wctablet",
++      "parent": "chardev"
++    },
++    {
++      "name": "hyperv-synic",
++      "parent": "device"
++    },
++    {
++      "name": "pc-i440fx-2.5-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "e1000-82544gc",
++      "parent": "e1000-base"
++    },
++    {
++      "name": "hpet",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "Broadwell-noTSX-IBRS-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "ioh3420",
++      "parent": "pcie-root-port-base"
++    },
++    {
++      "name": "pc-i440fx-2.4-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "virtio-9p-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "vmcoreinfo",
++      "parent": "device"
++    },
++    {
++      "name": "filter-buffer",
++      "parent": "netfilter"
++    },
++    {
++      "name": "pci-serial-4x",
++      "parent": "pci-device"
++    },
++    {
++      "name": "athlon-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "ich9-intel-hda",
++      "parent": "intel-hda-generic"
++    },
++    {
++      "name": "pc-i440fx-2.3-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "virtio-9p-device",
++      "parent": "virtio-device"
++    },
++    {
++      "name": "ivshmem",
++      "parent": "ivshmem-common"
++    },
++    {
++      "name": "imx-usdhc",
++      "parent": "generic-sdhci"
++    },
++    {
++      "name": "isa-ipmi-bt",
++      "parent": "isa-device"
++    },
++    {
++      "name": "ipoctal232",
++      "parent": "ipack-device"
++    },
++    {
++      "name": "virtio-tablet-device",
++      "parent": "virtio-input-hid-device"
++    },
++    {
++      "name": "virtio-scsi-pci",
++      "parent": "virtio-pci"
++    },
++    {
++      "name": "virtio-pci-bus",
++      "parent": "virtio-bus"
++    },
++    {
++      "name": "ES1370",
++      "parent": "pci-device"
++    },
++    {
++      "name": "x3130-upstream",
++      "parent": "pcie-port"
++    },
++    {
++      "name": "piix3-ide",
++      "parent": "pci-ide"
++    },
++    {
++      "name": "pci-testdev",
++      "parent": "pci-device"
++    },
++    {
++      "name": "qemu-console",
++      "parent": "object"
++    },
++    {
++      "name": "ISA",
++      "parent": "bus"
++    },
++    {
++      "name": "piix4-usb-uhci",
++      "parent": "pci-uhci-usb"
++    },
++    {
++      "name": "pc-i440fx-2.7-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "tcg-accel",
++      "parent": "accel"
++    },
++    {
++      "name": "virtconsole",
++      "parent": "virtserialport"
++    },
++    {
++      "name": "pentium3-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pci-serial-2x",
++      "parent": "pci-device"
++    },
++    {
++      "name": "ne2k_isa",
++      "parent": "isa-device"
++    },
++    {
++      "name": "Nehalem-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "isa-fdc",
++      "parent": "isa-device"
++    },
++    {
++      "name": "pc-i440fx-2.6-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "chardev-serial",
++      "parent": "chardev-fd"
++    },
++    {
++      "name": "igd-passthrough-i440FX",
++      "parent": "i440FX"
++    },
++    {
++      "name": "colo-compare",
++      "parent": "object"
++    },
++    {
++      "name": "e1000e",
++      "parent": "pci-device"
++    },
++    {
++      "name": "virtio-tablet-pci",
++      "parent": "virtio-input-hid-pci"
++    },
++    {
++      "name": "usb-bus",
++      "parent": "bus"
++    },
++    {
++      "name": "i82801b11-bridge",
++      "parent": "base-pci-bridge"
++    },
++    {
++      "name": "PCI",
++      "parent": "bus"
++    },
++    {
++      "name": "usb-storage",
++      "parent": "usb-storage-dev"
++    },
++    {
++      "name": "vhost-user-scsi",
++      "parent": "vhost-scsi-common"
++    },
++    {
++      "name": "mch",
++      "parent": "pci-device"
++    },
++    {
++      "name": "ib700",
++      "parent": "isa-device"
++    },
++    {
++      "name": "esp",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "isabus-bridge",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "vhost-user-blk",
++      "parent": "virtio-device"
++    },
++    {
++      "name": "qemu32-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "ne2k_pci",
++      "parent": "pci-device"
++    },
++    {
++      "name": "Broadwell-IBRS-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "tpm-emulator",
++      "parent": "tpm-backend"
++    },
++    {
++      "name": "ivshmem-plain",
++      "parent": "ivshmem-common"
++    },
++    {
++      "name": "usb-kbd",
++      "parent": "usb-hid"
++    },
++    {
++      "name": "isa-applesmc",
++      "parent": "isa-device"
++    },
++    {
++      "name": "secret",
++      "parent": "object"
++    },
++    {
++      "name": "hda-duplex",
++      "parent": "hda-audio"
++    },
++    {
++      "name": "kvm32-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pc-i440fx-2.9-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "kvm-apic",
++      "parent": "apic-common"
++    },
++    {
++      "name": "sev-guest",
++      "parent": "object"
++    },
++    {
++      "name": "virtio-balloon-device",
++      "parent": "virtio-device"
++    },
++    {
++      "name": "none-machine",
++      "parent": "machine"
++    },
++    {
++      "name": "sysbus-fdc",
++      "parent": "base-sysbus-fdc"
++    },
++    {
++      "name": "megasas-gen2",
++      "parent": "megasas-base"
++    },
++    {
++      "name": "pc-1.0-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "core2duo-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "qxl",
++      "parent": "pci-qxl"
++    },
++    {
++      "name": "ramfb",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "pc-i440fx-2.8-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "nvme",
++      "parent": "pci-device"
++    },
++    {
++      "name": "isa-debugcon",
++      "parent": "isa-device"
++    },
++    {
++      "name": "SandyBridge-IBRS-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "Skylake-Server-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pentium-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "usb-tablet",
++      "parent": "usb-hid"
++    },
++    {
++      "name": "qio-channel-buffer",
++      "parent": "qio-channel"
++    },
++    {
++      "name": "scsi-disk",
++      "parent": "scsi-disk-base"
++    },
++    {
++      "name": "usb-braille",
++      "parent": "usb-serial-dev"
++    },
++    {
++      "name": "intel-hda",
++      "parent": "intel-hda-generic"
++    },
++    {
++      "name": "kvm-accel",
++      "parent": "accel"
++    },
++    {
++      "name": "pxb-pcie-bus",
++      "parent": "PCIE"
++    },
++    {
++      "name": "virtio-scsi-device",
++      "parent": "virtio-scsi-common"
++    },
++    {
++      "name": "AC97",
++      "parent": "pci-device"
++    },
++    {
++      "name": "usb-wacom-tablet",
++      "parent": "usb-device"
++    },
++    {
++      "name": "i2c-bus",
++      "parent": "bus"
++    },
++    {
++      "name": "EPYC-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "virtio-mouse-device",
++      "parent": "virtio-input-hid-device"
++    },
++    {
++      "name": "Conroe-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "pxb-pcie",
++      "parent": "pci-device"
++    },
++    {
++      "name": "pc-1.3-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "ide-drive",
++      "parent": "ide-device"
++    },
++    {
++      "name": "generic-sdhci",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "pvrdma",
++      "parent": "pci-device"
++    },
++    {
++      "name": "isa-pit",
++      "parent": "pit-common"
++    },
++    {
++      "name": "vfio-platform",
++      "parent": "sys-bus-device"
++    },
++    {
++      "name": "pxb",
++      "parent": "pci-device"
++    },
++    {
++      "name": "pc-1.2-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "intel-iommu-iommu-memory-region",
++      "parent": "qemu:iommu-memory-region"
++    },
++    {
++      "name": "pc-1.1-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "sd-card",
++      "parent": "device"
++    },
++    {
++      "name": "kvaser_pci",
++      "parent": "pci-device"
++    },
++    {
++      "name": "vmxnet3",
++      "parent": "pci-device"
++    },
++    {
++      "name": "i6300esb",
++      "parent": "pci-device"
++    },
++    {
++      "name": "Westmere-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "amd-iommu-iommu-memory-region",
++      "parent": "qemu:iommu-memory-region"
++    },
++    {
++      "name": "pvpanic",
++      "parent": "isa-device"
++    },
++    {
++      "name": "Penryn-x86_64-cpu",
++      "parent": "x86_64-cpu"
++    },
++    {
++      "name": "apic",
++      "parent": "apic-common"
++    },
++    {
++      "name": "isapc-machine",
++      "parent": "generic-pc-machine"
++    },
++    {
++      "name": "rng-random",
++      "parent": "rng-backend"
++    }
++  ],
++  "id": "libvirt-9"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-blk-pci"
++  },
++  "id": "libvirt-10"
++}
++
++{
++  "return": [
++    {
++      "name": "iothread",
++      "type": "link<iothread>"
++    },
++    {
++      "name": "request-merging",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "secs",
++      "type": "uint32"
++    },
++    {
++      "name": "min_io_size",
++      "type": "uint16"
++    },
++    {
++      "name": "event_idx",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "serial",
++      "type": "str"
++    },
++    {
++      "name": "heads",
++      "type": "uint32"
++    },
++    {
++      "name": "ioeventfd",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "scsi",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "cyls",
++      "type": "uint32"
++    },
++    {
++      "name": "x-disable-pcie",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "logical_block_size",
++      "description": "A power of two between 512 and 32768",
++      "type": "uint16"
++    },
++    {
++      "name": "indirect_desc",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "queue-size",
++      "type": "uint16"
++    },
++    {
++      "name": "disable-modern",
++      "type": "bool"
++    },
++    {
++      "name": "drive",
++      "description": "Node name or ID of a block device to use as a backend",
++      "type": "str"
++    },
++    {
++      "name": "disable-legacy",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-lnkctl-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "werror",
++      "description": "Error handling policy, report/ignore/enospc/stop/auto",
++      "type": "BlockdevOnError"
++    },
++    {
++      "name": "bootindex",
++      "type": "int32"
++    },
++    {
++      "name": "discard_granularity",
++      "type": "uint32"
++    },
++    {
++      "name": "rerror",
++      "description": "Error handling policy, report/ignore/enospc/stop/auto",
++      "type": "BlockdevOnError"
++    },
++    {
++      "name": "page-per-vq",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-deverr-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-pm-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "any_layout",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "share-rw",
++      "type": "bool"
++    },
++    {
++      "name": "physical_block_size",
++      "description": "A power of two between 512 and 32768",
++      "type": "uint16"
++    },
++    {
++      "name": "config-wce",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "class",
++      "type": "uint32"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "migrate-extra",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "modern-pio-notify",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "vectors",
++      "type": "uint32"
++    },
++    {
++      "name": "iommu_platform",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virtio-backend",
++      "type": "child<virtio-blk-device>"
++    },
++    {
++      "name": "x-ignore-backend-features",
++      "type": "bool"
++    },
++    {
++      "name": "notify_on_empty",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "write-cache",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "num-queues",
++      "type": "uint16"
++    },
++    {
++      "name": "opt_io_size",
++      "type": "uint32"
++    },
++    {
++      "name": "ats",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virtio-pci-bus-master-bug-migration",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    }
++  ],
++  "id": "libvirt-10"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-net-pci"
++  },
++  "id": "libvirt-11"
++}
++
++{
++  "return": [
++    {
++      "name": "ctrl_mac_addr",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "status",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "notify_on_empty",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "indirect_desc",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-pm-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "guest_csum",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "speed",
++      "type": "int32"
++    },
++    {
++      "name": "ctrl_rx",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "ctrl_vq",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "bootindex",
++      "type": "int32"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "disable-modern",
++      "type": "bool"
++    },
++    {
++      "name": "mrg_rxbuf",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "host_tso6",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-txtimer",
++      "type": "uint32"
++    },
++    {
++      "name": "host_tso4",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "ctrl_rx_extra",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "gso",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "page-per-vq",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-disable-pcie",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-ignore-backend-features",
++      "type": "bool"
++    },
++    {
++      "name": "x-txburst",
++      "type": "int32"
++    },
++    {
++      "name": "iommu_platform",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-lnkctl-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "host_mtu",
++      "type": "uint16"
++    },
++    {
++      "name": "ctrl_vlan",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "guest_tso4",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virtio-backend",
++      "type": "child<virtio-net-device>"
++    },
++    {
++      "name": "vectors",
++      "type": "uint32"
++    },
++    {
++      "name": "event_idx",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "guest_announce",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "host_ecn",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "ats",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "host_ufo",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "duplex",
++      "type": "str"
++    },
++    {
++      "name": "guest_tso6",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "ctrl_guest_offloads",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "csum",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "modern-pio-notify",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "ioeventfd",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "mq",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "any_layout",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "guest_ecn",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "guest_ufo",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virtio-pci-bus-master-bug-migration",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "mac",
++      "description": "Ethernet 6-byte MAC Address, example: 52:54:00:12:34:56",
++      "type": "str"
++    },
++    {
++      "name": "tx_queue_size",
++      "type": "uint16"
++    },
++    {
++      "name": "disable-legacy",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "tx",
++      "type": "str"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-mtu-bypass-backend",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-deverr-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "netdev",
++      "description": "ID of a netdev to use as a backend",
++      "type": "str"
++    },
++    {
++      "name": "migrate-extra",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "rx_queue_size",
++      "type": "uint16"
++    }
++  ],
++  "id": "libvirt-11"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-scsi-pci"
++  },
++  "id": "libvirt-12"
++}
++
++{
++  "return": [
++    {
++      "name": "event_idx",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "ioeventfd",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "virtqueue_size",
++      "type": "uint32"
++    },
++    {
++      "name": "x-disable-pcie",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "indirect_desc",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "disable-modern",
++      "type": "bool"
++    },
++    {
++      "name": "disable-legacy",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "num_queues",
++      "type": "uint32"
++    },
++    {
++      "name": "cmd_per_lun",
++      "type": "uint32"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-lnkctl-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "hotplug",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "page-per-vq",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-deverr-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-pm-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "max_sectors",
++      "type": "uint32"
++    },
++    {
++      "name": "param_change",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "any_layout",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "iothread",
++      "type": "link<iothread>"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "migrate-extra",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "modern-pio-notify",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "vectors",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virtio-backend",
++      "type": "child<virtio-scsi-device>"
++    },
++    {
++      "name": "x-ignore-backend-features",
++      "type": "bool"
++    },
++    {
++      "name": "notify_on_empty",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "iommu_platform",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "ats",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virtio-pci-bus-master-bug-migration",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    }
++  ],
++  "id": "libvirt-12"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-net-ccw"
++  },
++  "id": "libvirt-13"
++}
++
++{
++  "id": "libvirt-13",
++  "error": {
++    "class": "DeviceNotFound",
++    "desc": "Device 'virtio-net-ccw' not found"
++  }
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-scsi-ccw"
++  },
++  "id": "libvirt-14"
++}
++
++{
++  "id": "libvirt-14",
++  "error": {
++    "class": "DeviceNotFound",
++    "desc": "Device 'virtio-scsi-ccw' not found"
++  }
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-net-s390"
++  },
++  "id": "libvirt-15"
++}
++
++{
++  "id": "libvirt-15",
++  "error": {
++    "class": "DeviceNotFound",
++    "desc": "Device 'virtio-net-s390' not found"
++  }
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "pci-assign"
++  },
++  "id": "libvirt-16"
++}
++
++{
++  "id": "libvirt-16",
++  "error": {
++    "class": "DeviceNotFound",
++    "desc": "Device 'pci-assign' not found"
++  }
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "kvm-pci-assign"
++  },
++  "id": "libvirt-17"
++}
++
++{
++  "id": "libvirt-17",
++  "error": {
++    "class": "DeviceNotFound",
++    "desc": "Device 'kvm-pci-assign' not found"
++  }
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "vfio-pci"
++  },
++  "id": "libvirt-18"
++}
++
++{
++  "return": [
++    {
++      "name": "x-igd-opregion",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pci-vendor-id",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pci-sub-device-id",
++      "type": "uint32"
++    },
++    {
++      "name": "x-no-kvm-ioeventfd",
++      "type": "bool"
++    },
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-req",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-no-kvm-msi",
++      "type": "bool"
++    },
++    {
++      "name": "x-no-vfio-ioeventfd",
++      "type": "bool"
++    },
++    {
++      "name": "x-no-kvm-intx",
++      "type": "bool"
++    },
++    {
++      "name": "host",
++      "description": "Address (bus/device/function) of the host device, example: 04:10.0",
++      "type": "str"
++    },
++    {
++      "name": "x-no-kvm-msix",
++      "type": "bool"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-balloon-allowed",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pci-sub-vendor-id",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pci-device-id",
++      "type": "uint32"
++    },
++    {
++      "name": "x-no-geforce-quirks",
++      "type": "bool"
++    },
++    {
++      "name": "display",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "x-nv-gpudirect-clique",
++      "description": "NVIDIA GPUDirect Clique ID (0 - 15)",
++      "type": "uint4"
++    },
++    {
++      "name": "x-igd-gms",
++      "type": "uint32"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "x-msix-relocation",
++      "description": "off/auto/bar0/bar1/bar2/bar3/bar4/bar5",
++      "type": "OffAutoPCIBAR"
++    },
++    {
++      "name": "x-intx-mmap-timeout-ms",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-no-mmap",
++      "type": "bool"
++    },
++    {
++      "name": "bootindex",
++      "type": "int32"
++    },
++    {
++      "name": "sysfsdev",
++      "type": "str"
++    },
++    {
++      "name": "x-vga",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    }
++  ],
++  "id": "libvirt-18"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "scsi-disk"
++  },
++  "id": "libvirt-19"
++}
++
++{
++  "return": [
++    {
++      "name": "serial",
++      "type": "str"
++    },
++    {
++      "name": "port_index",
++      "type": "uint16"
++    },
++    {
++      "name": "dpofua",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "lun",
++      "type": "uint32"
++    },
++    {
++      "name": "logical_block_size",
++      "description": "A power of two between 512 and 32768",
++      "type": "uint16"
++    },
++    {
++      "name": "discard_granularity",
++      "type": "uint32"
++    },
++    {
++      "name": "scsi_version",
++      "type": "int32"
++    },
++    {
++      "name": "max_unmap_size",
++      "type": "uint64"
++    },
++    {
++      "name": "drive",
++      "description": "Node name or ID of a block device to use as a backend",
++      "type": "str"
++    },
++    {
++      "name": "port_wwn",
++      "type": "uint64"
++    },
++    {
++      "name": "write-cache",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "share-rw",
++      "type": "bool"
++    },
++    {
++      "name": "min_io_size",
++      "type": "uint16"
++    },
++    {
++      "name": "opt_io_size",
++      "type": "uint32"
++    },
++    {
++      "name": "product",
++      "type": "str"
++    },
++    {
++      "name": "scsi-id",
++      "type": "uint32"
++    },
++    {
++      "name": "bootindex",
++      "type": "int32"
++    },
++    {
++      "name": "vendor",
++      "type": "str"
++    },
++    {
++      "name": "channel",
++      "type": "uint32"
++    },
++    {
++      "name": "wwn",
++      "type": "uint64"
++    },
++    {
++      "name": "werror",
++      "description": "Error handling policy, report/ignore/enospc/stop/auto",
++      "type": "BlockdevOnError"
++    },
++    {
++      "name": "removable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "rerror",
++      "description": "Error handling policy, report/ignore/enospc/stop/auto",
++      "type": "BlockdevOnError"
++    },
++    {
++      "name": "ver",
++      "type": "str"
++    },
++    {
++      "name": "physical_block_size",
++      "description": "A power of two between 512 and 32768",
++      "type": "uint16"
++    },
++    {
++      "name": "max_io_size",
++      "type": "uint64"
++    }
++  ],
++  "id": "libvirt-19"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "ide-drive"
++  },
++  "id": "libvirt-20"
++}
++
++{
++  "return": [
++    {
++      "name": "serial",
++      "type": "str"
++    },
++    {
++      "name": "logical_block_size",
++      "description": "A power of two between 512 and 32768",
++      "type": "uint16"
++    },
++    {
++      "name": "discard_granularity",
++      "type": "uint32"
++    },
++    {
++      "name": "drive",
++      "description": "Node name or ID of a block device to use as a backend",
++      "type": "str"
++    },
++    {
++      "name": "bootindex",
++      "type": "int32"
++    },
++    {
++      "name": "write-cache",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "share-rw",
++      "type": "bool"
++    },
++    {
++      "name": "min_io_size",
++      "type": "uint16"
++    },
++    {
++      "name": "opt_io_size",
++      "type": "uint32"
++    },
++    {
++      "name": "unit",
++      "type": "uint32"
++    },
++    {
++      "name": "wwn",
++      "type": "uint64"
++    },
++    {
++      "name": "werror",
++      "description": "Error handling policy, report/ignore/enospc/stop/auto",
++      "type": "BlockdevOnError"
++    },
++    {
++      "name": "model",
++      "type": "str"
++    },
++    {
++      "name": "rerror",
++      "description": "Error handling policy, report/ignore/enospc/stop/auto",
++      "type": "BlockdevOnError"
++    },
++    {
++      "name": "ver",
++      "type": "str"
++    },
++    {
++      "name": "physical_block_size",
++      "description": "A power of two between 512 and 32768",
++      "type": "uint16"
++    }
++  ],
++  "id": "libvirt-20"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "PIIX4_PM"
++  },
++  "id": "libvirt-21"
++}
++
++{
++  "return": [
++    {
++      "name": "memory-hotplug-support",
++      "type": "bool"
++    },
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "acpi-pci-hotplug-with-bridge-support",
++      "type": "bool"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    },
++    {
++      "name": "disable_s4",
++      "type": "uint8"
++    },
++    {
++      "name": "disable_s3",
++      "type": "uint8"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "s4_val",
++      "type": "uint8"
++    },
++    {
++      "name": "smb_io_base",
++      "type": "uint32"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    }
++  ],
++  "id": "libvirt-21"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "usb-redir"
++  },
++  "id": "libvirt-22"
++}
++
++{
++  "return": [
++    {
++      "name": "filter",
++      "type": "str"
++    },
++    {
++      "name": "msos-desc",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "serial",
++      "type": "str"
++    },
++    {
++      "name": "bootindex",
++      "type": "int32"
++    },
++    {
++      "name": "port",
++      "type": "str"
++    },
++    {
++      "name": "debug",
++      "type": "uint8"
++    },
++    {
++      "name": "streams",
++      "type": "bool"
++    },
++    {
++      "name": "chardev",
++      "description": "ID of a chardev to use as a backend",
++      "type": "str"
++    },
++    {
++      "name": "full-path",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "attached",
++      "type": "bool"
++    }
++  ],
++  "id": "libvirt-22"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "usb-host"
++  },
++  "id": "libvirt-23"
++}
++
++{
++  "return": [
++    {
++      "name": "isobufs",
++      "type": "uint32"
++    },
++    {
++      "name": "hostaddr",
++      "type": "uint32"
++    },
++    {
++      "name": "msos-desc",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "productid",
++      "type": "uint32"
++    },
++    {
++      "name": "serial",
++      "type": "str"
++    },
++    {
++      "name": "bootindex",
++      "type": "int32"
++    },
++    {
++      "name": "isobsize",
++      "type": "uint32"
++    },
++    {
++      "name": "port",
++      "type": "str"
++    },
++    {
++      "name": "vendorid",
++      "type": "uint32"
++    },
++    {
++      "name": "pipeline",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "attached",
++      "type": "bool"
++    },
++    {
++      "name": "hostport",
++      "type": "str"
++    },
++    {
++      "name": "full-path",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "loglevel",
++      "type": "uint32"
++    },
++    {
++      "name": "hostbus",
++      "type": "uint32"
++    }
++  ],
++  "id": "libvirt-23"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "scsi-generic"
++  },
++  "id": "libvirt-24"
++}
++
++{
++  "return": [
++    {
++      "name": "bootindex",
++      "type": "int32"
++    },
++    {
++      "name": "drive",
++      "description": "Node name or ID of a block device to use as a backend",
++      "type": "str"
++    },
++    {
++      "name": "lun",
++      "type": "uint32"
++    },
++    {
++      "name": "share-rw",
++      "type": "bool"
++    },
++    {
++      "name": "channel",
++      "type": "uint32"
++    },
++    {
++      "name": "scsi-id",
++      "type": "uint32"
++    }
++  ],
++  "id": "libvirt-24"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "i440FX-pcihost"
++  },
++  "id": "libvirt-25"
++}
++
++{
++  "return": [
++    {
++      "name": "short_root_bus",
++      "type": "uint32"
++    },
++    {
++      "name": "pci-conf-idx[0]",
++      "type": "child<qemu:memory-region>"
++    },
++    {
++      "name": "pci-hole64-end",
++      "type": "uint64"
++    },
++    {
++      "name": "pci-hole-end",
++      "type": "uint32"
++    },
++    {
++      "name": "pci-hole-start",
++      "type": "uint32"
++    },
++    {
++      "name": "pci-hole64-start",
++      "type": "uint64"
++    },
++    {
++      "name": "pci-hole64-size",
++      "type": "size"
++    },
++    {
++      "name": "pci-conf-data[0]",
++      "type": "child<qemu:memory-region>"
++    },
++    {
++      "name": "x-pci-hole64-fix",
++      "type": "bool"
++    }
++  ],
++  "id": "libvirt-25"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "q35-pcihost"
++  },
++  "id": "libvirt-26"
++}
++
++{
++  "return": [
++    {
++      "name": "short_root_bus",
++      "type": "uint32"
++    },
++    {
++      "name": "system-mem",
++      "type": "link<qemu:memory-region>"
++    },
++    {
++      "name": "pci-conf-idx[0]",
++      "type": "child<qemu:memory-region>"
++    },
++    {
++      "name": "pcie-mmcfg-mmio[0]",
++      "type": "child<qemu:memory-region>"
++    },
++    {
++      "name": "pci-hole64-start",
++      "type": "uint64"
++    },
++    {
++      "name": "io-mem",
++      "type": "link<qemu:memory-region>"
++    },
++    {
++      "name": "pci-hole64-end",
++      "type": "uint64"
++    },
++    {
++      "name": "pci-hole-end",
++      "type": "uint32"
++    },
++    {
++      "name": "above-4g-mem-size",
++      "type": "size"
++    },
++    {
++      "name": "below-4g-mem-size",
++      "type": "size"
++    },
++    {
++      "name": "ram-mem",
++      "type": "link<qemu:memory-region>"
++    },
++    {
++      "name": "pci-hole-start",
++      "type": "uint32"
++    },
++    {
++      "name": "MCFG",
++      "type": "uint64"
++    },
++    {
++      "name": "mch",
++      "type": "child<mch>"
++    },
++    {
++      "name": "pci-hole64-size",
++      "type": "size"
++    },
++    {
++      "name": "pci-mem",
++      "type": "link<qemu:memory-region>"
++    },
++    {
++      "name": "pci-conf-data[0]",
++      "type": "child<qemu:memory-region>"
++    },
++    {
++      "name": "x-pci-hole64-fix",
++      "type": "bool"
++    },
++    {
++      "name": "mcfg_size",
++      "type": "uint64"
++    }
++  ],
++  "id": "libvirt-26"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "usb-storage"
++  },
++  "id": "libvirt-27"
++}
++
++{
++  "return": [
++    {
++      "name": "serial",
++      "type": "str"
++    },
++    {
++      "name": "msos-desc",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "logical_block_size",
++      "description": "A power of two between 512 and 32768",
++      "type": "uint16"
++    },
++    {
++      "name": "discard_granularity",
++      "type": "uint32"
++    },
++    {
++      "name": "drive",
++      "description": "Node name or ID of a block device to use as a backend",
++      "type": "str"
++    },
++    {
++      "name": "bootindex",
++      "type": "int32"
++    },
++    {
++      "name": "write-cache",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "share-rw",
++      "type": "bool"
++    },
++    {
++      "name": "min_io_size",
++      "type": "uint16"
++    },
++    {
++      "name": "opt_io_size",
++      "type": "uint32"
++    },
++    {
++      "name": "port",
++      "type": "str"
++    },
++    {
++      "name": "attached",
++      "type": "bool"
++    },
++    {
++      "name": "werror",
++      "description": "Error handling policy, report/ignore/enospc/stop/auto",
++      "type": "BlockdevOnError"
++    },
++    {
++      "name": "full-path",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "rerror",
++      "description": "Error handling policy, report/ignore/enospc/stop/auto",
++      "type": "BlockdevOnError"
++    },
++    {
++      "name": "removable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "physical_block_size",
++      "description": "A power of two between 512 and 32768",
++      "type": "uint16"
++    }
++  ],
++  "id": "libvirt-27"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "kvm-pit"
++  },
++  "id": "libvirt-28"
++}
++
++{
++  "return": [
++    {
++      "name": "iobase",
++      "type": "uint32"
++    },
++    {
++      "name": "lost_tick_policy",
++      "type": "LostTickPolicy"
++    }
++  ],
++  "id": "libvirt-28"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "VGA"
++  },
++  "id": "libvirt-29"
++}
++
++{
++  "return": [
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "mmio",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "qemu-extended-regs",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "big-endian-framebuffer",
++      "type": "bool"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    },
++    {
++      "name": "yres",
++      "type": "uint32"
++    },
++    {
++      "name": "vgamem_mb",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "global-vmstate",
++      "type": "bool"
++    },
++    {
++      "name": "edid",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "xres",
++      "type": "uint32"
++    }
++  ],
++  "id": "libvirt-29"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "vmware-svga"
++  },
++  "id": "libvirt-30"
++}
++
++{
++  "return": [
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    },
++    {
++      "name": "vgamem_mb",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "global-vmstate",
++      "type": "bool"
++    }
++  ],
++  "id": "libvirt-30"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "qxl"
++  },
++  "id": "libvirt-31"
++}
++
++{
++  "return": [
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "yres",
++      "type": "uint32"
++    },
++    {
++      "name": "ram_size_mb",
++      "type": "uint32"
++    },
++    {
++      "name": "global-vmstate",
++      "type": "bool"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "vgamem_mb",
++      "type": "uint32"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "debug",
++      "type": "uint32"
++    },
++    {
++      "name": "vram_size_mb",
++      "type": "uint32"
++    },
++    {
++      "name": "revision",
++      "type": "uint32"
++    },
++    {
++      "name": "ram_size",
++      "type": "uint32"
++    },
++    {
++      "name": "vram64_size_mb",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "guestdebug",
++      "type": "uint32"
++    },
++    {
++      "name": "vram_size",
++      "type": "uint64"
++    },
++    {
++      "name": "surfaces",
++      "type": "int32"
++    },
++    {
++      "name": "max_outputs",
++      "type": "uint16"
++    },
++    {
++      "name": "xres",
++      "type": "uint32"
++    },
++    {
++      "name": "cmdlog",
++      "type": "uint32"
++    }
++  ],
++  "id": "libvirt-31"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-gpu-pci"
++  },
++  "id": "libvirt-32"
++}
++
++{
++  "return": [
++    {
++      "name": "event_idx",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "yres",
++      "type": "uint32"
++    },
++    {
++      "name": "ioeventfd",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "xres",
++      "type": "uint32"
++    },
++    {
++      "name": "x-disable-pcie",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "indirect_desc",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "disable-modern",
++      "type": "bool"
++    },
++    {
++      "name": "disable-legacy",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-lnkctl-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "page-per-vq",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-deverr-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-pm-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "max_outputs",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "any_layout",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "migrate-extra",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "modern-pio-notify",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "vectors",
++      "type": "uint32"
++    },
++    {
++      "name": "iommu_platform",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virtio-backend",
++      "type": "child<virtio-gpu-device>"
++    },
++    {
++      "name": "max_hostmem",
++      "type": "size"
++    },
++    {
++      "name": "x-ignore-backend-features",
++      "type": "bool"
++    },
++    {
++      "name": "stats",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "notify_on_empty",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virtio-pci-bus-master-bug-migration",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "ats",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    },
++    {
++      "name": "virgl",
++      "description": "on/off",
++      "type": "bool"
++    }
++  ],
++  "id": "libvirt-32"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-gpu-device"
++  },
++  "id": "libvirt-33"
++}
++
++{
++  "return": [
++    {
++      "name": "notify_on_empty",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "any_layout",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "indirect_desc",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "event_idx",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "yres",
++      "type": "uint32"
++    },
++    {
++      "name": "stats",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "iommu_platform",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virgl",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "max_outputs",
++      "type": "uint32"
++    },
++    {
++      "name": "xres",
++      "type": "uint32"
++    },
++    {
++      "name": "max_hostmem",
++      "type": "size"
++    }
++  ],
++  "id": "libvirt-33"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "ICH9-LPC"
++  },
++  "id": "libvirt-34"
++}
++
++{
++  "return": [
++    {
++      "name": "memory-hotplug-support",
++      "type": "bool"
++    },
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "sci_int",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "gpe0_blk_len",
++      "type": "uint32"
++    },
++    {
++      "name": "pm_io_base",
++      "type": "uint32"
++    },
++    {
++      "name": "noreboot",
++      "type": "bool"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "cpu-hotplug-legacy",
++      "type": "bool"
++    },
++    {
++      "name": "acpi_disable_cmd",
++      "type": "uint8"
++    },
++    {
++      "name": "x-smi-broadcast",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    },
++    {
++      "name": "disable_s3",
++      "type": "uint8"
++    },
++    {
++      "name": "s4_val",
++      "type": "uint8"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "acpi_enable_cmd",
++      "type": "uint8"
++    },
++    {
++      "name": "enable_tco",
++      "type": "bool"
++    },
++    {
++      "name": "disable_s4",
++      "type": "uint8"
++    },
++    {
++      "name": "gpe0_blk",
++      "type": "uint32"
++    }
++  ],
++  "id": "libvirt-34"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-balloon-pci"
++  },
++  "id": "libvirt-35"
++}
++
++{
++  "return": [
++    {
++      "name": "guest-stats-polling-interval",
++      "type": "int"
++    },
++    {
++      "name": "event_idx",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-disable-pcie",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "indirect_desc",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "disable-modern",
++      "type": "bool"
++    },
++    {
++      "name": "disable-legacy",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-lnkctl-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "guest-stats",
++      "type": "guest statistics"
++    },
++    {
++      "name": "deflate-on-oom",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "page-per-vq",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-deverr-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-pm-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "any_layout",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "class",
++      "type": "uint32"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "migrate-extra",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "modern-pio-notify",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virtio-backend",
++      "type": "child<virtio-balloon-device>"
++    },
++    {
++      "name": "x-ignore-backend-features",
++      "type": "bool"
++    },
++    {
++      "name": "notify_on_empty",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "iommu_platform",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "ats",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "virtio-pci-bus-master-bug-migration",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    }
++  ],
++  "id": "libvirt-35"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-balloon-ccw"
++  },
++  "id": "libvirt-36"
++}
++
++{
++  "id": "libvirt-36",
++  "error": {
++    "class": "DeviceNotFound",
++    "desc": "Device 'virtio-balloon-ccw' not found"
++  }
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "virtio-balloon-device"
++  },
++  "id": "libvirt-37"
++}
++
++{
++  "return": [
++    {
++      "name": "notify_on_empty",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "any_layout",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "indirect_desc",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "guest-stats",
++      "type": "guest statistics"
++    },
++    {
++      "name": "guest-stats-polling-interval",
++      "type": "int"
++    },
++    {
++      "name": "event_idx",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "iommu_platform",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "deflate-on-oom",
++      "description": "on/off",
++      "type": "bool"
++    }
++  ],
++  "id": "libvirt-37"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "nec-usb-xhci"
++  },
++  "id": "libvirt-38"
++}
++
++{
++  "return": [
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "intrs",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "msix",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "msi",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "superspeed-ports-first",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "streams",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    },
++    {
++      "name": "force-pcie-endcap",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    },
++    {
++      "name": "p3",
++      "type": "uint32"
++    },
++    {
++      "name": "p2",
++      "type": "uint32"
++    },
++    {
++      "name": "slots",
++      "type": "uint32"
++    }
++  ],
++  "id": "libvirt-38"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "intel-iommu"
++  },
++  "id": "libvirt-39"
++}
++
++{
++  "return": [
++    {
++      "name": "x-aw-bits",
++      "type": "uint8"
++    },
++    {
++      "name": "eim",
++      "description": "on/off/auto",
++      "type": "OnOffAuto"
++    },
++    {
++      "name": "caching-mode",
++      "type": "bool"
++    },
++    {
++      "name": "x-buggy-eim",
++      "type": "bool"
++    },
++    {
++      "name": "intremap",
++      "type": "bool"
++    },
++    {
++      "name": "version",
++      "type": "uint32"
++    },
++    {
++      "name": "pt",
++      "type": "bool"
++    },
++    {
++      "name": "device-iotlb",
++      "type": "bool"
++    }
++  ],
++  "id": "libvirt-39"
++}
++
++{
++  "execute": "device-list-properties",
++  "arguments": {
++    "typename": "mch"
++  },
++  "id": "libvirt-40"
++}
++
++{
++  "return": [
++    {
++      "name": "rombar",
++      "type": "uint32"
++    },
++    {
++      "name": "x-pcie-lnksta-dllla",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "multifunction",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "extended-tseg-mbytes",
++      "type": "uint16"
++    },
++    {
++      "name": "romfile",
++      "type": "str"
++    },
++    {
++      "name": "x-pcie-extcap-init",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "command_serr_enable",
++      "description": "on/off",
++      "type": "bool"
++    },
++    {
++      "name": "addr",
++      "description": "Slot and optional function number, example: 06.0 or 06",
++      "type": "int32"
++    }
++  ],
++  "id": "libvirt-40"
++}
++
++{
++  "execute": "qom-list-properties",
++  "arguments": {
++    "typename": "memory-backend-file"
++  },
++  "id": "libvirt-41"
++}
++
++{
++  "return": [
++    {
++      "name": "type",
++      "type": "string"
++    },
++    {
++      "name": "policy",
++      "description": "Set the NUMA policy",
++      "type": "HostMemPolicy"
++    },
++    {
++      "name": "share",
++      "description": "Mark the memory as private to QEMU or shared",
++      "type": "bool"
++    },
++    {
++      "name": "host-nodes",
++      "description": "Binds memory to the list of NUMA host nodes",
++      "type": "int"
++    },
++    {
++      "name": "prealloc",
++      "description": "Preallocate memory",
++      "type": "bool"
++    },
++    {
++      "name": "dump",
++      "description": "Set to 'off' to exclude from core dump",
++      "type": "bool"
++    },
++    {
++      "name": "size",
++      "description": "Size of the memory region (ex: 500M)",
++      "type": "int"
++    },
++    {
++      "name": "merge",
++      "description": "Mark memory as mergeable",
++      "type": "bool"
++    },
++    {
++      "name": "pmem",
++      "type": "bool"
++    },
++    {
++      "name": "align",
++      "type": "int"
++    },
++    {
++      "name": "mem-path",
++      "type": "string"
++    },
++    {
++      "name": "discard-data",
++      "type": "bool"
++    }
++  ],
++  "id": "libvirt-41"
++}
++
++{
++  "execute": "qom-list-properties",
++  "arguments": {
++    "typename": "spapr-machine"
++  },
++  "id": "libvirt-42"
++}
++
++{
++  "id": "libvirt-42",
++  "error": {
++    "class": "DeviceNotFound",
++    "desc": "Class 'spapr-machine' not found"
++  }
++}
++
++{
++  "execute": "query-machines",
++  "id": "libvirt-43"
++}
++
++{
++  "return": [
++    {
++      "hotpluggable-cpus": true,
++      "name": "isapc",
++      "cpu-max": 1
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-1.1",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-1.2",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-1.3",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.8",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-1.0",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": false,
++      "name": "none",
++      "cpu-max": 1
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.9",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.6",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.7",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.3",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.4",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.5",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.1",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.2",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-3.1",
++      "cpu-max": 288,
++      "alias": "q35"
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.0",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-2.11",
++      "cpu-max": 288
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-2.12",
++      "cpu-max": 288
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-3.0",
++      "cpu-max": 288
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-2.10",
++      "cpu-max": 288
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-1.7",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-2.9",
++      "cpu-max": 288
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-0.15",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-1.5",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-2.7",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-1.6",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.11",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-2.8",
++      "cpu-max": 288
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-0.13",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.12",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-0.14",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-3.0",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-3.1",
++      "is-default": true,
++      "cpu-max": 255,
++      "alias": "pc"
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-2.4",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-2.5",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-q35-2.6",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-1.4",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-i440fx-2.10",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-0.11",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-0.12",
++      "cpu-max": 255
++    },
++    {
++      "hotpluggable-cpus": true,
++      "name": "pc-0.10",
++      "cpu-max": 255
++    }
++  ],
++  "id": "libvirt-43"
++}
++
++{
++  "execute": "query-cpu-definitions",
++  "id": "libvirt-44"
++}
++
++{
++  "return": [
++    {
++      "name": "max",
++      "typename": "max-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": false
++    },
++    {
++      "name": "host",
++      "typename": "host-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": false
++    },
++    {
++      "name": "base",
++      "typename": "base-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": true,
++      "migration-safe": true
++    },
++    {
++      "name": "qemu64",
++      "typename": "qemu64-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "qemu32",
++      "typename": "qemu32-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "phenom",
++      "typename": "phenom-x86_64-cpu",
++      "unavailable-features": [
++        "mmxext",
++        "fxsr-opt",
++        "3dnowext",
++        "3dnow",
++        "sse4a",
++        "npt"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "pentium3",
++      "typename": "pentium3-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "pentium2",
++      "typename": "pentium2-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "pentium",
++      "typename": "pentium-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "n270",
++      "typename": "n270-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "kvm64",
++      "typename": "kvm64-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "kvm32",
++      "typename": "kvm32-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "coreduo",
++      "typename": "coreduo-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "core2duo",
++      "typename": "core2duo-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "athlon",
++      "typename": "athlon-x86_64-cpu",
++      "unavailable-features": [
++        "mmxext",
++        "3dnowext",
++        "3dnow"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Westmere-IBRS",
++      "typename": "Westmere-IBRS-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Westmere",
++      "typename": "Westmere-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Skylake-Server-IBRS",
++      "typename": "Skylake-Server-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "avx512f",
++        "avx512dq",
++        "clwb",
++        "avx512cd",
++        "avx512bw",
++        "avx512vl",
++        "pku",
++        "avx512f",
++        "avx512f",
++        "avx512f",
++        "pku"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Skylake-Server",
++      "typename": "Skylake-Server-x86_64-cpu",
++      "unavailable-features": [
++        "avx512f",
++        "avx512dq",
++        "clwb",
++        "avx512cd",
++        "avx512bw",
++        "avx512vl",
++        "pku",
++        "avx512f",
++        "avx512f",
++        "avx512f",
++        "pku"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Skylake-Client-IBRS",
++      "typename": "Skylake-Client-IBRS-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Skylake-Client",
++      "typename": "Skylake-Client-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "SandyBridge-IBRS",
++      "typename": "SandyBridge-IBRS-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "SandyBridge",
++      "typename": "SandyBridge-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Penryn",
++      "typename": "Penryn-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Opteron_G5",
++      "typename": "Opteron_G5-x86_64-cpu",
++      "unavailable-features": [
++        "sse4a",
++        "misalignsse",
++        "xop",
++        "fma4",
++        "tbm"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Opteron_G4",
++      "typename": "Opteron_G4-x86_64-cpu",
++      "unavailable-features": [
++        "sse4a",
++        "misalignsse",
++        "xop",
++        "fma4"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Opteron_G3",
++      "typename": "Opteron_G3-x86_64-cpu",
++      "unavailable-features": [
++        "sse4a",
++        "misalignsse"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Opteron_G2",
++      "typename": "Opteron_G2-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Opteron_G1",
++      "typename": "Opteron_G1-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Nehalem-IBRS",
++      "typename": "Nehalem-IBRS-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Nehalem",
++      "typename": "Nehalem-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "KnightsMill",
++      "typename": "KnightsMill-x86_64-cpu",
++      "unavailable-features": [
++        "avx512f",
++        "avx512pf",
++        "avx512er",
++        "avx512cd",
++        "avx512-vpopcntdq",
++        "avx512-4vnniw",
++        "avx512-4fmaps",
++        "avx512f",
++        "avx512f",
++        "avx512f"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "IvyBridge-IBRS",
++      "typename": "IvyBridge-IBRS-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "IvyBridge",
++      "typename": "IvyBridge-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Icelake-Server",
++      "typename": "Icelake-Server-x86_64-cpu",
++      "unavailable-features": [
++        "avx512f",
++        "avx512dq",
++        "clwb",
++        "intel-pt",
++        "avx512cd",
++        "avx512bw",
++        "avx512vl",
++        "avx512vbmi",
++        "pku",
++        "",
++        "avx512vbmi2",
++        "gfni",
++        "vaes",
++        "vpclmulqdq",
++        "avx512vnni",
++        "avx512bitalg",
++        "avx512-vpopcntdq",
++        "la57",
++        "pconfig",
++        "ssbd",
++        "wbnoinvd",
++        "avx512f",
++        "avx512f",
++        "avx512f",
++        "pku"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Icelake-Client",
++      "typename": "Icelake-Client-x86_64-cpu",
++      "unavailable-features": [
++        "intel-pt",
++        "avx512vbmi",
++        "pku",
++        "",
++        "avx512vbmi2",
++        "gfni",
++        "vaes",
++        "vpclmulqdq",
++        "avx512vnni",
++        "avx512bitalg",
++        "avx512-vpopcntdq",
++        "ssbd",
++        "wbnoinvd",
++        "pku"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Haswell-noTSX-IBRS",
++      "typename": "Haswell-noTSX-IBRS-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Haswell-noTSX",
++      "typename": "Haswell-noTSX-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Haswell-IBRS",
++      "typename": "Haswell-IBRS-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Haswell",
++      "typename": "Haswell-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "EPYC-IBPB",
++      "typename": "EPYC-IBPB-x86_64-cpu",
++      "unavailable-features": [
++        "sha-ni",
++        "mmxext",
++        "fxsr-opt",
++        "cr8legacy",
++        "sse4a",
++        "misalignsse",
++        "osvw",
++        "ibpb"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "EPYC",
++      "typename": "EPYC-x86_64-cpu",
++      "unavailable-features": [
++        "sha-ni",
++        "mmxext",
++        "fxsr-opt",
++        "cr8legacy",
++        "sse4a",
++        "misalignsse",
++        "osvw"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Conroe",
++      "typename": "Conroe-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Cascadelake-Server",
++      "typename": "Cascadelake-Server-x86_64-cpu",
++      "unavailable-features": [
++        "avx512f",
++        "avx512dq",
++        "clwb",
++        "intel-pt",
++        "avx512cd",
++        "avx512bw",
++        "avx512vl",
++        "pku",
++        "",
++        "avx512vnni",
++        "ssbd",
++        "avx512f",
++        "avx512f",
++        "avx512f",
++        "pku"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Broadwell-noTSX-IBRS",
++      "typename": "Broadwell-noTSX-IBRS-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Broadwell-noTSX",
++      "typename": "Broadwell-noTSX-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Broadwell-IBRS",
++      "typename": "Broadwell-IBRS-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Broadwell",
++      "typename": "Broadwell-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "486",
++      "typename": "486-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    }
++  ],
++  "id": "libvirt-44"
++}
++
++{
++  "execute": "query-tpm-models",
++  "id": "libvirt-45"
++}
++
++{
++  "return": [
++    "tpm-crb",
++    "tpm-tis"
++  ],
++  "id": "libvirt-45"
++}
++
++{
++  "execute": "query-tpm-types",
++  "id": "libvirt-46"
++}
++
++{
++  "return": [
++    "passthrough",
++    "emulator"
++  ],
++  "id": "libvirt-46"
++}
++
++{
++  "execute": "query-command-line-options",
++  "id": "libvirt-47"
++}
++
++{
++  "return": [
++    {
++      "parameters": [
++        {
++          "name": "timeout",
++          "help": "Request timeout in seconds (default 0 = no timeout)",
++          "type": "number"
++        },
++        {
++          "name": "initiator-name",
++          "help": "Initiator iqn name to use when connecting",
++          "type": "string"
++        },
++        {
++          "name": "header-digest",
++          "help": "HeaderDigest setting. {CRC32C|CRC32C-NONE|NONE-CRC32C|NONE}",
++          "type": "string"
++        },
++        {
++          "name": "password-secret",
++          "help": "ID of the secret providing password for CHAP authentication to target",
++          "type": "string"
++        },
++        {
++          "name": "password",
++          "help": "password for CHAP authentication to target",
++          "type": "string"
++        },
++        {
++          "name": "user",
++          "help": "username for CHAP authentication to target",
++          "type": "string"
++        }
++      ],
++      "option": "iscsi"
++    },
++    {
++      "parameters": [
++        {
++          "name": "non-adaptive",
++          "type": "boolean"
++        },
++        {
++          "name": "lossy",
++          "type": "boolean"
++        },
++        {
++          "name": "acl",
++          "type": "boolean"
++        },
++        {
++          "name": "sasl",
++          "type": "boolean"
++        },
++        {
++          "name": "key-delay-ms",
++          "type": "number"
++        },
++        {
++          "name": "lock-key-sync",
++          "type": "boolean"
++        },
++        {
++          "name": "reverse",
++          "type": "boolean"
++        },
++        {
++          "name": "password",
++          "type": "boolean"
++        },
++        {
++          "name": "ipv6",
++          "type": "boolean"
++        },
++        {
++          "name": "ipv4",
++          "type": "boolean"
++        },
++        {
++          "name": "to",
++          "type": "number"
++        },
++        {
++          "name": "connections",
++          "type": "number"
++        },
++        {
++          "name": "head",
++          "type": "number"
++        },
++        {
++          "name": "display",
++          "type": "string"
++        },
++        {
++          "name": "share",
++          "type": "string"
++        },
++        {
++          "name": "tls-creds",
++          "type": "string"
++        },
++        {
++          "name": "websocket",
++          "type": "string"
++        },
++        {
++          "name": "vnc",
++          "type": "string"
++        }
++      ],
++      "option": "vnc"
++    },
++    {
++      "parameters": [
++        {
++          "name": "rendernode",
++          "type": "string"
++        },
++        {
++          "name": "gl",
++          "type": "boolean"
++        },
++        {
++          "name": "head",
++          "type": "number"
++        },
++        {
++          "name": "display",
++          "type": "string"
++        },
++        {
++          "name": "seamless-migration",
++          "type": "boolean"
++        },
++        {
++          "name": "playback-compression",
++          "type": "boolean"
++        },
++        {
++          "name": "agent-mouse",
++          "type": "boolean"
++        },
++        {
++          "name": "streaming-video",
++          "type": "string"
++        },
++        {
++          "name": "zlib-glz-wan-compression",
++          "type": "string"
++        },
++        {
++          "name": "jpeg-wan-compression",
++          "type": "string"
++        },
++        {
++          "name": "image-compression",
++          "type": "string"
++        },
++        {
++          "name": "plaintext-channel",
++          "type": "string"
++        },
++        {
++          "name": "tls-channel",
++          "type": "string"
++        },
++        {
++          "name": "tls-ciphers",
++          "type": "string"
++        },
++        {
++          "name": "x509-dh-key-file",
++          "type": "string"
++        },
++        {
++          "name": "x509-cacert-file",
++          "type": "string"
++        },
++        {
++          "name": "x509-cert-file",
++          "type": "string"
++        },
++        {
++          "name": "x509-key-password",
++          "type": "string"
++        },
++        {
++          "name": "x509-key-file",
++          "type": "string"
++        },
++        {
++          "name": "x509-dir",
++          "type": "string"
++        },
++        {
++          "name": "sasl",
++          "type": "boolean"
++        },
++        {
++          "name": "disable-agent-file-xfer",
++          "type": "boolean"
++        },
++        {
++          "name": "disable-copy-paste",
++          "type": "boolean"
++        },
++        {
++          "name": "disable-ticketing",
++          "type": "boolean"
++        },
++        {
++          "name": "password",
++          "type": "string"
++        },
++        {
++          "name": "unix",
++          "type": "boolean"
++        },
++        {
++          "name": "ipv6",
++          "type": "boolean"
++        },
++        {
++          "name": "ipv4",
++          "type": "boolean"
++        },
++        {
++          "name": "addr",
++          "type": "string"
++        },
++        {
++          "name": "tls-port",
++          "type": "number"
++        },
++        {
++          "name": "port",
++          "type": "number"
++        }
++      ],
++      "option": "spice"
++    },
++    {
++      "parameters": [
++      ],
++      "option": "smbios"
++    },
++    {
++      "parameters": [
++      ],
++      "option": "acpi"
++    },
++    {
++      "parameters": [
++        {
++          "name": "dmode",
++          "type": "number"
++        },
++        {
++          "name": "fmode",
++          "type": "number"
++        },
++        {
++          "name": "sock_fd",
++          "type": "number"
++        },
++        {
++          "name": "socket",
++          "type": "string"
++        },
++        {
++          "name": "readonly",
++          "type": "boolean"
++        },
++        {
++          "name": "writeout",
++          "type": "string"
++        },
++        {
++          "name": "security_model",
++          "type": "string"
++        },
++        {
++          "name": "mount_tag",
++          "type": "string"
++        },
++        {
++          "name": "path",
++          "type": "string"
++        },
++        {
++          "name": "fsdriver",
++          "type": "string"
++        }
++      ],
++      "option": "virtfs"
++    },
++    {
++      "parameters": [
++        {
++          "name": "throttling.iops-size",
++          "help": "when limiting by iops max size of an I/O in bytes",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-write-max-length",
++          "help": "length of the bps-write-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-read-max-length",
++          "help": "length of the bps-read-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-total-max-length",
++          "help": "length of the bps-total-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-write-max-length",
++          "help": "length of the iops-write-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-read-max-length",
++          "help": "length of the iops-read-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-total-max-length",
++          "help": "length of the iops-total-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-write-max",
++          "help": "total bytes write burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-read-max",
++          "help": "total bytes read burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-total-max",
++          "help": "total bytes burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-write-max",
++          "help": "I/O operations write burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-read-max",
++          "help": "I/O operations read burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-total-max",
++          "help": "I/O operations burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-write",
++          "help": "limit write bytes per second",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-read",
++          "help": "limit read bytes per second",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-total",
++          "help": "limit total bytes per second",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-write",
++          "help": "limit write operations per second",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-read",
++          "help": "limit read operations per second",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-total",
++          "help": "limit total I/O operations per second",
++          "type": "number"
++        },
++        {
++          "name": "dmode",
++          "type": "number"
++        },
++        {
++          "name": "fmode",
++          "type": "number"
++        },
++        {
++          "name": "sock_fd",
++          "type": "number"
++        },
++        {
++          "name": "socket",
++          "type": "string"
++        },
++        {
++          "name": "readonly",
++          "type": "boolean"
++        },
++        {
++          "name": "writeout",
++          "type": "string"
++        },
++        {
++          "name": "security_model",
++          "type": "string"
++        },
++        {
++          "name": "path",
++          "type": "string"
++        },
++        {
++          "name": "fsdriver",
++          "type": "string"
++        }
++      ],
++      "option": "fsdev"
++    },
++    {
++      "parameters": [
++        {
++          "name": "resourcecontrol",
++          "type": "string"
++        },
++        {
++          "name": "spawn",
++          "type": "string"
++        },
++        {
++          "name": "elevateprivileges",
++          "type": "string"
++        },
++        {
++          "name": "obsolete",
++          "type": "string"
++        },
++        {
++          "name": "enable",
++          "type": "boolean"
++        }
++      ],
++      "option": "sandbox"
++    },
++    {
++      "parameters": [
++        {
++          "name": "string",
++          "help": "Sets content of the blob to be inserted from a string",
++          "type": "string"
++        },
++        {
++          "name": "file",
++          "help": "Sets the name of the file from which the fw_cfg blob will be loaded",
++          "type": "string"
++        },
++        {
++          "name": "name",
++          "help": "Sets the fw_cfg name of the blob to be inserted",
++          "type": "string"
++        }
++      ],
++      "option": "fw_cfg"
++    },
++    {
++      "parameters": [
++        {
++          "name": "arg",
++          "type": "string"
++        },
++        {
++          "name": "target",
++          "type": "string"
++        },
++        {
++          "name": "enable",
++          "type": "boolean"
++        }
++      ],
++      "option": "semihosting-config"
++    },
++    {
++      "parameters": [
++        {
++          "name": "rrsnapshot",
++          "type": "string"
++        },
++        {
++          "name": "rrfile",
++          "type": "string"
++        },
++        {
++          "name": "rr",
++          "type": "string"
++        },
++        {
++          "name": "sleep",
++          "type": "boolean"
++        },
++        {
++          "name": "align",
++          "type": "boolean"
++        },
++        {
++          "name": "shift",
++          "type": "string"
++        }
++      ],
++      "option": "icount"
++    },
++    {
++      "parameters": [
++      ],
++      "option": "numa"
++    },
++    {
++      "parameters": [
++        {
++          "name": "debug-threads",
++          "help": "When enabled, name the individual threads; defaults off.\nNOTE: The thread names are for debugging and not a\nstable API.",
++          "type": "boolean"
++        },
++        {
++          "name": "process",
++          "help": "Sets the name of the QEMU process, as shown in top etc",
++          "type": "string"
++        },
++        {
++          "name": "guest",
++          "help": "Sets the name of the guest.\nThis name will be displayed in the SDL window caption.\nThe name will also be used for the VNC server",
++          "type": "string"
++        }
++      ],
++      "option": "name"
++    },
++    {
++      "parameters": [
++        {
++          "name": "timestamp",
++          "type": "boolean"
++        }
++      ],
++      "option": "msg"
++    },
++    {
++      "parameters": [
++        {
++          "name": "cpu-pm",
++          "type": "boolean"
++        },
++        {
++          "name": "mem-lock",
++          "type": "boolean"
++        }
++      ],
++      "option": "overcommit"
++    },
++    {
++      "parameters": [
++        {
++          "name": "mlock",
++          "type": "boolean"
++        }
++      ],
++      "option": "realtime"
++    },
++    {
++      "parameters": [
++      ],
++      "option": "tpmdev"
++    },
++    {
++      "parameters": [
++      ],
++      "option": "object"
++    },
++    {
++      "parameters": [
++        {
++          "name": "opaque",
++          "help": "free-form string used to describe fd",
++          "type": "string"
++        },
++        {
++          "name": "set",
++          "help": "ID of the fd set to add fd to",
++          "type": "number"
++        },
++        {
++          "name": "fd",
++          "help": "file descriptor of which a duplicate is added to fd set",
++          "type": "number"
++        }
++      ],
++      "option": "add-fd"
++    },
++    {
++      "parameters": [
++        {
++          "name": "strict",
++          "type": "boolean"
++        },
++        {
++          "name": "reboot-timeout",
++          "type": "string"
++        },
++        {
++          "name": "splash-time",
++          "type": "string"
++        },
++        {
++          "name": "splash",
++          "type": "string"
++        },
++        {
++          "name": "menu",
++          "type": "boolean"
++        },
++        {
++          "name": "once",
++          "type": "string"
++        },
++        {
++          "name": "order",
++          "type": "string"
++        }
++      ],
++      "option": "boot-opts"
++    },
++    {
++      "parameters": [
++        {
++          "name": "maxcpus",
++          "type": "number"
++        },
++        {
++          "name": "threads",
++          "type": "number"
++        },
++        {
++          "name": "cores",
++          "type": "number"
++        },
++        {
++          "name": "sockets",
++          "type": "number"
++        },
++        {
++          "name": "cpus",
++          "type": "number"
++        }
++      ],
++      "option": "smp-opts"
++    },
++    {
++      "parameters": [
++        {
++          "name": "maxmem",
++          "type": "size"
++        },
++        {
++          "name": "slots",
++          "type": "number"
++        },
++        {
++          "name": "size",
++          "type": "size"
++        }
++      ],
++      "option": "memory"
++    },
++    {
++      "parameters": [
++        {
++          "name": "thread",
++          "help": "Enable/disable multi-threaded TCG",
++          "type": "string"
++        },
++        {
++          "name": "accel",
++          "help": "Select the type of accelerator",
++          "type": "string"
++        }
++      ],
++      "option": "accel"
++    },
++    {
++      "parameters": [
++        {
++          "name": "loadparm",
++          "help": "Up to 8 chars in set of [A-Za-z0-9. ](lower case chars converted to upper case) to pass to machine loader, boot manager, and guest kernel",
++          "type": "string"
++        },
++        {
++          "name": "dea-key-wrap",
++          "help": "enable/disable DEA key wrapping using the CPACF wrapping key",
++          "type": "boolean"
++        },
++        {
++          "name": "aes-key-wrap",
++          "help": "enable/disable AES key wrapping using the CPACF wrapping key",
++          "type": "boolean"
++        },
++        {
++          "name": "suppress-vmdesc",
++          "help": "Set on to disable self-describing migration",
++          "type": "boolean"
++        },
++        {
++          "name": "iommu",
++          "help": "Set on/off to enable/disable Intel IOMMU (VT-d)",
++          "type": "boolean"
++        },
++        {
++          "name": "firmware",
++          "help": "firmware image",
++          "type": "string"
++        },
++        {
++          "name": "usb",
++          "help": "Set on/off to enable/disable usb",
++          "type": "boolean"
++        },
++        {
++          "name": "mem-merge",
++          "help": "enable/disable memory merge support",
++          "type": "boolean"
++        },
++        {
++          "name": "dump-guest-core",
++          "help": "Include guest memory in  a core dump",
++          "type": "boolean"
++        },
++        {
++          "name": "dt_compatible",
++          "help": "Overrides the \"compatible\" property of the dt root node",
++          "type": "string"
++        },
++        {
++          "name": "phandle_start",
++          "help": "The first phandle ID we may generate dynamically",
++          "type": "number"
++        },
++        {
++          "name": "dumpdtb",
++          "help": "Dump current dtb to a file and quit",
++          "type": "string"
++        },
++        {
++          "name": "dtb",
++          "help": "Linux kernel device tree file",
++          "type": "string"
++        },
++        {
++          "name": "append",
++          "help": "Linux kernel command line",
++          "type": "string"
++        },
++        {
++          "name": "initrd",
++          "help": "Linux initial ramdisk file",
++          "type": "string"
++        },
++        {
++          "name": "kernel",
++          "help": "Linux kernel image file",
++          "type": "string"
++        },
++        {
++          "name": "kvm_shadow_mem",
++          "help": "KVM shadow MMU size",
++          "type": "size"
++        },
++        {
++          "name": "kernel_irqchip",
++          "help": "use KVM in-kernel irqchip",
++          "type": "boolean"
++        },
++        {
++          "name": "accel",
++          "help": "accelerator list",
++          "type": "string"
++        },
++        {
++          "name": "type",
++          "help": "emulated machine",
++          "type": "string"
++        }
++      ],
++      "option": "machine"
++    },
++    {
++      "parameters": [
++        {
++          "name": "romfile",
++          "type": "string"
++        },
++        {
++          "name": "bootindex",
++          "type": "number"
++        }
++      ],
++      "option": "option-rom"
++    },
++    {
++      "parameters": [
++        {
++          "name": "file",
++          "type": "string"
++        },
++        {
++          "name": "events",
++          "type": "string"
++        },
++        {
++          "name": "enable",
++          "type": "string"
++        }
++      ],
++      "option": "trace"
++    },
++    {
++      "parameters": [
++        {
++          "name": "x-oob",
++          "type": "boolean"
++        },
++        {
++          "name": "pretty",
++          "type": "boolean"
++        },
++        {
++          "name": "chardev",
++          "type": "string"
++        },
++        {
++          "name": "mode",
++          "type": "string"
++        }
++      ],
++      "option": "mon"
++    },
++    {
++      "parameters": [
++        {
++          "name": "value",
++          "type": "string"
++        },
++        {
++          "name": "property",
++          "type": "string"
++        },
++        {
++          "name": "driver",
++          "type": "string"
++        }
++      ],
++      "option": "global"
++    },
++    {
++      "parameters": [
++        {
++          "name": "driftfix",
++          "type": "string"
++        },
++        {
++          "name": "clock",
++          "type": "string"
++        },
++        {
++          "name": "base",
++          "type": "string"
++        }
++      ],
++      "option": "rtc"
++    },
++    {
++      "parameters": [
++      ],
++      "option": "net"
++    },
++    {
++      "parameters": [
++      ],
++      "option": "nic"
++    },
++    {
++      "parameters": [
++      ],
++      "option": "netdev"
++    },
++    {
++      "parameters": [
++      ],
++      "option": "device"
++    },
++    {
++      "parameters": [
++        {
++          "name": "logappend",
++          "type": "boolean"
++        },
++        {
++          "name": "logfile",
++          "type": "string"
++        },
++        {
++          "name": "append",
++          "type": "boolean"
++        },
++        {
++          "name": "chardev",
++          "type": "string"
++        },
++        {
++          "name": "size",
++          "type": "size"
++        },
++        {
++          "name": "debug",
++          "type": "number"
++        },
++        {
++          "name": "name",
++          "type": "string"
++        },
++        {
++          "name": "signal",
++          "type": "boolean"
++        },
++        {
++          "name": "mux",
++          "type": "boolean"
++        },
++        {
++          "name": "rows",
++          "type": "number"
++        },
++        {
++          "name": "cols",
++          "type": "number"
++        },
++        {
++          "name": "height",
++          "type": "number"
++        },
++        {
++          "name": "width",
++          "type": "number"
++        },
++        {
++          "name": "websocket",
++          "type": "boolean"
++        },
++        {
++          "name": "tls-creds",
++          "type": "string"
++        },
++        {
++          "name": "tn3270",
++          "type": "boolean"
++        },
++        {
++          "name": "telnet",
++          "type": "boolean"
++        },
++        {
++          "name": "reconnect",
++          "type": "number"
++        },
++        {
++          "name": "delay",
++          "type": "boolean"
++        },
++        {
++          "name": "server",
++          "type": "boolean"
++        },
++        {
++          "name": "wait",
++          "type": "boolean"
++        },
++        {
++          "name": "ipv6",
++          "type": "boolean"
++        },
++        {
++          "name": "ipv4",
++          "type": "boolean"
++        },
++        {
++          "name": "to",
++          "type": "number"
++        },
++        {
++          "name": "localport",
++          "type": "string"
++        },
++        {
++          "name": "localaddr",
++          "type": "string"
++        },
++        {
++          "name": "fd",
++          "type": "string"
++        },
++        {
++          "name": "port",
++          "type": "string"
++        },
++        {
++          "name": "host",
++          "type": "string"
++        },
++        {
++          "name": "path",
++          "type": "string"
++        },
++        {
++          "name": "backend",
++          "type": "string"
++        }
++      ],
++      "option": "chardev"
++    },
++    {
++      "parameters": [
++        {
++          "name": "copy-on-read",
++          "help": "copy read data from backing file into image file",
++          "type": "boolean"
++        },
++        {
++          "name": "werror",
++          "help": "write error action",
++          "type": "string"
++        },
++        {
++          "name": "rerror",
++          "help": "read error action",
++          "type": "string"
++        },
++        {
++          "name": "read-only",
++          "help": "open drive file as read-only",
++          "type": "boolean"
++        },
++        {
++          "name": "file",
++          "help": "file name",
++          "type": "string"
++        },
++        {
++          "name": "if",
++          "help": "interface (ide, scsi, sd, mtd, floppy, pflash, virtio)",
++          "type": "string"
++        },
++        {
++          "name": "media",
++          "help": "media type (disk, cdrom)",
++          "type": "string"
++        },
++        {
++          "name": "index",
++          "help": "index number",
++          "type": "number"
++        },
++        {
++          "name": "unit",
++          "help": "unit number (i.e. lun for scsi)",
++          "type": "number"
++        },
++        {
++          "name": "bus",
++          "help": "bus number",
++          "type": "number"
++        },
++        {
++          "name": "stats-account-failed",
++          "help": "whether to account for failed I/O operations in the statistics",
++          "type": "boolean"
++        },
++        {
++          "name": "stats-account-invalid",
++          "help": "whether to account for invalid I/O operations in the statistics",
++          "type": "boolean"
++        },
++        {
++          "name": "detect-zeroes",
++          "help": "try to optimize zero writes (off, on, unmap)",
++          "type": "string"
++        },
++        {
++          "name": "throttling.group",
++          "help": "name of the block throttling group",
++          "type": "string"
++        },
++        {
++          "name": "throttling.iops-size",
++          "help": "when limiting by iops max size of an I/O in bytes",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-write-max-length",
++          "help": "length of the bps-write-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-read-max-length",
++          "help": "length of the bps-read-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-total-max-length",
++          "help": "length of the bps-total-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-write-max-length",
++          "help": "length of the iops-write-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-read-max-length",
++          "help": "length of the iops-read-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-total-max-length",
++          "help": "length of the iops-total-max burst period, in seconds",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-write-max",
++          "help": "total bytes write burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-read-max",
++          "help": "total bytes read burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-total-max",
++          "help": "total bytes burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-write-max",
++          "help": "I/O operations write burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-read-max",
++          "help": "I/O operations read burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-total-max",
++          "help": "I/O operations burst",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-write",
++          "help": "limit write bytes per second",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-read",
++          "help": "limit read bytes per second",
++          "type": "number"
++        },
++        {
++          "name": "throttling.bps-total",
++          "help": "limit total bytes per second",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-write",
++          "help": "limit write operations per second",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-read",
++          "help": "limit read operations per second",
++          "type": "number"
++        },
++        {
++          "name": "throttling.iops-total",
++          "help": "limit total I/O operations per second",
++          "type": "number"
++        },
++        {
++          "name": "werror",
++          "help": "write error action",
++          "type": "string"
++        },
++        {
++          "name": "format",
++          "help": "disk format (raw, qcow2, ...)",
++          "type": "string"
++        },
++        {
++          "name": "cache.writeback",
++          "help": "Enable writeback mode",
++          "type": "boolean"
++        },
++        {
++          "name": "aio",
++          "help": "host AIO implementation (threads, native)",
++          "type": "string"
++        },
++        {
++          "name": "snapshot",
++          "help": "enable/disable snapshot mode",
++          "type": "boolean"
++        },
++        {
++          "name": "force-share",
++          "help": "always accept other writers (default: off)",
++          "type": "boolean"
++        },
++        {
++          "name": "discard",
++          "help": "discard operation (ignore/off, unmap/on)",
++          "type": "string"
++        },
++        {
++          "name": "auto-read-only",
++          "help": "Node can become read-only if opening read-write fails",
++          "type": "boolean"
++        },
++        {
++          "name": "cache.no-flush",
++          "help": "Ignore flush requests",
++          "type": "boolean"
++        },
++        {
++          "name": "cache.direct",
++          "help": "Bypass software writeback cache on the host",
++          "type": "boolean"
++        },
++        {
++          "name": "driver",
++          "help": "Block driver to use for the node",
++          "type": "string"
++        },
++        {
++          "name": "node-name",
++          "help": "Node name of the block device node",
++          "type": "string"
++        }
++      ],
++      "option": "drive"
++    }
++  ],
++  "id": "libvirt-47"
++}
++
++{
++  "execute": "query-migrate-capabilities",
++  "id": "libvirt-48"
++}
++
++{
++  "return": [
++    {
++      "state": false,
++      "capability": "xbzrle"
++    },
++    {
++      "state": false,
++      "capability": "rdma-pin-all"
++    },
++    {
++      "state": false,
++      "capability": "auto-converge"
++    },
++    {
++      "state": false,
++      "capability": "zero-blocks"
++    },
++    {
++      "state": false,
++      "capability": "compress"
++    },
++    {
++      "state": false,
++      "capability": "events"
++    },
++    {
++      "state": false,
++      "capability": "postcopy-ram"
++    },
++    {
++      "state": false,
++      "capability": "x-colo"
++    },
++    {
++      "state": false,
++      "capability": "release-ram"
++    },
++    {
++      "state": false,
++      "capability": "block"
++    },
++    {
++      "state": false,
++      "capability": "return-path"
++    },
++    {
++      "state": false,
++      "capability": "pause-before-switchover"
++    },
++    {
++      "state": false,
++      "capability": "x-multifd"
++    },
++    {
++      "state": false,
++      "capability": "dirty-bitmaps"
++    },
++    {
++      "state": false,
++      "capability": "postcopy-blocktime"
++    },
++    {
++      "state": false,
++      "capability": "late-block-activate"
++    }
++  ],
++  "id": "libvirt-48"
++}
++
++{
++  "execute": "query-qmp-schema",
++  "id": "libvirt-49"
++}
++
++{
++  "return": [
++    {
++      "name": "query-status",
++      "ret-type": "1",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "SHUTDOWN",
++      "meta-type": "event",
++      "arg-type": "2"
++    },
++    {
++      "name": "POWERDOWN",
++      "meta-type": "event",
++      "arg-type": "0"
++    },
++    {
++      "name": "RESET",
++      "meta-type": "event",
++      "arg-type": "3"
++    },
++    {
++      "name": "STOP",
++      "meta-type": "event",
++      "arg-type": "0"
++    },
++    {
++      "name": "RESUME",
++      "meta-type": "event",
++      "arg-type": "0"
++    },
++    {
++      "name": "SUSPEND",
++      "meta-type": "event",
++      "arg-type": "0"
++    },
++    {
++      "name": "SUSPEND_DISK",
++      "meta-type": "event",
++      "arg-type": "0"
++    },
++    {
++      "name": "WAKEUP",
++      "meta-type": "event",
++      "arg-type": "0"
++    },
++    {
++      "name": "WATCHDOG",
++      "meta-type": "event",
++      "arg-type": "4"
++    },
++    {
++      "name": "watchdog-set-action",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "5"
++    },
++    {
++      "name": "GUEST_PANICKED",
++      "meta-type": "event",
++      "arg-type": "6"
++    },
++    {
++      "name": "JOB_STATUS_CHANGE",
++      "meta-type": "event",
++      "arg-type": "7"
++    },
++    {
++      "name": "job-pause",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "8"
++    },
++    {
++      "name": "job-resume",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "9"
++    },
++    {
++      "name": "job-cancel",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "10"
++    },
++    {
++      "name": "job-complete",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "11"
++    },
++    {
++      "name": "job-dismiss",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "12"
++    },
++    {
++      "name": "job-finalize",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "13"
++    },
++    {
++      "name": "query-jobs",
++      "ret-type": "[14]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "x-block-latency-histogram-set",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "15"
++    },
++    {
++      "name": "query-block",
++      "ret-type": "[16]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-blockstats",
++      "ret-type": "[18]",
++      "meta-type": "command",
++      "arg-type": "17"
++    },
++    {
++      "name": "query-block-jobs",
++      "ret-type": "[19]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "block_passwd",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "20"
++    },
++    {
++      "name": "block_resize",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "21"
++    },
++    {
++      "name": "blockdev-snapshot-sync",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "22"
++    },
++    {
++      "name": "blockdev-snapshot",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "23"
++    },
++    {
++      "name": "change-backing-file",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "24"
++    },
++    {
++      "name": "block-commit",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "25"
++    },
++    {
++      "name": "drive-backup",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "26"
++    },
++    {
++      "name": "blockdev-backup",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "27"
++    },
++    {
++      "name": "query-named-block-nodes",
++      "ret-type": "[28]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "drive-mirror",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "29"
++    },
++    {
++      "name": "block-dirty-bitmap-add",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "30"
++    },
++    {
++      "name": "block-dirty-bitmap-remove",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "31"
++    },
++    {
++      "name": "block-dirty-bitmap-clear",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "31"
++    },
++    {
++      "name": "x-block-dirty-bitmap-enable",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "31"
++    },
++    {
++      "name": "x-block-dirty-bitmap-disable",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "31"
++    },
++    {
++      "name": "x-block-dirty-bitmap-merge",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "32"
++    },
++    {
++      "name": "x-debug-block-dirty-bitmap-sha256",
++      "ret-type": "33",
++      "meta-type": "command",
++      "arg-type": "31"
++    },
++    {
++      "name": "blockdev-mirror",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "34"
++    },
++    {
++      "name": "block_set_io_throttle",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "35"
++    },
++    {
++      "name": "block-stream",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "36"
++    },
++    {
++      "name": "block-job-set-speed",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "37"
++    },
++    {
++      "name": "block-job-cancel",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "38"
++    },
++    {
++      "name": "block-job-pause",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "39"
++    },
++    {
++      "name": "block-job-resume",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "40"
++    },
++    {
++      "name": "block-job-complete",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "41"
++    },
++    {
++      "name": "block-job-dismiss",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "42"
++    },
++    {
++      "name": "block-job-finalize",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "43"
++    },
++    {
++      "name": "blockdev-add",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "44"
++    },
++    {
++      "name": "blockdev-del",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "45"
++    },
++    {
++      "name": "blockdev-create",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "46"
++    },
++    {
++      "name": "blockdev-open-tray",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "47"
++    },
++    {
++      "name": "blockdev-close-tray",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "48"
++    },
++    {
++      "name": "blockdev-remove-medium",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "49"
++    },
++    {
++      "name": "blockdev-insert-medium",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "50"
++    },
++    {
++      "name": "blockdev-change-medium",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "51"
++    },
++    {
++      "name": "BLOCK_IMAGE_CORRUPTED",
++      "meta-type": "event",
++      "arg-type": "52"
++    },
++    {
++      "name": "BLOCK_IO_ERROR",
++      "meta-type": "event",
++      "arg-type": "53"
++    },
++    {
++      "name": "BLOCK_JOB_COMPLETED",
++      "meta-type": "event",
++      "arg-type": "54"
++    },
++    {
++      "name": "BLOCK_JOB_CANCELLED",
++      "meta-type": "event",
++      "arg-type": "55"
++    },
++    {
++      "name": "BLOCK_JOB_ERROR",
++      "meta-type": "event",
++      "arg-type": "56"
++    },
++    {
++      "name": "BLOCK_JOB_READY",
++      "meta-type": "event",
++      "arg-type": "57"
++    },
++    {
++      "name": "BLOCK_JOB_PENDING",
++      "meta-type": "event",
++      "arg-type": "58"
++    },
++    {
++      "name": "BLOCK_WRITE_THRESHOLD",
++      "meta-type": "event",
++      "arg-type": "59"
++    },
++    {
++      "name": "block-set-write-threshold",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "60"
++    },
++    {
++      "name": "x-blockdev-change",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "61"
++    },
++    {
++      "name": "x-blockdev-set-iothread",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "62"
++    },
++    {
++      "name": "query-pr-managers",
++      "ret-type": "[63]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "blockdev-snapshot-internal-sync",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "64"
++    },
++    {
++      "name": "blockdev-snapshot-delete-internal-sync",
++      "ret-type": "66",
++      "meta-type": "command",
++      "arg-type": "65"
++    },
++    {
++      "name": "eject",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "67"
++    },
++    {
++      "name": "nbd-server-start",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "68"
++    },
++    {
++      "name": "nbd-server-add",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "69"
++    },
++    {
++      "name": "nbd-server-remove",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "70"
++    },
++    {
++      "name": "x-nbd-server-add-bitmap",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "71"
++    },
++    {
++      "name": "nbd-server-stop",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "DEVICE_TRAY_MOVED",
++      "meta-type": "event",
++      "arg-type": "72"
++    },
++    {
++      "name": "PR_MANAGER_STATUS_CHANGED",
++      "meta-type": "event",
++      "arg-type": "73"
++    },
++    {
++      "name": "QUORUM_FAILURE",
++      "meta-type": "event",
++      "arg-type": "74"
++    },
++    {
++      "name": "QUORUM_REPORT_BAD",
++      "meta-type": "event",
++      "arg-type": "75"
++    },
++    {
++      "name": "query-chardev",
++      "ret-type": "[76]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-chardev-backends",
++      "ret-type": "[77]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "ringbuf-write",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "78"
++    },
++    {
++      "name": "ringbuf-read",
++      "ret-type": "str",
++      "meta-type": "command",
++      "arg-type": "79"
++    },
++    {
++      "name": "chardev-add",
++      "ret-type": "81",
++      "meta-type": "command",
++      "arg-type": "80"
++    },
++    {
++      "name": "chardev-change",
++      "ret-type": "81",
++      "meta-type": "command",
++      "arg-type": "82"
++    },
++    {
++      "name": "chardev-remove",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "83"
++    },
++    {
++      "name": "chardev-send-break",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "84"
++    },
++    {
++      "name": "VSERPORT_CHANGE",
++      "meta-type": "event",
++      "arg-type": "85"
++    },
++    {
++      "name": "set_link",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "86"
++    },
++    {
++      "name": "netdev_add",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "87"
++    },
++    {
++      "name": "netdev_del",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "88"
++    },
++    {
++      "name": "query-rx-filter",
++      "ret-type": "[90]",
++      "meta-type": "command",
++      "arg-type": "89"
++    },
++    {
++      "name": "NIC_RX_FILTER_CHANGED",
++      "meta-type": "event",
++      "arg-type": "91"
++    },
++    {
++      "name": "query-rocker",
++      "ret-type": "93",
++      "meta-type": "command",
++      "arg-type": "92"
++    },
++    {
++      "name": "query-rocker-ports",
++      "ret-type": "[95]",
++      "meta-type": "command",
++      "arg-type": "94"
++    },
++    {
++      "name": "query-rocker-of-dpa-flows",
++      "ret-type": "[97]",
++      "meta-type": "command",
++      "arg-type": "96"
++    },
++    {
++      "name": "query-rocker-of-dpa-groups",
++      "ret-type": "[99]",
++      "meta-type": "command",
++      "arg-type": "98"
++    },
++    {
++      "name": "query-tpm-models",
++      "ret-type": "[100]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-tpm-types",
++      "ret-type": "[101]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-tpm",
++      "ret-type": "[102]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "set_password",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "103"
++    },
++    {
++      "name": "expire_password",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "104"
++    },
++    {
++      "name": "screendump",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "105"
++    },
++    {
++      "name": "query-spice",
++      "ret-type": "106",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "SPICE_CONNECTED",
++      "meta-type": "event",
++      "arg-type": "107"
++    },
++    {
++      "name": "SPICE_INITIALIZED",
++      "meta-type": "event",
++      "arg-type": "108"
++    },
++    {
++      "name": "SPICE_DISCONNECTED",
++      "meta-type": "event",
++      "arg-type": "109"
++    },
++    {
++      "name": "SPICE_MIGRATE_COMPLETED",
++      "meta-type": "event",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-vnc",
++      "ret-type": "110",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-vnc-servers",
++      "ret-type": "[111]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "change-vnc-password",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "112"
++    },
++    {
++      "name": "VNC_CONNECTED",
++      "meta-type": "event",
++      "arg-type": "113"
++    },
++    {
++      "name": "VNC_INITIALIZED",
++      "meta-type": "event",
++      "arg-type": "114"
++    },
++    {
++      "name": "VNC_DISCONNECTED",
++      "meta-type": "event",
++      "arg-type": "115"
++    },
++    {
++      "name": "query-mice",
++      "ret-type": "[116]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "send-key",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "117"
++    },
++    {
++      "name": "input-send-event",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "118"
++    },
++    {
++      "name": "query-display-options",
++      "ret-type": "119",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-migrate",
++      "ret-type": "120",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "migrate-set-capabilities",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "121"
++    },
++    {
++      "name": "query-migrate-capabilities",
++      "ret-type": "[122]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "migrate-set-parameters",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "123"
++    },
++    {
++      "name": "query-migrate-parameters",
++      "ret-type": "124",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "client_migrate_info",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "125"
++    },
++    {
++      "name": "migrate-start-postcopy",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "MIGRATION",
++      "meta-type": "event",
++      "arg-type": "126"
++    },
++    {
++      "name": "MIGRATION_PASS",
++      "meta-type": "event",
++      "arg-type": "127"
++    },
++    {
++      "name": "COLO_EXIT",
++      "meta-type": "event",
++      "arg-type": "128"
++    },
++    {
++      "name": "x-colo-lost-heartbeat",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "migrate_cancel",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "migrate-continue",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "129"
++    },
++    {
++      "name": "migrate_set_downtime",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "130"
++    },
++    {
++      "name": "migrate_set_speed",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "131"
++    },
++    {
++      "name": "migrate-set-cache-size",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "132"
++    },
++    {
++      "name": "query-migrate-cache-size",
++      "ret-type": "int",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "migrate",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "133"
++    },
++    {
++      "name": "migrate-incoming",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "134"
++    },
++    {
++      "name": "xen-save-devices-state",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "135"
++    },
++    {
++      "name": "xen-set-replication",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "136"
++    },
++    {
++      "name": "query-xen-replication-status",
++      "ret-type": "137",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "xen-colo-do-checkpoint",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-colo-status",
++      "ret-type": "138",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "migrate-recover",
++      "ret-type": "0",
++      "allow-oob": true,
++      "meta-type": "command",
++      "arg-type": "139"
++    },
++    {
++      "name": "migrate-pause",
++      "ret-type": "0",
++      "allow-oob": true,
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "transaction",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "140"
++    },
++    {
++      "name": "trace-event-get-state",
++      "ret-type": "[142]",
++      "meta-type": "command",
++      "arg-type": "141"
++    },
++    {
++      "name": "trace-event-set-state",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "143"
++    },
++    {
++      "name": "query-qmp-schema",
++      "ret-type": "[144]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "qmp_capabilities",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "145"
++    },
++    {
++      "name": "query-version",
++      "ret-type": "146",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-commands",
++      "ret-type": "[147]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "add_client",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "148"
++    },
++    {
++      "name": "query-name",
++      "ret-type": "149",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-kvm",
++      "ret-type": "150",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-uuid",
++      "ret-type": "151",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-events",
++      "ret-type": "[152]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-cpus",
++      "ret-type": "[153]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-cpus-fast",
++      "ret-type": "[154]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-iothreads",
++      "ret-type": "[155]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-balloon",
++      "ret-type": "156",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "BALLOON_CHANGE",
++      "meta-type": "event",
++      "arg-type": "157"
++    },
++    {
++      "name": "query-pci",
++      "ret-type": "[158]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "quit",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "stop",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "system_reset",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "system_powerdown",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "cpu-add",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "159"
++    },
++    {
++      "name": "memsave",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "160"
++    },
++    {
++      "name": "pmemsave",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "161"
++    },
++    {
++      "name": "cont",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "x-exit-preconfig",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "system_wakeup",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "inject-nmi",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "balloon",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "162"
++    },
++    {
++      "name": "human-monitor-command",
++      "ret-type": "str",
++      "meta-type": "command",
++      "arg-type": "163"
++    },
++    {
++      "name": "qom-list",
++      "ret-type": "[165]",
++      "meta-type": "command",
++      "arg-type": "164"
++    },
++    {
++      "name": "qom-get",
++      "ret-type": "any",
++      "meta-type": "command",
++      "arg-type": "166"
++    },
++    {
++      "name": "qom-set",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "167"
++    },
++    {
++      "name": "change",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "168"
++    },
++    {
++      "name": "qom-list-types",
++      "ret-type": "[170]",
++      "meta-type": "command",
++      "arg-type": "169"
++    },
++    {
++      "name": "device-list-properties",
++      "ret-type": "[165]",
++      "meta-type": "command",
++      "arg-type": "171"
++    },
++    {
++      "name": "qom-list-properties",
++      "ret-type": "[165]",
++      "meta-type": "command",
++      "arg-type": "172"
++    },
++    {
++      "name": "xen-set-global-dirty-log",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "173"
++    },
++    {
++      "name": "device_add",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "174"
++    },
++    {
++      "name": "device_del",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "175"
++    },
++    {
++      "name": "DEVICE_DELETED",
++      "meta-type": "event",
++      "arg-type": "176"
++    },
++    {
++      "name": "dump-guest-memory",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "177"
++    },
++    {
++      "name": "query-dump",
++      "ret-type": "178",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "DUMP_COMPLETED",
++      "meta-type": "event",
++      "arg-type": "179"
++    },
++    {
++      "name": "query-dump-guest-memory-capability",
++      "ret-type": "180",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "dump-skeys",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "181"
++    },
++    {
++      "name": "object-add",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "182"
++    },
++    {
++      "name": "object-del",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "183"
++    },
++    {
++      "name": "getfd",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "184"
++    },
++    {
++      "name": "closefd",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "185"
++    },
++    {
++      "name": "query-machines",
++      "ret-type": "[186]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-memory-size-summary",
++      "ret-type": "187",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-cpu-definitions",
++      "ret-type": "[188]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-cpu-model-expansion",
++      "ret-type": "190",
++      "meta-type": "command",
++      "arg-type": "189"
++    },
++    {
++      "name": "query-cpu-model-comparison",
++      "ret-type": "192",
++      "meta-type": "command",
++      "arg-type": "191"
++    },
++    {
++      "name": "query-cpu-model-baseline",
++      "ret-type": "194",
++      "meta-type": "command",
++      "arg-type": "193"
++    },
++    {
++      "name": "add-fd",
++      "ret-type": "196",
++      "meta-type": "command",
++      "arg-type": "195"
++    },
++    {
++      "name": "remove-fd",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "197"
++    },
++    {
++      "name": "query-fdsets",
++      "ret-type": "[198]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-target",
++      "ret-type": "199",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-command-line-options",
++      "ret-type": "[201]",
++      "meta-type": "command",
++      "arg-type": "200"
++    },
++    {
++      "name": "query-memdev",
++      "ret-type": "[202]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-memory-devices",
++      "ret-type": "[203]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "MEM_UNPLUG_ERROR",
++      "meta-type": "event",
++      "arg-type": "204"
++    },
++    {
++      "name": "query-acpi-ospm-status",
++      "ret-type": "[205]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "ACPI_DEVICE_OST",
++      "meta-type": "event",
++      "arg-type": "206"
++    },
++    {
++      "name": "rtc-reset-reinjection",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "RTC_CHANGE",
++      "meta-type": "event",
++      "arg-type": "207"
++    },
++    {
++      "name": "xen-load-devices-state",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "208"
++    },
++    {
++      "name": "query-gic-capabilities",
++      "ret-type": "[209]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-hotpluggable-cpus",
++      "ret-type": "[210]",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-vm-generation-id",
++      "ret-type": "211",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-sev",
++      "ret-type": "212",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-sev-launch-measure",
++      "ret-type": "213",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "query-sev-capabilities",
++      "ret-type": "214",
++      "meta-type": "command",
++      "arg-type": "0"
++    },
++    {
++      "name": "COMMAND_DROPPED",
++      "meta-type": "event",
++      "arg-type": "215"
++    },
++    {
++      "name": "set-numa-node",
++      "ret-type": "0",
++      "meta-type": "command",
++      "arg-type": "216"
++    },
++    {
++      "name": "0",
++      "members": [
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "1",
++      "members": [
++        {
++          "name": "running",
++          "type": "bool"
++        },
++        {
++          "name": "singlestep",
++          "type": "bool"
++        },
++        {
++          "name": "status",
++          "type": "217"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "2",
++      "members": [
++        {
++          "name": "guest",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "3",
++      "members": [
++        {
++          "name": "guest",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "4",
++      "members": [
++        {
++          "name": "action",
++          "type": "218"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "5",
++      "members": [
++        {
++          "name": "action",
++          "type": "218"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "6",
++      "members": [
++        {
++          "name": "action",
++          "type": "219"
++        },
++        {
++          "name": "info",
++          "default": null,
++          "type": "220"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "7",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "status",
++          "type": "221"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "8",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "9",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "10",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "11",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "12",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "13",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[14]",
++      "element-type": "14",
++      "meta-type": "array"
++    },
++    {
++      "name": "14",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "type",
++          "type": "222"
++        },
++        {
++          "name": "status",
++          "type": "221"
++        },
++        {
++          "name": "current-progress",
++          "type": "int"
++        },
++        {
++          "name": "total-progress",
++          "type": "int"
++        },
++        {
++          "name": "error",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "15",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "boundaries",
++          "default": null,
++          "type": "[int]"
++        },
++        {
++          "name": "boundaries-read",
++          "default": null,
++          "type": "[int]"
++        },
++        {
++          "name": "boundaries-write",
++          "default": null,
++          "type": "[int]"
++        },
++        {
++          "name": "boundaries-flush",
++          "default": null,
++          "type": "[int]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[16]",
++      "element-type": "16",
++      "meta-type": "array"
++    },
++    {
++      "name": "16",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "qdev",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "type",
++          "type": "str"
++        },
++        {
++          "name": "removable",
++          "type": "bool"
++        },
++        {
++          "name": "locked",
++          "type": "bool"
++        },
++        {
++          "name": "inserted",
++          "default": null,
++          "type": "28"
++        },
++        {
++          "name": "tray_open",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "io-status",
++          "default": null,
++          "type": "223"
++        },
++        {
++          "name": "dirty-bitmaps",
++          "default": null,
++          "type": "[224]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "17",
++      "members": [
++        {
++          "name": "query-nodes",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[18]",
++      "element-type": "18",
++      "meta-type": "array"
++    },
++    {
++      "name": "18",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "qdev",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "stats",
++          "type": "225"
++        },
++        {
++          "name": "parent",
++          "default": null,
++          "type": "18"
++        },
++        {
++          "name": "backing",
++          "default": null,
++          "type": "18"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[19]",
++      "element-type": "19",
++      "meta-type": "array"
++    },
++    {
++      "name": "19",
++      "members": [
++        {
++          "name": "type",
++          "type": "str"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "len",
++          "type": "int"
++        },
++        {
++          "name": "offset",
++          "type": "int"
++        },
++        {
++          "name": "busy",
++          "type": "bool"
++        },
++        {
++          "name": "paused",
++          "type": "bool"
++        },
++        {
++          "name": "speed",
++          "type": "int"
++        },
++        {
++          "name": "io-status",
++          "type": "223"
++        },
++        {
++          "name": "ready",
++          "type": "bool"
++        },
++        {
++          "name": "status",
++          "type": "221"
++        },
++        {
++          "name": "auto-finalize",
++          "type": "bool"
++        },
++        {
++          "name": "auto-dismiss",
++          "type": "bool"
++        },
++        {
++          "name": "error",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "20",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "password",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "21",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "22",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "snapshot-file",
++          "type": "str"
++        },
++        {
++          "name": "snapshot-node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "format",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "mode",
++          "default": null,
++          "type": "226"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "23",
++      "members": [
++        {
++          "name": "node",
++          "type": "str"
++        },
++        {
++          "name": "overlay",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "24",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "image-node-name",
++          "type": "str"
++        },
++        {
++          "name": "backing-file",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "25",
++      "members": [
++        {
++          "name": "job-id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "base-node",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "base",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "top-node",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "top",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "backing-file",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "speed",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "filter-node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "auto-finalize",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "auto-dismiss",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "26",
++      "members": [
++        {
++          "name": "job-id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "target",
++          "type": "str"
++        },
++        {
++          "name": "format",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "sync",
++          "type": "227"
++        },
++        {
++          "name": "mode",
++          "default": null,
++          "type": "226"
++        },
++        {
++          "name": "speed",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bitmap",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "compress",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "on-source-error",
++          "default": null,
++          "type": "228"
++        },
++        {
++          "name": "on-target-error",
++          "default": null,
++          "type": "228"
++        },
++        {
++          "name": "auto-finalize",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "auto-dismiss",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "27",
++      "members": [
++        {
++          "name": "job-id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "target",
++          "type": "str"
++        },
++        {
++          "name": "sync",
++          "type": "227"
++        },
++        {
++          "name": "speed",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bitmap",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "compress",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "on-source-error",
++          "default": null,
++          "type": "228"
++        },
++        {
++          "name": "on-target-error",
++          "default": null,
++          "type": "228"
++        },
++        {
++          "name": "auto-finalize",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "auto-dismiss",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[28]",
++      "element-type": "28",
++      "meta-type": "array"
++    },
++    {
++      "name": "28",
++      "members": [
++        {
++          "name": "file",
++          "type": "str"
++        },
++        {
++          "name": "node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "ro",
++          "type": "bool"
++        },
++        {
++          "name": "drv",
++          "type": "str"
++        },
++        {
++          "name": "backing_file",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "backing_file_depth",
++          "type": "int"
++        },
++        {
++          "name": "encrypted",
++          "type": "bool"
++        },
++        {
++          "name": "encryption_key_missing",
++          "type": "bool"
++        },
++        {
++          "name": "detect_zeroes",
++          "type": "229"
++        },
++        {
++          "name": "bps",
++          "type": "int"
++        },
++        {
++          "name": "bps_rd",
++          "type": "int"
++        },
++        {
++          "name": "bps_wr",
++          "type": "int"
++        },
++        {
++          "name": "iops",
++          "type": "int"
++        },
++        {
++          "name": "iops_rd",
++          "type": "int"
++        },
++        {
++          "name": "iops_wr",
++          "type": "int"
++        },
++        {
++          "name": "image",
++          "type": "230"
++        },
++        {
++          "name": "bps_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bps_rd_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bps_wr_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_rd_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_wr_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bps_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bps_rd_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bps_wr_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_rd_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_wr_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "group",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "cache",
++          "type": "231"
++        },
++        {
++          "name": "write_threshold",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "29",
++      "members": [
++        {
++          "name": "job-id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "target",
++          "type": "str"
++        },
++        {
++          "name": "format",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "replaces",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "sync",
++          "type": "227"
++        },
++        {
++          "name": "mode",
++          "default": null,
++          "type": "226"
++        },
++        {
++          "name": "speed",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "granularity",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "buf-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "on-source-error",
++          "default": null,
++          "type": "228"
++        },
++        {
++          "name": "on-target-error",
++          "default": null,
++          "type": "228"
++        },
++        {
++          "name": "unmap",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "copy-mode",
++          "default": null,
++          "type": "232"
++        },
++        {
++          "name": "auto-finalize",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "auto-dismiss",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "30",
++      "members": [
++        {
++          "name": "node",
++          "type": "str"
++        },
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "granularity",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "persistent",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "autoload",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "x-disabled",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "31",
++      "members": [
++        {
++          "name": "node",
++          "type": "str"
++        },
++        {
++          "name": "name",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "32",
++      "members": [
++        {
++          "name": "node",
++          "type": "str"
++        },
++        {
++          "name": "dst_name",
++          "type": "str"
++        },
++        {
++          "name": "src_name",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "33",
++      "members": [
++        {
++          "name": "sha256",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "34",
++      "members": [
++        {
++          "name": "job-id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "target",
++          "type": "str"
++        },
++        {
++          "name": "replaces",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "sync",
++          "type": "227"
++        },
++        {
++          "name": "speed",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "granularity",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "buf-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "on-source-error",
++          "default": null,
++          "type": "228"
++        },
++        {
++          "name": "on-target-error",
++          "default": null,
++          "type": "228"
++        },
++        {
++          "name": "filter-node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "copy-mode",
++          "default": null,
++          "type": "232"
++        },
++        {
++          "name": "auto-finalize",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "auto-dismiss",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "35",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "bps",
++          "type": "int"
++        },
++        {
++          "name": "bps_rd",
++          "type": "int"
++        },
++        {
++          "name": "bps_wr",
++          "type": "int"
++        },
++        {
++          "name": "iops",
++          "type": "int"
++        },
++        {
++          "name": "iops_rd",
++          "type": "int"
++        },
++        {
++          "name": "iops_wr",
++          "type": "int"
++        },
++        {
++          "name": "bps_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bps_rd_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bps_wr_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_rd_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_wr_max",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bps_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bps_rd_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "bps_wr_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_rd_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_wr_max_length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "iops_size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "group",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "36",
++      "members": [
++        {
++          "name": "job-id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "base",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "base-node",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "backing-file",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "speed",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "on-error",
++          "default": null,
++          "type": "228"
++        },
++        {
++          "name": "auto-finalize",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "auto-dismiss",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "37",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "speed",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "38",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "force",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "39",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "40",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "41",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "42",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "43",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "44",
++      "tag": "driver",
++      "variants": [
++        {
++          "case": "blkdebug",
++          "type": "236"
++        },
++        {
++          "case": "blklogwrites",
++          "type": "237"
++        },
++        {
++          "case": "blkverify",
++          "type": "238"
++        },
++        {
++          "case": "bochs",
++          "type": "239"
++        },
++        {
++          "case": "cloop",
++          "type": "239"
++        },
++        {
++          "case": "copy-on-read",
++          "type": "239"
++        },
++        {
++          "case": "dmg",
++          "type": "239"
++        },
++        {
++          "case": "file",
++          "type": "240"
++        },
++        {
++          "case": "ftp",
++          "type": "241"
++        },
++        {
++          "case": "ftps",
++          "type": "242"
++        },
++        {
++          "case": "gluster",
++          "type": "243"
++        },
++        {
++          "case": "host_cdrom",
++          "type": "240"
++        },
++        {
++          "case": "host_device",
++          "type": "240"
++        },
++        {
++          "case": "http",
++          "type": "244"
++        },
++        {
++          "case": "https",
++          "type": "245"
++        },
++        {
++          "case": "iscsi",
++          "type": "246"
++        },
++        {
++          "case": "luks",
++          "type": "247"
++        },
++        {
++          "case": "nbd",
++          "type": "248"
++        },
++        {
++          "case": "nfs",
++          "type": "249"
++        },
++        {
++          "case": "null-aio",
++          "type": "250"
++        },
++        {
++          "case": "null-co",
++          "type": "250"
++        },
++        {
++          "case": "nvme",
++          "type": "251"
++        },
++        {
++          "case": "parallels",
++          "type": "239"
++        },
++        {
++          "case": "qcow2",
++          "type": "252"
++        },
++        {
++          "case": "qcow",
++          "type": "253"
++        },
++        {
++          "case": "qed",
++          "type": "254"
++        },
++        {
++          "case": "quorum",
++          "type": "255"
++        },
++        {
++          "case": "raw",
++          "type": "256"
++        },
++        {
++          "case": "rbd",
++          "type": "257"
++        },
++        {
++          "case": "replication",
++          "type": "258"
++        },
++        {
++          "case": "sheepdog",
++          "type": "259"
++        },
++        {
++          "case": "ssh",
++          "type": "260"
++        },
++        {
++          "case": "throttle",
++          "type": "261"
++        },
++        {
++          "case": "vdi",
++          "type": "239"
++        },
++        {
++          "case": "vhdx",
++          "type": "239"
++        },
++        {
++          "case": "vmdk",
++          "type": "254"
++        },
++        {
++          "case": "vpc",
++          "type": "239"
++        },
++        {
++          "case": "vvfat",
++          "type": "262"
++        },
++        {
++          "case": "vxhs",
++          "type": "263"
++        }
++      ],
++      "members": [
++        {
++          "name": "driver",
++          "type": "233"
++        },
++        {
++          "name": "node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "discard",
++          "default": null,
++          "type": "234"
++        },
++        {
++          "name": "cache",
++          "default": null,
++          "type": "235"
++        },
++        {
++          "name": "read-only",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "auto-read-only",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "force-share",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "detect-zeroes",
++          "default": null,
++          "type": "229"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "45",
++      "members": [
++        {
++          "name": "node-name",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "46",
++      "members": [
++        {
++          "name": "job-id",
++          "type": "str"
++        },
++        {
++          "name": "options",
++          "type": "264"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "47",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "force",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "48",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "49",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "50",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "node-name",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "51",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "filename",
++          "type": "str"
++        },
++        {
++          "name": "format",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "read-only-mode",
++          "default": null,
++          "type": "265"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "52",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "msg",
++          "type": "str"
++        },
++        {
++          "name": "offset",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "fatal",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "53",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "node-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "operation",
++          "type": "266"
++        },
++        {
++          "name": "action",
++          "type": "267"
++        },
++        {
++          "name": "nospace",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "reason",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "54",
++      "members": [
++        {
++          "name": "type",
++          "type": "222"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "len",
++          "type": "int"
++        },
++        {
++          "name": "offset",
++          "type": "int"
++        },
++        {
++          "name": "speed",
++          "type": "int"
++        },
++        {
++          "name": "error",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "55",
++      "members": [
++        {
++          "name": "type",
++          "type": "222"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "len",
++          "type": "int"
++        },
++        {
++          "name": "offset",
++          "type": "int"
++        },
++        {
++          "name": "speed",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "56",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "operation",
++          "type": "266"
++        },
++        {
++          "name": "action",
++          "type": "267"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "57",
++      "members": [
++        {
++          "name": "type",
++          "type": "222"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "len",
++          "type": "int"
++        },
++        {
++          "name": "offset",
++          "type": "int"
++        },
++        {
++          "name": "speed",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "58",
++      "members": [
++        {
++          "name": "type",
++          "type": "222"
++        },
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "59",
++      "members": [
++        {
++          "name": "node-name",
++          "type": "str"
++        },
++        {
++          "name": "amount-exceeded",
++          "type": "int"
++        },
++        {
++          "name": "write-threshold",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "60",
++      "members": [
++        {
++          "name": "node-name",
++          "type": "str"
++        },
++        {
++          "name": "write-threshold",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "61",
++      "members": [
++        {
++          "name": "parent",
++          "type": "str"
++        },
++        {
++          "name": "child",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "node",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "62",
++      "members": [
++        {
++          "name": "node-name",
++          "type": "str"
++        },
++        {
++          "name": "iothread",
++          "type": "268"
++        },
++        {
++          "name": "force",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[63]",
++      "element-type": "63",
++      "meta-type": "array"
++    },
++    {
++      "name": "63",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "connected",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "64",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "name",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "65",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "name",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "66",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "vm-state-size",
++          "type": "int"
++        },
++        {
++          "name": "date-sec",
++          "type": "int"
++        },
++        {
++          "name": "date-nsec",
++          "type": "int"
++        },
++        {
++          "name": "vm-clock-sec",
++          "type": "int"
++        },
++        {
++          "name": "vm-clock-nsec",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "67",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "force",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "68",
++      "members": [
++        {
++          "name": "addr",
++          "type": "269"
++        },
++        {
++          "name": "tls-creds",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "69",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "writable",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "70",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "mode",
++          "default": null,
++          "type": "270"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "71",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "bitmap",
++          "type": "str"
++        },
++        {
++          "name": "bitmap-export-name",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "72",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "tray-open",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "73",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "connected",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "74",
++      "members": [
++        {
++          "name": "reference",
++          "type": "str"
++        },
++        {
++          "name": "sector-num",
++          "type": "int"
++        },
++        {
++          "name": "sectors-count",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "75",
++      "members": [
++        {
++          "name": "type",
++          "type": "271"
++        },
++        {
++          "name": "error",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "node-name",
++          "type": "str"
++        },
++        {
++          "name": "sector-num",
++          "type": "int"
++        },
++        {
++          "name": "sectors-count",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[76]",
++      "element-type": "76",
++      "meta-type": "array"
++    },
++    {
++      "name": "76",
++      "members": [
++        {
++          "name": "label",
++          "type": "str"
++        },
++        {
++          "name": "filename",
++          "type": "str"
++        },
++        {
++          "name": "frontend-open",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[77]",
++      "element-type": "77",
++      "meta-type": "array"
++    },
++    {
++      "name": "77",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "78",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "data",
++          "type": "str"
++        },
++        {
++          "name": "format",
++          "default": null,
++          "type": "272"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "79",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "format",
++          "default": null,
++          "type": "272"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "str",
++      "json-type": "string",
++      "meta-type": "builtin"
++    },
++    {
++      "name": "80",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "backend",
++          "type": "273"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "81",
++      "members": [
++        {
++          "name": "pty",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "82",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "backend",
++          "type": "273"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "83",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "84",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "85",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "open",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "86",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "up",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "87",
++      "members": [
++        {
++          "name": "type",
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "88",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "89",
++      "members": [
++        {
++          "name": "name",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[90]",
++      "element-type": "90",
++      "meta-type": "array"
++    },
++    {
++      "name": "90",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "promiscuous",
++          "type": "bool"
++        },
++        {
++          "name": "multicast",
++          "type": "274"
++        },
++        {
++          "name": "unicast",
++          "type": "274"
++        },
++        {
++          "name": "vlan",
++          "type": "274"
++        },
++        {
++          "name": "broadcast-allowed",
++          "type": "bool"
++        },
++        {
++          "name": "multicast-overflow",
++          "type": "bool"
++        },
++        {
++          "name": "unicast-overflow",
++          "type": "bool"
++        },
++        {
++          "name": "main-mac",
++          "type": "str"
++        },
++        {
++          "name": "vlan-table",
++          "type": "[int]"
++        },
++        {
++          "name": "unicast-table",
++          "type": "[str]"
++        },
++        {
++          "name": "multicast-table",
++          "type": "[str]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "91",
++      "members": [
++        {
++          "name": "name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "path",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "92",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "93",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "type": "int"
++        },
++        {
++          "name": "ports",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "94",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[95]",
++      "element-type": "95",
++      "meta-type": "array"
++    },
++    {
++      "name": "95",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "enabled",
++          "type": "bool"
++        },
++        {
++          "name": "link-up",
++          "type": "bool"
++        },
++        {
++          "name": "speed",
++          "type": "int"
++        },
++        {
++          "name": "duplex",
++          "type": "275"
++        },
++        {
++          "name": "autoneg",
++          "type": "276"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "96",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "tbl-id",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[97]",
++      "element-type": "97",
++      "meta-type": "array"
++    },
++    {
++      "name": "97",
++      "members": [
++        {
++          "name": "cookie",
++          "type": "int"
++        },
++        {
++          "name": "hits",
++          "type": "int"
++        },
++        {
++          "name": "key",
++          "type": "277"
++        },
++        {
++          "name": "mask",
++          "type": "278"
++        },
++        {
++          "name": "action",
++          "type": "279"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "98",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "type",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[99]",
++      "element-type": "99",
++      "meta-type": "array"
++    },
++    {
++      "name": "99",
++      "members": [
++        {
++          "name": "id",
++          "type": "int"
++        },
++        {
++          "name": "type",
++          "type": "int"
++        },
++        {
++          "name": "vlan-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "pport",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "index",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "out-pport",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "group-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "set-vlan-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "pop-vlan",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "group-ids",
++          "default": null,
++          "type": "[int]"
++        },
++        {
++          "name": "set-eth-src",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "set-eth-dst",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "ttl-check",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[100]",
++      "element-type": "100",
++      "meta-type": "array"
++    },
++    {
++      "name": "100",
++      "meta-type": "enum",
++      "values": [
++        "tpm-tis",
++        "tpm-crb"
++      ]
++    },
++    {
++      "name": "[101]",
++      "element-type": "101",
++      "meta-type": "array"
++    },
++    {
++      "name": "101",
++      "meta-type": "enum",
++      "values": [
++        "passthrough",
++        "emulator"
++      ]
++    },
++    {
++      "name": "[102]",
++      "element-type": "102",
++      "meta-type": "array"
++    },
++    {
++      "name": "102",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "model",
++          "type": "100"
++        },
++        {
++          "name": "options",
++          "type": "280"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "103",
++      "members": [
++        {
++          "name": "protocol",
++          "type": "str"
++        },
++        {
++          "name": "password",
++          "type": "str"
++        },
++        {
++          "name": "connected",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "104",
++      "members": [
++        {
++          "name": "protocol",
++          "type": "str"
++        },
++        {
++          "name": "time",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "105",
++      "members": [
++        {
++          "name": "filename",
++          "type": "str"
++        },
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "head",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "106",
++      "members": [
++        {
++          "name": "enabled",
++          "type": "bool"
++        },
++        {
++          "name": "migrated",
++          "type": "bool"
++        },
++        {
++          "name": "host",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "port",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "tls-port",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "auth",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "compiled-version",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "mouse-mode",
++          "type": "281"
++        },
++        {
++          "name": "channels",
++          "default": null,
++          "type": "[282]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "107",
++      "members": [
++        {
++          "name": "server",
++          "type": "283"
++        },
++        {
++          "name": "client",
++          "type": "283"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "108",
++      "members": [
++        {
++          "name": "server",
++          "type": "284"
++        },
++        {
++          "name": "client",
++          "type": "282"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "109",
++      "members": [
++        {
++          "name": "server",
++          "type": "283"
++        },
++        {
++          "name": "client",
++          "type": "283"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "110",
++      "members": [
++        {
++          "name": "enabled",
++          "type": "bool"
++        },
++        {
++          "name": "host",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "family",
++          "default": null,
++          "type": "285"
++        },
++        {
++          "name": "service",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "auth",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "clients",
++          "default": null,
++          "type": "[286]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[111]",
++      "element-type": "111",
++      "meta-type": "array"
++    },
++    {
++      "name": "111",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "server",
++          "type": "[287]"
++        },
++        {
++          "name": "clients",
++          "type": "[286]"
++        },
++        {
++          "name": "auth",
++          "type": "288"
++        },
++        {
++          "name": "vencrypt",
++          "default": null,
++          "type": "289"
++        },
++        {
++          "name": "display",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "112",
++      "members": [
++        {
++          "name": "password",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "113",
++      "members": [
++        {
++          "name": "server",
++          "type": "290"
++        },
++        {
++          "name": "client",
++          "type": "291"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "114",
++      "members": [
++        {
++          "name": "server",
++          "type": "290"
++        },
++        {
++          "name": "client",
++          "type": "286"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "115",
++      "members": [
++        {
++          "name": "server",
++          "type": "290"
++        },
++        {
++          "name": "client",
++          "type": "286"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[116]",
++      "element-type": "116",
++      "meta-type": "array"
++    },
++    {
++      "name": "116",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "index",
++          "type": "int"
++        },
++        {
++          "name": "current",
++          "type": "bool"
++        },
++        {
++          "name": "absolute",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "117",
++      "members": [
++        {
++          "name": "keys",
++          "type": "[292]"
++        },
++        {
++          "name": "hold-time",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "118",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "head",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "events",
++          "type": "[293]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "119",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "gtk",
++          "type": "296"
++        },
++        {
++          "case": "egl-headless",
++          "type": "297"
++        },
++        {
++          "case": "default",
++          "type": "0"
++        },
++        {
++          "case": "none",
++          "type": "0"
++        },
++        {
++          "case": "sdl",
++          "type": "0"
++        },
++        {
++          "case": "curses",
++          "type": "0"
++        },
++        {
++          "case": "cocoa",
++          "type": "0"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "294"
++        },
++        {
++          "name": "full-screen",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "window-close",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "gl",
++          "default": null,
++          "type": "295"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "120",
++      "members": [
++        {
++          "name": "status",
++          "default": null,
++          "type": "298"
++        },
++        {
++          "name": "ram",
++          "default": null,
++          "type": "299"
++        },
++        {
++          "name": "disk",
++          "default": null,
++          "type": "299"
++        },
++        {
++          "name": "xbzrle-cache",
++          "default": null,
++          "type": "300"
++        },
++        {
++          "name": "total-time",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "expected-downtime",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "downtime",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "setup-time",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "cpu-throttle-percentage",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "error-desc",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "postcopy-blocktime",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "postcopy-vcpu-blocktime",
++          "default": null,
++          "type": "[int]"
++        },
++        {
++          "name": "compression",
++          "default": null,
++          "type": "301"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "121",
++      "members": [
++        {
++          "name": "capabilities",
++          "type": "[122]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[122]",
++      "element-type": "122",
++      "meta-type": "array"
++    },
++    {
++      "name": "122",
++      "members": [
++        {
++          "name": "capability",
++          "type": "302"
++        },
++        {
++          "name": "state",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "123",
++      "members": [
++        {
++          "name": "compress-level",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "compress-threads",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "compress-wait-thread",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "decompress-threads",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "cpu-throttle-initial",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "cpu-throttle-increment",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "tls-creds",
++          "default": null,
++          "type": "268"
++        },
++        {
++          "name": "tls-hostname",
++          "default": null,
++          "type": "268"
++        },
++        {
++          "name": "max-bandwidth",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "downtime-limit",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "x-checkpoint-delay",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "block-incremental",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "x-multifd-channels",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "x-multifd-page-count",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "xbzrle-cache-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "max-postcopy-bandwidth",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "max-cpu-throttle",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "124",
++      "members": [
++        {
++          "name": "compress-level",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "compress-threads",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "compress-wait-thread",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "decompress-threads",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "cpu-throttle-initial",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "cpu-throttle-increment",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "tls-creds",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "tls-hostname",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "max-bandwidth",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "downtime-limit",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "x-checkpoint-delay",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "block-incremental",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "x-multifd-channels",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "x-multifd-page-count",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "xbzrle-cache-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "max-postcopy-bandwidth",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "max-cpu-throttle",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "125",
++      "members": [
++        {
++          "name": "protocol",
++          "type": "str"
++        },
++        {
++          "name": "hostname",
++          "type": "str"
++        },
++        {
++          "name": "port",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "tls-port",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "cert-subject",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "126",
++      "members": [
++        {
++          "name": "status",
++          "type": "298"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "127",
++      "members": [
++        {
++          "name": "pass",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "128",
++      "members": [
++        {
++          "name": "mode",
++          "type": "303"
++        },
++        {
++          "name": "reason",
++          "type": "304"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "129",
++      "members": [
++        {
++          "name": "state",
++          "type": "298"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "130",
++      "members": [
++        {
++          "name": "value",
++          "type": "number"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "131",
++      "members": [
++        {
++          "name": "value",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "132",
++      "members": [
++        {
++          "name": "value",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "int",
++      "json-type": "int",
++      "meta-type": "builtin"
++    },
++    {
++      "name": "133",
++      "members": [
++        {
++          "name": "uri",
++          "type": "str"
++        },
++        {
++          "name": "blk",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "inc",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "detach",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "resume",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "134",
++      "members": [
++        {
++          "name": "uri",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "135",
++      "members": [
++        {
++          "name": "filename",
++          "type": "str"
++        },
++        {
++          "name": "live",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "136",
++      "members": [
++        {
++          "name": "enable",
++          "type": "bool"
++        },
++        {
++          "name": "primary",
++          "type": "bool"
++        },
++        {
++          "name": "failover",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "137",
++      "members": [
++        {
++          "name": "error",
++          "type": "bool"
++        },
++        {
++          "name": "desc",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "138",
++      "members": [
++        {
++          "name": "mode",
++          "type": "303"
++        },
++        {
++          "name": "reason",
++          "type": "304"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "139",
++      "members": [
++        {
++          "name": "uri",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "140",
++      "members": [
++        {
++          "name": "actions",
++          "type": "[305]"
++        },
++        {
++          "name": "properties",
++          "default": null,
++          "type": "306"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "141",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "vcpu",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[142]",
++      "element-type": "142",
++      "meta-type": "array"
++    },
++    {
++      "name": "142",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "state",
++          "type": "307"
++        },
++        {
++          "name": "vcpu",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "143",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "enable",
++          "type": "bool"
++        },
++        {
++          "name": "ignore-unavailable",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "vcpu",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[144]",
++      "element-type": "144",
++      "meta-type": "array"
++    },
++    {
++      "name": "144",
++      "tag": "meta-type",
++      "variants": [
++        {
++          "case": "builtin",
++          "type": "309"
++        },
++        {
++          "case": "enum",
++          "type": "310"
++        },
++        {
++          "case": "array",
++          "type": "311"
++        },
++        {
++          "case": "object",
++          "type": "312"
++        },
++        {
++          "case": "alternate",
++          "type": "313"
++        },
++        {
++          "case": "command",
++          "type": "314"
++        },
++        {
++          "case": "event",
++          "type": "315"
++        }
++      ],
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "meta-type",
++          "type": "308"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "145",
++      "members": [
++        {
++          "name": "enable",
++          "default": null,
++          "type": "[316]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "146",
++      "members": [
++        {
++          "name": "qemu",
++          "type": "317"
++        },
++        {
++          "name": "package",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[147]",
++      "element-type": "147",
++      "meta-type": "array"
++    },
++    {
++      "name": "147",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "148",
++      "members": [
++        {
++          "name": "protocol",
++          "type": "str"
++        },
++        {
++          "name": "fdname",
++          "type": "str"
++        },
++        {
++          "name": "skipauth",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "tls",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "149",
++      "members": [
++        {
++          "name": "name",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "150",
++      "members": [
++        {
++          "name": "enabled",
++          "type": "bool"
++        },
++        {
++          "name": "present",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "151",
++      "members": [
++        {
++          "name": "UUID",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[152]",
++      "element-type": "152",
++      "meta-type": "array"
++    },
++    {
++      "name": "152",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[153]",
++      "element-type": "153",
++      "meta-type": "array"
++    },
++    {
++      "name": "153",
++      "tag": "arch",
++      "variants": [
++        {
++          "case": "x86",
++          "type": "320"
++        },
++        {
++          "case": "sparc",
++          "type": "321"
++        },
++        {
++          "case": "ppc",
++          "type": "322"
++        },
++        {
++          "case": "mips",
++          "type": "323"
++        },
++        {
++          "case": "tricore",
++          "type": "324"
++        },
++        {
++          "case": "s390",
++          "type": "325"
++        },
++        {
++          "case": "riscv",
++          "type": "326"
++        },
++        {
++          "case": "other",
++          "type": "0"
++        }
++      ],
++      "members": [
++        {
++          "name": "CPU",
++          "type": "int"
++        },
++        {
++          "name": "current",
++          "type": "bool"
++        },
++        {
++          "name": "halted",
++          "type": "bool"
++        },
++        {
++          "name": "qom_path",
++          "type": "str"
++        },
++        {
++          "name": "thread_id",
++          "type": "int"
++        },
++        {
++          "name": "props",
++          "default": null,
++          "type": "318"
++        },
++        {
++          "name": "arch",
++          "type": "319"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[154]",
++      "element-type": "154",
++      "meta-type": "array"
++    },
++    {
++      "name": "154",
++      "tag": "target",
++      "variants": [
++        {
++          "case": "s390x",
++          "type": "325"
++        },
++        {
++          "case": "aarch64",
++          "type": "0"
++        },
++        {
++          "case": "alpha",
++          "type": "0"
++        },
++        {
++          "case": "arm",
++          "type": "0"
++        },
++        {
++          "case": "cris",
++          "type": "0"
++        },
++        {
++          "case": "hppa",
++          "type": "0"
++        },
++        {
++          "case": "i386",
++          "type": "0"
++        },
++        {
++          "case": "lm32",
++          "type": "0"
++        },
++        {
++          "case": "m68k",
++          "type": "0"
++        },
++        {
++          "case": "microblaze",
++          "type": "0"
++        },
++        {
++          "case": "microblazeel",
++          "type": "0"
++        },
++        {
++          "case": "mips",
++          "type": "0"
++        },
++        {
++          "case": "mips64",
++          "type": "0"
++        },
++        {
++          "case": "mips64el",
++          "type": "0"
++        },
++        {
++          "case": "mipsel",
++          "type": "0"
++        },
++        {
++          "case": "moxie",
++          "type": "0"
++        },
++        {
++          "case": "nios2",
++          "type": "0"
++        },
++        {
++          "case": "or1k",
++          "type": "0"
++        },
++        {
++          "case": "ppc",
++          "type": "0"
++        },
++        {
++          "case": "ppc64",
++          "type": "0"
++        },
++        {
++          "case": "riscv32",
++          "type": "0"
++        },
++        {
++          "case": "riscv64",
++          "type": "0"
++        },
++        {
++          "case": "sh4",
++          "type": "0"
++        },
++        {
++          "case": "sh4eb",
++          "type": "0"
++        },
++        {
++          "case": "sparc",
++          "type": "0"
++        },
++        {
++          "case": "sparc64",
++          "type": "0"
++        },
++        {
++          "case": "tricore",
++          "type": "0"
++        },
++        {
++          "case": "unicore32",
++          "type": "0"
++        },
++        {
++          "case": "x86_64",
++          "type": "0"
++        },
++        {
++          "case": "xtensa",
++          "type": "0"
++        },
++        {
++          "case": "xtensaeb",
++          "type": "0"
++        }
++      ],
++      "members": [
++        {
++          "name": "cpu-index",
++          "type": "int"
++        },
++        {
++          "name": "qom-path",
++          "type": "str"
++        },
++        {
++          "name": "thread-id",
++          "type": "int"
++        },
++        {
++          "name": "props",
++          "default": null,
++          "type": "318"
++        },
++        {
++          "name": "arch",
++          "type": "319"
++        },
++        {
++          "name": "target",
++          "type": "327"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[155]",
++      "element-type": "155",
++      "meta-type": "array"
++    },
++    {
++      "name": "155",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "thread-id",
++          "type": "int"
++        },
++        {
++          "name": "poll-max-ns",
++          "type": "int"
++        },
++        {
++          "name": "poll-grow",
++          "type": "int"
++        },
++        {
++          "name": "poll-shrink",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "156",
++      "members": [
++        {
++          "name": "actual",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "157",
++      "members": [
++        {
++          "name": "actual",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[158]",
++      "element-type": "158",
++      "meta-type": "array"
++    },
++    {
++      "name": "158",
++      "members": [
++        {
++          "name": "bus",
++          "type": "int"
++        },
++        {
++          "name": "devices",
++          "type": "[328]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "159",
++      "members": [
++        {
++          "name": "id",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "160",
++      "members": [
++        {
++          "name": "val",
++          "type": "int"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "filename",
++          "type": "str"
++        },
++        {
++          "name": "cpu-index",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "161",
++      "members": [
++        {
++          "name": "val",
++          "type": "int"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "filename",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "162",
++      "members": [
++        {
++          "name": "value",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "163",
++      "members": [
++        {
++          "name": "command-line",
++          "type": "str"
++        },
++        {
++          "name": "cpu-index",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "164",
++      "members": [
++        {
++          "name": "path",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[165]",
++      "element-type": "165",
++      "meta-type": "array"
++    },
++    {
++      "name": "165",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "type",
++          "type": "str"
++        },
++        {
++          "name": "description",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "166",
++      "members": [
++        {
++          "name": "path",
++          "type": "str"
++        },
++        {
++          "name": "property",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "any",
++      "json-type": "value",
++      "meta-type": "builtin"
++    },
++    {
++      "name": "167",
++      "members": [
++        {
++          "name": "path",
++          "type": "str"
++        },
++        {
++          "name": "property",
++          "type": "str"
++        },
++        {
++          "name": "value",
++          "type": "any"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "168",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "target",
++          "type": "str"
++        },
++        {
++          "name": "arg",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "169",
++      "members": [
++        {
++          "name": "implements",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "abstract",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[170]",
++      "element-type": "170",
++      "meta-type": "array"
++    },
++    {
++      "name": "170",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "abstract",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "parent",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "171",
++      "members": [
++        {
++          "name": "typename",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "172",
++      "members": [
++        {
++          "name": "typename",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "173",
++      "members": [
++        {
++          "name": "enable",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "174",
++      "members": [
++        {
++          "name": "driver",
++          "type": "str"
++        },
++        {
++          "name": "bus",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "175",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "176",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "path",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "177",
++      "members": [
++        {
++          "name": "paging",
++          "type": "bool"
++        },
++        {
++          "name": "protocol",
++          "type": "str"
++        },
++        {
++          "name": "detach",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "begin",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "length",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "format",
++          "default": null,
++          "type": "329"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "178",
++      "members": [
++        {
++          "name": "status",
++          "type": "330"
++        },
++        {
++          "name": "completed",
++          "type": "int"
++        },
++        {
++          "name": "total",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "179",
++      "members": [
++        {
++          "name": "result",
++          "type": "178"
++        },
++        {
++          "name": "error",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "180",
++      "members": [
++        {
++          "name": "formats",
++          "type": "[329]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "181",
++      "members": [
++        {
++          "name": "filename",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "182",
++      "members": [
++        {
++          "name": "qom-type",
++          "type": "str"
++        },
++        {
++          "name": "id",
++          "type": "str"
++        },
++        {
++          "name": "props",
++          "default": null,
++          "type": "any"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "183",
++      "members": [
++        {
++          "name": "id",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "184",
++      "members": [
++        {
++          "name": "fdname",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "185",
++      "members": [
++        {
++          "name": "fdname",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[186]",
++      "element-type": "186",
++      "meta-type": "array"
++    },
++    {
++      "name": "186",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "alias",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "is-default",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "cpu-max",
++          "type": "int"
++        },
++        {
++          "name": "hotpluggable-cpus",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "187",
++      "members": [
++        {
++          "name": "base-memory",
++          "type": "int"
++        },
++        {
++          "name": "plugged-memory",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[188]",
++      "element-type": "188",
++      "meta-type": "array"
++    },
++    {
++      "name": "188",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "migration-safe",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "static",
++          "type": "bool"
++        },
++        {
++          "name": "unavailable-features",
++          "default": null,
++          "type": "[str]"
++        },
++        {
++          "name": "typename",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "189",
++      "members": [
++        {
++          "name": "type",
++          "type": "331"
++        },
++        {
++          "name": "model",
++          "type": "332"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "190",
++      "members": [
++        {
++          "name": "model",
++          "type": "332"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "191",
++      "members": [
++        {
++          "name": "modela",
++          "type": "332"
++        },
++        {
++          "name": "modelb",
++          "type": "332"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "192",
++      "members": [
++        {
++          "name": "result",
++          "type": "333"
++        },
++        {
++          "name": "responsible-properties",
++          "type": "[str]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "193",
++      "members": [
++        {
++          "name": "modela",
++          "type": "332"
++        },
++        {
++          "name": "modelb",
++          "type": "332"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "194",
++      "members": [
++        {
++          "name": "model",
++          "type": "332"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "195",
++      "members": [
++        {
++          "name": "fdset-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "opaque",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "196",
++      "members": [
++        {
++          "name": "fdset-id",
++          "type": "int"
++        },
++        {
++          "name": "fd",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "197",
++      "members": [
++        {
++          "name": "fdset-id",
++          "type": "int"
++        },
++        {
++          "name": "fd",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[198]",
++      "element-type": "198",
++      "meta-type": "array"
++    },
++    {
++      "name": "198",
++      "members": [
++        {
++          "name": "fdset-id",
++          "type": "int"
++        },
++        {
++          "name": "fds",
++          "type": "[334]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "199",
++      "members": [
++        {
++          "name": "arch",
++          "type": "327"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "200",
++      "members": [
++        {
++          "name": "option",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[201]",
++      "element-type": "201",
++      "meta-type": "array"
++    },
++    {
++      "name": "201",
++      "members": [
++        {
++          "name": "option",
++          "type": "str"
++        },
++        {
++          "name": "parameters",
++          "type": "[335]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[202]",
++      "element-type": "202",
++      "meta-type": "array"
++    },
++    {
++      "name": "202",
++      "members": [
++        {
++          "name": "id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "merge",
++          "type": "bool"
++        },
++        {
++          "name": "dump",
++          "type": "bool"
++        },
++        {
++          "name": "prealloc",
++          "type": "bool"
++        },
++        {
++          "name": "host-nodes",
++          "type": "[int]"
++        },
++        {
++          "name": "policy",
++          "type": "336"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[203]",
++      "element-type": "203",
++      "meta-type": "array"
++    },
++    {
++      "name": "203",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "dimm",
++          "type": "338"
++        },
++        {
++          "case": "nvdimm",
++          "type": "338"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "337"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "204",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "msg",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[205]",
++      "element-type": "205",
++      "meta-type": "array"
++    },
++    {
++      "name": "205",
++      "members": [
++        {
++          "name": "device",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "slot",
++          "type": "str"
++        },
++        {
++          "name": "slot-type",
++          "type": "339"
++        },
++        {
++          "name": "source",
++          "type": "int"
++        },
++        {
++          "name": "status",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "206",
++      "members": [
++        {
++          "name": "info",
++          "type": "205"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "207",
++      "members": [
++        {
++          "name": "offset",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "208",
++      "members": [
++        {
++          "name": "filename",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[209]",
++      "element-type": "209",
++      "meta-type": "array"
++    },
++    {
++      "name": "209",
++      "members": [
++        {
++          "name": "version",
++          "type": "int"
++        },
++        {
++          "name": "emulated",
++          "type": "bool"
++        },
++        {
++          "name": "kernel",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[210]",
++      "element-type": "210",
++      "meta-type": "array"
++    },
++    {
++      "name": "210",
++      "members": [
++        {
++          "name": "type",
++          "type": "str"
++        },
++        {
++          "name": "vcpus-count",
++          "type": "int"
++        },
++        {
++          "name": "props",
++          "type": "318"
++        },
++        {
++          "name": "qom-path",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "211",
++      "members": [
++        {
++          "name": "guid",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "212",
++      "members": [
++        {
++          "name": "enabled",
++          "type": "bool"
++        },
++        {
++          "name": "api-major",
++          "type": "int"
++        },
++        {
++          "name": "api-minor",
++          "type": "int"
++        },
++        {
++          "name": "build-id",
++          "type": "int"
++        },
++        {
++          "name": "policy",
++          "type": "int"
++        },
++        {
++          "name": "state",
++          "type": "340"
++        },
++        {
++          "name": "handle",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "213",
++      "members": [
++        {
++          "name": "data",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "214",
++      "members": [
++        {
++          "name": "pdh",
++          "type": "str"
++        },
++        {
++          "name": "cert-chain",
++          "type": "str"
++        },
++        {
++          "name": "cbitpos",
++          "type": "int"
++        },
++        {
++          "name": "reduced-phys-bits",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "215",
++      "members": [
++        {
++          "name": "id",
++          "type": "any"
++        },
++        {
++          "name": "reason",
++          "type": "341"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "216",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "node",
++          "type": "343"
++        },
++        {
++          "case": "dist",
++          "type": "344"
++        },
++        {
++          "case": "cpu",
++          "type": "345"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "342"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "bool",
++      "json-type": "boolean",
++      "meta-type": "builtin"
++    },
++    {
++      "name": "217",
++      "meta-type": "enum",
++      "values": [
++        "debug",
++        "inmigrate",
++        "internal-error",
++        "io-error",
++        "paused",
++        "postmigrate",
++        "prelaunch",
++        "finish-migrate",
++        "restore-vm",
++        "running",
++        "save-vm",
++        "shutdown",
++        "suspended",
++        "watchdog",
++        "guest-panicked",
++        "colo",
++        "preconfig"
++      ]
++    },
++    {
++      "name": "218",
++      "meta-type": "enum",
++      "values": [
++        "reset",
++        "shutdown",
++        "poweroff",
++        "pause",
++        "debug",
++        "none",
++        "inject-nmi"
++      ]
++    },
++    {
++      "name": "219",
++      "meta-type": "enum",
++      "values": [
++        "pause",
++        "poweroff"
++      ]
++    },
++    {
++      "name": "220",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "hyper-v",
++          "type": "347"
++        },
++        {
++          "case": "s390",
++          "type": "348"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "346"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "221",
++      "meta-type": "enum",
++      "values": [
++        "undefined",
++        "created",
++        "running",
++        "paused",
++        "ready",
++        "standby",
++        "waiting",
++        "pending",
++        "aborting",
++        "concluded",
++        "null"
++      ]
++    },
++    {
++      "name": "222",
++      "meta-type": "enum",
++      "values": [
++        "commit",
++        "stream",
++        "mirror",
++        "backup",
++        "create"
++      ]
++    },
++    {
++      "name": "[int]",
++      "element-type": "int",
++      "meta-type": "array"
++    },
++    {
++      "name": "223",
++      "meta-type": "enum",
++      "values": [
++        "ok",
++        "failed",
++        "nospace"
++      ]
++    },
++    {
++      "name": "[224]",
++      "element-type": "224",
++      "meta-type": "array"
++    },
++    {
++      "name": "224",
++      "members": [
++        {
++          "name": "name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "count",
++          "type": "int"
++        },
++        {
++          "name": "granularity",
++          "type": "int"
++        },
++        {
++          "name": "status",
++          "type": "349"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "225",
++      "members": [
++        {
++          "name": "rd_bytes",
++          "type": "int"
++        },
++        {
++          "name": "wr_bytes",
++          "type": "int"
++        },
++        {
++          "name": "rd_operations",
++          "type": "int"
++        },
++        {
++          "name": "wr_operations",
++          "type": "int"
++        },
++        {
++          "name": "flush_operations",
++          "type": "int"
++        },
++        {
++          "name": "flush_total_time_ns",
++          "type": "int"
++        },
++        {
++          "name": "wr_total_time_ns",
++          "type": "int"
++        },
++        {
++          "name": "rd_total_time_ns",
++          "type": "int"
++        },
++        {
++          "name": "wr_highest_offset",
++          "type": "int"
++        },
++        {
++          "name": "rd_merged",
++          "type": "int"
++        },
++        {
++          "name": "wr_merged",
++          "type": "int"
++        },
++        {
++          "name": "idle_time_ns",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "failed_rd_operations",
++          "type": "int"
++        },
++        {
++          "name": "failed_wr_operations",
++          "type": "int"
++        },
++        {
++          "name": "failed_flush_operations",
++          "type": "int"
++        },
++        {
++          "name": "invalid_rd_operations",
++          "type": "int"
++        },
++        {
++          "name": "invalid_wr_operations",
++          "type": "int"
++        },
++        {
++          "name": "invalid_flush_operations",
++          "type": "int"
++        },
++        {
++          "name": "account_invalid",
++          "type": "bool"
++        },
++        {
++          "name": "account_failed",
++          "type": "bool"
++        },
++        {
++          "name": "timed_stats",
++          "type": "[350]"
++        },
++        {
++          "name": "x_rd_latency_histogram",
++          "default": null,
++          "type": "351"
++        },
++        {
++          "name": "x_wr_latency_histogram",
++          "default": null,
++          "type": "351"
++        },
++        {
++          "name": "x_flush_latency_histogram",
++          "default": null,
++          "type": "351"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "226",
++      "meta-type": "enum",
++      "values": [
++        "existing",
++        "absolute-paths"
++      ]
++    },
++    {
++      "name": "227",
++      "meta-type": "enum",
++      "values": [
++        "top",
++        "full",
++        "none",
++        "incremental"
++      ]
++    },
++    {
++      "name": "228",
++      "meta-type": "enum",
++      "values": [
++        "report",
++        "ignore",
++        "enospc",
++        "stop",
++        "auto"
++      ]
++    },
++    {
++      "name": "229",
++      "meta-type": "enum",
++      "values": [
++        "off",
++        "on",
++        "unmap"
++      ]
++    },
++    {
++      "name": "230",
++      "members": [
++        {
++          "name": "filename",
++          "type": "str"
++        },
++        {
++          "name": "format",
++          "type": "str"
++        },
++        {
++          "name": "dirty-flag",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "actual-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "virtual-size",
++          "type": "int"
++        },
++        {
++          "name": "cluster-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "encrypted",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "compressed",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "backing-filename",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "full-backing-filename",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "backing-filename-format",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "snapshots",
++          "default": null,
++          "type": "[66]"
++        },
++        {
++          "name": "backing-image",
++          "default": null,
++          "type": "230"
++        },
++        {
++          "name": "format-specific",
++          "default": null,
++          "type": "352"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "231",
++      "members": [
++        {
++          "name": "writeback",
++          "type": "bool"
++        },
++        {
++          "name": "direct",
++          "type": "bool"
++        },
++        {
++          "name": "no-flush",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "232",
++      "meta-type": "enum",
++      "values": [
++        "background",
++        "write-blocking"
++      ]
++    },
++    {
++      "name": "233",
++      "meta-type": "enum",
++      "values": [
++        "blkdebug",
++        "blklogwrites",
++        "blkverify",
++        "bochs",
++        "cloop",
++        "copy-on-read",
++        "dmg",
++        "file",
++        "ftp",
++        "ftps",
++        "gluster",
++        "host_cdrom",
++        "host_device",
++        "http",
++        "https",
++        "iscsi",
++        "luks",
++        "nbd",
++        "nfs",
++        "null-aio",
++        "null-co",
++        "nvme",
++        "parallels",
++        "qcow",
++        "qcow2",
++        "qed",
++        "quorum",
++        "raw",
++        "rbd",
++        "replication",
++        "sheepdog",
++        "ssh",
++        "throttle",
++        "vdi",
++        "vhdx",
++        "vmdk",
++        "vpc",
++        "vvfat",
++        "vxhs"
++      ]
++    },
++    {
++      "name": "234",
++      "meta-type": "enum",
++      "values": [
++        "ignore",
++        "unmap"
++      ]
++    },
++    {
++      "name": "235",
++      "members": [
++        {
++          "name": "direct",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "no-flush",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "236",
++      "members": [
++        {
++          "name": "image",
++          "type": "353"
++        },
++        {
++          "name": "config",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "align",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "max-transfer",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "opt-write-zero",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "max-write-zero",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "opt-discard",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "max-discard",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "inject-error",
++          "default": null,
++          "type": "[354]"
++        },
++        {
++          "name": "set-state",
++          "default": null,
++          "type": "[355]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "237",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "log",
++          "type": "353"
++        },
++        {
++          "name": "log-sector-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "log-append",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "log-super-update-interval",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "238",
++      "members": [
++        {
++          "name": "test",
++          "type": "353"
++        },
++        {
++          "name": "raw",
++          "type": "353"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "239",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "240",
++      "members": [
++        {
++          "name": "filename",
++          "type": "str"
++        },
++        {
++          "name": "pr-manager",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "locking",
++          "default": null,
++          "type": "356"
++        },
++        {
++          "name": "aio",
++          "default": null,
++          "type": "357"
++        },
++        {
++          "name": "x-check-cache-dropped",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "241",
++      "members": [
++        {
++          "name": "url",
++          "type": "str"
++        },
++        {
++          "name": "readahead",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "timeout",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "username",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "password-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "proxy-username",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "proxy-password-secret",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "242",
++      "members": [
++        {
++          "name": "url",
++          "type": "str"
++        },
++        {
++          "name": "readahead",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "timeout",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "username",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "password-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "proxy-username",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "proxy-password-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "sslverify",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "243",
++      "members": [
++        {
++          "name": "volume",
++          "type": "str"
++        },
++        {
++          "name": "path",
++          "type": "str"
++        },
++        {
++          "name": "server",
++          "type": "[358]"
++        },
++        {
++          "name": "debug",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "244",
++      "members": [
++        {
++          "name": "url",
++          "type": "str"
++        },
++        {
++          "name": "readahead",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "timeout",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "username",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "password-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "proxy-username",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "proxy-password-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "cookie",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "cookie-secret",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "245",
++      "members": [
++        {
++          "name": "url",
++          "type": "str"
++        },
++        {
++          "name": "readahead",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "timeout",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "username",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "password-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "proxy-username",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "proxy-password-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "cookie",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "sslverify",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "cookie-secret",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "246",
++      "members": [
++        {
++          "name": "transport",
++          "type": "359"
++        },
++        {
++          "name": "portal",
++          "type": "str"
++        },
++        {
++          "name": "target",
++          "type": "str"
++        },
++        {
++          "name": "lun",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "user",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "password-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "initiator-name",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "header-digest",
++          "default": null,
++          "type": "360"
++        },
++        {
++          "name": "timeout",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "247",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "key-secret",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "248",
++      "members": [
++        {
++          "name": "server",
++          "type": "358"
++        },
++        {
++          "name": "export",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "tls-creds",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "x-dirty-bitmap",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "249",
++      "members": [
++        {
++          "name": "server",
++          "type": "361"
++        },
++        {
++          "name": "path",
++          "type": "str"
++        },
++        {
++          "name": "user",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "group",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "tcp-syn-count",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "readahead-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "page-cache-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "debug",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "250",
++      "members": [
++        {
++          "name": "size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "latency-ns",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "251",
++      "members": [
++        {
++          "name": "device",
++          "type": "str"
++        },
++        {
++          "name": "namespace",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "252",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "backing",
++          "default": null,
++          "type": "362"
++        },
++        {
++          "name": "lazy-refcounts",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "pass-discard-request",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "pass-discard-snapshot",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "pass-discard-other",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "overlap-check",
++          "default": null,
++          "type": "363"
++        },
++        {
++          "name": "cache-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "l2-cache-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "l2-cache-entry-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "refcount-cache-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "cache-clean-interval",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "encrypt",
++          "default": null,
++          "type": "364"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "253",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "backing",
++          "default": null,
++          "type": "362"
++        },
++        {
++          "name": "encrypt",
++          "default": null,
++          "type": "365"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "254",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "backing",
++          "default": null,
++          "type": "362"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "255",
++      "members": [
++        {
++          "name": "blkverify",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "children",
++          "type": "[353]"
++        },
++        {
++          "name": "vote-threshold",
++          "type": "int"
++        },
++        {
++          "name": "rewrite-corrupted",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "read-pattern",
++          "default": null,
++          "type": "366"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "256",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "offset",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "size",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "257",
++      "members": [
++        {
++          "name": "pool",
++          "type": "str"
++        },
++        {
++          "name": "image",
++          "type": "str"
++        },
++        {
++          "name": "conf",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "snapshot",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "user",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "auth-client-required",
++          "default": null,
++          "type": "[367]"
++        },
++        {
++          "name": "key-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "server",
++          "default": null,
++          "type": "[368]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "258",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "mode",
++          "type": "369"
++        },
++        {
++          "name": "top-id",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "259",
++      "members": [
++        {
++          "name": "server",
++          "type": "358"
++        },
++        {
++          "name": "vdi",
++          "type": "str"
++        },
++        {
++          "name": "snap-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "tag",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "260",
++      "members": [
++        {
++          "name": "server",
++          "type": "370"
++        },
++        {
++          "name": "path",
++          "type": "str"
++        },
++        {
++          "name": "user",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "host-key-check",
++          "default": null,
++          "type": "371"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "261",
++      "members": [
++        {
++          "name": "throttle-group",
++          "type": "str"
++        },
++        {
++          "name": "file",
++          "type": "353"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "262",
++      "members": [
++        {
++          "name": "dir",
++          "type": "str"
++        },
++        {
++          "name": "fat-type",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "floppy",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "label",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "rw",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "263",
++      "members": [
++        {
++          "name": "vdisk-id",
++          "type": "str"
++        },
++        {
++          "name": "server",
++          "type": "368"
++        },
++        {
++          "name": "tls-creds",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "264",
++      "tag": "driver",
++      "variants": [
++        {
++          "case": "file",
++          "type": "372"
++        },
++        {
++          "case": "gluster",
++          "type": "373"
++        },
++        {
++          "case": "luks",
++          "type": "374"
++        },
++        {
++          "case": "nfs",
++          "type": "375"
++        },
++        {
++          "case": "parallels",
++          "type": "376"
++        },
++        {
++          "case": "qcow",
++          "type": "377"
++        },
++        {
++          "case": "qcow2",
++          "type": "378"
++        },
++        {
++          "case": "qed",
++          "type": "379"
++        },
++        {
++          "case": "rbd",
++          "type": "380"
++        },
++        {
++          "case": "sheepdog",
++          "type": "381"
++        },
++        {
++          "case": "ssh",
++          "type": "382"
++        },
++        {
++          "case": "vdi",
++          "type": "383"
++        },
++        {
++          "case": "vhdx",
++          "type": "384"
++        },
++        {
++          "case": "vpc",
++          "type": "385"
++        },
++        {
++          "case": "blkdebug",
++          "type": "0"
++        },
++        {
++          "case": "blklogwrites",
++          "type": "0"
++        },
++        {
++          "case": "blkverify",
++          "type": "0"
++        },
++        {
++          "case": "bochs",
++          "type": "0"
++        },
++        {
++          "case": "cloop",
++          "type": "0"
++        },
++        {
++          "case": "copy-on-read",
++          "type": "0"
++        },
++        {
++          "case": "dmg",
++          "type": "0"
++        },
++        {
++          "case": "ftp",
++          "type": "0"
++        },
++        {
++          "case": "ftps",
++          "type": "0"
++        },
++        {
++          "case": "host_cdrom",
++          "type": "0"
++        },
++        {
++          "case": "host_device",
++          "type": "0"
++        },
++        {
++          "case": "http",
++          "type": "0"
++        },
++        {
++          "case": "https",
++          "type": "0"
++        },
++        {
++          "case": "iscsi",
++          "type": "0"
++        },
++        {
++          "case": "nbd",
++          "type": "0"
++        },
++        {
++          "case": "null-aio",
++          "type": "0"
++        },
++        {
++          "case": "null-co",
++          "type": "0"
++        },
++        {
++          "case": "nvme",
++          "type": "0"
++        },
++        {
++          "case": "quorum",
++          "type": "0"
++        },
++        {
++          "case": "raw",
++          "type": "0"
++        },
++        {
++          "case": "replication",
++          "type": "0"
++        },
++        {
++          "case": "throttle",
++          "type": "0"
++        },
++        {
++          "case": "vmdk",
++          "type": "0"
++        },
++        {
++          "case": "vvfat",
++          "type": "0"
++        },
++        {
++          "case": "vxhs",
++          "type": "0"
++        }
++      ],
++      "members": [
++        {
++          "name": "driver",
++          "type": "233"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "265",
++      "meta-type": "enum",
++      "values": [
++        "retain",
++        "read-only",
++        "read-write"
++      ]
++    },
++    {
++      "name": "266",
++      "meta-type": "enum",
++      "values": [
++        "read",
++        "write"
++      ]
++    },
++    {
++      "name": "267",
++      "meta-type": "enum",
++      "values": [
++        "ignore",
++        "report",
++        "stop"
++      ]
++    },
++    {
++      "name": "268",
++      "members": [
++        {
++          "type": "str"
++        },
++        {
++          "type": "null"
++        }
++      ],
++      "meta-type": "alternate"
++    },
++    {
++      "name": "269",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "inet",
++          "type": "387"
++        },
++        {
++          "case": "unix",
++          "type": "388"
++        },
++        {
++          "case": "vsock",
++          "type": "389"
++        },
++        {
++          "case": "fd",
++          "type": "390"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "386"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "270",
++      "meta-type": "enum",
++      "values": [
++        "safe",
++        "hard"
++      ]
++    },
++    {
++      "name": "271",
++      "meta-type": "enum",
++      "values": [
++        "read",
++        "write",
++        "flush"
++      ]
++    },
++    {
++      "name": "272",
++      "meta-type": "enum",
++      "values": [
++        "utf8",
++        "base64"
++      ]
++    },
++    {
++      "name": "273",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "file",
++          "type": "392"
++        },
++        {
++          "case": "serial",
++          "type": "393"
++        },
++        {
++          "case": "parallel",
++          "type": "393"
++        },
++        {
++          "case": "pipe",
++          "type": "393"
++        },
++        {
++          "case": "socket",
++          "type": "394"
++        },
++        {
++          "case": "udp",
++          "type": "395"
++        },
++        {
++          "case": "pty",
++          "type": "396"
++        },
++        {
++          "case": "null",
++          "type": "396"
++        },
++        {
++          "case": "mux",
++          "type": "397"
++        },
++        {
++          "case": "msmouse",
++          "type": "396"
++        },
++        {
++          "case": "wctablet",
++          "type": "396"
++        },
++        {
++          "case": "braille",
++          "type": "396"
++        },
++        {
++          "case": "testdev",
++          "type": "396"
++        },
++        {
++          "case": "stdio",
++          "type": "398"
++        },
++        {
++          "case": "console",
++          "type": "396"
++        },
++        {
++          "case": "spicevmc",
++          "type": "399"
++        },
++        {
++          "case": "spiceport",
++          "type": "400"
++        },
++        {
++          "case": "vc",
++          "type": "401"
++        },
++        {
++          "case": "ringbuf",
++          "type": "402"
++        },
++        {
++          "case": "memory",
++          "type": "402"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "391"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "274",
++      "meta-type": "enum",
++      "values": [
++        "normal",
++        "none",
++        "all"
++      ]
++    },
++    {
++      "name": "[str]",
++      "element-type": "str",
++      "meta-type": "array"
++    },
++    {
++      "name": "275",
++      "meta-type": "enum",
++      "values": [
++        "half",
++        "full"
++      ]
++    },
++    {
++      "name": "276",
++      "meta-type": "enum",
++      "values": [
++        "off",
++        "on"
++      ]
++    },
++    {
++      "name": "277",
++      "members": [
++        {
++          "name": "priority",
++          "type": "int"
++        },
++        {
++          "name": "tbl-id",
++          "type": "int"
++        },
++        {
++          "name": "in-pport",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "tunnel-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "vlan-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "eth-type",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "eth-src",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "eth-dst",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "ip-proto",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "ip-tos",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "ip-dst",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "278",
++      "members": [
++        {
++          "name": "in-pport",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "tunnel-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "vlan-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "eth-src",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "eth-dst",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "ip-proto",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "ip-tos",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "279",
++      "members": [
++        {
++          "name": "goto-tbl",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "group-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "tunnel-lport",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "vlan-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "new-vlan-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "out-pport",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "280",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "passthrough",
++          "type": "404"
++        },
++        {
++          "case": "emulator",
++          "type": "405"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "403"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "281",
++      "meta-type": "enum",
++      "values": [
++        "client",
++        "server",
++        "unknown"
++      ]
++    },
++    {
++      "name": "[282]",
++      "element-type": "282",
++      "meta-type": "array"
++    },
++    {
++      "name": "282",
++      "members": [
++        {
++          "name": "host",
++          "type": "str"
++        },
++        {
++          "name": "port",
++          "type": "str"
++        },
++        {
++          "name": "family",
++          "type": "285"
++        },
++        {
++          "name": "connection-id",
++          "type": "int"
++        },
++        {
++          "name": "channel-type",
++          "type": "int"
++        },
++        {
++          "name": "channel-id",
++          "type": "int"
++        },
++        {
++          "name": "tls",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "283",
++      "members": [
++        {
++          "name": "host",
++          "type": "str"
++        },
++        {
++          "name": "port",
++          "type": "str"
++        },
++        {
++          "name": "family",
++          "type": "285"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "284",
++      "members": [
++        {
++          "name": "host",
++          "type": "str"
++        },
++        {
++          "name": "port",
++          "type": "str"
++        },
++        {
++          "name": "family",
++          "type": "285"
++        },
++        {
++          "name": "auth",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "285",
++      "meta-type": "enum",
++      "values": [
++        "ipv4",
++        "ipv6",
++        "unix",
++        "vsock",
++        "unknown"
++      ]
++    },
++    {
++      "name": "[286]",
++      "element-type": "286",
++      "meta-type": "array"
++    },
++    {
++      "name": "286",
++      "members": [
++        {
++          "name": "host",
++          "type": "str"
++        },
++        {
++          "name": "service",
++          "type": "str"
++        },
++        {
++          "name": "family",
++          "type": "285"
++        },
++        {
++          "name": "websocket",
++          "type": "bool"
++        },
++        {
++          "name": "x509_dname",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "sasl_username",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[287]",
++      "element-type": "287",
++      "meta-type": "array"
++    },
++    {
++      "name": "287",
++      "members": [
++        {
++          "name": "host",
++          "type": "str"
++        },
++        {
++          "name": "service",
++          "type": "str"
++        },
++        {
++          "name": "family",
++          "type": "285"
++        },
++        {
++          "name": "websocket",
++          "type": "bool"
++        },
++        {
++          "name": "auth",
++          "type": "288"
++        },
++        {
++          "name": "vencrypt",
++          "default": null,
++          "type": "289"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "288",
++      "meta-type": "enum",
++      "values": [
++        "none",
++        "vnc",
++        "ra2",
++        "ra2ne",
++        "tight",
++        "ultra",
++        "tls",
++        "vencrypt",
++        "sasl"
++      ]
++    },
++    {
++      "name": "289",
++      "meta-type": "enum",
++      "values": [
++        "plain",
++        "tls-none",
++        "x509-none",
++        "tls-vnc",
++        "x509-vnc",
++        "tls-plain",
++        "x509-plain",
++        "tls-sasl",
++        "x509-sasl"
++      ]
++    },
++    {
++      "name": "290",
++      "members": [
++        {
++          "name": "host",
++          "type": "str"
++        },
++        {
++          "name": "service",
++          "type": "str"
++        },
++        {
++          "name": "family",
++          "type": "285"
++        },
++        {
++          "name": "websocket",
++          "type": "bool"
++        },
++        {
++          "name": "auth",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "291",
++      "members": [
++        {
++          "name": "host",
++          "type": "str"
++        },
++        {
++          "name": "service",
++          "type": "str"
++        },
++        {
++          "name": "family",
++          "type": "285"
++        },
++        {
++          "name": "websocket",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[292]",
++      "element-type": "292",
++      "meta-type": "array"
++    },
++    {
++      "name": "292",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "number",
++          "type": "407"
++        },
++        {
++          "case": "qcode",
++          "type": "408"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "406"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[293]",
++      "element-type": "293",
++      "meta-type": "array"
++    },
++    {
++      "name": "293",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "key",
++          "type": "410"
++        },
++        {
++          "case": "btn",
++          "type": "411"
++        },
++        {
++          "case": "rel",
++          "type": "412"
++        },
++        {
++          "case": "abs",
++          "type": "412"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "409"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "294",
++      "meta-type": "enum",
++      "values": [
++        "default",
++        "none",
++        "gtk",
++        "sdl",
++        "egl-headless",
++        "curses",
++        "cocoa"
++      ]
++    },
++    {
++      "name": "295",
++      "meta-type": "enum",
++      "values": [
++        "off",
++        "on",
++        "core",
++        "es"
++      ]
++    },
++    {
++      "name": "296",
++      "members": [
++        {
++          "name": "grab-on-hover",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "zoom-to-fit",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "297",
++      "members": [
++        {
++          "name": "rendernode",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "298",
++      "meta-type": "enum",
++      "values": [
++        "none",
++        "setup",
++        "cancelling",
++        "cancelled",
++        "active",
++        "postcopy-active",
++        "postcopy-paused",
++        "postcopy-recover",
++        "completed",
++        "failed",
++        "colo",
++        "pre-switchover",
++        "device"
++      ]
++    },
++    {
++      "name": "299",
++      "members": [
++        {
++          "name": "transferred",
++          "type": "int"
++        },
++        {
++          "name": "remaining",
++          "type": "int"
++        },
++        {
++          "name": "total",
++          "type": "int"
++        },
++        {
++          "name": "duplicate",
++          "type": "int"
++        },
++        {
++          "name": "skipped",
++          "type": "int"
++        },
++        {
++          "name": "normal",
++          "type": "int"
++        },
++        {
++          "name": "normal-bytes",
++          "type": "int"
++        },
++        {
++          "name": "dirty-pages-rate",
++          "type": "int"
++        },
++        {
++          "name": "mbps",
++          "type": "number"
++        },
++        {
++          "name": "dirty-sync-count",
++          "type": "int"
++        },
++        {
++          "name": "postcopy-requests",
++          "type": "int"
++        },
++        {
++          "name": "page-size",
++          "type": "int"
++        },
++        {
++          "name": "multifd-bytes",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "300",
++      "members": [
++        {
++          "name": "cache-size",
++          "type": "int"
++        },
++        {
++          "name": "bytes",
++          "type": "int"
++        },
++        {
++          "name": "pages",
++          "type": "int"
++        },
++        {
++          "name": "cache-miss",
++          "type": "int"
++        },
++        {
++          "name": "cache-miss-rate",
++          "type": "number"
++        },
++        {
++          "name": "overflow",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "301",
++      "members": [
++        {
++          "name": "pages",
++          "type": "int"
++        },
++        {
++          "name": "busy",
++          "type": "int"
++        },
++        {
++          "name": "busy-rate",
++          "type": "number"
++        },
++        {
++          "name": "compressed-size",
++          "type": "int"
++        },
++        {
++          "name": "compression-rate",
++          "type": "number"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "302",
++      "meta-type": "enum",
++      "values": [
++        "xbzrle",
++        "rdma-pin-all",
++        "auto-converge",
++        "zero-blocks",
++        "compress",
++        "events",
++        "postcopy-ram",
++        "x-colo",
++        "release-ram",
++        "block",
++        "return-path",
++        "pause-before-switchover",
++        "x-multifd",
++        "dirty-bitmaps",
++        "postcopy-blocktime",
++        "late-block-activate"
++      ]
++    },
++    {
++      "name": "303",
++      "meta-type": "enum",
++      "values": [
++        "none",
++        "primary",
++        "secondary"
++      ]
++    },
++    {
++      "name": "304",
++      "meta-type": "enum",
++      "values": [
++        "none",
++        "request",
++        "error"
++      ]
++    },
++    {
++      "name": "number",
++      "json-type": "number",
++      "meta-type": "builtin"
++    },
++    {
++      "name": "[305]",
++      "element-type": "305",
++      "meta-type": "array"
++    },
++    {
++      "name": "305",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "abort",
++          "type": "414"
++        },
++        {
++          "case": "block-dirty-bitmap-add",
++          "type": "415"
++        },
++        {
++          "case": "block-dirty-bitmap-clear",
++          "type": "416"
++        },
++        {
++          "case": "x-block-dirty-bitmap-enable",
++          "type": "416"
++        },
++        {
++          "case": "x-block-dirty-bitmap-disable",
++          "type": "416"
++        },
++        {
++          "case": "x-block-dirty-bitmap-merge",
++          "type": "417"
++        },
++        {
++          "case": "blockdev-backup",
++          "type": "418"
++        },
++        {
++          "case": "blockdev-snapshot",
++          "type": "419"
++        },
++        {
++          "case": "blockdev-snapshot-internal-sync",
++          "type": "420"
++        },
++        {
++          "case": "blockdev-snapshot-sync",
++          "type": "421"
++        },
++        {
++          "case": "drive-backup",
++          "type": "422"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "413"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "306",
++      "members": [
++        {
++          "name": "completion-mode",
++          "default": null,
++          "type": "423"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "307",
++      "meta-type": "enum",
++      "values": [
++        "unavailable",
++        "disabled",
++        "enabled"
++      ]
++    },
++    {
++      "name": "308",
++      "meta-type": "enum",
++      "values": [
++        "builtin",
++        "enum",
++        "array",
++        "object",
++        "alternate",
++        "command",
++        "event"
++      ]
++    },
++    {
++      "name": "309",
++      "members": [
++        {
++          "name": "json-type",
++          "type": "424"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "310",
++      "members": [
++        {
++          "name": "values",
++          "type": "[str]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "311",
++      "members": [
++        {
++          "name": "element-type",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "312",
++      "members": [
++        {
++          "name": "members",
++          "type": "[425]"
++        },
++        {
++          "name": "tag",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "variants",
++          "default": null,
++          "type": "[426]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "313",
++      "members": [
++        {
++          "name": "members",
++          "type": "[427]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "314",
++      "members": [
++        {
++          "name": "arg-type",
++          "type": "str"
++        },
++        {
++          "name": "ret-type",
++          "type": "str"
++        },
++        {
++          "name": "allow-oob",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "315",
++      "members": [
++        {
++          "name": "arg-type",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[316]",
++      "element-type": "316",
++      "meta-type": "array"
++    },
++    {
++      "name": "316",
++      "meta-type": "enum",
++      "values": [
++        "oob"
++      ]
++    },
++    {
++      "name": "317",
++      "members": [
++        {
++          "name": "major",
++          "type": "int"
++        },
++        {
++          "name": "minor",
++          "type": "int"
++        },
++        {
++          "name": "micro",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "318",
++      "members": [
++        {
++          "name": "node-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "socket-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "core-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "thread-id",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "319",
++      "meta-type": "enum",
++      "values": [
++        "x86",
++        "sparc",
++        "ppc",
++        "mips",
++        "tricore",
++        "s390",
++        "riscv",
++        "other"
++      ]
++    },
++    {
++      "name": "320",
++      "members": [
++        {
++          "name": "pc",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "321",
++      "members": [
++        {
++          "name": "pc",
++          "type": "int"
++        },
++        {
++          "name": "npc",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "322",
++      "members": [
++        {
++          "name": "nip",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "323",
++      "members": [
++        {
++          "name": "PC",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "324",
++      "members": [
++        {
++          "name": "PC",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "325",
++      "members": [
++        {
++          "name": "cpu-state",
++          "type": "428"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "326",
++      "members": [
++        {
++          "name": "pc",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "327",
++      "meta-type": "enum",
++      "values": [
++        "aarch64",
++        "alpha",
++        "arm",
++        "cris",
++        "hppa",
++        "i386",
++        "lm32",
++        "m68k",
++        "microblaze",
++        "microblazeel",
++        "mips",
++        "mips64",
++        "mips64el",
++        "mipsel",
++        "moxie",
++        "nios2",
++        "or1k",
++        "ppc",
++        "ppc64",
++        "riscv32",
++        "riscv64",
++        "s390x",
++        "sh4",
++        "sh4eb",
++        "sparc",
++        "sparc64",
++        "tricore",
++        "unicore32",
++        "x86_64",
++        "xtensa",
++        "xtensaeb"
++      ]
++    },
++    {
++      "name": "[328]",
++      "element-type": "328",
++      "meta-type": "array"
++    },
++    {
++      "name": "328",
++      "members": [
++        {
++          "name": "bus",
++          "type": "int"
++        },
++        {
++          "name": "slot",
++          "type": "int"
++        },
++        {
++          "name": "function",
++          "type": "int"
++        },
++        {
++          "name": "class_info",
++          "type": "429"
++        },
++        {
++          "name": "id",
++          "type": "430"
++        },
++        {
++          "name": "irq",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "qdev_id",
++          "type": "str"
++        },
++        {
++          "name": "pci_bridge",
++          "default": null,
++          "type": "431"
++        },
++        {
++          "name": "regions",
++          "type": "[432]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "329",
++      "meta-type": "enum",
++      "values": [
++        "elf",
++        "kdump-zlib",
++        "kdump-lzo",
++        "kdump-snappy",
++        "win-dmp"
++      ]
++    },
++    {
++      "name": "330",
++      "meta-type": "enum",
++      "values": [
++        "none",
++        "active",
++        "completed",
++        "failed"
++      ]
++    },
++    {
++      "name": "[329]",
++      "element-type": "329",
++      "meta-type": "array"
++    },
++    {
++      "name": "331",
++      "meta-type": "enum",
++      "values": [
++        "static",
++        "full"
++      ]
++    },
++    {
++      "name": "332",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "props",
++          "default": null,
++          "type": "any"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "333",
++      "meta-type": "enum",
++      "values": [
++        "incompatible",
++        "identical",
++        "superset",
++        "subset"
++      ]
++    },
++    {
++      "name": "[334]",
++      "element-type": "334",
++      "meta-type": "array"
++    },
++    {
++      "name": "334",
++      "members": [
++        {
++          "name": "fd",
++          "type": "int"
++        },
++        {
++          "name": "opaque",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[335]",
++      "element-type": "335",
++      "meta-type": "array"
++    },
++    {
++      "name": "335",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "type",
++          "type": "433"
++        },
++        {
++          "name": "help",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "default",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "336",
++      "meta-type": "enum",
++      "values": [
++        "default",
++        "preferred",
++        "bind",
++        "interleave"
++      ]
++    },
++    {
++      "name": "337",
++      "meta-type": "enum",
++      "values": [
++        "dimm",
++        "nvdimm"
++      ]
++    },
++    {
++      "name": "338",
++      "members": [
++        {
++          "name": "data",
++          "type": "434"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "339",
++      "meta-type": "enum",
++      "values": [
++        "DIMM",
++        "CPU"
++      ]
++    },
++    {
++      "name": "340",
++      "meta-type": "enum",
++      "values": [
++        "uninit",
++        "launch-update",
++        "launch-secret",
++        "running",
++        "send-update",
++        "receive-update"
++      ]
++    },
++    {
++      "name": "341",
++      "meta-type": "enum",
++      "values": [
++        "queue-full"
++      ]
++    },
++    {
++      "name": "342",
++      "meta-type": "enum",
++      "values": [
++        "node",
++        "dist",
++        "cpu"
++      ]
++    },
++    {
++      "name": "343",
++      "members": [
++        {
++          "name": "nodeid",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "cpus",
++          "default": null,
++          "type": "[int]"
++        },
++        {
++          "name": "mem",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "memdev",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "344",
++      "members": [
++        {
++          "name": "src",
++          "type": "int"
++        },
++        {
++          "name": "dst",
++          "type": "int"
++        },
++        {
++          "name": "val",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "345",
++      "members": [
++        {
++          "name": "node-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "socket-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "core-id",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "thread-id",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "346",
++      "meta-type": "enum",
++      "values": [
++        "hyper-v",
++        "s390"
++      ]
++    },
++    {
++      "name": "347",
++      "members": [
++        {
++          "name": "arg1",
++          "type": "int"
++        },
++        {
++          "name": "arg2",
++          "type": "int"
++        },
++        {
++          "name": "arg3",
++          "type": "int"
++        },
++        {
++          "name": "arg4",
++          "type": "int"
++        },
++        {
++          "name": "arg5",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "348",
++      "members": [
++        {
++          "name": "core",
++          "type": "int"
++        },
++        {
++          "name": "psw-mask",
++          "type": "int"
++        },
++        {
++          "name": "psw-addr",
++          "type": "int"
++        },
++        {
++          "name": "reason",
++          "type": "435"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "349",
++      "meta-type": "enum",
++      "values": [
++        "active",
++        "disabled",
++        "frozen",
++        "locked"
++      ]
++    },
++    {
++      "name": "[350]",
++      "element-type": "350",
++      "meta-type": "array"
++    },
++    {
++      "name": "350",
++      "members": [
++        {
++          "name": "interval_length",
++          "type": "int"
++        },
++        {
++          "name": "min_rd_latency_ns",
++          "type": "int"
++        },
++        {
++          "name": "max_rd_latency_ns",
++          "type": "int"
++        },
++        {
++          "name": "avg_rd_latency_ns",
++          "type": "int"
++        },
++        {
++          "name": "min_wr_latency_ns",
++          "type": "int"
++        },
++        {
++          "name": "max_wr_latency_ns",
++          "type": "int"
++        },
++        {
++          "name": "avg_wr_latency_ns",
++          "type": "int"
++        },
++        {
++          "name": "min_flush_latency_ns",
++          "type": "int"
++        },
++        {
++          "name": "max_flush_latency_ns",
++          "type": "int"
++        },
++        {
++          "name": "avg_flush_latency_ns",
++          "type": "int"
++        },
++        {
++          "name": "avg_rd_queue_depth",
++          "type": "number"
++        },
++        {
++          "name": "avg_wr_queue_depth",
++          "type": "number"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "351",
++      "members": [
++        {
++          "name": "boundaries",
++          "type": "[int]"
++        },
++        {
++          "name": "bins",
++          "type": "[int]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[66]",
++      "element-type": "66",
++      "meta-type": "array"
++    },
++    {
++      "name": "352",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "qcow2",
++          "type": "437"
++        },
++        {
++          "case": "vmdk",
++          "type": "438"
++        },
++        {
++          "case": "luks",
++          "type": "439"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "436"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "353",
++      "members": [
++        {
++          "type": "44"
++        },
++        {
++          "type": "str"
++        }
++      ],
++      "meta-type": "alternate"
++    },
++    {
++      "name": "[354]",
++      "element-type": "354",
++      "meta-type": "array"
++    },
++    {
++      "name": "354",
++      "members": [
++        {
++          "name": "event",
++          "type": "440"
++        },
++        {
++          "name": "state",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "errno",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "sector",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "once",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "immediately",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[355]",
++      "element-type": "355",
++      "meta-type": "array"
++    },
++    {
++      "name": "355",
++      "members": [
++        {
++          "name": "event",
++          "type": "440"
++        },
++        {
++          "name": "state",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "new_state",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "356",
++      "meta-type": "enum",
++      "values": [
++        "auto",
++        "on",
++        "off"
++      ]
++    },
++    {
++      "name": "357",
++      "meta-type": "enum",
++      "values": [
++        "threads",
++        "native"
++      ]
++    },
++    {
++      "name": "[358]",
++      "element-type": "358",
++      "meta-type": "array"
++    },
++    {
++      "name": "358",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "inet",
++          "type": "370"
++        },
++        {
++          "case": "unix",
++          "type": "442"
++        },
++        {
++          "case": "vsock",
++          "type": "443"
++        },
++        {
++          "case": "fd",
++          "type": "444"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "441"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "359",
++      "meta-type": "enum",
++      "values": [
++        "tcp",
++        "iser"
++      ]
++    },
++    {
++      "name": "360",
++      "meta-type": "enum",
++      "values": [
++        "crc32c",
++        "none",
++        "crc32c-none",
++        "none-crc32c"
++      ]
++    },
++    {
++      "name": "361",
++      "members": [
++        {
++          "name": "type",
++          "type": "445"
++        },
++        {
++          "name": "host",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "362",
++      "members": [
++        {
++          "type": "44"
++        },
++        {
++          "type": "str"
++        },
++        {
++          "type": "null"
++        }
++      ],
++      "meta-type": "alternate"
++    },
++    {
++      "name": "363",
++      "members": [
++        {
++          "type": "446"
++        },
++        {
++          "type": "447"
++        }
++      ],
++      "meta-type": "alternate"
++    },
++    {
++      "name": "364",
++      "tag": "format",
++      "variants": [
++        {
++          "case": "aes",
++          "type": "449"
++        },
++        {
++          "case": "luks",
++          "type": "450"
++        }
++      ],
++      "members": [
++        {
++          "name": "format",
++          "type": "448"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "365",
++      "tag": "format",
++      "variants": [
++        {
++          "case": "aes",
++          "type": "449"
++        }
++      ],
++      "members": [
++        {
++          "name": "format",
++          "type": "451"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[353]",
++      "element-type": "353",
++      "meta-type": "array"
++    },
++    {
++      "name": "366",
++      "meta-type": "enum",
++      "values": [
++        "quorum",
++        "fifo"
++      ]
++    },
++    {
++      "name": "[367]",
++      "element-type": "367",
++      "meta-type": "array"
++    },
++    {
++      "name": "367",
++      "meta-type": "enum",
++      "values": [
++        "cephx",
++        "none"
++      ]
++    },
++    {
++      "name": "[368]",
++      "element-type": "368",
++      "meta-type": "array"
++    },
++    {
++      "name": "368",
++      "members": [
++        {
++          "name": "host",
++          "type": "str"
++        },
++        {
++          "name": "port",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "369",
++      "meta-type": "enum",
++      "values": [
++        "primary",
++        "secondary"
++      ]
++    },
++    {
++      "name": "370",
++      "members": [
++        {
++          "name": "host",
++          "type": "str"
++        },
++        {
++          "name": "port",
++          "type": "str"
++        },
++        {
++          "name": "numeric",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "to",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "ipv4",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "ipv6",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "371",
++      "tag": "mode",
++      "variants": [
++        {
++          "case": "hash",
++          "type": "453"
++        },
++        {
++          "case": "none",
++          "type": "0"
++        },
++        {
++          "case": "known_hosts",
++          "type": "0"
++        }
++      ],
++      "members": [
++        {
++          "name": "mode",
++          "type": "452"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "372",
++      "members": [
++        {
++          "name": "filename",
++          "type": "str"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "preallocation",
++          "default": null,
++          "type": "454"
++        },
++        {
++          "name": "nocow",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "373",
++      "members": [
++        {
++          "name": "location",
++          "type": "243"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "preallocation",
++          "default": null,
++          "type": "454"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "374",
++      "members": [
++        {
++          "name": "key-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "cipher-alg",
++          "default": null,
++          "type": "455"
++        },
++        {
++          "name": "cipher-mode",
++          "default": null,
++          "type": "456"
++        },
++        {
++          "name": "ivgen-alg",
++          "default": null,
++          "type": "457"
++        },
++        {
++          "name": "ivgen-hash-alg",
++          "default": null,
++          "type": "458"
++        },
++        {
++          "name": "hash-alg",
++          "default": null,
++          "type": "458"
++        },
++        {
++          "name": "iter-time",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "375",
++      "members": [
++        {
++          "name": "location",
++          "type": "249"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "376",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "cluster-size",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "377",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "backing-file",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "encrypt",
++          "default": null,
++          "type": "459"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "378",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "version",
++          "default": null,
++          "type": "460"
++        },
++        {
++          "name": "backing-file",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "backing-fmt",
++          "default": null,
++          "type": "233"
++        },
++        {
++          "name": "encrypt",
++          "default": null,
++          "type": "459"
++        },
++        {
++          "name": "cluster-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "preallocation",
++          "default": null,
++          "type": "454"
++        },
++        {
++          "name": "lazy-refcounts",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "refcount-bits",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "379",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "backing-file",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "backing-fmt",
++          "default": null,
++          "type": "233"
++        },
++        {
++          "name": "cluster-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "table-size",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "380",
++      "members": [
++        {
++          "name": "location",
++          "type": "257"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "cluster-size",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "381",
++      "members": [
++        {
++          "name": "location",
++          "type": "259"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "backing-file",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "preallocation",
++          "default": null,
++          "type": "454"
++        },
++        {
++          "name": "redundancy",
++          "default": null,
++          "type": "461"
++        },
++        {
++          "name": "object-size",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "382",
++      "members": [
++        {
++          "name": "location",
++          "type": "260"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "383",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "preallocation",
++          "default": null,
++          "type": "454"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "384",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "log-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "block-size",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "subformat",
++          "default": null,
++          "type": "462"
++        },
++        {
++          "name": "block-state-zero",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "385",
++      "members": [
++        {
++          "name": "file",
++          "type": "353"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "subformat",
++          "default": null,
++          "type": "463"
++        },
++        {
++          "name": "force-size",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "null",
++      "json-type": "null",
++      "meta-type": "builtin"
++    },
++    {
++      "name": "386",
++      "meta-type": "enum",
++      "values": [
++        "inet",
++        "unix",
++        "vsock",
++        "fd"
++      ]
++    },
++    {
++      "name": "387",
++      "members": [
++        {
++          "name": "data",
++          "type": "370"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "388",
++      "members": [
++        {
++          "name": "data",
++          "type": "442"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "389",
++      "members": [
++        {
++          "name": "data",
++          "type": "443"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "390",
++      "members": [
++        {
++          "name": "data",
++          "type": "444"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "391",
++      "meta-type": "enum",
++      "values": [
++        "file",
++        "serial",
++        "parallel",
++        "pipe",
++        "socket",
++        "udp",
++        "pty",
++        "null",
++        "mux",
++        "msmouse",
++        "wctablet",
++        "braille",
++        "testdev",
++        "stdio",
++        "console",
++        "spicevmc",
++        "spiceport",
++        "vc",
++        "ringbuf",
++        "memory"
++      ]
++    },
++    {
++      "name": "392",
++      "members": [
++        {
++          "name": "data",
++          "type": "464"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "393",
++      "members": [
++        {
++          "name": "data",
++          "type": "465"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "394",
++      "members": [
++        {
++          "name": "data",
++          "type": "466"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "395",
++      "members": [
++        {
++          "name": "data",
++          "type": "467"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "396",
++      "members": [
++        {
++          "name": "data",
++          "type": "468"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "397",
++      "members": [
++        {
++          "name": "data",
++          "type": "469"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "398",
++      "members": [
++        {
++          "name": "data",
++          "type": "470"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "399",
++      "members": [
++        {
++          "name": "data",
++          "type": "471"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "400",
++      "members": [
++        {
++          "name": "data",
++          "type": "472"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "401",
++      "members": [
++        {
++          "name": "data",
++          "type": "473"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "402",
++      "members": [
++        {
++          "name": "data",
++          "type": "474"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "403",
++      "meta-type": "enum",
++      "values": [
++        "passthrough",
++        "emulator"
++      ]
++    },
++    {
++      "name": "404",
++      "members": [
++        {
++          "name": "data",
++          "type": "475"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "405",
++      "members": [
++        {
++          "name": "data",
++          "type": "476"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "406",
++      "meta-type": "enum",
++      "values": [
++        "number",
++        "qcode"
++      ]
++    },
++    {
++      "name": "407",
++      "members": [
++        {
++          "name": "data",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "408",
++      "members": [
++        {
++          "name": "data",
++          "type": "477"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "409",
++      "meta-type": "enum",
++      "values": [
++        "key",
++        "btn",
++        "rel",
++        "abs"
++      ]
++    },
++    {
++      "name": "410",
++      "members": [
++        {
++          "name": "data",
++          "type": "478"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "411",
++      "members": [
++        {
++          "name": "data",
++          "type": "479"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "412",
++      "members": [
++        {
++          "name": "data",
++          "type": "480"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "413",
++      "meta-type": "enum",
++      "values": [
++        "abort",
++        "block-dirty-bitmap-add",
++        "block-dirty-bitmap-clear",
++        "x-block-dirty-bitmap-enable",
++        "x-block-dirty-bitmap-disable",
++        "x-block-dirty-bitmap-merge",
++        "blockdev-backup",
++        "blockdev-snapshot",
++        "blockdev-snapshot-internal-sync",
++        "blockdev-snapshot-sync",
++        "drive-backup"
++      ]
++    },
++    {
++      "name": "414",
++      "members": [
++        {
++          "name": "data",
++          "type": "481"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "415",
++      "members": [
++        {
++          "name": "data",
++          "type": "30"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "416",
++      "members": [
++        {
++          "name": "data",
++          "type": "31"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "417",
++      "members": [
++        {
++          "name": "data",
++          "type": "32"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "418",
++      "members": [
++        {
++          "name": "data",
++          "type": "27"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "419",
++      "members": [
++        {
++          "name": "data",
++          "type": "23"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "420",
++      "members": [
++        {
++          "name": "data",
++          "type": "64"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "421",
++      "members": [
++        {
++          "name": "data",
++          "type": "22"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "422",
++      "members": [
++        {
++          "name": "data",
++          "type": "26"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "423",
++      "meta-type": "enum",
++      "values": [
++        "individual",
++        "grouped"
++      ]
++    },
++    {
++      "name": "424",
++      "meta-type": "enum",
++      "values": [
++        "string",
++        "number",
++        "int",
++        "boolean",
++        "null",
++        "object",
++        "array",
++        "value"
++      ]
++    },
++    {
++      "name": "[425]",
++      "element-type": "425",
++      "meta-type": "array"
++    },
++    {
++      "name": "425",
++      "members": [
++        {
++          "name": "name",
++          "type": "str"
++        },
++        {
++          "name": "type",
++          "type": "str"
++        },
++        {
++          "name": "default",
++          "default": null,
++          "type": "any"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[426]",
++      "element-type": "426",
++      "meta-type": "array"
++    },
++    {
++      "name": "426",
++      "members": [
++        {
++          "name": "case",
++          "type": "str"
++        },
++        {
++          "name": "type",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[427]",
++      "element-type": "427",
++      "meta-type": "array"
++    },
++    {
++      "name": "427",
++      "members": [
++        {
++          "name": "type",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "428",
++      "meta-type": "enum",
++      "values": [
++        "uninitialized",
++        "stopped",
++        "check-stop",
++        "operating",
++        "load"
++      ]
++    },
++    {
++      "name": "429",
++      "members": [
++        {
++          "name": "desc",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "class",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "430",
++      "members": [
++        {
++          "name": "device",
++          "type": "int"
++        },
++        {
++          "name": "vendor",
++          "type": "int"
++        },
++        {
++          "name": "subsystem",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "subsystem-vendor",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "431",
++      "members": [
++        {
++          "name": "bus",
++          "type": "482"
++        },
++        {
++          "name": "devices",
++          "default": null,
++          "type": "[328]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[432]",
++      "element-type": "432",
++      "meta-type": "array"
++    },
++    {
++      "name": "432",
++      "members": [
++        {
++          "name": "bar",
++          "type": "int"
++        },
++        {
++          "name": "type",
++          "type": "str"
++        },
++        {
++          "name": "address",
++          "type": "int"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "prefetch",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "mem_type_64",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "433",
++      "meta-type": "enum",
++      "values": [
++        "string",
++        "boolean",
++        "number",
++        "size"
++      ]
++    },
++    {
++      "name": "434",
++      "members": [
++        {
++          "name": "id",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "addr",
++          "type": "int"
++        },
++        {
++          "name": "size",
++          "type": "int"
++        },
++        {
++          "name": "slot",
++          "type": "int"
++        },
++        {
++          "name": "node",
++          "type": "int"
++        },
++        {
++          "name": "memdev",
++          "type": "str"
++        },
++        {
++          "name": "hotplugged",
++          "type": "bool"
++        },
++        {
++          "name": "hotpluggable",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "435",
++      "meta-type": "enum",
++      "values": [
++        "unknown",
++        "disabled-wait",
++        "extint-loop",
++        "pgmint-loop",
++        "opint-loop"
++      ]
++    },
++    {
++      "name": "436",
++      "meta-type": "enum",
++      "values": [
++        "qcow2",
++        "vmdk",
++        "luks"
++      ]
++    },
++    {
++      "name": "437",
++      "members": [
++        {
++          "name": "data",
++          "type": "483"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "438",
++      "members": [
++        {
++          "name": "data",
++          "type": "484"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "439",
++      "members": [
++        {
++          "name": "data",
++          "type": "485"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "440",
++      "meta-type": "enum",
++      "values": [
++        "l1_update",
++        "l1_grow_alloc_table",
++        "l1_grow_write_table",
++        "l1_grow_activate_table",
++        "l2_load",
++        "l2_update",
++        "l2_update_compressed",
++        "l2_alloc_cow_read",
++        "l2_alloc_write",
++        "read_aio",
++        "read_backing_aio",
++        "read_compressed",
++        "write_aio",
++        "write_compressed",
++        "vmstate_load",
++        "vmstate_save",
++        "cow_read",
++        "cow_write",
++        "reftable_load",
++        "reftable_grow",
++        "reftable_update",
++        "refblock_load",
++        "refblock_update",
++        "refblock_update_part",
++        "refblock_alloc",
++        "refblock_alloc_hookup",
++        "refblock_alloc_write",
++        "refblock_alloc_write_blocks",
++        "refblock_alloc_write_table",
++        "refblock_alloc_switch_table",
++        "cluster_alloc",
++        "cluster_alloc_bytes",
++        "cluster_free",
++        "flush_to_os",
++        "flush_to_disk",
++        "pwritev_rmw_head",
++        "pwritev_rmw_after_head",
++        "pwritev_rmw_tail",
++        "pwritev_rmw_after_tail",
++        "pwritev",
++        "pwritev_zero",
++        "pwritev_done",
++        "empty_image_prepare",
++        "l1_shrink_write_table",
++        "l1_shrink_free_l2_clusters",
++        "cor_write"
++      ]
++    },
++    {
++      "name": "441",
++      "meta-type": "enum",
++      "values": [
++        "inet",
++        "unix",
++        "vsock",
++        "fd"
++      ]
++    },
++    {
++      "name": "442",
++      "members": [
++        {
++          "name": "path",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "443",
++      "members": [
++        {
++          "name": "cid",
++          "type": "str"
++        },
++        {
++          "name": "port",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "444",
++      "members": [
++        {
++          "name": "str",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "445",
++      "meta-type": "enum",
++      "values": [
++        "inet"
++      ]
++    },
++    {
++      "name": "446",
++      "members": [
++        {
++          "name": "template",
++          "default": null,
++          "type": "447"
++        },
++        {
++          "name": "main-header",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "active-l1",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "active-l2",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "refcount-table",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "refcount-block",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "snapshot-table",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "inactive-l1",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "inactive-l2",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "bitmap-directory",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "447",
++      "meta-type": "enum",
++      "values": [
++        "none",
++        "constant",
++        "cached",
++        "all"
++      ]
++    },
++    {
++      "name": "448",
++      "meta-type": "enum",
++      "values": [
++        "aes",
++        "luks"
++      ]
++    },
++    {
++      "name": "449",
++      "members": [
++        {
++          "name": "key-secret",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "450",
++      "members": [
++        {
++          "name": "key-secret",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "451",
++      "meta-type": "enum",
++      "values": [
++        "aes"
++      ]
++    },
++    {
++      "name": "452",
++      "meta-type": "enum",
++      "values": [
++        "none",
++        "hash",
++        "known_hosts"
++      ]
++    },
++    {
++      "name": "453",
++      "members": [
++        {
++          "name": "type",
++          "type": "486"
++        },
++        {
++          "name": "hash",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "454",
++      "meta-type": "enum",
++      "values": [
++        "off",
++        "metadata",
++        "falloc",
++        "full"
++      ]
++    },
++    {
++      "name": "455",
++      "meta-type": "enum",
++      "values": [
++        "aes-128",
++        "aes-192",
++        "aes-256",
++        "des-rfb",
++        "3des",
++        "cast5-128",
++        "serpent-128",
++        "serpent-192",
++        "serpent-256",
++        "twofish-128",
++        "twofish-192",
++        "twofish-256"
++      ]
++    },
++    {
++      "name": "456",
++      "meta-type": "enum",
++      "values": [
++        "ecb",
++        "cbc",
++        "xts",
++        "ctr"
++      ]
++    },
++    {
++      "name": "457",
++      "meta-type": "enum",
++      "values": [
++        "plain",
++        "plain64",
++        "essiv"
++      ]
++    },
++    {
++      "name": "458",
++      "meta-type": "enum",
++      "values": [
++        "md5",
++        "sha1",
++        "sha224",
++        "sha256",
++        "sha384",
++        "sha512",
++        "ripemd160"
++      ]
++    },
++    {
++      "name": "459",
++      "tag": "format",
++      "variants": [
++        {
++          "case": "qcow",
++          "type": "449"
++        },
++        {
++          "case": "luks",
++          "type": "488"
++        }
++      ],
++      "members": [
++        {
++          "name": "format",
++          "type": "487"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "460",
++      "meta-type": "enum",
++      "values": [
++        "v2",
++        "v3"
++      ]
++    },
++    {
++      "name": "461",
++      "tag": "type",
++      "variants": [
++        {
++          "case": "full",
++          "type": "490"
++        },
++        {
++          "case": "erasure-coded",
++          "type": "491"
++        }
++      ],
++      "members": [
++        {
++          "name": "type",
++          "type": "489"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "462",
++      "meta-type": "enum",
++      "values": [
++        "dynamic",
++        "fixed"
++      ]
++    },
++    {
++      "name": "463",
++      "meta-type": "enum",
++      "values": [
++        "dynamic",
++        "fixed"
++      ]
++    },
++    {
++      "name": "464",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "in",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "out",
++          "type": "str"
++        },
++        {
++          "name": "append",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "465",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "device",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "466",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "addr",
++          "type": "269"
++        },
++        {
++          "name": "tls-creds",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "server",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "wait",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "nodelay",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "telnet",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "tn3270",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "websocket",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "reconnect",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "467",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "remote",
++          "type": "269"
++        },
++        {
++          "name": "local",
++          "default": null,
++          "type": "269"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "468",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "469",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "chardev",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "470",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "signal",
++          "default": null,
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "471",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "type",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "472",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "fqdn",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "473",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "width",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "height",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "cols",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "rows",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "474",
++      "members": [
++        {
++          "name": "logfile",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "logappend",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "size",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "475",
++      "members": [
++        {
++          "name": "path",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "cancel-path",
++          "default": null,
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "476",
++      "members": [
++        {
++          "name": "chardev",
++          "type": "str"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "477",
++      "meta-type": "enum",
++      "values": [
++        "unmapped",
++        "shift",
++        "shift_r",
++        "alt",
++        "alt_r",
++        "ctrl",
++        "ctrl_r",
++        "menu",
++        "esc",
++        "1",
++        "2",
++        "3",
++        "4",
++        "5",
++        "6",
++        "7",
++        "8",
++        "9",
++        "0",
++        "minus",
++        "equal",
++        "backspace",
++        "tab",
++        "q",
++        "w",
++        "e",
++        "r",
++        "t",
++        "y",
++        "u",
++        "i",
++        "o",
++        "p",
++        "bracket_left",
++        "bracket_right",
++        "ret",
++        "a",
++        "s",
++        "d",
++        "f",
++        "g",
++        "h",
++        "j",
++        "k",
++        "l",
++        "semicolon",
++        "apostrophe",
++        "grave_accent",
++        "backslash",
++        "z",
++        "x",
++        "c",
++        "v",
++        "b",
++        "n",
++        "m",
++        "comma",
++        "dot",
++        "slash",
++        "asterisk",
++        "spc",
++        "caps_lock",
++        "f1",
++        "f2",
++        "f3",
++        "f4",
++        "f5",
++        "f6",
++        "f7",
++        "f8",
++        "f9",
++        "f10",
++        "num_lock",
++        "scroll_lock",
++        "kp_divide",
++        "kp_multiply",
++        "kp_subtract",
++        "kp_add",
++        "kp_enter",
++        "kp_decimal",
++        "sysrq",
++        "kp_0",
++        "kp_1",
++        "kp_2",
++        "kp_3",
++        "kp_4",
++        "kp_5",
++        "kp_6",
++        "kp_7",
++        "kp_8",
++        "kp_9",
++        "less",
++        "f11",
++        "f12",
++        "print",
++        "home",
++        "pgup",
++        "pgdn",
++        "end",
++        "left",
++        "up",
++        "down",
++        "right",
++        "insert",
++        "delete",
++        "stop",
++        "again",
++        "props",
++        "undo",
++        "front",
++        "copy",
++        "open",
++        "paste",
++        "find",
++        "cut",
++        "lf",
++        "help",
++        "meta_l",
++        "meta_r",
++        "compose",
++        "pause",
++        "ro",
++        "hiragana",
++        "henkan",
++        "yen",
++        "muhenkan",
++        "katakanahiragana",
++        "kp_comma",
++        "kp_equals",
++        "power",
++        "sleep",
++        "wake",
++        "audionext",
++        "audioprev",
++        "audiostop",
++        "audioplay",
++        "audiomute",
++        "volumeup",
++        "volumedown",
++        "mediaselect",
++        "mail",
++        "calculator",
++        "computer",
++        "ac_home",
++        "ac_back",
++        "ac_forward",
++        "ac_refresh",
++        "ac_bookmarks"
++      ]
++    },
++    {
++      "name": "478",
++      "members": [
++        {
++          "name": "key",
++          "type": "292"
++        },
++        {
++          "name": "down",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "479",
++      "members": [
++        {
++          "name": "button",
++          "type": "492"
++        },
++        {
++          "name": "down",
++          "type": "bool"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "480",
++      "members": [
++        {
++          "name": "axis",
++          "type": "493"
++        },
++        {
++          "name": "value",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "481",
++      "members": [
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "482",
++      "members": [
++        {
++          "name": "number",
++          "type": "int"
++        },
++        {
++          "name": "secondary",
++          "type": "int"
++        },
++        {
++          "name": "subordinate",
++          "type": "int"
++        },
++        {
++          "name": "io_range",
++          "type": "494"
++        },
++        {
++          "name": "memory_range",
++          "type": "494"
++        },
++        {
++          "name": "prefetchable_range",
++          "type": "494"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "483",
++      "members": [
++        {
++          "name": "compat",
++          "type": "str"
++        },
++        {
++          "name": "lazy-refcounts",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "corrupt",
++          "default": null,
++          "type": "bool"
++        },
++        {
++          "name": "refcount-bits",
++          "type": "int"
++        },
++        {
++          "name": "encrypt",
++          "default": null,
++          "type": "495"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "484",
++      "members": [
++        {
++          "name": "create-type",
++          "type": "str"
++        },
++        {
++          "name": "cid",
++          "type": "int"
++        },
++        {
++          "name": "parent-cid",
++          "type": "int"
++        },
++        {
++          "name": "extents",
++          "type": "[230]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "485",
++      "members": [
++        {
++          "name": "cipher-alg",
++          "type": "455"
++        },
++        {
++          "name": "cipher-mode",
++          "type": "456"
++        },
++        {
++          "name": "ivgen-alg",
++          "type": "457"
++        },
++        {
++          "name": "ivgen-hash-alg",
++          "default": null,
++          "type": "458"
++        },
++        {
++          "name": "hash-alg",
++          "type": "458"
++        },
++        {
++          "name": "payload-offset",
++          "type": "int"
++        },
++        {
++          "name": "master-key-iters",
++          "type": "int"
++        },
++        {
++          "name": "uuid",
++          "type": "str"
++        },
++        {
++          "name": "slots",
++          "type": "[496]"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "486",
++      "meta-type": "enum",
++      "values": [
++        "md5",
++        "sha1"
++      ]
++    },
++    {
++      "name": "487",
++      "meta-type": "enum",
++      "values": [
++        "qcow",
++        "luks"
++      ]
++    },
++    {
++      "name": "488",
++      "members": [
++        {
++          "name": "key-secret",
++          "default": null,
++          "type": "str"
++        },
++        {
++          "name": "cipher-alg",
++          "default": null,
++          "type": "455"
++        },
++        {
++          "name": "cipher-mode",
++          "default": null,
++          "type": "456"
++        },
++        {
++          "name": "ivgen-alg",
++          "default": null,
++          "type": "457"
++        },
++        {
++          "name": "ivgen-hash-alg",
++          "default": null,
++          "type": "458"
++        },
++        {
++          "name": "hash-alg",
++          "default": null,
++          "type": "458"
++        },
++        {
++          "name": "iter-time",
++          "default": null,
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "489",
++      "meta-type": "enum",
++      "values": [
++        "full",
++        "erasure-coded"
++      ]
++    },
++    {
++      "name": "490",
++      "members": [
++        {
++          "name": "copies",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "491",
++      "members": [
++        {
++          "name": "data-strips",
++          "type": "int"
++        },
++        {
++          "name": "parity-strips",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "492",
++      "meta-type": "enum",
++      "values": [
++        "left",
++        "middle",
++        "right",
++        "wheel-up",
++        "wheel-down",
++        "side",
++        "extra"
++      ]
++    },
++    {
++      "name": "493",
++      "meta-type": "enum",
++      "values": [
++        "x",
++        "y"
++      ]
++    },
++    {
++      "name": "494",
++      "members": [
++        {
++          "name": "base",
++          "type": "int"
++        },
++        {
++          "name": "limit",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "495",
++      "tag": "format",
++      "variants": [
++        {
++          "case": "luks",
++          "type": "485"
++        },
++        {
++          "case": "aes",
++          "type": "0"
++        }
++      ],
++      "members": [
++        {
++          "name": "format",
++          "type": "448"
++        }
++      ],
++      "meta-type": "object"
++    },
++    {
++      "name": "[230]",
++      "element-type": "230",
++      "meta-type": "array"
++    },
++    {
++      "name": "[496]",
++      "element-type": "496",
++      "meta-type": "array"
++    },
++    {
++      "name": "496",
++      "members": [
++        {
++          "name": "active",
++          "type": "bool"
++        },
++        {
++          "name": "iters",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "stripes",
++          "default": null,
++          "type": "int"
++        },
++        {
++          "name": "key-offset",
++          "type": "int"
++        }
++      ],
++      "meta-type": "object"
++    }
++  ],
++  "id": "libvirt-49"
++}
++
++{
++  "execute": "query-cpu-model-expansion",
++  "arguments": {
++    "type": "static",
++    "model": {
++      "name": "host"
++    }
++  },
++  "id": "libvirt-50"
++}
++
++{
++  "return": {
++    "model": {
++      "name": "base",
++      "props": {
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": true,
++        "intel-pt": false,
++        "kvm-asyncpf": true,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "avx512cd": false,
++        "decodeassists": false,
++        "sse4.1": true,
++        "family": 6,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "xcrypt": false,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": true,
++        "avx512vbmi2": false,
++        "cr8legacy": false,
++        "xcrypt-en": false,
++        "pn": false,
++        "rsba": false,
++        "dca": false,
++        "vendor": "GenuineIntel",
++        "pku": false,
++        "smx": false,
++        "cmp-legacy": false,
++        "avx512-4fmaps": false,
++        "vmcb-clean": false,
++        "hle": true,
++        "3dnowext": false,
++        "amd-no-ssb": false,
++        "npt": false,
++        "rdctl-no": false,
++        "clwb": false,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm-lock": false,
++        "smep": true,
++        "smap": true,
++        "pfthreshold": false,
++        "x2apic": true,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "flushbyasid": false,
++        "f16c": true,
++        "ace2-en": false,
++        "pae": true,
++        "pat": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm-nopiodelay": true,
++        "tm": false,
++        "kvmclock-stable-bit": true,
++        "hypervisor": true,
++        "pcommit": false,
++        "syscall": true,
++        "avx512dq": false,
++        "svm": false,
++        "invtsc": false,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-eoi": true,
++        "kvm-pv-ipi": false,
++        "cx8": true,
++        "cldemote": false,
++        "kvm-mmu": false,
++        "sse4.2": true,
++        "pge": true,
++        "avx512bitalg": false,
++        "pdcm": false,
++        "model": 94,
++        "movbe": true,
++        "nrip-save": false,
++        "ssse3": true,
++        "sse4a": false,
++        "invpcid": true,
++        "pdpe1gb": true,
++        "tsc-deadline": true,
++        "skip-l1dfl-vmentry": true,
++        "fma": true,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ds-cpl": false,
++        "ibs": false,
++        "fma4": false,
++        "la57": false,
++        "osvw": false,
++        "apic": true,
++        "pmm": false,
++        "spec-ctrl": true,
++        "tsc-adjust": true,
++        "kvm-steal-time": true,
++        "kvmclock": true,
++        "lwp": false,
++        "amd-ssbd": false,
++        "xop": false,
++        "ibpb": false,
++        "avx": true,
++        "acpi": false,
++        "avx512bw": false,
++        "ace2": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": false,
++        "popcnt": true,
++        "vaes": false,
++        "xsaves": true,
++        "lm": true,
++        "umip": true,
++        "pse": true,
++        "avx2": true,
++        "sep": true,
++        "virt-ssbd": false,
++        "nodeid-msr": false,
++        "misalignsse": false,
++        "min-xlevel": 2147483656,
++        "bmi1": true,
++        "bmi2": true,
++        "kvm-pv-unhalt": true,
++        "tsc-scale": false,
++        "topoext": false,
++        "clflushopt": true,
++        "monitor": false,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": true,
++        "arch-capabilities": false,
++        "3dnow": false,
++        "erms": true,
++        "lahf-lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "xstore": false,
++        "rtm": true,
++        "kvm-hint-dedicated": false,
++        "lmce": true,
++        "perfctr-nb": false,
++        "rdrand": true,
++        "rdseed": true,
++        "avx512-4vnniw": false,
++        "vme": true,
++        "vmx": true,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": true,
++        "tbm": false,
++        "wdt": false,
++        "model-id": "Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz",
++        "sha-ni": false,
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-50"
++}
++
++{
++  "execute": "query-cpu-model-expansion",
++  "arguments": {
++    "type": "full",
++    "model": {
++      "name": "base",
++      "props": {
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": true,
++        "intel-pt": false,
++        "kvm-asyncpf": true,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "avx512cd": false,
++        "decodeassists": false,
++        "sse4.1": true,
++        "family": 6,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "xcrypt": false,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": true,
++        "avx512vbmi2": false,
++        "cr8legacy": false,
++        "xcrypt-en": false,
++        "pn": false,
++        "rsba": false,
++        "dca": false,
++        "vendor": "GenuineIntel",
++        "pku": false,
++        "smx": false,
++        "cmp-legacy": false,
++        "avx512-4fmaps": false,
++        "vmcb-clean": false,
++        "hle": true,
++        "3dnowext": false,
++        "amd-no-ssb": false,
++        "npt": false,
++        "rdctl-no": false,
++        "clwb": false,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm-lock": false,
++        "smep": true,
++        "smap": true,
++        "pfthreshold": false,
++        "x2apic": true,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "flushbyasid": false,
++        "f16c": true,
++        "ace2-en": false,
++        "pae": true,
++        "pat": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm-nopiodelay": true,
++        "tm": false,
++        "kvmclock-stable-bit": true,
++        "hypervisor": true,
++        "pcommit": false,
++        "syscall": true,
++        "avx512dq": false,
++        "svm": false,
++        "invtsc": false,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-eoi": true,
++        "kvm-pv-ipi": false,
++        "cx8": true,
++        "cldemote": false,
++        "kvm-mmu": false,
++        "sse4.2": true,
++        "pge": true,
++        "avx512bitalg": false,
++        "pdcm": false,
++        "model": 94,
++        "movbe": true,
++        "nrip-save": false,
++        "ssse3": true,
++        "sse4a": false,
++        "invpcid": true,
++        "pdpe1gb": true,
++        "tsc-deadline": true,
++        "skip-l1dfl-vmentry": true,
++        "fma": true,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ds-cpl": false,
++        "ibs": false,
++        "fma4": false,
++        "la57": false,
++        "osvw": false,
++        "apic": true,
++        "pmm": false,
++        "spec-ctrl": true,
++        "tsc-adjust": true,
++        "kvm-steal-time": true,
++        "kvmclock": true,
++        "lwp": false,
++        "amd-ssbd": false,
++        "xop": false,
++        "ibpb": false,
++        "avx": true,
++        "acpi": false,
++        "avx512bw": false,
++        "ace2": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": false,
++        "popcnt": true,
++        "vaes": false,
++        "xsaves": true,
++        "lm": true,
++        "umip": true,
++        "pse": true,
++        "avx2": true,
++        "sep": true,
++        "virt-ssbd": false,
++        "nodeid-msr": false,
++        "misalignsse": false,
++        "min-xlevel": 2147483656,
++        "bmi1": true,
++        "bmi2": true,
++        "kvm-pv-unhalt": true,
++        "tsc-scale": false,
++        "topoext": false,
++        "clflushopt": true,
++        "monitor": false,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": true,
++        "arch-capabilities": false,
++        "3dnow": false,
++        "erms": true,
++        "lahf-lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "xstore": false,
++        "rtm": true,
++        "kvm-hint-dedicated": false,
++        "lmce": true,
++        "perfctr-nb": false,
++        "rdrand": true,
++        "rdseed": true,
++        "avx512-4vnniw": false,
++        "vme": true,
++        "vmx": true,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": true,
++        "tbm": false,
++        "wdt": false,
++        "model-id": "Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz",
++        "sha-ni": false,
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-51"
++}
++
++{
++  "return": {
++    "model": {
++      "name": "base",
++      "props": {
++        "phys-bits": 0,
++        "core-id": -1,
++        "xlevel": 2147483656,
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": true,
++        "intel-pt": false,
++        "hv-frequencies": false,
++        "tsc-frequency": 0,
++        "xd": true,
++        "hv-vendor-id": "",
++        "kvm-asyncpf": true,
++        "kvm_asyncpf": true,
++        "perfctr_core": false,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "decodeassists": false,
++        "avx512cd": false,
++        "sse4_1": true,
++        "sse4.1": true,
++        "sse4-1": true,
++        "family": 6,
++        "legacy-cache": true,
++        "vmware-cpuid-freq": true,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "hv-runtime": false,
++        "xcrypt": false,
++        "thread-id": -1,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "hv-relaxed": false,
++        "hv-crash": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "hv-evmcs": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": true,
++        "avx512vbmi2": false,
++        "cr8legacy": false,
++        "cpuid-0xb": true,
++        "xcrypt-en": false,
++        "kvm_pv_eoi": true,
++        "apic-id": 4294967295,
++        "rsba": false,
++        "pn": false,
++        "dca": false,
++        "vendor": "GenuineIntel",
++        "hv-ipi": false,
++        "pku": false,
++        "smx": false,
++        "cmp_legacy": false,
++        "cmp-legacy": false,
++        "node-id": -1,
++        "avx512-4fmaps": false,
++        "vmcb_clean": false,
++        "vmcb-clean": false,
++        "3dnowext": false,
++        "amd-no-ssb": false,
++        "hle": true,
++        "npt": false,
++        "rdctl-no": false,
++        "memory": "/machine/unattached/system[0]",
++        "clwb": false,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm_lock": false,
++        "svm-lock": false,
++        "pfthreshold": false,
++        "smep": true,
++        "smap": true,
++        "x2apic": true,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "hv-stimer": false,
++        "x-hv-synic-kvm-only": false,
++        "i64": true,
++        "flushbyasid": false,
++        "f16c": true,
++        "ace2-en": false,
++        "pat": true,
++        "pae": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm_nopiodelay": true,
++        "kvm-nopiodelay": true,
++        "tm": false,
++        "kvmclock-stable-bit": true,
++        "hypervisor": true,
++        "socket-id": -1,
++        "pcommit": false,
++        "syscall": true,
++        "level": 13,
++        "avx512dq": false,
++        "x-migrate-smi-count": true,
++        "svm": false,
++        "full-cpuid-auto-level": true,
++        "hv-reset": false,
++        "invtsc": false,
++        "sse3": true,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-ipi": false,
++        "kvm-pv-eoi": true,
++        "cx8": true,
++        "cldemote": false,
++        "hv-reenlightenment": false,
++        "kvm_mmu": false,
++        "kvm-mmu": false,
++        "sse4_2": true,
++        "sse4.2": true,
++        "sse4-2": true,
++        "pge": true,
++        "fill-mtrr-mask": true,
++        "avx512bitalg": false,
++        "nodeid_msr": false,
++        "pdcm": false,
++        "movbe": true,
++        "model": 94,
++        "nrip_save": false,
++        "nrip-save": false,
++        "kvm_pv_unhalt": true,
++        "ssse3": true,
++        "sse4a": false,
++        "invpcid": true,
++        "pdpe1gb": true,
++        "tsc-deadline": true,
++        "skip-l1dfl-vmentry": true,
++        "fma": true,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "enforce": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ibs": false,
++        "ds_cpl": false,
++        "ds-cpl": false,
++        "host-phys-bits": false,
++        "fma4": false,
++        "la57": false,
++        "osvw": false,
++        "check": true,
++        "hv-spinlocks": -1,
++        "pmu": false,
++        "pmm": false,
++        "apic": true,
++        "spec-ctrl": true,
++        "min-xlevel2": 0,
++        "tsc-adjust": true,
++        "tsc_adjust": true,
++        "kvm-steal-time": true,
++        "kvm_steal_time": true,
++        "kvmclock": true,
++        "l3-cache": true,
++        "lwp": false,
++        "amd-ssbd": false,
++        "ibpb": false,
++        "xop": false,
++        "avx": true,
++        "ace2": false,
++        "avx512bw": false,
++        "acpi": false,
++        "hv-vapic": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": false,
++        "vaes": false,
++        "popcnt": true,
++        "xsaves": true,
++        "tcg-cpuid": true,
++        "lm": true,
++        "umip": true,
++        "pse": true,
++        "avx2": true,
++        "sep": true,
++        "pclmuldq": true,
++        "virt-ssbd": false,
++        "x-hv-max-vps": -1,
++        "nodeid-msr": false,
++        "kvm": true,
++        "misalignsse": false,
++        "min-xlevel": 2147483656,
++        "kvm-pv-unhalt": true,
++        "bmi2": true,
++        "bmi1": true,
++        "realized": false,
++        "tsc_scale": false,
++        "tsc-scale": false,
++        "topoext": false,
++        "hv-vpindex": false,
++        "xlevel2": 0,
++        "clflushopt": true,
++        "kvm-no-smi-migration": false,
++        "monitor": false,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": true,
++        "arch-capabilities": false,
++        "3dnow": false,
++        "erms": true,
++        "lahf-lm": true,
++        "lahf_lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "hv-synic": false,
++        "xstore": false,
++        "fxsr_opt": false,
++        "kvm-hint-dedicated": false,
++        "rtm": true,
++        "lmce": true,
++        "hv-time": false,
++        "perfctr-nb": false,
++        "perfctr_nb": false,
++        "ffxsr": false,
++        "hv-tlbflush": false,
++        "rdrand": true,
++        "rdseed": true,
++        "avx512-4vnniw": false,
++        "vmx": true,
++        "vme": true,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": true,
++        "tbm": false,
++        "wdt": false,
++        "pause_filter": false,
++        "sha-ni": false,
++        "model-id": "Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz",
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-51"
++}
++
++{
++  "execute": "query-cpu-model-expansion",
++  "arguments": {
++    "type": "static",
++    "model": {
++      "name": "host",
++      "props": {
++        "migratable": false
++      }
++    }
++  },
++  "id": "libvirt-52"
++}
++
++{
++  "return": {
++    "model": {
++      "name": "base",
++      "props": {
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": true,
++        "intel-pt": false,
++        "kvm-asyncpf": true,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "avx512cd": false,
++        "decodeassists": false,
++        "sse4.1": true,
++        "family": 6,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "xcrypt": false,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": true,
++        "avx512vbmi2": false,
++        "cr8legacy": false,
++        "xcrypt-en": false,
++        "pn": false,
++        "rsba": false,
++        "dca": false,
++        "vendor": "GenuineIntel",
++        "pku": false,
++        "smx": false,
++        "cmp-legacy": false,
++        "avx512-4fmaps": false,
++        "vmcb-clean": false,
++        "hle": true,
++        "3dnowext": false,
++        "amd-no-ssb": false,
++        "npt": false,
++        "rdctl-no": false,
++        "clwb": false,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm-lock": false,
++        "smep": true,
++        "smap": true,
++        "pfthreshold": false,
++        "x2apic": true,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "flushbyasid": false,
++        "f16c": true,
++        "ace2-en": false,
++        "pae": true,
++        "pat": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm-nopiodelay": true,
++        "tm": false,
++        "kvmclock-stable-bit": true,
++        "hypervisor": true,
++        "pcommit": false,
++        "syscall": true,
++        "avx512dq": false,
++        "svm": false,
++        "invtsc": true,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-eoi": true,
++        "kvm-pv-ipi": false,
++        "cx8": true,
++        "cldemote": false,
++        "kvm-mmu": false,
++        "sse4.2": true,
++        "pge": true,
++        "avx512bitalg": false,
++        "pdcm": false,
++        "model": 94,
++        "movbe": true,
++        "nrip-save": false,
++        "ssse3": true,
++        "sse4a": false,
++        "invpcid": true,
++        "pdpe1gb": true,
++        "tsc-deadline": true,
++        "skip-l1dfl-vmentry": true,
++        "fma": true,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ds-cpl": false,
++        "ibs": false,
++        "fma4": false,
++        "la57": false,
++        "osvw": false,
++        "apic": true,
++        "pmm": false,
++        "spec-ctrl": true,
++        "tsc-adjust": true,
++        "kvm-steal-time": true,
++        "kvmclock": true,
++        "lwp": false,
++        "amd-ssbd": false,
++        "xop": false,
++        "ibpb": false,
++        "avx": true,
++        "acpi": false,
++        "avx512bw": false,
++        "ace2": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": false,
++        "popcnt": true,
++        "vaes": false,
++        "xsaves": true,
++        "lm": true,
++        "umip": true,
++        "pse": true,
++        "avx2": true,
++        "sep": true,
++        "virt-ssbd": false,
++        "nodeid-msr": false,
++        "misalignsse": false,
++        "min-xlevel": 2147483656,
++        "bmi1": true,
++        "bmi2": true,
++        "kvm-pv-unhalt": true,
++        "tsc-scale": false,
++        "topoext": false,
++        "clflushopt": true,
++        "monitor": false,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": true,
++        "arch-capabilities": true,
++        "3dnow": false,
++        "erms": true,
++        "lahf-lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "xstore": false,
++        "rtm": true,
++        "kvm-hint-dedicated": false,
++        "lmce": true,
++        "perfctr-nb": false,
++        "rdrand": true,
++        "rdseed": true,
++        "avx512-4vnniw": false,
++        "vme": true,
++        "vmx": true,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": true,
++        "tbm": false,
++        "wdt": false,
++        "model-id": "Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz",
++        "sha-ni": false,
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-52"
++}
++
++{
++  "execute": "query-cpu-model-expansion",
++  "arguments": {
++    "type": "full",
++    "model": {
++      "name": "base",
++      "props": {
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": true,
++        "intel-pt": false,
++        "kvm-asyncpf": true,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "avx512cd": false,
++        "decodeassists": false,
++        "sse4.1": true,
++        "family": 6,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "xcrypt": false,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": true,
++        "avx512vbmi2": false,
++        "cr8legacy": false,
++        "xcrypt-en": false,
++        "pn": false,
++        "rsba": false,
++        "dca": false,
++        "vendor": "GenuineIntel",
++        "pku": false,
++        "smx": false,
++        "cmp-legacy": false,
++        "avx512-4fmaps": false,
++        "vmcb-clean": false,
++        "hle": true,
++        "3dnowext": false,
++        "amd-no-ssb": false,
++        "npt": false,
++        "rdctl-no": false,
++        "clwb": false,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm-lock": false,
++        "smep": true,
++        "smap": true,
++        "pfthreshold": false,
++        "x2apic": true,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "flushbyasid": false,
++        "f16c": true,
++        "ace2-en": false,
++        "pae": true,
++        "pat": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm-nopiodelay": true,
++        "tm": false,
++        "kvmclock-stable-bit": true,
++        "hypervisor": true,
++        "pcommit": false,
++        "syscall": true,
++        "avx512dq": false,
++        "svm": false,
++        "invtsc": true,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-eoi": true,
++        "kvm-pv-ipi": false,
++        "cx8": true,
++        "cldemote": false,
++        "kvm-mmu": false,
++        "sse4.2": true,
++        "pge": true,
++        "avx512bitalg": false,
++        "pdcm": false,
++        "model": 94,
++        "movbe": true,
++        "nrip-save": false,
++        "ssse3": true,
++        "sse4a": false,
++        "invpcid": true,
++        "pdpe1gb": true,
++        "tsc-deadline": true,
++        "skip-l1dfl-vmentry": true,
++        "fma": true,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ds-cpl": false,
++        "ibs": false,
++        "fma4": false,
++        "la57": false,
++        "osvw": false,
++        "apic": true,
++        "pmm": false,
++        "spec-ctrl": true,
++        "tsc-adjust": true,
++        "kvm-steal-time": true,
++        "kvmclock": true,
++        "lwp": false,
++        "amd-ssbd": false,
++        "xop": false,
++        "ibpb": false,
++        "avx": true,
++        "acpi": false,
++        "avx512bw": false,
++        "ace2": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": false,
++        "popcnt": true,
++        "vaes": false,
++        "xsaves": true,
++        "lm": true,
++        "umip": true,
++        "pse": true,
++        "avx2": true,
++        "sep": true,
++        "virt-ssbd": false,
++        "nodeid-msr": false,
++        "misalignsse": false,
++        "min-xlevel": 2147483656,
++        "bmi1": true,
++        "bmi2": true,
++        "kvm-pv-unhalt": true,
++        "tsc-scale": false,
++        "topoext": false,
++        "clflushopt": true,
++        "monitor": false,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": true,
++        "arch-capabilities": true,
++        "3dnow": false,
++        "erms": true,
++        "lahf-lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "xstore": false,
++        "rtm": true,
++        "kvm-hint-dedicated": false,
++        "lmce": true,
++        "perfctr-nb": false,
++        "rdrand": true,
++        "rdseed": true,
++        "avx512-4vnniw": false,
++        "vme": true,
++        "vmx": true,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": true,
++        "tbm": false,
++        "wdt": false,
++        "model-id": "Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz",
++        "sha-ni": false,
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-53"
++}
++
++{
++  "return": {
++    "model": {
++      "name": "base",
++      "props": {
++        "phys-bits": 0,
++        "core-id": -1,
++        "xlevel": 2147483656,
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": true,
++        "intel-pt": false,
++        "hv-frequencies": false,
++        "tsc-frequency": 0,
++        "xd": true,
++        "hv-vendor-id": "",
++        "kvm-asyncpf": true,
++        "kvm_asyncpf": true,
++        "perfctr_core": false,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "decodeassists": false,
++        "avx512cd": false,
++        "sse4_1": true,
++        "sse4.1": true,
++        "sse4-1": true,
++        "family": 6,
++        "legacy-cache": true,
++        "vmware-cpuid-freq": true,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "hv-runtime": false,
++        "xcrypt": false,
++        "thread-id": -1,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "hv-relaxed": false,
++        "hv-crash": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "hv-evmcs": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": true,
++        "avx512vbmi2": false,
++        "cr8legacy": false,
++        "cpuid-0xb": true,
++        "xcrypt-en": false,
++        "kvm_pv_eoi": true,
++        "apic-id": 4294967295,
++        "rsba": false,
++        "pn": false,
++        "dca": false,
++        "vendor": "GenuineIntel",
++        "hv-ipi": false,
++        "pku": false,
++        "smx": false,
++        "cmp_legacy": false,
++        "cmp-legacy": false,
++        "node-id": -1,
++        "avx512-4fmaps": false,
++        "vmcb_clean": false,
++        "vmcb-clean": false,
++        "3dnowext": false,
++        "amd-no-ssb": false,
++        "hle": true,
++        "npt": false,
++        "rdctl-no": false,
++        "memory": "/machine/unattached/system[0]",
++        "clwb": false,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm_lock": false,
++        "svm-lock": false,
++        "pfthreshold": false,
++        "smep": true,
++        "smap": true,
++        "x2apic": true,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "hv-stimer": false,
++        "x-hv-synic-kvm-only": false,
++        "i64": true,
++        "flushbyasid": false,
++        "f16c": true,
++        "ace2-en": false,
++        "pat": true,
++        "pae": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm_nopiodelay": true,
++        "kvm-nopiodelay": true,
++        "tm": false,
++        "kvmclock-stable-bit": true,
++        "hypervisor": true,
++        "socket-id": -1,
++        "pcommit": false,
++        "syscall": true,
++        "level": 13,
++        "avx512dq": false,
++        "x-migrate-smi-count": true,
++        "svm": false,
++        "full-cpuid-auto-level": true,
++        "hv-reset": false,
++        "invtsc": true,
++        "sse3": true,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-ipi": false,
++        "kvm-pv-eoi": true,
++        "cx8": true,
++        "cldemote": false,
++        "hv-reenlightenment": false,
++        "kvm_mmu": false,
++        "kvm-mmu": false,
++        "sse4_2": true,
++        "sse4.2": true,
++        "sse4-2": true,
++        "pge": true,
++        "fill-mtrr-mask": true,
++        "avx512bitalg": false,
++        "nodeid_msr": false,
++        "pdcm": false,
++        "movbe": true,
++        "model": 94,
++        "nrip_save": false,
++        "nrip-save": false,
++        "kvm_pv_unhalt": true,
++        "ssse3": true,
++        "sse4a": false,
++        "invpcid": true,
++        "pdpe1gb": true,
++        "tsc-deadline": true,
++        "skip-l1dfl-vmentry": true,
++        "fma": true,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "enforce": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ibs": false,
++        "ds_cpl": false,
++        "ds-cpl": false,
++        "host-phys-bits": false,
++        "fma4": false,
++        "la57": false,
++        "osvw": false,
++        "check": true,
++        "hv-spinlocks": -1,
++        "pmu": false,
++        "pmm": false,
++        "apic": true,
++        "spec-ctrl": true,
++        "min-xlevel2": 0,
++        "tsc-adjust": true,
++        "tsc_adjust": true,
++        "kvm-steal-time": true,
++        "kvm_steal_time": true,
++        "kvmclock": true,
++        "l3-cache": true,
++        "lwp": false,
++        "amd-ssbd": false,
++        "ibpb": false,
++        "xop": false,
++        "avx": true,
++        "ace2": false,
++        "avx512bw": false,
++        "acpi": false,
++        "hv-vapic": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": false,
++        "vaes": false,
++        "popcnt": true,
++        "xsaves": true,
++        "tcg-cpuid": true,
++        "lm": true,
++        "umip": true,
++        "pse": true,
++        "avx2": true,
++        "sep": true,
++        "pclmuldq": true,
++        "virt-ssbd": false,
++        "x-hv-max-vps": -1,
++        "nodeid-msr": false,
++        "kvm": true,
++        "misalignsse": false,
++        "min-xlevel": 2147483656,
++        "kvm-pv-unhalt": true,
++        "bmi2": true,
++        "bmi1": true,
++        "realized": false,
++        "tsc_scale": false,
++        "tsc-scale": false,
++        "topoext": false,
++        "hv-vpindex": false,
++        "xlevel2": 0,
++        "clflushopt": true,
++        "kvm-no-smi-migration": false,
++        "monitor": false,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": true,
++        "arch-capabilities": true,
++        "3dnow": false,
++        "erms": true,
++        "lahf-lm": true,
++        "lahf_lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "hv-synic": false,
++        "xstore": false,
++        "fxsr_opt": false,
++        "kvm-hint-dedicated": false,
++        "rtm": true,
++        "lmce": true,
++        "hv-time": false,
++        "perfctr-nb": false,
++        "perfctr_nb": false,
++        "ffxsr": false,
++        "hv-tlbflush": false,
++        "rdrand": true,
++        "rdseed": true,
++        "avx512-4vnniw": false,
++        "vmx": true,
++        "vme": true,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": true,
++        "tbm": false,
++        "wdt": false,
++        "pause_filter": false,
++        "sha-ni": false,
++        "model-id": "Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz",
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-53"
++}
++
++{
++  "execute": "query-sev-capabilities",
++  "id": "libvirt-54"
++}
++
++{
++  "id": "libvirt-54",
++  "error": {
++    "class": "GenericError",
++    "desc": "SEV feature is not available"
++  }
++}
++
++{
++  "execute": "qmp_capabilities",
++  "id": "libvirt-1"
++}
++
++{
++  "return": {
++  },
++  "id": "libvirt-1"
++}
++
++{
++  "execute": "query-cpu-definitions",
++  "id": "libvirt-2"
++}
++
++{
++  "return": [
++    {
++      "name": "max",
++      "typename": "max-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": false
++    },
++    {
++      "name": "host",
++      "typename": "host-x86_64-cpu",
++      "unavailable-features": [
++        "kvm"
++      ],
++      "static": false,
++      "migration-safe": false
++    },
++    {
++      "name": "base",
++      "typename": "base-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": true,
++      "migration-safe": true
++    },
++    {
++      "name": "qemu64",
++      "typename": "qemu64-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "qemu32",
++      "typename": "qemu32-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "phenom",
++      "typename": "phenom-x86_64-cpu",
++      "unavailable-features": [
++        "fxsr-opt"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "pentium3",
++      "typename": "pentium3-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "pentium2",
++      "typename": "pentium2-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "pentium",
++      "typename": "pentium-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "n270",
++      "typename": "n270-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "kvm64",
++      "typename": "kvm64-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "kvm32",
++      "typename": "kvm32-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "coreduo",
++      "typename": "coreduo-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "core2duo",
++      "typename": "core2duo-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "athlon",
++      "typename": "athlon-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Westmere-IBRS",
++      "typename": "Westmere-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "spec-ctrl"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Westmere",
++      "typename": "Westmere-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Skylake-Server-IBRS",
++      "typename": "Skylake-Server-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm",
++        "avx512f",
++        "avx512dq",
++        "rdseed",
++        "avx512cd",
++        "avx512bw",
++        "avx512vl",
++        "spec-ctrl",
++        "3dnowprefetch",
++        "xsavec"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Skylake-Server",
++      "typename": "Skylake-Server-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm",
++        "avx512f",
++        "avx512dq",
++        "rdseed",
++        "avx512cd",
++        "avx512bw",
++        "avx512vl",
++        "3dnowprefetch",
++        "xsavec"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Skylake-Client-IBRS",
++      "typename": "Skylake-Client-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm",
++        "rdseed",
++        "spec-ctrl",
++        "3dnowprefetch",
++        "xsavec"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Skylake-Client",
++      "typename": "Skylake-Client-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm",
++        "rdseed",
++        "3dnowprefetch",
++        "xsavec"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "SandyBridge-IBRS",
++      "typename": "SandyBridge-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "spec-ctrl"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "SandyBridge",
++      "typename": "SandyBridge-x86_64-cpu",
++      "unavailable-features": [
++        "x2apic",
++        "tsc-deadline",
++        "avx"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Penryn",
++      "typename": "Penryn-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Opteron_G5",
++      "typename": "Opteron_G5-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "avx",
++        "f16c",
++        "misalignsse",
++        "3dnowprefetch",
++        "xop",
++        "fma4",
++        "tbm"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Opteron_G4",
++      "typename": "Opteron_G4-x86_64-cpu",
++      "unavailable-features": [
++        "avx",
++        "misalignsse",
++        "3dnowprefetch",
++        "xop",
++        "fma4"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Opteron_G3",
++      "typename": "Opteron_G3-x86_64-cpu",
++      "unavailable-features": [
++        "misalignsse"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Opteron_G2",
++      "typename": "Opteron_G2-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Opteron_G1",
++      "typename": "Opteron_G1-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Nehalem-IBRS",
++      "typename": "Nehalem-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "spec-ctrl"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Nehalem",
++      "typename": "Nehalem-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "KnightsMill",
++      "typename": "KnightsMill-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "avx2",
++        "avx512f",
++        "rdseed",
++        "avx512pf",
++        "avx512er",
++        "avx512cd",
++        "avx512-vpopcntdq",
++        "avx512-4vnniw",
++        "avx512-4fmaps",
++        "3dnowprefetch"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "IvyBridge-IBRS",
++      "typename": "IvyBridge-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "spec-ctrl"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "IvyBridge",
++      "typename": "IvyBridge-x86_64-cpu",
++      "unavailable-features": [
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Icelake-Server",
++      "typename": "Icelake-Server-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm",
++        "avx512f",
++        "avx512dq",
++        "rdseed",
++        "intel-pt",
++        "avx512cd",
++        "avx512bw",
++        "avx512vl",
++        "avx512vbmi",
++        "umip",
++        "",
++        "avx512vbmi2",
++        "gfni",
++        "vaes",
++        "vpclmulqdq",
++        "avx512vnni",
++        "avx512bitalg",
++        "avx512-vpopcntdq",
++        "pconfig",
++        "spec-ctrl",
++        "ssbd",
++        "3dnowprefetch",
++        "wbnoinvd",
++        "xsavec"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Icelake-Client",
++      "typename": "Icelake-Client-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm",
++        "rdseed",
++        "intel-pt",
++        "avx512vbmi",
++        "umip",
++        "",
++        "avx512vbmi2",
++        "gfni",
++        "vaes",
++        "vpclmulqdq",
++        "avx512vnni",
++        "avx512bitalg",
++        "avx512-vpopcntdq",
++        "spec-ctrl",
++        "ssbd",
++        "3dnowprefetch",
++        "wbnoinvd",
++        "xsavec"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Haswell-noTSX-IBRS",
++      "typename": "Haswell-noTSX-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "avx2",
++        "invpcid",
++        "spec-ctrl"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Haswell-noTSX",
++      "typename": "Haswell-noTSX-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "avx2",
++        "invpcid"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Haswell-IBRS",
++      "typename": "Haswell-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm",
++        "spec-ctrl"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Haswell",
++      "typename": "Haswell-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "EPYC-IBPB",
++      "typename": "EPYC-IBPB-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "avx",
++        "f16c",
++        "rdrand",
++        "avx2",
++        "rdseed",
++        "sha-ni",
++        "fxsr-opt",
++        "misalignsse",
++        "3dnowprefetch",
++        "osvw",
++        "topoext",
++        "ibpb",
++        "xsavec"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "EPYC",
++      "typename": "EPYC-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "avx",
++        "f16c",
++        "rdrand",
++        "avx2",
++        "rdseed",
++        "sha-ni",
++        "fxsr-opt",
++        "misalignsse",
++        "3dnowprefetch",
++        "osvw",
++        "topoext",
++        "xsavec"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Conroe",
++      "typename": "Conroe-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Cascadelake-Server",
++      "typename": "Cascadelake-Server-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm",
++        "avx512f",
++        "avx512dq",
++        "rdseed",
++        "intel-pt",
++        "avx512cd",
++        "avx512bw",
++        "avx512vl",
++        "",
++        "avx512vnni",
++        "spec-ctrl",
++        "ssbd",
++        "3dnowprefetch",
++        "xsavec"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Broadwell-noTSX-IBRS",
++      "typename": "Broadwell-noTSX-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "avx2",
++        "invpcid",
++        "rdseed",
++        "spec-ctrl",
++        "3dnowprefetch"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Broadwell-noTSX",
++      "typename": "Broadwell-noTSX-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "avx2",
++        "invpcid",
++        "rdseed",
++        "3dnowprefetch"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Broadwell-IBRS",
++      "typename": "Broadwell-IBRS-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm",
++        "rdseed",
++        "spec-ctrl",
++        "3dnowprefetch"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "Broadwell",
++      "typename": "Broadwell-x86_64-cpu",
++      "unavailable-features": [
++        "fma",
++        "pcid",
++        "x2apic",
++        "tsc-deadline",
++        "avx",
++        "f16c",
++        "rdrand",
++        "hle",
++        "avx2",
++        "invpcid",
++        "rtm",
++        "rdseed",
++        "3dnowprefetch"
++      ],
++      "static": false,
++      "migration-safe": true
++    },
++    {
++      "name": "486",
++      "typename": "486-x86_64-cpu",
++      "unavailable-features": [
++      ],
++      "static": false,
++      "migration-safe": true
++    }
++  ],
++  "id": "libvirt-2"
++}
++
++{
++  "execute": "query-cpu-model-expansion",
++  "arguments": {
++    "type": "static",
++    "model": {
++      "name": "max"
++    }
++  },
++  "id": "libvirt-3"
++}
++
++{
++  "return": {
++    "model": {
++      "name": "base",
++      "props": {
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": false,
++        "intel-pt": false,
++        "kvm-asyncpf": false,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "avx512cd": false,
++        "decodeassists": false,
++        "sse4.1": true,
++        "family": 6,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "xcrypt": false,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": false,
++        "avx512vbmi2": false,
++        "cr8legacy": true,
++        "xcrypt-en": false,
++        "pn": false,
++        "rsba": false,
++        "dca": false,
++        "vendor": "AuthenticAMD",
++        "pku": true,
++        "smx": false,
++        "cmp-legacy": false,
++        "avx512-4fmaps": false,
++        "vmcb-clean": false,
++        "hle": false,
++        "3dnowext": true,
++        "amd-no-ssb": false,
++        "npt": true,
++        "rdctl-no": false,
++        "clwb": true,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm-lock": false,
++        "smep": true,
++        "smap": true,
++        "pfthreshold": false,
++        "x2apic": false,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "flushbyasid": false,
++        "f16c": false,
++        "ace2-en": false,
++        "pae": true,
++        "pat": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm-nopiodelay": false,
++        "tm": false,
++        "kvmclock-stable-bit": false,
++        "hypervisor": true,
++        "pcommit": true,
++        "syscall": true,
++        "avx512dq": false,
++        "svm": true,
++        "invtsc": false,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-eoi": false,
++        "kvm-pv-ipi": false,
++        "cx8": true,
++        "cldemote": false,
++        "kvm-mmu": false,
++        "sse4.2": true,
++        "pge": true,
++        "avx512bitalg": false,
++        "pdcm": false,
++        "model": 6,
++        "movbe": true,
++        "nrip-save": false,
++        "ssse3": true,
++        "sse4a": true,
++        "invpcid": false,
++        "pdpe1gb": true,
++        "tsc-deadline": false,
++        "skip-l1dfl-vmentry": false,
++        "fma": false,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ds-cpl": false,
++        "ibs": false,
++        "fma4": false,
++        "la57": true,
++        "osvw": false,
++        "apic": true,
++        "pmm": false,
++        "spec-ctrl": false,
++        "tsc-adjust": false,
++        "kvm-steal-time": false,
++        "kvmclock": false,
++        "lwp": false,
++        "amd-ssbd": false,
++        "xop": false,
++        "ibpb": false,
++        "avx": false,
++        "acpi": true,
++        "avx512bw": false,
++        "ace2": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": true,
++        "popcnt": true,
++        "vaes": false,
++        "xsaves": false,
++        "lm": true,
++        "umip": false,
++        "pse": true,
++        "avx2": false,
++        "sep": true,
++        "virt-ssbd": false,
++        "nodeid-msr": false,
++        "misalignsse": false,
++        "min-xlevel": 2147483658,
++        "bmi1": true,
++        "bmi2": true,
++        "kvm-pv-unhalt": false,
++        "tsc-scale": false,
++        "topoext": false,
++        "clflushopt": true,
++        "monitor": true,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": false,
++        "arch-capabilities": false,
++        "3dnow": true,
++        "erms": true,
++        "lahf-lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "xstore": false,
++        "rtm": false,
++        "kvm-hint-dedicated": false,
++        "lmce": false,
++        "perfctr-nb": false,
++        "rdrand": false,
++        "rdseed": false,
++        "avx512-4vnniw": false,
++        "vme": false,
++        "vmx": false,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": false,
++        "tbm": false,
++        "wdt": false,
++        "model-id": "QEMU TCG CPU version 2.5+",
++        "sha-ni": false,
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-3"
++}
++
++{
++  "execute": "query-cpu-model-expansion",
++  "arguments": {
++    "type": "full",
++    "model": {
++      "name": "base",
++      "props": {
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": false,
++        "intel-pt": false,
++        "kvm-asyncpf": false,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "avx512cd": false,
++        "decodeassists": false,
++        "sse4.1": true,
++        "family": 6,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "xcrypt": false,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": false,
++        "avx512vbmi2": false,
++        "cr8legacy": true,
++        "xcrypt-en": false,
++        "pn": false,
++        "rsba": false,
++        "dca": false,
++        "vendor": "AuthenticAMD",
++        "pku": true,
++        "smx": false,
++        "cmp-legacy": false,
++        "avx512-4fmaps": false,
++        "vmcb-clean": false,
++        "hle": false,
++        "3dnowext": true,
++        "amd-no-ssb": false,
++        "npt": true,
++        "rdctl-no": false,
++        "clwb": true,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm-lock": false,
++        "smep": true,
++        "smap": true,
++        "pfthreshold": false,
++        "x2apic": false,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "flushbyasid": false,
++        "f16c": false,
++        "ace2-en": false,
++        "pae": true,
++        "pat": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm-nopiodelay": false,
++        "tm": false,
++        "kvmclock-stable-bit": false,
++        "hypervisor": true,
++        "pcommit": true,
++        "syscall": true,
++        "avx512dq": false,
++        "svm": true,
++        "invtsc": false,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-eoi": false,
++        "kvm-pv-ipi": false,
++        "cx8": true,
++        "cldemote": false,
++        "kvm-mmu": false,
++        "sse4.2": true,
++        "pge": true,
++        "avx512bitalg": false,
++        "pdcm": false,
++        "model": 6,
++        "movbe": true,
++        "nrip-save": false,
++        "ssse3": true,
++        "sse4a": true,
++        "invpcid": false,
++        "pdpe1gb": true,
++        "tsc-deadline": false,
++        "skip-l1dfl-vmentry": false,
++        "fma": false,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ds-cpl": false,
++        "ibs": false,
++        "fma4": false,
++        "la57": true,
++        "osvw": false,
++        "apic": true,
++        "pmm": false,
++        "spec-ctrl": false,
++        "tsc-adjust": false,
++        "kvm-steal-time": false,
++        "kvmclock": false,
++        "lwp": false,
++        "amd-ssbd": false,
++        "xop": false,
++        "ibpb": false,
++        "avx": false,
++        "acpi": true,
++        "avx512bw": false,
++        "ace2": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": true,
++        "popcnt": true,
++        "vaes": false,
++        "xsaves": false,
++        "lm": true,
++        "umip": false,
++        "pse": true,
++        "avx2": false,
++        "sep": true,
++        "virt-ssbd": false,
++        "nodeid-msr": false,
++        "misalignsse": false,
++        "min-xlevel": 2147483658,
++        "bmi1": true,
++        "bmi2": true,
++        "kvm-pv-unhalt": false,
++        "tsc-scale": false,
++        "topoext": false,
++        "clflushopt": true,
++        "monitor": true,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": false,
++        "arch-capabilities": false,
++        "3dnow": true,
++        "erms": true,
++        "lahf-lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "xstore": false,
++        "rtm": false,
++        "kvm-hint-dedicated": false,
++        "lmce": false,
++        "perfctr-nb": false,
++        "rdrand": false,
++        "rdseed": false,
++        "avx512-4vnniw": false,
++        "vme": false,
++        "vmx": false,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": false,
++        "tbm": false,
++        "wdt": false,
++        "model-id": "QEMU TCG CPU version 2.5+",
++        "sha-ni": false,
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-4"
++}
++
++{
++  "return": {
++    "model": {
++      "name": "base",
++      "props": {
++        "phys-bits": 0,
++        "core-id": -1,
++        "xlevel": 2147483658,
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": false,
++        "intel-pt": false,
++        "hv-frequencies": false,
++        "tsc-frequency": 0,
++        "xd": true,
++        "hv-vendor-id": "",
++        "kvm-asyncpf": false,
++        "kvm_asyncpf": false,
++        "perfctr_core": false,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "decodeassists": false,
++        "avx512cd": false,
++        "sse4_1": true,
++        "sse4.1": true,
++        "sse4-1": true,
++        "family": 6,
++        "legacy-cache": true,
++        "vmware-cpuid-freq": true,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "hv-runtime": false,
++        "xcrypt": false,
++        "thread-id": -1,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "hv-relaxed": false,
++        "hv-crash": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "hv-evmcs": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": false,
++        "avx512vbmi2": false,
++        "cr8legacy": true,
++        "cpuid-0xb": true,
++        "xcrypt-en": false,
++        "kvm_pv_eoi": false,
++        "apic-id": 4294967295,
++        "rsba": false,
++        "pn": false,
++        "dca": false,
++        "vendor": "AuthenticAMD",
++        "hv-ipi": false,
++        "pku": true,
++        "smx": false,
++        "cmp_legacy": false,
++        "cmp-legacy": false,
++        "node-id": -1,
++        "avx512-4fmaps": false,
++        "vmcb_clean": false,
++        "vmcb-clean": false,
++        "3dnowext": true,
++        "amd-no-ssb": false,
++        "hle": false,
++        "npt": true,
++        "rdctl-no": false,
++        "memory": "/machine/unattached/system[0]",
++        "clwb": true,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm_lock": false,
++        "svm-lock": false,
++        "pfthreshold": false,
++        "smep": true,
++        "smap": true,
++        "x2apic": false,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "hv-stimer": false,
++        "x-hv-synic-kvm-only": false,
++        "i64": true,
++        "flushbyasid": false,
++        "f16c": false,
++        "ace2-en": false,
++        "pat": true,
++        "pae": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm_nopiodelay": false,
++        "kvm-nopiodelay": false,
++        "tm": false,
++        "kvmclock-stable-bit": false,
++        "hypervisor": true,
++        "socket-id": -1,
++        "pcommit": true,
++        "syscall": true,
++        "level": 13,
++        "avx512dq": false,
++        "x-migrate-smi-count": true,
++        "svm": true,
++        "full-cpuid-auto-level": true,
++        "hv-reset": false,
++        "invtsc": false,
++        "sse3": true,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-ipi": false,
++        "kvm-pv-eoi": false,
++        "cx8": true,
++        "cldemote": false,
++        "hv-reenlightenment": false,
++        "kvm_mmu": false,
++        "kvm-mmu": false,
++        "sse4_2": true,
++        "sse4.2": true,
++        "sse4-2": true,
++        "pge": true,
++        "fill-mtrr-mask": true,
++        "avx512bitalg": false,
++        "nodeid_msr": false,
++        "pdcm": false,
++        "movbe": true,
++        "model": 6,
++        "nrip_save": false,
++        "nrip-save": false,
++        "kvm_pv_unhalt": false,
++        "ssse3": true,
++        "sse4a": true,
++        "invpcid": false,
++        "pdpe1gb": true,
++        "tsc-deadline": false,
++        "skip-l1dfl-vmentry": false,
++        "fma": false,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "enforce": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ibs": false,
++        "ds_cpl": false,
++        "ds-cpl": false,
++        "host-phys-bits": false,
++        "fma4": false,
++        "la57": true,
++        "osvw": false,
++        "check": true,
++        "hv-spinlocks": -1,
++        "pmu": false,
++        "pmm": false,
++        "apic": true,
++        "spec-ctrl": false,
++        "min-xlevel2": 0,
++        "tsc-adjust": false,
++        "tsc_adjust": false,
++        "kvm-steal-time": false,
++        "kvm_steal_time": false,
++        "kvmclock": false,
++        "l3-cache": true,
++        "lwp": false,
++        "amd-ssbd": false,
++        "ibpb": false,
++        "xop": false,
++        "avx": false,
++        "ace2": false,
++        "avx512bw": false,
++        "acpi": true,
++        "hv-vapic": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": true,
++        "vaes": false,
++        "popcnt": true,
++        "xsaves": false,
++        "tcg-cpuid": true,
++        "lm": true,
++        "umip": false,
++        "pse": true,
++        "avx2": false,
++        "sep": true,
++        "pclmuldq": true,
++        "virt-ssbd": false,
++        "x-hv-max-vps": -1,
++        "nodeid-msr": false,
++        "kvm": true,
++        "misalignsse": false,
++        "min-xlevel": 2147483658,
++        "kvm-pv-unhalt": false,
++        "bmi2": true,
++        "bmi1": true,
++        "realized": false,
++        "tsc_scale": false,
++        "tsc-scale": false,
++        "topoext": false,
++        "hv-vpindex": false,
++        "xlevel2": 0,
++        "clflushopt": true,
++        "kvm-no-smi-migration": false,
++        "monitor": true,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": false,
++        "arch-capabilities": false,
++        "3dnow": true,
++        "erms": true,
++        "lahf-lm": true,
++        "lahf_lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "hv-synic": false,
++        "xstore": false,
++        "fxsr_opt": false,
++        "kvm-hint-dedicated": false,
++        "rtm": false,
++        "lmce": false,
++        "hv-time": false,
++        "perfctr-nb": false,
++        "perfctr_nb": false,
++        "ffxsr": false,
++        "hv-tlbflush": false,
++        "rdrand": false,
++        "rdseed": false,
++        "avx512-4vnniw": false,
++        "vmx": false,
++        "vme": false,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": false,
++        "tbm": false,
++        "wdt": false,
++        "pause_filter": false,
++        "sha-ni": false,
++        "model-id": "QEMU TCG CPU version 2.5+",
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-4"
++}
++
++{
++  "execute": "query-cpu-model-expansion",
++  "arguments": {
++    "type": "static",
++    "model": {
++      "name": "max",
++      "props": {
++        "migratable": false
++      }
++    }
++  },
++  "id": "libvirt-5"
++}
++
++{
++  "return": {
++    "model": {
++      "name": "base",
++      "props": {
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": false,
++        "intel-pt": false,
++        "kvm-asyncpf": false,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "avx512cd": false,
++        "decodeassists": false,
++        "sse4.1": true,
++        "family": 6,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "xcrypt": false,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": false,
++        "avx512vbmi2": false,
++        "cr8legacy": true,
++        "xcrypt-en": false,
++        "pn": false,
++        "rsba": false,
++        "dca": false,
++        "vendor": "AuthenticAMD",
++        "pku": true,
++        "smx": false,
++        "cmp-legacy": false,
++        "avx512-4fmaps": false,
++        "vmcb-clean": false,
++        "hle": false,
++        "3dnowext": true,
++        "amd-no-ssb": false,
++        "npt": true,
++        "rdctl-no": false,
++        "clwb": true,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm-lock": false,
++        "smep": true,
++        "smap": true,
++        "pfthreshold": false,
++        "x2apic": false,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "flushbyasid": false,
++        "f16c": false,
++        "ace2-en": false,
++        "pae": true,
++        "pat": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm-nopiodelay": false,
++        "tm": false,
++        "kvmclock-stable-bit": false,
++        "hypervisor": true,
++        "pcommit": true,
++        "syscall": true,
++        "avx512dq": false,
++        "svm": true,
++        "invtsc": false,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-eoi": false,
++        "kvm-pv-ipi": false,
++        "cx8": true,
++        "cldemote": false,
++        "kvm-mmu": false,
++        "sse4.2": true,
++        "pge": true,
++        "avx512bitalg": false,
++        "pdcm": false,
++        "model": 6,
++        "movbe": true,
++        "nrip-save": false,
++        "ssse3": true,
++        "sse4a": true,
++        "invpcid": false,
++        "pdpe1gb": true,
++        "tsc-deadline": false,
++        "skip-l1dfl-vmentry": false,
++        "fma": false,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ds-cpl": false,
++        "ibs": false,
++        "fma4": false,
++        "la57": true,
++        "osvw": false,
++        "apic": true,
++        "pmm": false,
++        "spec-ctrl": false,
++        "tsc-adjust": false,
++        "kvm-steal-time": false,
++        "kvmclock": false,
++        "lwp": false,
++        "amd-ssbd": false,
++        "xop": false,
++        "ibpb": false,
++        "avx": false,
++        "acpi": true,
++        "avx512bw": false,
++        "ace2": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": true,
++        "popcnt": true,
++        "vaes": false,
++        "xsaves": false,
++        "lm": true,
++        "umip": false,
++        "pse": true,
++        "avx2": false,
++        "sep": true,
++        "virt-ssbd": false,
++        "nodeid-msr": false,
++        "misalignsse": false,
++        "min-xlevel": 2147483658,
++        "bmi1": true,
++        "bmi2": true,
++        "kvm-pv-unhalt": false,
++        "tsc-scale": false,
++        "topoext": false,
++        "clflushopt": true,
++        "monitor": true,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": false,
++        "arch-capabilities": false,
++        "3dnow": true,
++        "erms": true,
++        "lahf-lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "xstore": false,
++        "rtm": false,
++        "kvm-hint-dedicated": false,
++        "lmce": false,
++        "perfctr-nb": false,
++        "rdrand": false,
++        "rdseed": false,
++        "avx512-4vnniw": false,
++        "vme": false,
++        "vmx": false,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": false,
++        "tbm": false,
++        "wdt": false,
++        "model-id": "QEMU TCG CPU version 2.5+",
++        "sha-ni": false,
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-5"
++}
++
++{
++  "execute": "query-cpu-model-expansion",
++  "arguments": {
++    "type": "full",
++    "model": {
++      "name": "base",
++      "props": {
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": false,
++        "intel-pt": false,
++        "kvm-asyncpf": false,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "avx512cd": false,
++        "decodeassists": false,
++        "sse4.1": true,
++        "family": 6,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "xcrypt": false,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": false,
++        "avx512vbmi2": false,
++        "cr8legacy": true,
++        "xcrypt-en": false,
++        "pn": false,
++        "rsba": false,
++        "dca": false,
++        "vendor": "AuthenticAMD",
++        "pku": true,
++        "smx": false,
++        "cmp-legacy": false,
++        "avx512-4fmaps": false,
++        "vmcb-clean": false,
++        "hle": false,
++        "3dnowext": true,
++        "amd-no-ssb": false,
++        "npt": true,
++        "rdctl-no": false,
++        "clwb": true,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm-lock": false,
++        "smep": true,
++        "smap": true,
++        "pfthreshold": false,
++        "x2apic": false,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "flushbyasid": false,
++        "f16c": false,
++        "ace2-en": false,
++        "pae": true,
++        "pat": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm-nopiodelay": false,
++        "tm": false,
++        "kvmclock-stable-bit": false,
++        "hypervisor": true,
++        "pcommit": true,
++        "syscall": true,
++        "avx512dq": false,
++        "svm": true,
++        "invtsc": false,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-eoi": false,
++        "kvm-pv-ipi": false,
++        "cx8": true,
++        "cldemote": false,
++        "kvm-mmu": false,
++        "sse4.2": true,
++        "pge": true,
++        "avx512bitalg": false,
++        "pdcm": false,
++        "model": 6,
++        "movbe": true,
++        "nrip-save": false,
++        "ssse3": true,
++        "sse4a": true,
++        "invpcid": false,
++        "pdpe1gb": true,
++        "tsc-deadline": false,
++        "skip-l1dfl-vmentry": false,
++        "fma": false,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ds-cpl": false,
++        "ibs": false,
++        "fma4": false,
++        "la57": true,
++        "osvw": false,
++        "apic": true,
++        "pmm": false,
++        "spec-ctrl": false,
++        "tsc-adjust": false,
++        "kvm-steal-time": false,
++        "kvmclock": false,
++        "lwp": false,
++        "amd-ssbd": false,
++        "xop": false,
++        "ibpb": false,
++        "avx": false,
++        "acpi": true,
++        "avx512bw": false,
++        "ace2": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": true,
++        "popcnt": true,
++        "vaes": false,
++        "xsaves": false,
++        "lm": true,
++        "umip": false,
++        "pse": true,
++        "avx2": false,
++        "sep": true,
++        "virt-ssbd": false,
++        "nodeid-msr": false,
++        "misalignsse": false,
++        "min-xlevel": 2147483658,
++        "bmi1": true,
++        "bmi2": true,
++        "kvm-pv-unhalt": false,
++        "tsc-scale": false,
++        "topoext": false,
++        "clflushopt": true,
++        "monitor": true,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": false,
++        "arch-capabilities": false,
++        "3dnow": true,
++        "erms": true,
++        "lahf-lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "xstore": false,
++        "rtm": false,
++        "kvm-hint-dedicated": false,
++        "lmce": false,
++        "perfctr-nb": false,
++        "rdrand": false,
++        "rdseed": false,
++        "avx512-4vnniw": false,
++        "vme": false,
++        "vmx": false,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": false,
++        "tbm": false,
++        "wdt": false,
++        "model-id": "QEMU TCG CPU version 2.5+",
++        "sha-ni": false,
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-6"
++}
++
++{
++  "return": {
++    "model": {
++      "name": "base",
++      "props": {
++        "phys-bits": 0,
++        "core-id": -1,
++        "xlevel": 2147483658,
++        "cmov": true,
++        "ia64": false,
++        "ssb-no": false,
++        "aes": true,
++        "mmx": true,
++        "rdpid": false,
++        "arat": true,
++        "gfni": false,
++        "ibrs-all": false,
++        "pause-filter": false,
++        "xsavec": false,
++        "intel-pt": false,
++        "hv-frequencies": false,
++        "tsc-frequency": 0,
++        "xd": true,
++        "hv-vendor-id": "",
++        "kvm-asyncpf": false,
++        "kvm_asyncpf": false,
++        "perfctr_core": false,
++        "perfctr-core": false,
++        "mpx": true,
++        "pbe": false,
++        "decodeassists": false,
++        "avx512cd": false,
++        "sse4_1": true,
++        "sse4.1": true,
++        "sse4-1": true,
++        "family": 6,
++        "legacy-cache": true,
++        "vmware-cpuid-freq": true,
++        "wbnoinvd": false,
++        "avx512f": false,
++        "msr": true,
++        "mce": true,
++        "mca": true,
++        "hv-runtime": false,
++        "xcrypt": false,
++        "thread-id": -1,
++        "min-level": 13,
++        "xgetbv1": true,
++        "cid": false,
++        "hv-relaxed": false,
++        "hv-crash": false,
++        "ds": false,
++        "fxsr": true,
++        "xsaveopt": true,
++        "xtpr": false,
++        "hv-evmcs": false,
++        "avx512vl": false,
++        "avx512-vpopcntdq": false,
++        "phe": false,
++        "extapic": false,
++        "3dnowprefetch": false,
++        "avx512vbmi2": false,
++        "cr8legacy": true,
++        "cpuid-0xb": true,
++        "xcrypt-en": false,
++        "kvm_pv_eoi": false,
++        "apic-id": 4294967295,
++        "rsba": false,
++        "pn": false,
++        "dca": false,
++        "vendor": "AuthenticAMD",
++        "hv-ipi": false,
++        "pku": true,
++        "smx": false,
++        "cmp_legacy": false,
++        "cmp-legacy": false,
++        "node-id": -1,
++        "avx512-4fmaps": false,
++        "vmcb_clean": false,
++        "vmcb-clean": false,
++        "3dnowext": true,
++        "amd-no-ssb": false,
++        "hle": false,
++        "npt": true,
++        "rdctl-no": false,
++        "memory": "/machine/unattached/system[0]",
++        "clwb": true,
++        "lbrv": false,
++        "adx": true,
++        "ss": true,
++        "pni": true,
++        "svm_lock": false,
++        "svm-lock": false,
++        "pfthreshold": false,
++        "smep": true,
++        "smap": true,
++        "x2apic": false,
++        "avx512vbmi": false,
++        "avx512vnni": false,
++        "hv-stimer": false,
++        "x-hv-synic-kvm-only": false,
++        "i64": true,
++        "flushbyasid": false,
++        "f16c": false,
++        "ace2-en": false,
++        "pat": true,
++        "pae": true,
++        "sse": true,
++        "phe-en": false,
++        "kvm_nopiodelay": false,
++        "kvm-nopiodelay": false,
++        "tm": false,
++        "kvmclock-stable-bit": false,
++        "hypervisor": true,
++        "socket-id": -1,
++        "pcommit": true,
++        "syscall": true,
++        "level": 13,
++        "avx512dq": false,
++        "x-migrate-smi-count": true,
++        "svm": true,
++        "full-cpuid-auto-level": true,
++        "hv-reset": false,
++        "invtsc": false,
++        "sse3": true,
++        "sse2": true,
++        "ssbd": false,
++        "est": false,
++        "avx512ifma": false,
++        "tm2": false,
++        "kvm-pv-ipi": false,
++        "kvm-pv-eoi": false,
++        "cx8": true,
++        "cldemote": false,
++        "hv-reenlightenment": false,
++        "kvm_mmu": false,
++        "kvm-mmu": false,
++        "sse4_2": true,
++        "sse4.2": true,
++        "sse4-2": true,
++        "pge": true,
++        "fill-mtrr-mask": true,
++        "avx512bitalg": false,
++        "nodeid_msr": false,
++        "pdcm": false,
++        "movbe": true,
++        "model": 6,
++        "nrip_save": false,
++        "nrip-save": false,
++        "kvm_pv_unhalt": false,
++        "ssse3": true,
++        "sse4a": true,
++        "invpcid": false,
++        "pdpe1gb": true,
++        "tsc-deadline": false,
++        "skip-l1dfl-vmentry": false,
++        "fma": false,
++        "cx16": true,
++        "de": true,
++        "pconfig": false,
++        "enforce": false,
++        "stepping": 3,
++        "xsave": true,
++        "clflush": true,
++        "skinit": false,
++        "tsc": true,
++        "tce": false,
++        "fpu": true,
++        "ibs": false,
++        "ds_cpl": false,
++        "ds-cpl": false,
++        "host-phys-bits": false,
++        "fma4": false,
++        "la57": true,
++        "osvw": false,
++        "check": true,
++        "hv-spinlocks": -1,
++        "pmu": false,
++        "pmm": false,
++        "apic": true,
++        "spec-ctrl": false,
++        "min-xlevel2": 0,
++        "tsc-adjust": false,
++        "tsc_adjust": false,
++        "kvm-steal-time": false,
++        "kvm_steal_time": false,
++        "kvmclock": false,
++        "l3-cache": true,
++        "lwp": false,
++        "amd-ssbd": false,
++        "ibpb": false,
++        "xop": false,
++        "avx": false,
++        "ace2": false,
++        "avx512bw": false,
++        "acpi": true,
++        "hv-vapic": false,
++        "fsgsbase": true,
++        "ht": false,
++        "nx": true,
++        "pclmulqdq": true,
++        "mmxext": true,
++        "vaes": false,
++        "popcnt": true,
++        "xsaves": false,
++        "tcg-cpuid": true,
++        "lm": true,
++        "umip": false,
++        "pse": true,
++        "avx2": false,
++        "sep": true,
++        "pclmuldq": true,
++        "virt-ssbd": false,
++        "x-hv-max-vps": -1,
++        "nodeid-msr": false,
++        "kvm": true,
++        "misalignsse": false,
++        "min-xlevel": 2147483658,
++        "kvm-pv-unhalt": false,
++        "bmi2": true,
++        "bmi1": true,
++        "realized": false,
++        "tsc_scale": false,
++        "tsc-scale": false,
++        "topoext": false,
++        "hv-vpindex": false,
++        "xlevel2": 0,
++        "clflushopt": true,
++        "kvm-no-smi-migration": false,
++        "monitor": true,
++        "avx512er": false,
++        "pmm-en": false,
++        "pcid": false,
++        "arch-capabilities": false,
++        "3dnow": true,
++        "erms": true,
++        "lahf-lm": true,
++        "lahf_lm": true,
++        "vpclmulqdq": false,
++        "fxsr-opt": false,
++        "hv-synic": false,
++        "xstore": false,
++        "fxsr_opt": false,
++        "kvm-hint-dedicated": false,
++        "rtm": false,
++        "lmce": false,
++        "hv-time": false,
++        "perfctr-nb": false,
++        "perfctr_nb": false,
++        "ffxsr": false,
++        "hv-tlbflush": false,
++        "rdrand": false,
++        "rdseed": false,
++        "avx512-4vnniw": false,
++        "vmx": false,
++        "vme": false,
++        "dtes64": false,
++        "mtrr": true,
++        "rdtscp": true,
++        "pse36": true,
++        "kvm-pv-tlb-flush": false,
++        "tbm": false,
++        "wdt": false,
++        "pause_filter": false,
++        "sha-ni": false,
++        "model-id": "QEMU TCG CPU version 2.5+",
++        "abm": true,
++        "avx512pf": false,
++        "xstore-en": false
++      }
++    }
++  },
++  "id": "libvirt-6"
++}
+diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
+new file mode 100644
+index 0000000000..cbeea14796
+--- /dev/null
++++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
+@@ -0,0 +1,1382 @@
++<qemuCaps>
++  <qemuctime>0</qemuctime>
++  <selfctime>0</selfctime>
++  <selfvers>0</selfvers>
++  <usedQMP/>
++  <flag name='kvm'/>
++  <flag name='no-hpet'/>
++  <flag name='spice'/>
++  <flag name='boot-index'/>
++  <flag name='hda-duplex'/>
++  <flag name='ccid-emulated'/>
++  <flag name='ccid-passthru'/>
++  <flag name='virtio-tx-alg'/>
++  <flag name='virtio-blk-pci.ioeventfd'/>
++  <flag name='sga'/>
++  <flag name='virtio-blk-pci.event_idx'/>
++  <flag name='virtio-net-pci.event_idx'/>
++  <flag name='piix3-usb-uhci'/>
++  <flag name='piix4-usb-uhci'/>
++  <flag name='usb-ehci'/>
++  <flag name='ich9-usb-ehci1'/>
++  <flag name='vt82c686b-usb-uhci'/>
++  <flag name='pci-ohci'/>
++  <flag name='usb-redir'/>
++  <flag name='usb-hub'/>
++  <flag name='ich9-ahci'/>
++  <flag name='no-acpi'/>
++  <flag name='virtio-blk-pci.scsi'/>
++  <flag name='scsi-disk.channel'/>
++  <flag name='scsi-block'/>
++  <flag name='transaction'/>
++  <flag name='block-job-async'/>
++  <flag name='scsi-cd'/>
++  <flag name='ide-cd'/>
++  <flag name='hda-micro'/>
++  <flag name='dump-guest-memory'/>
++  <flag name='nec-usb-xhci'/>
++  <flag name='balloon-event'/>
++  <flag name='lsi'/>
++  <flag name='virtio-scsi-pci'/>
++  <flag name='blockio'/>
++  <flag name='disable-s3'/>
++  <flag name='disable-s4'/>
++  <flag name='usb-redir.filter'/>
++  <flag name='ide-drive.wwn'/>
++  <flag name='scsi-disk.wwn'/>
++  <flag name='seccomp-sandbox'/>
++  <flag name='reboot-timeout'/>
++  <flag name='seamless-migration'/>
++  <flag name='block-commit'/>
++  <flag name='vnc'/>
++  <flag name='drive-mirror'/>
++  <flag name='usb-redir.bootindex'/>
++  <flag name='usb-host.bootindex'/>
++  <flag name='blockdev-snapshot-sync'/>
++  <flag name='qxl'/>
++  <flag name='VGA'/>
++  <flag name='cirrus-vga'/>
++  <flag name='vmware-svga'/>
++  <flag name='device-video-primary'/>
++  <flag name='usb-serial'/>
++  <flag name='usb-net'/>
++  <flag name='add-fd'/>
++  <flag name='nbd-server'/>
++  <flag name='virtio-rng'/>
++  <flag name='rng-random'/>
++  <flag name='rng-egd'/>
++  <flag name='megasas'/>
++  <flag name='tpm-passthrough'/>
++  <flag name='tpm-tis'/>
++  <flag name='pci-bridge'/>
++  <flag name='vfio-pci'/>
++  <flag name='vfio-pci.bootindex'/>
++  <flag name='scsi-generic'/>
++  <flag name='scsi-generic.bootindex'/>
++  <flag name='mem-merge'/>
++  <flag name='vnc-websocket'/>
++  <flag name='drive-discard'/>
++  <flag name='mlock'/>
++  <flag name='device-del-event'/>
++  <flag name='dmi-to-pci-bridge'/>
++  <flag name='i440fx-pci-hole64-size'/>
++  <flag name='q35-pci-hole64-size'/>
++  <flag name='usb-storage'/>
++  <flag name='usb-storage.removable'/>
++  <flag name='ich9-intel-hda'/>
++  <flag name='kvm-pit-lost-tick-policy'/>
++  <flag name='boot-strict'/>
++  <flag name='pvpanic'/>
++  <flag name='spice-file-xfer-disable'/>
++  <flag name='spiceport'/>
++  <flag name='usb-kbd'/>
++  <flag name='msg-timestamp'/>
++  <flag name='active-commit'/>
++  <flag name='change-backing-file'/>
++  <flag name='memory-backend-ram'/>
++  <flag name='numa'/>
++  <flag name='memory-backend-file'/>
++  <flag name='usb-audio'/>
++  <flag name='rtc-reset-reinjection'/>
++  <flag name='splash-timeout'/>
++  <flag name='iothread'/>
++  <flag name='migrate-rdma'/>
++  <flag name='ivshmem'/>
++  <flag name='drive-iotune-max'/>
++  <flag name='VGA.vgamem_mb'/>
++  <flag name='vmware-svga.vgamem_mb'/>
++  <flag name='qxl.vgamem_mb'/>
++  <flag name='pc-dimm'/>
++  <flag name='machine-vmport-opt'/>
++  <flag name='aes-key-wrap'/>
++  <flag name='dea-key-wrap'/>
++  <flag name='pci-serial'/>
++  <flag name='vhost-user-multiqueue'/>
++  <flag name='migration-event'/>
++  <flag name='ioh3420'/>
++  <flag name='x3130-upstream'/>
++  <flag name='xio3130-downstream'/>
++  <flag name='rtl8139'/>
++  <flag name='e1000'/>
++  <flag name='virtio-net'/>
++  <flag name='gic-version'/>
++  <flag name='incoming-defer'/>
++  <flag name='virtio-gpu'/>
++  <flag name='virtio-gpu.virgl'/>
++  <flag name='virtio-keyboard'/>
++  <flag name='virtio-mouse'/>
++  <flag name='virtio-tablet'/>
++  <flag name='virtio-input-host'/>
++  <flag name='chardev-file-append'/>
++  <flag name='ich9-disable-s3'/>
++  <flag name='ich9-disable-s4'/>
++  <flag name='vserport-change-event'/>
++  <flag name='virtio-balloon-pci.deflate-on-oom'/>
++  <flag name='mptsas1068'/>
++  <flag name='spice-gl'/>
++  <flag name='qxl.vram64_size_mb'/>
++  <flag name='chardev-logfile'/>
++  <flag name='debug-threads'/>
++  <flag name='secret'/>
++  <flag name='pxb'/>
++  <flag name='pxb-pcie'/>
++  <flag name='device-tray-moved-event'/>
++  <flag name='nec-usb-xhci-ports'/>
++  <flag name='virtio-scsi-pci.iothread'/>
++  <flag name='name-guest'/>
++  <flag name='qxl.max_outputs'/>
++  <flag name='spice-unix'/>
++  <flag name='drive-detect-zeroes'/>
++  <flag name='tls-creds-x509'/>
++  <flag name='intel-iommu'/>
++  <flag name='smm'/>
++  <flag name='virtio-pci-disable-legacy'/>
++  <flag name='query-hotpluggable-cpus'/>
++  <flag name='virtio-net.rx_queue_size'/>
++  <flag name='virtio-vga'/>
++  <flag name='drive-iotune-max-length'/>
++  <flag name='ivshmem-plain'/>
++  <flag name='ivshmem-doorbell'/>
++  <flag name='query-qmp-schema'/>
++  <flag name='gluster.debug_level'/>
++  <flag name='vhost-scsi'/>
++  <flag name='drive-iotune-group'/>
++  <flag name='query-cpu-model-expansion'/>
++  <flag name='virtio-net.host_mtu'/>
++  <flag name='spice-rendernode'/>
++  <flag name='nvdimm'/>
++  <flag name='pcie-root-port'/>
++  <flag name='query-cpu-definitions'/>
++  <flag name='block-write-threshold'/>
++  <flag name='query-named-block-nodes'/>
++  <flag name='cpu-cache'/>
++  <flag name='qemu-xhci'/>
++  <flag name='kernel-irqchip'/>
++  <flag name='kernel-irqchip.split'/>
++  <flag name='intel-iommu.intremap'/>
++  <flag name='intel-iommu.caching-mode'/>
++  <flag name='intel-iommu.eim'/>
++  <flag name='intel-iommu.device-iotlb'/>
++  <flag name='virtio.iommu_platform'/>
++  <flag name='virtio.ats'/>
++  <flag name='loadparm'/>
++  <flag name='vnc-multi-servers'/>
++  <flag name='virtio-net.tx_queue_size'/>
++  <flag name='chardev-reconnect'/>
++  <flag name='virtio-gpu.max_outputs'/>
++  <flag name='vxhs'/>
++  <flag name='virtio-blk.num-queues'/>
++  <flag name='vmcoreinfo'/>
++  <flag name='numa.dist'/>
++  <flag name='disk-share-rw'/>
++  <flag name='iscsi.password-secret'/>
++  <flag name='isa-serial'/>
++  <flag name='dump-completed'/>
++  <flag name='qcow2-luks'/>
++  <flag name='pcie-pci-bridge'/>
++  <flag name='seccomp-blacklist'/>
++  <flag name='query-cpus-fast'/>
++  <flag name='disk-write-cache'/>
++  <flag name='nbd-tls'/>
++  <flag name='tpm-crb'/>
++  <flag name='pr-manager-helper'/>
++  <flag name='qom-list-properties'/>
++  <flag name='memory-backend-file.discard-data'/>
++  <flag name='sdl-gl'/>
++  <flag name='screendump_device'/>
++  <flag name='hda-output'/>
++  <flag name='blockdev-del'/>
++  <flag name='vmgenid'/>
++  <flag name='vhost-vsock'/>
++  <flag name='chardev-fd-pass'/>
++  <flag name='tpm-emulator'/>
++  <flag name='mch'/>
++  <flag name='mch.extended-tseg-mbytes'/>
++  <flag name='usb-storage.werror'/>
++  <flag name='egl-headless'/>
++  <flag name='vfio-pci.display'/>
++  <version>3000092</version>
++  <kvmVersion>0</kvmVersion>
++  <microcodeVersion>441682</microcodeVersion>
++  <package>v3.1.0-rc2-48-g039d4e3df0</package>
++  <arch>x86_64</arch>
++  <hostCPU type='kvm' model='base' migratability='yes'>
++    <property name='phys-bits' type='number' value='0'/>
++    <property name='core-id' type='number' value='-1'/>
++    <property name='xlevel' type='number' value='2147483656'/>
++    <property name='cmov' type='boolean' value='true' migratable='yes'/>
++    <property name='ia64' type='boolean' value='false'/>
++    <property name='ssb-no' type='boolean' value='false'/>
++    <property name='aes' type='boolean' value='true' migratable='yes'/>
++    <property name='mmx' type='boolean' value='true' migratable='yes'/>
++    <property name='rdpid' type='boolean' value='false'/>
++    <property name='arat' type='boolean' value='true' migratable='yes'/>
++    <property name='gfni' type='boolean' value='false'/>
++    <property name='ibrs-all' type='boolean' value='false'/>
++    <property name='pause-filter' type='boolean' value='false'/>
++    <property name='xsavec' type='boolean' value='true' migratable='yes'/>
++    <property name='intel-pt' type='boolean' value='false'/>
++    <property name='hv-frequencies' type='boolean' value='false'/>
++    <property name='tsc-frequency' type='number' value='0'/>
++    <property name='xd' type='boolean' value='true' migratable='yes'/>
++    <property name='hv-vendor-id' type='string' value=''/>
++    <property name='kvm-asyncpf' type='boolean' value='true' migratable='yes'/>
++    <property name='kvm_asyncpf' type='boolean' value='true' migratable='yes'/>
++    <property name='perfctr_core' type='boolean' value='false'/>
++    <property name='perfctr-core' type='boolean' value='false'/>
++    <property name='mpx' type='boolean' value='true' migratable='yes'/>
++    <property name='pbe' type='boolean' value='false'/>
++    <property name='decodeassists' type='boolean' value='false'/>
++    <property name='avx512cd' type='boolean' value='false'/>
++    <property name='sse4_1' type='boolean' value='true' migratable='yes'/>
++    <property name='sse4.1' type='boolean' value='true' migratable='yes'/>
++    <property name='sse4-1' type='boolean' value='true' migratable='yes'/>
++    <property name='family' type='number' value='6'/>
++    <property name='legacy-cache' type='boolean' value='true' migratable='yes'/>
++    <property name='vmware-cpuid-freq' type='boolean' value='true' migratable='yes'/>
++    <property name='wbnoinvd' type='boolean' value='false'/>
++    <property name='avx512f' type='boolean' value='false'/>
++    <property name='msr' type='boolean' value='true' migratable='yes'/>
++    <property name='mce' type='boolean' value='true' migratable='yes'/>
++    <property name='mca' type='boolean' value='true' migratable='yes'/>
++    <property name='hv-runtime' type='boolean' value='false'/>
++    <property name='xcrypt' type='boolean' value='false'/>
++    <property name='thread-id' type='number' value='-1'/>
++    <property name='min-level' type='number' value='13'/>
++    <property name='xgetbv1' type='boolean' value='true' migratable='yes'/>
++    <property name='cid' type='boolean' value='false'/>
++    <property name='hv-relaxed' type='boolean' value='false'/>
++    <property name='hv-crash' type='boolean' value='false'/>
++    <property name='ds' type='boolean' value='false'/>
++    <property name='fxsr' type='boolean' value='true' migratable='yes'/>
++    <property name='xsaveopt' type='boolean' value='true' migratable='yes'/>
++    <property name='xtpr' type='boolean' value='false'/>
++    <property name='hv-evmcs' type='boolean' value='false'/>
++    <property name='avx512vl' type='boolean' value='false'/>
++    <property name='avx512-vpopcntdq' type='boolean' value='false'/>
++    <property name='phe' type='boolean' value='false'/>
++    <property name='extapic' type='boolean' value='false'/>
++    <property name='3dnowprefetch' type='boolean' value='true' migratable='yes'/>
++    <property name='avx512vbmi2' type='boolean' value='false'/>
++    <property name='cr8legacy' type='boolean' value='false'/>
++    <property name='cpuid-0xb' type='boolean' value='true' migratable='yes'/>
++    <property name='xcrypt-en' type='boolean' value='false'/>
++    <property name='kvm_pv_eoi' type='boolean' value='true' migratable='yes'/>
++    <property name='apic-id' type='number' value='4294967295'/>
++    <property name='rsba' type='boolean' value='false'/>
++    <property name='pn' type='boolean' value='false'/>
++    <property name='dca' type='boolean' value='false'/>
++    <property name='vendor' type='string' value='GenuineIntel'/>
++    <property name='hv-ipi' type='boolean' value='false'/>
++    <property name='pku' type='boolean' value='false'/>
++    <property name='smx' type='boolean' value='false'/>
++    <property name='cmp_legacy' type='boolean' value='false'/>
++    <property name='cmp-legacy' type='boolean' value='false'/>
++    <property name='node-id' type='number' value='-1'/>
++    <property name='avx512-4fmaps' type='boolean' value='false'/>
++    <property name='vmcb_clean' type='boolean' value='false'/>
++    <property name='vmcb-clean' type='boolean' value='false'/>
++    <property name='3dnowext' type='boolean' value='false'/>
++    <property name='amd-no-ssb' type='boolean' value='false'/>
++    <property name='hle' type='boolean' value='true' migratable='yes'/>
++    <property name='npt' type='boolean' value='false'/>
++    <property name='rdctl-no' type='boolean' value='false'/>
++    <property name='memory' type='string' value='/machine/unattached/system[0]'/>
++    <property name='clwb' type='boolean' value='false'/>
++    <property name='lbrv' type='boolean' value='false'/>
++    <property name='adx' type='boolean' value='true' migratable='yes'/>
++    <property name='ss' type='boolean' value='true' migratable='yes'/>
++    <property name='pni' type='boolean' value='true' migratable='yes'/>
++    <property name='svm_lock' type='boolean' value='false'/>
++    <property name='svm-lock' type='boolean' value='false'/>
++    <property name='pfthreshold' type='boolean' value='false'/>
++    <property name='smep' type='boolean' value='true' migratable='yes'/>
++    <property name='smap' type='boolean' value='true' migratable='yes'/>
++    <property name='x2apic' type='boolean' value='true' migratable='yes'/>
++    <property name='avx512vbmi' type='boolean' value='false'/>
++    <property name='avx512vnni' type='boolean' value='false'/>
++    <property name='hv-stimer' type='boolean' value='false'/>
++    <property name='x-hv-synic-kvm-only' type='boolean' value='false'/>
++    <property name='i64' type='boolean' value='true' migratable='yes'/>
++    <property name='flushbyasid' type='boolean' value='false'/>
++    <property name='f16c' type='boolean' value='true' migratable='yes'/>
++    <property name='ace2-en' type='boolean' value='false'/>
++    <property name='pat' type='boolean' value='true' migratable='yes'/>
++    <property name='pae' type='boolean' value='true' migratable='yes'/>
++    <property name='sse' type='boolean' value='true' migratable='yes'/>
++    <property name='phe-en' type='boolean' value='false'/>
++    <property name='kvm_nopiodelay' type='boolean' value='true' migratable='yes'/>
++    <property name='kvm-nopiodelay' type='boolean' value='true' migratable='yes'/>
++    <property name='tm' type='boolean' value='false'/>
++    <property name='kvmclock-stable-bit' type='boolean' value='true' migratable='yes'/>
++    <property name='hypervisor' type='boolean' value='true' migratable='yes'/>
++    <property name='socket-id' type='number' value='-1'/>
++    <property name='pcommit' type='boolean' value='false'/>
++    <property name='syscall' type='boolean' value='true' migratable='yes'/>
++    <property name='level' type='number' value='13'/>
++    <property name='avx512dq' type='boolean' value='false'/>
++    <property name='x-migrate-smi-count' type='boolean' value='true' migratable='yes'/>
++    <property name='svm' type='boolean' value='false'/>
++    <property name='full-cpuid-auto-level' type='boolean' value='true' migratable='yes'/>
++    <property name='hv-reset' type='boolean' value='false'/>
++    <property name='invtsc' type='boolean' value='true' migratable='no'/>
++    <property name='sse3' type='boolean' value='true' migratable='yes'/>
++    <property name='sse2' type='boolean' value='true' migratable='yes'/>
++    <property name='ssbd' type='boolean' value='false'/>
++    <property name='est' type='boolean' value='false'/>
++    <property name='avx512ifma' type='boolean' value='false'/>
++    <property name='tm2' type='boolean' value='false'/>
++    <property name='kvm-pv-ipi' type='boolean' value='false'/>
++    <property name='kvm-pv-eoi' type='boolean' value='true' migratable='yes'/>
++    <property name='cx8' type='boolean' value='true' migratable='yes'/>
++    <property name='cldemote' type='boolean' value='false'/>
++    <property name='hv-reenlightenment' type='boolean' value='false'/>
++    <property name='kvm_mmu' type='boolean' value='false'/>
++    <property name='kvm-mmu' type='boolean' value='false'/>
++    <property name='sse4_2' type='boolean' value='true' migratable='yes'/>
++    <property name='sse4.2' type='boolean' value='true' migratable='yes'/>
++    <property name='sse4-2' type='boolean' value='true' migratable='yes'/>
++    <property name='pge' type='boolean' value='true' migratable='yes'/>
++    <property name='fill-mtrr-mask' type='boolean' value='true' migratable='yes'/>
++    <property name='avx512bitalg' type='boolean' value='false'/>
++    <property name='nodeid_msr' type='boolean' value='false'/>
++    <property name='pdcm' type='boolean' value='false'/>
++    <property name='movbe' type='boolean' value='true' migratable='yes'/>
++    <property name='model' type='number' value='94'/>
++    <property name='nrip_save' type='boolean' value='false'/>
++    <property name='nrip-save' type='boolean' value='false'/>
++    <property name='kvm_pv_unhalt' type='boolean' value='true' migratable='yes'/>
++    <property name='ssse3' type='boolean' value='true' migratable='yes'/>
++    <property name='sse4a' type='boolean' value='false'/>
++    <property name='invpcid' type='boolean' value='true' migratable='yes'/>
++    <property name='pdpe1gb' type='boolean' value='true' migratable='yes'/>
++    <property name='tsc-deadline' type='boolean' value='true' migratable='yes'/>
++    <property name='skip-l1dfl-vmentry' type='boolean' value='true' migratable='yes'/>
++    <property name='fma' type='boolean' value='true' migratable='yes'/>
++    <property name='cx16' type='boolean' value='true' migratable='yes'/>
++    <property name='de' type='boolean' value='true' migratable='yes'/>
++    <property name='pconfig' type='boolean' value='false'/>
++    <property name='enforce' type='boolean' value='false'/>
++    <property name='stepping' type='number' value='3'/>
++    <property name='xsave' type='boolean' value='true' migratable='yes'/>
++    <property name='clflush' type='boolean' value='true' migratable='yes'/>
++    <property name='skinit' type='boolean' value='false'/>
++    <property name='tsc' type='boolean' value='true' migratable='yes'/>
++    <property name='tce' type='boolean' value='false'/>
++    <property name='fpu' type='boolean' value='true' migratable='yes'/>
++    <property name='ibs' type='boolean' value='false'/>
++    <property name='ds_cpl' type='boolean' value='false'/>
++    <property name='ds-cpl' type='boolean' value='false'/>
++    <property name='host-phys-bits' type='boolean' value='false'/>
++    <property name='fma4' type='boolean' value='false'/>
++    <property name='la57' type='boolean' value='false'/>
++    <property name='osvw' type='boolean' value='false'/>
++    <property name='check' type='boolean' value='true' migratable='yes'/>
++    <property name='hv-spinlocks' type='number' value='-1'/>
++    <property name='pmu' type='boolean' value='false'/>
++    <property name='pmm' type='boolean' value='false'/>
++    <property name='apic' type='boolean' value='true' migratable='yes'/>
++    <property name='spec-ctrl' type='boolean' value='true' migratable='yes'/>
++    <property name='min-xlevel2' type='number' value='0'/>
++    <property name='tsc-adjust' type='boolean' value='true' migratable='yes'/>
++    <property name='tsc_adjust' type='boolean' value='true' migratable='yes'/>
++    <property name='kvm-steal-time' type='boolean' value='true' migratable='yes'/>
++    <property name='kvm_steal_time' type='boolean' value='true' migratable='yes'/>
++    <property name='kvmclock' type='boolean' value='true' migratable='yes'/>
++    <property name='l3-cache' type='boolean' value='true' migratable='yes'/>
++    <property name='lwp' type='boolean' value='false'/>
++    <property name='amd-ssbd' type='boolean' value='false'/>
++    <property name='ibpb' type='boolean' value='false'/>
++    <property name='xop' type='boolean' value='false'/>
++    <property name='avx' type='boolean' value='true' migratable='yes'/>
++    <property name='ace2' type='boolean' value='false'/>
++    <property name='avx512bw' type='boolean' value='false'/>
++    <property name='acpi' type='boolean' value='false'/>
++    <property name='hv-vapic' type='boolean' value='false'/>
++    <property name='fsgsbase' type='boolean' value='true' migratable='yes'/>
++    <property name='ht' type='boolean' value='false'/>
++    <property name='nx' type='boolean' value='true' migratable='yes'/>
++    <property name='pclmulqdq' type='boolean' value='true' migratable='yes'/>
++    <property name='mmxext' type='boolean' value='false'/>
++    <property name='vaes' type='boolean' value='false'/>
++    <property name='popcnt' type='boolean' value='true' migratable='yes'/>
++    <property name='xsaves' type='boolean' value='true' migratable='yes'/>
++    <property name='tcg-cpuid' type='boolean' value='true' migratable='yes'/>
++    <property name='lm' type='boolean' value='true' migratable='yes'/>
++    <property name='umip' type='boolean' value='true' migratable='yes'/>
++    <property name='pse' type='boolean' value='true' migratable='yes'/>
++    <property name='avx2' type='boolean' value='true' migratable='yes'/>
++    <property name='sep' type='boolean' value='true' migratable='yes'/>
++    <property name='pclmuldq' type='boolean' value='true' migratable='yes'/>
++    <property name='virt-ssbd' type='boolean' value='false'/>
++    <property name='x-hv-max-vps' type='number' value='-1'/>
++    <property name='nodeid-msr' type='boolean' value='false'/>
++    <property name='kvm' type='boolean' value='true' migratable='yes'/>
++    <property name='misalignsse' type='boolean' value='false'/>
++    <property name='min-xlevel' type='number' value='2147483656'/>
++    <property name='kvm-pv-unhalt' type='boolean' value='true' migratable='yes'/>
++    <property name='bmi2' type='boolean' value='true' migratable='yes'/>
++    <property name='bmi1' type='boolean' value='true' migratable='yes'/>
++    <property name='realized' type='boolean' value='false'/>
++    <property name='tsc_scale' type='boolean' value='false'/>
++    <property name='tsc-scale' type='boolean' value='false'/>
++    <property name='topoext' type='boolean' value='false'/>
++    <property name='hv-vpindex' type='boolean' value='false'/>
++    <property name='xlevel2' type='number' value='0'/>
++    <property name='clflushopt' type='boolean' value='true' migratable='yes'/>
++    <property name='kvm-no-smi-migration' type='boolean' value='false'/>
++    <property name='monitor' type='boolean' value='false'/>
++    <property name='avx512er' type='boolean' value='false'/>
++    <property name='pmm-en' type='boolean' value='false'/>
++    <property name='pcid' type='boolean' value='true' migratable='yes'/>
++    <property name='arch-capabilities' type='boolean' value='true' migratable='no'/>
++    <property name='3dnow' type='boolean' value='false'/>
++    <property name='erms' type='boolean' value='true' migratable='yes'/>
++    <property name='lahf-lm' type='boolean' value='true' migratable='yes'/>
++    <property name='lahf_lm' type='boolean' value='true' migratable='yes'/>
++    <property name='vpclmulqdq' type='boolean' value='false'/>
++    <property name='fxsr-opt' type='boolean' value='false'/>
++    <property name='hv-synic' type='boolean' value='false'/>
++    <property name='xstore' type='boolean' value='false'/>
++    <property name='fxsr_opt' type='boolean' value='false'/>
++    <property name='kvm-hint-dedicated' type='boolean' value='false'/>
++    <property name='rtm' type='boolean' value='true' migratable='yes'/>
++    <property name='lmce' type='boolean' value='true' migratable='yes'/>
++    <property name='hv-time' type='boolean' value='false'/>
++    <property name='perfctr-nb' type='boolean' value='false'/>
++    <property name='perfctr_nb' type='boolean' value='false'/>
++    <property name='ffxsr' type='boolean' value='false'/>
++    <property name='hv-tlbflush' type='boolean' value='false'/>
++    <property name='rdrand' type='boolean' value='true' migratable='yes'/>
++    <property name='rdseed' type='boolean' value='true' migratable='yes'/>
++    <property name='avx512-4vnniw' type='boolean' value='false'/>
++    <property name='vmx' type='boolean' value='true' migratable='yes'/>
++    <property name='vme' type='boolean' value='true' migratable='yes'/>
++    <property name='dtes64' type='boolean' value='false'/>
++    <property name='mtrr' type='boolean' value='true' migratable='yes'/>
++    <property name='rdtscp' type='boolean' value='true' migratable='yes'/>
++    <property name='pse36' type='boolean' value='true' migratable='yes'/>
++    <property name='kvm-pv-tlb-flush' type='boolean' value='true' migratable='yes'/>
++    <property name='tbm' type='boolean' value='false'/>
++    <property name='wdt' type='boolean' value='false'/>
++    <property name='pause_filter' type='boolean' value='false'/>
++    <property name='sha-ni' type='boolean' value='false'/>
++    <property name='model-id' type='string' value='Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz'/>
++    <property name='abm' type='boolean' value='true' migratable='yes'/>
++    <property name='avx512pf' type='boolean' value='false'/>
++    <property name='xstore-en' type='boolean' value='false'/>
++  </hostCPU>
++  <hostCPU type='tcg' model='base' migratability='yes'>
++    <property name='phys-bits' type='number' value='0'/>
++    <property name='core-id' type='number' value='-1'/>
++    <property name='xlevel' type='number' value='2147483658'/>
++    <property name='cmov' type='boolean' value='true' migratable='yes'/>
++    <property name='ia64' type='boolean' value='false'/>
++    <property name='ssb-no' type='boolean' value='false'/>
++    <property name='aes' type='boolean' value='true' migratable='yes'/>
++    <property name='mmx' type='boolean' value='true' migratable='yes'/>
++    <property name='rdpid' type='boolean' value='false'/>
++    <property name='arat' type='boolean' value='true' migratable='yes'/>
++    <property name='gfni' type='boolean' value='false'/>
++    <property name='ibrs-all' type='boolean' value='false'/>
++    <property name='pause-filter' type='boolean' value='false'/>
++    <property name='xsavec' type='boolean' value='false'/>
++    <property name='intel-pt' type='boolean' value='false'/>
++    <property name='hv-frequencies' type='boolean' value='false'/>
++    <property name='tsc-frequency' type='number' value='0'/>
++    <property name='xd' type='boolean' value='true' migratable='yes'/>
++    <property name='hv-vendor-id' type='string' value=''/>
++    <property name='kvm-asyncpf' type='boolean' value='false'/>
++    <property name='kvm_asyncpf' type='boolean' value='false'/>
++    <property name='perfctr_core' type='boolean' value='false'/>
++    <property name='perfctr-core' type='boolean' value='false'/>
++    <property name='mpx' type='boolean' value='true' migratable='yes'/>
++    <property name='pbe' type='boolean' value='false'/>
++    <property name='decodeassists' type='boolean' value='false'/>
++    <property name='avx512cd' type='boolean' value='false'/>
++    <property name='sse4_1' type='boolean' value='true' migratable='yes'/>
++    <property name='sse4.1' type='boolean' value='true' migratable='yes'/>
++    <property name='sse4-1' type='boolean' value='true' migratable='yes'/>
++    <property name='family' type='number' value='6'/>
++    <property name='legacy-cache' type='boolean' value='true' migratable='yes'/>
++    <property name='vmware-cpuid-freq' type='boolean' value='true' migratable='yes'/>
++    <property name='wbnoinvd' type='boolean' value='false'/>
++    <property name='avx512f' type='boolean' value='false'/>
++    <property name='msr' type='boolean' value='true' migratable='yes'/>
++    <property name='mce' type='boolean' value='true' migratable='yes'/>
++    <property name='mca' type='boolean' value='true' migratable='yes'/>
++    <property name='hv-runtime' type='boolean' value='false'/>
++    <property name='xcrypt' type='boolean' value='false'/>
++    <property name='thread-id' type='number' value='-1'/>
++    <property name='min-level' type='number' value='13'/>
++    <property name='xgetbv1' type='boolean' value='true' migratable='yes'/>
++    <property name='cid' type='boolean' value='false'/>
++    <property name='hv-relaxed' type='boolean' value='false'/>
++    <property name='hv-crash' type='boolean' value='false'/>
++    <property name='ds' type='boolean' value='false'/>
++    <property name='fxsr' type='boolean' value='true' migratable='yes'/>
++    <property name='xsaveopt' type='boolean' value='true' migratable='yes'/>
++    <property name='xtpr' type='boolean' value='false'/>
++    <property name='hv-evmcs' type='boolean' value='false'/>
++    <property name='avx512vl' type='boolean' value='false'/>
++    <property name='avx512-vpopcntdq' type='boolean' value='false'/>
++    <property name='phe' type='boolean' value='false'/>
++    <property name='extapic' type='boolean' value='false'/>
++    <property name='3dnowprefetch' type='boolean' value='false'/>
++    <property name='avx512vbmi2' type='boolean' value='false'/>
++    <property name='cr8legacy' type='boolean' value='true' migratable='yes'/>
++    <property name='cpuid-0xb' type='boolean' value='true' migratable='yes'/>
++    <property name='xcrypt-en' type='boolean' value='false'/>
++    <property name='kvm_pv_eoi' type='boolean' value='false'/>
++    <property name='apic-id' type='number' value='4294967295'/>
++    <property name='rsba' type='boolean' value='false'/>
++    <property name='pn' type='boolean' value='false'/>
++    <property name='dca' type='boolean' value='false'/>
++    <property name='vendor' type='string' value='AuthenticAMD'/>
++    <property name='hv-ipi' type='boolean' value='false'/>
++    <property name='pku' type='boolean' value='true' migratable='yes'/>
++    <property name='smx' type='boolean' value='false'/>
++    <property name='cmp_legacy' type='boolean' value='false'/>
++    <property name='cmp-legacy' type='boolean' value='false'/>
++    <property name='node-id' type='number' value='-1'/>
++    <property name='avx512-4fmaps' type='boolean' value='false'/>
++    <property name='vmcb_clean' type='boolean' value='false'/>
++    <property name='vmcb-clean' type='boolean' value='false'/>
++    <property name='3dnowext' type='boolean' value='true' migratable='yes'/>
++    <property name='amd-no-ssb' type='boolean' value='false'/>
++    <property name='hle' type='boolean' value='false'/>
++    <property name='npt' type='boolean' value='true' migratable='yes'/>
++    <property name='rdctl-no' type='boolean' value='false'/>
++    <property name='memory' type='string' value='/machine/unattached/system[0]'/>
++    <property name='clwb' type='boolean' value='true' migratable='yes'/>
++    <property name='lbrv' type='boolean' value='false'/>
++    <property name='adx' type='boolean' value='true' migratable='yes'/>
++    <property name='ss' type='boolean' value='true' migratable='yes'/>
++    <property name='pni' type='boolean' value='true' migratable='yes'/>
++    <property name='svm_lock' type='boolean' value='false'/>
++    <property name='svm-lock' type='boolean' value='false'/>
++    <property name='pfthreshold' type='boolean' value='false'/>
++    <property name='smep' type='boolean' value='true' migratable='yes'/>
++    <property name='smap' type='boolean' value='true' migratable='yes'/>
++    <property name='x2apic' type='boolean' value='false'/>
++    <property name='avx512vbmi' type='boolean' value='false'/>
++    <property name='avx512vnni' type='boolean' value='false'/>
++    <property name='hv-stimer' type='boolean' value='false'/>
++    <property name='x-hv-synic-kvm-only' type='boolean' value='false'/>
++    <property name='i64' type='boolean' value='true' migratable='yes'/>
++    <property name='flushbyasid' type='boolean' value='false'/>
++    <property name='f16c' type='boolean' value='false'/>
++    <property name='ace2-en' type='boolean' value='false'/>
++    <property name='pat' type='boolean' value='true' migratable='yes'/>
++    <property name='pae' type='boolean' value='true' migratable='yes'/>
++    <property name='sse' type='boolean' value='true' migratable='yes'/>
++    <property name='phe-en' type='boolean' value='false'/>
++    <property name='kvm_nopiodelay' type='boolean' value='false'/>
++    <property name='kvm-nopiodelay' type='boolean' value='false'/>
++    <property name='tm' type='boolean' value='false'/>
++    <property name='kvmclock-stable-bit' type='boolean' value='false'/>
++    <property name='hypervisor' type='boolean' value='true' migratable='yes'/>
++    <property name='socket-id' type='number' value='-1'/>
++    <property name='pcommit' type='boolean' value='true' migratable='yes'/>
++    <property name='syscall' type='boolean' value='true' migratable='yes'/>
++    <property name='level' type='number' value='13'/>
++    <property name='avx512dq' type='boolean' value='false'/>
++    <property name='x-migrate-smi-count' type='boolean' value='true' migratable='yes'/>
++    <property name='svm' type='boolean' value='true' migratable='yes'/>
++    <property name='full-cpuid-auto-level' type='boolean' value='true' migratable='yes'/>
++    <property name='hv-reset' type='boolean' value='false'/>
++    <property name='invtsc' type='boolean' value='false'/>
++    <property name='sse3' type='boolean' value='true' migratable='yes'/>
++    <property name='sse2' type='boolean' value='true' migratable='yes'/>
++    <property name='ssbd' type='boolean' value='false'/>
++    <property name='est' type='boolean' value='false'/>
++    <property name='avx512ifma' type='boolean' value='false'/>
++    <property name='tm2' type='boolean' value='false'/>
++    <property name='kvm-pv-ipi' type='boolean' value='false'/>
++    <property name='kvm-pv-eoi' type='boolean' value='false'/>
++    <property name='cx8' type='boolean' value='true' migratable='yes'/>
++    <property name='cldemote' type='boolean' value='false'/>
++    <property name='hv-reenlightenment' type='boolean' value='false'/>
++    <property name='kvm_mmu' type='boolean' value='false'/>
++    <property name='kvm-mmu' type='boolean' value='false'/>
++    <property name='sse4_2' type='boolean' value='true' migratable='yes'/>
++    <property name='sse4.2' type='boolean' value='true' migratable='yes'/>
++    <property name='sse4-2' type='boolean' value='true' migratable='yes'/>
++    <property name='pge' type='boolean' value='true' migratable='yes'/>
++    <property name='fill-mtrr-mask' type='boolean' value='true' migratable='yes'/>
++    <property name='avx512bitalg' type='boolean' value='false'/>
++    <property name='nodeid_msr' type='boolean' value='false'/>
++    <property name='pdcm' type='boolean' value='false'/>
++    <property name='movbe' type='boolean' value='true' migratable='yes'/>
++    <property name='model' type='number' value='6'/>
++    <property name='nrip_save' type='boolean' value='false'/>
++    <property name='nrip-save' type='boolean' value='false'/>
++    <property name='kvm_pv_unhalt' type='boolean' value='false'/>
++    <property name='ssse3' type='boolean' value='true' migratable='yes'/>
++    <property name='sse4a' type='boolean' value='true' migratable='yes'/>
++    <property name='invpcid' type='boolean' value='false'/>
++    <property name='pdpe1gb' type='boolean' value='true' migratable='yes'/>
++    <property name='tsc-deadline' type='boolean' value='false'/>
++    <property name='skip-l1dfl-vmentry' type='boolean' value='false'/>
++    <property name='fma' type='boolean' value='false'/>
++    <property name='cx16' type='boolean' value='true' migratable='yes'/>
++    <property name='de' type='boolean' value='true' migratable='yes'/>
++    <property name='pconfig' type='boolean' value='false'/>
++    <property name='enforce' type='boolean' value='false'/>
++    <property name='stepping' type='number' value='3'/>
++    <property name='xsave' type='boolean' value='true' migratable='yes'/>
++    <property name='clflush' type='boolean' value='true' migratable='yes'/>
++    <property name='skinit' type='boolean' value='false'/>
++    <property name='tsc' type='boolean' value='true' migratable='yes'/>
++    <property name='tce' type='boolean' value='false'/>
++    <property name='fpu' type='boolean' value='true' migratable='yes'/>
++    <property name='ibs' type='boolean' value='false'/>
++    <property name='ds_cpl' type='boolean' value='false'/>
++    <property name='ds-cpl' type='boolean' value='false'/>
++    <property name='host-phys-bits' type='boolean' value='false'/>
++    <property name='fma4' type='boolean' value='false'/>
++    <property name='la57' type='boolean' value='true' migratable='yes'/>
++    <property name='osvw' type='boolean' value='false'/>
++    <property name='check' type='boolean' value='true' migratable='yes'/>
++    <property name='hv-spinlocks' type='number' value='-1'/>
++    <property name='pmu' type='boolean' value='false'/>
++    <property name='pmm' type='boolean' value='false'/>
++    <property name='apic' type='boolean' value='true' migratable='yes'/>
++    <property name='spec-ctrl' type='boolean' value='false'/>
++    <property name='min-xlevel2' type='number' value='0'/>
++    <property name='tsc-adjust' type='boolean' value='false'/>
++    <property name='tsc_adjust' type='boolean' value='false'/>
++    <property name='kvm-steal-time' type='boolean' value='false'/>
++    <property name='kvm_steal_time' type='boolean' value='false'/>
++    <property name='kvmclock' type='boolean' value='false'/>
++    <property name='l3-cache' type='boolean' value='true' migratable='yes'/>
++    <property name='lwp' type='boolean' value='false'/>
++    <property name='amd-ssbd' type='boolean' value='false'/>
++    <property name='ibpb' type='boolean' value='false'/>
++    <property name='xop' type='boolean' value='false'/>
++    <property name='avx' type='boolean' value='false'/>
++    <property name='ace2' type='boolean' value='false'/>
++    <property name='avx512bw' type='boolean' value='false'/>
++    <property name='acpi' type='boolean' value='true' migratable='yes'/>
++    <property name='hv-vapic' type='boolean' value='false'/>
++    <property name='fsgsbase' type='boolean' value='true' migratable='yes'/>
++    <property name='ht' type='boolean' value='false'/>
++    <property name='nx' type='boolean' value='true' migratable='yes'/>
++    <property name='pclmulqdq' type='boolean' value='true' migratable='yes'/>
++    <property name='mmxext' type='boolean' value='true' migratable='yes'/>
++    <property name='vaes' type='boolean' value='false'/>
++    <property name='popcnt' type='boolean' value='true' migratable='yes'/>
++    <property name='xsaves' type='boolean' value='false'/>
++    <property name='tcg-cpuid' type='boolean' value='true' migratable='yes'/>
++    <property name='lm' type='boolean' value='true' migratable='yes'/>
++    <property name='umip' type='boolean' value='false'/>
++    <property name='pse' type='boolean' value='true' migratable='yes'/>
++    <property name='avx2' type='boolean' value='false'/>
++    <property name='sep' type='boolean' value='true' migratable='yes'/>
++    <property name='pclmuldq' type='boolean' value='true' migratable='yes'/>
++    <property name='virt-ssbd' type='boolean' value='false'/>
++    <property name='x-hv-max-vps' type='number' value='-1'/>
++    <property name='nodeid-msr' type='boolean' value='false'/>
++    <property name='kvm' type='boolean' value='true' migratable='yes'/>
++    <property name='misalignsse' type='boolean' value='false'/>
++    <property name='min-xlevel' type='number' value='2147483658'/>
++    <property name='kvm-pv-unhalt' type='boolean' value='false'/>
++    <property name='bmi2' type='boolean' value='true' migratable='yes'/>
++    <property name='bmi1' type='boolean' value='true' migratable='yes'/>
++    <property name='realized' type='boolean' value='false'/>
++    <property name='tsc_scale' type='boolean' value='false'/>
++    <property name='tsc-scale' type='boolean' value='false'/>
++    <property name='topoext' type='boolean' value='false'/>
++    <property name='hv-vpindex' type='boolean' value='false'/>
++    <property name='xlevel2' type='number' value='0'/>
++    <property name='clflushopt' type='boolean' value='true' migratable='yes'/>
++    <property name='kvm-no-smi-migration' type='boolean' value='false'/>
++    <property name='monitor' type='boolean' value='true' migratable='yes'/>
++    <property name='avx512er' type='boolean' value='false'/>
++    <property name='pmm-en' type='boolean' value='false'/>
++    <property name='pcid' type='boolean' value='false'/>
++    <property name='arch-capabilities' type='boolean' value='false'/>
++    <property name='3dnow' type='boolean' value='true' migratable='yes'/>
++    <property name='erms' type='boolean' value='true' migratable='yes'/>
++    <property name='lahf-lm' type='boolean' value='true' migratable='yes'/>
++    <property name='lahf_lm' type='boolean' value='true' migratable='yes'/>
++    <property name='vpclmulqdq' type='boolean' value='false'/>
++    <property name='fxsr-opt' type='boolean' value='false'/>
++    <property name='hv-synic' type='boolean' value='false'/>
++    <property name='xstore' type='boolean' value='false'/>
++    <property name='fxsr_opt' type='boolean' value='false'/>
++    <property name='kvm-hint-dedicated' type='boolean' value='false'/>
++    <property name='rtm' type='boolean' value='false'/>
++    <property name='lmce' type='boolean' value='false'/>
++    <property name='hv-time' type='boolean' value='false'/>
++    <property name='perfctr-nb' type='boolean' value='false'/>
++    <property name='perfctr_nb' type='boolean' value='false'/>
++    <property name='ffxsr' type='boolean' value='false'/>
++    <property name='hv-tlbflush' type='boolean' value='false'/>
++    <property name='rdrand' type='boolean' value='false'/>
++    <property name='rdseed' type='boolean' value='false'/>
++    <property name='avx512-4vnniw' type='boolean' value='false'/>
++    <property name='vmx' type='boolean' value='false'/>
++    <property name='vme' type='boolean' value='false'/>
++    <property name='dtes64' type='boolean' value='false'/>
++    <property name='mtrr' type='boolean' value='true' migratable='yes'/>
++    <property name='rdtscp' type='boolean' value='true' migratable='yes'/>
++    <property name='pse36' type='boolean' value='true' migratable='yes'/>
++    <property name='kvm-pv-tlb-flush' type='boolean' value='false'/>
++    <property name='tbm' type='boolean' value='false'/>
++    <property name='wdt' type='boolean' value='false'/>
++    <property name='pause_filter' type='boolean' value='false'/>
++    <property name='sha-ni' type='boolean' value='false'/>
++    <property name='model-id' type='string' value='QEMU TCG CPU version 2.5+'/>
++    <property name='abm' type='boolean' value='true' migratable='yes'/>
++    <property name='avx512pf' type='boolean' value='false'/>
++    <property name='xstore-en' type='boolean' value='false'/>
++  </hostCPU>
++  <cpu type='kvm' name='max' usable='yes'/>
++  <cpu type='kvm' name='host' usable='yes'/>
++  <cpu type='kvm' name='base' usable='yes'/>
++  <cpu type='kvm' name='qemu64' usable='yes'/>
++  <cpu type='kvm' name='qemu32' usable='yes'/>
++  <cpu type='kvm' name='phenom' usable='no'>
++    <blocker name='mmxext'/>
++    <blocker name='fxsr-opt'/>
++    <blocker name='3dnowext'/>
++    <blocker name='3dnow'/>
++    <blocker name='sse4a'/>
++    <blocker name='npt'/>
++  </cpu>
++  <cpu type='kvm' name='pentium3' usable='yes'/>
++  <cpu type='kvm' name='pentium2' usable='yes'/>
++  <cpu type='kvm' name='pentium' usable='yes'/>
++  <cpu type='kvm' name='n270' usable='yes'/>
++  <cpu type='kvm' name='kvm64' usable='yes'/>
++  <cpu type='kvm' name='kvm32' usable='yes'/>
++  <cpu type='kvm' name='coreduo' usable='yes'/>
++  <cpu type='kvm' name='core2duo' usable='yes'/>
++  <cpu type='kvm' name='athlon' usable='no'>
++    <blocker name='mmxext'/>
++    <blocker name='3dnowext'/>
++    <blocker name='3dnow'/>
++  </cpu>
++  <cpu type='kvm' name='Westmere-IBRS' usable='yes'/>
++  <cpu type='kvm' name='Westmere' usable='yes'/>
++  <cpu type='kvm' name='Skylake-Server-IBRS' usable='no'>
++    <blocker name='avx512f'/>
++    <blocker name='avx512dq'/>
++    <blocker name='clwb'/>
++    <blocker name='avx512cd'/>
++    <blocker name='avx512bw'/>
++    <blocker name='avx512vl'/>
++    <blocker name='pku'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512f'/>
++    <blocker name='pku'/>
++  </cpu>
++  <cpu type='kvm' name='Skylake-Server' usable='no'>
++    <blocker name='avx512f'/>
++    <blocker name='avx512dq'/>
++    <blocker name='clwb'/>
++    <blocker name='avx512cd'/>
++    <blocker name='avx512bw'/>
++    <blocker name='avx512vl'/>
++    <blocker name='pku'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512f'/>
++    <blocker name='pku'/>
++  </cpu>
++  <cpu type='kvm' name='Skylake-Client-IBRS' usable='yes'/>
++  <cpu type='kvm' name='Skylake-Client' usable='yes'/>
++  <cpu type='kvm' name='SandyBridge-IBRS' usable='yes'/>
++  <cpu type='kvm' name='SandyBridge' usable='yes'/>
++  <cpu type='kvm' name='Penryn' usable='yes'/>
++  <cpu type='kvm' name='Opteron_G5' usable='no'>
++    <blocker name='sse4a'/>
++    <blocker name='misalignsse'/>
++    <blocker name='xop'/>
++    <blocker name='fma4'/>
++    <blocker name='tbm'/>
++  </cpu>
++  <cpu type='kvm' name='Opteron_G4' usable='no'>
++    <blocker name='sse4a'/>
++    <blocker name='misalignsse'/>
++    <blocker name='xop'/>
++    <blocker name='fma4'/>
++  </cpu>
++  <cpu type='kvm' name='Opteron_G3' usable='no'>
++    <blocker name='sse4a'/>
++    <blocker name='misalignsse'/>
++  </cpu>
++  <cpu type='kvm' name='Opteron_G2' usable='yes'/>
++  <cpu type='kvm' name='Opteron_G1' usable='yes'/>
++  <cpu type='kvm' name='Nehalem-IBRS' usable='yes'/>
++  <cpu type='kvm' name='Nehalem' usable='yes'/>
++  <cpu type='kvm' name='KnightsMill' usable='no'>
++    <blocker name='avx512f'/>
++    <blocker name='avx512pf'/>
++    <blocker name='avx512er'/>
++    <blocker name='avx512cd'/>
++    <blocker name='avx512-vpopcntdq'/>
++    <blocker name='avx512-4vnniw'/>
++    <blocker name='avx512-4fmaps'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512f'/>
++  </cpu>
++  <cpu type='kvm' name='IvyBridge-IBRS' usable='yes'/>
++  <cpu type='kvm' name='IvyBridge' usable='yes'/>
++  <cpu type='kvm' name='Icelake-Server' usable='no'>
++    <blocker name='avx512f'/>
++    <blocker name='avx512dq'/>
++    <blocker name='clwb'/>
++    <blocker name='intel-pt'/>
++    <blocker name='avx512cd'/>
++    <blocker name='avx512bw'/>
++    <blocker name='avx512vl'/>
++    <blocker name='avx512vbmi'/>
++    <blocker name='pku'/>
++    <blocker name=''/>
++    <blocker name='avx512vbmi2'/>
++    <blocker name='gfni'/>
++    <blocker name='vaes'/>
++    <blocker name='vpclmulqdq'/>
++    <blocker name='avx512vnni'/>
++    <blocker name='avx512bitalg'/>
++    <blocker name='avx512-vpopcntdq'/>
++    <blocker name='la57'/>
++    <blocker name='pconfig'/>
++    <blocker name='ssbd'/>
++    <blocker name='wbnoinvd'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512f'/>
++    <blocker name='pku'/>
++  </cpu>
++  <cpu type='kvm' name='Icelake-Client' usable='no'>
++    <blocker name='intel-pt'/>
++    <blocker name='avx512vbmi'/>
++    <blocker name='pku'/>
++    <blocker name=''/>
++    <blocker name='avx512vbmi2'/>
++    <blocker name='gfni'/>
++    <blocker name='vaes'/>
++    <blocker name='vpclmulqdq'/>
++    <blocker name='avx512vnni'/>
++    <blocker name='avx512bitalg'/>
++    <blocker name='avx512-vpopcntdq'/>
++    <blocker name='ssbd'/>
++    <blocker name='wbnoinvd'/>
++    <blocker name='pku'/>
++  </cpu>
++  <cpu type='kvm' name='Haswell-noTSX-IBRS' usable='yes'/>
++  <cpu type='kvm' name='Haswell-noTSX' usable='yes'/>
++  <cpu type='kvm' name='Haswell-IBRS' usable='yes'/>
++  <cpu type='kvm' name='Haswell' usable='yes'/>
++  <cpu type='kvm' name='EPYC-IBPB' usable='no'>
++    <blocker name='sha-ni'/>
++    <blocker name='mmxext'/>
++    <blocker name='fxsr-opt'/>
++    <blocker name='cr8legacy'/>
++    <blocker name='sse4a'/>
++    <blocker name='misalignsse'/>
++    <blocker name='osvw'/>
++    <blocker name='ibpb'/>
++  </cpu>
++  <cpu type='kvm' name='EPYC' usable='no'>
++    <blocker name='sha-ni'/>
++    <blocker name='mmxext'/>
++    <blocker name='fxsr-opt'/>
++    <blocker name='cr8legacy'/>
++    <blocker name='sse4a'/>
++    <blocker name='misalignsse'/>
++    <blocker name='osvw'/>
++  </cpu>
++  <cpu type='kvm' name='Conroe' usable='yes'/>
++  <cpu type='kvm' name='Cascadelake-Server' usable='no'>
++    <blocker name='avx512f'/>
++    <blocker name='avx512dq'/>
++    <blocker name='clwb'/>
++    <blocker name='intel-pt'/>
++    <blocker name='avx512cd'/>
++    <blocker name='avx512bw'/>
++    <blocker name='avx512vl'/>
++    <blocker name='pku'/>
++    <blocker name=''/>
++    <blocker name='avx512vnni'/>
++    <blocker name='ssbd'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512f'/>
++    <blocker name='pku'/>
++  </cpu>
++  <cpu type='kvm' name='Broadwell-noTSX-IBRS' usable='yes'/>
++  <cpu type='kvm' name='Broadwell-noTSX' usable='yes'/>
++  <cpu type='kvm' name='Broadwell-IBRS' usable='yes'/>
++  <cpu type='kvm' name='Broadwell' usable='yes'/>
++  <cpu type='kvm' name='486' usable='yes'/>
++  <cpu type='tcg' name='max' usable='yes'/>
++  <cpu type='tcg' name='host' usable='no'>
++    <blocker name='kvm'/>
++  </cpu>
++  <cpu type='tcg' name='base' usable='yes'/>
++  <cpu type='tcg' name='qemu64' usable='yes'/>
++  <cpu type='tcg' name='qemu32' usable='yes'/>
++  <cpu type='tcg' name='phenom' usable='no'>
++    <blocker name='fxsr-opt'/>
++  </cpu>
++  <cpu type='tcg' name='pentium3' usable='yes'/>
++  <cpu type='tcg' name='pentium2' usable='yes'/>
++  <cpu type='tcg' name='pentium' usable='yes'/>
++  <cpu type='tcg' name='n270' usable='yes'/>
++  <cpu type='tcg' name='kvm64' usable='yes'/>
++  <cpu type='tcg' name='kvm32' usable='yes'/>
++  <cpu type='tcg' name='coreduo' usable='yes'/>
++  <cpu type='tcg' name='core2duo' usable='yes'/>
++  <cpu type='tcg' name='athlon' usable='yes'/>
++  <cpu type='tcg' name='Westmere-IBRS' usable='no'>
++    <blocker name='spec-ctrl'/>
++  </cpu>
++  <cpu type='tcg' name='Westmere' usable='yes'/>
++  <cpu type='tcg' name='Skylake-Server-IBRS' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512dq'/>
++    <blocker name='rdseed'/>
++    <blocker name='avx512cd'/>
++    <blocker name='avx512bw'/>
++    <blocker name='avx512vl'/>
++    <blocker name='spec-ctrl'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='xsavec'/>
++  </cpu>
++  <cpu type='tcg' name='Skylake-Server' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512dq'/>
++    <blocker name='rdseed'/>
++    <blocker name='avx512cd'/>
++    <blocker name='avx512bw'/>
++    <blocker name='avx512vl'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='xsavec'/>
++  </cpu>
++  <cpu type='tcg' name='Skylake-Client-IBRS' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++    <blocker name='rdseed'/>
++    <blocker name='spec-ctrl'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='xsavec'/>
++  </cpu>
++  <cpu type='tcg' name='Skylake-Client' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++    <blocker name='rdseed'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='xsavec'/>
++  </cpu>
++  <cpu type='tcg' name='SandyBridge-IBRS' usable='no'>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='spec-ctrl'/>
++  </cpu>
++  <cpu type='tcg' name='SandyBridge' usable='no'>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++  </cpu>
++  <cpu type='tcg' name='Penryn' usable='yes'/>
++  <cpu type='tcg' name='Opteron_G5' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='misalignsse'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='xop'/>
++    <blocker name='fma4'/>
++    <blocker name='tbm'/>
++  </cpu>
++  <cpu type='tcg' name='Opteron_G4' usable='no'>
++    <blocker name='avx'/>
++    <blocker name='misalignsse'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='xop'/>
++    <blocker name='fma4'/>
++  </cpu>
++  <cpu type='tcg' name='Opteron_G3' usable='no'>
++    <blocker name='misalignsse'/>
++  </cpu>
++  <cpu type='tcg' name='Opteron_G2' usable='yes'/>
++  <cpu type='tcg' name='Opteron_G1' usable='yes'/>
++  <cpu type='tcg' name='Nehalem-IBRS' usable='no'>
++    <blocker name='spec-ctrl'/>
++  </cpu>
++  <cpu type='tcg' name='Nehalem' usable='yes'/>
++  <cpu type='tcg' name='KnightsMill' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='avx2'/>
++    <blocker name='avx512f'/>
++    <blocker name='rdseed'/>
++    <blocker name='avx512pf'/>
++    <blocker name='avx512er'/>
++    <blocker name='avx512cd'/>
++    <blocker name='avx512-vpopcntdq'/>
++    <blocker name='avx512-4vnniw'/>
++    <blocker name='avx512-4fmaps'/>
++    <blocker name='3dnowprefetch'/>
++  </cpu>
++  <cpu type='tcg' name='IvyBridge-IBRS' usable='no'>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='spec-ctrl'/>
++  </cpu>
++  <cpu type='tcg' name='IvyBridge' usable='no'>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++  </cpu>
++  <cpu type='tcg' name='Icelake-Server' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512dq'/>
++    <blocker name='rdseed'/>
++    <blocker name='intel-pt'/>
++    <blocker name='avx512cd'/>
++    <blocker name='avx512bw'/>
++    <blocker name='avx512vl'/>
++    <blocker name='avx512vbmi'/>
++    <blocker name='umip'/>
++    <blocker name=''/>
++    <blocker name='avx512vbmi2'/>
++    <blocker name='gfni'/>
++    <blocker name='vaes'/>
++    <blocker name='vpclmulqdq'/>
++    <blocker name='avx512vnni'/>
++    <blocker name='avx512bitalg'/>
++    <blocker name='avx512-vpopcntdq'/>
++    <blocker name='pconfig'/>
++    <blocker name='spec-ctrl'/>
++    <blocker name='ssbd'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='wbnoinvd'/>
++    <blocker name='xsavec'/>
++  </cpu>
++  <cpu type='tcg' name='Icelake-Client' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++    <blocker name='rdseed'/>
++    <blocker name='intel-pt'/>
++    <blocker name='avx512vbmi'/>
++    <blocker name='umip'/>
++    <blocker name=''/>
++    <blocker name='avx512vbmi2'/>
++    <blocker name='gfni'/>
++    <blocker name='vaes'/>
++    <blocker name='vpclmulqdq'/>
++    <blocker name='avx512vnni'/>
++    <blocker name='avx512bitalg'/>
++    <blocker name='avx512-vpopcntdq'/>
++    <blocker name='spec-ctrl'/>
++    <blocker name='ssbd'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='wbnoinvd'/>
++    <blocker name='xsavec'/>
++  </cpu>
++  <cpu type='tcg' name='Haswell-noTSX-IBRS' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='spec-ctrl'/>
++  </cpu>
++  <cpu type='tcg' name='Haswell-noTSX' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++  </cpu>
++  <cpu type='tcg' name='Haswell-IBRS' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++    <blocker name='spec-ctrl'/>
++  </cpu>
++  <cpu type='tcg' name='Haswell' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++  </cpu>
++  <cpu type='tcg' name='EPYC-IBPB' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='avx2'/>
++    <blocker name='rdseed'/>
++    <blocker name='sha-ni'/>
++    <blocker name='fxsr-opt'/>
++    <blocker name='misalignsse'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='osvw'/>
++    <blocker name='topoext'/>
++    <blocker name='ibpb'/>
++    <blocker name='xsavec'/>
++  </cpu>
++  <cpu type='tcg' name='EPYC' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='avx2'/>
++    <blocker name='rdseed'/>
++    <blocker name='sha-ni'/>
++    <blocker name='fxsr-opt'/>
++    <blocker name='misalignsse'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='osvw'/>
++    <blocker name='topoext'/>
++    <blocker name='xsavec'/>
++  </cpu>
++  <cpu type='tcg' name='Conroe' usable='yes'/>
++  <cpu type='tcg' name='Cascadelake-Server' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++    <blocker name='avx512f'/>
++    <blocker name='avx512dq'/>
++    <blocker name='rdseed'/>
++    <blocker name='intel-pt'/>
++    <blocker name='avx512cd'/>
++    <blocker name='avx512bw'/>
++    <blocker name='avx512vl'/>
++    <blocker name=''/>
++    <blocker name='avx512vnni'/>
++    <blocker name='spec-ctrl'/>
++    <blocker name='ssbd'/>
++    <blocker name='3dnowprefetch'/>
++    <blocker name='xsavec'/>
++  </cpu>
++  <cpu type='tcg' name='Broadwell-noTSX-IBRS' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rdseed'/>
++    <blocker name='spec-ctrl'/>
++    <blocker name='3dnowprefetch'/>
++  </cpu>
++  <cpu type='tcg' name='Broadwell-noTSX' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rdseed'/>
++    <blocker name='3dnowprefetch'/>
++  </cpu>
++  <cpu type='tcg' name='Broadwell-IBRS' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++    <blocker name='rdseed'/>
++    <blocker name='spec-ctrl'/>
++    <blocker name='3dnowprefetch'/>
++  </cpu>
++  <cpu type='tcg' name='Broadwell' usable='no'>
++    <blocker name='fma'/>
++    <blocker name='pcid'/>
++    <blocker name='x2apic'/>
++    <blocker name='tsc-deadline'/>
++    <blocker name='avx'/>
++    <blocker name='f16c'/>
++    <blocker name='rdrand'/>
++    <blocker name='hle'/>
++    <blocker name='avx2'/>
++    <blocker name='invpcid'/>
++    <blocker name='rtm'/>
++    <blocker name='rdseed'/>
++    <blocker name='3dnowprefetch'/>
++  </cpu>
++  <cpu type='tcg' name='486' usable='yes'/>
++  <machine name='pc-i440fx-3.1' alias='pc' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='isapc' hotplugCpus='yes' maxCpus='1'/>
++  <machine name='pc-1.1' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-1.2' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-1.3' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.8' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-1.0' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.9' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.6' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.7' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.3' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.4' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.5' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.1' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.2' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-q35-3.1' alias='q35' hotplugCpus='yes' maxCpus='288'/>
++  <machine name='pc-i440fx-2.0' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-q35-2.11' hotplugCpus='yes' maxCpus='288'/>
++  <machine name='pc-q35-2.12' hotplugCpus='yes' maxCpus='288'/>
++  <machine name='pc-q35-3.0' hotplugCpus='yes' maxCpus='288'/>
++  <machine name='pc-q35-2.10' hotplugCpus='yes' maxCpus='288'/>
++  <machine name='pc-i440fx-1.7' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-q35-2.9' hotplugCpus='yes' maxCpus='288'/>
++  <machine name='pc-0.15' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-1.5' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-q35-2.7' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-1.6' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.11' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-q35-2.8' hotplugCpus='yes' maxCpus='288'/>
++  <machine name='pc-0.13' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.12' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-0.14' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-3.0' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-q35-2.4' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-q35-2.5' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-q35-2.6' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-1.4' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-i440fx-2.10' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-0.11' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-0.12' hotplugCpus='yes' maxCpus='255'/>
++  <machine name='pc-0.10' hotplugCpus='yes' maxCpus='255'/>
++</qemuCaps>
+diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
+index 828e3d106c..ae0d2abf8a 100644
+--- a/tests/qemucapabilitiestest.c
++++ b/tests/qemucapabilitiestest.c
+@@ -178,6 +178,7 @@ mymain(void)
+     DO_TEST("x86_64", "caps_2.11.0");
+     DO_TEST("x86_64", "caps_2.12.0");
+     DO_TEST("x86_64", "caps_3.0.0");
++    DO_TEST("x86_64", "caps_3.1.0");
+     DO_TEST("aarch64", "caps_2.6.0");
+     DO_TEST("aarch64", "caps_2.10.0");
+     DO_TEST("aarch64", "caps_2.12.0");
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-test-replace-calls-to-individual-detach-functions-with-one-call-to-main-detach.patch b/SOURCES/libvirt-test-replace-calls-to-individual-detach-functions-with-one-call-to-main-detach.patch
new file mode 100644
index 0000000..4b1a9ce
--- /dev/null
+++ b/SOURCES/libvirt-test-replace-calls-to-individual-detach-functions-with-one-call-to-main-detach.patch
@@ -0,0 +1,61 @@
+From 621040f56e852c0b95be8aef20878b8a4012b9ee Mon Sep 17 00:00:00 2001
+Message-Id: <621040f56e852c0b95be8aef20878b8a4012b9ee@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 11 Apr 2019 15:14:43 -0400
+Subject: [PATCH] test: replace calls to individual detach functions with one
+ call to main detach
+
+The individual qemuDomainDetach*Device() functions will soon be "less
+functional", since some of the code that is duplicated in 10 of the 12
+detach functions is going to be moved into the common
+qemuDomainDetachDeviceLive(), which calls them all.
+
+qemuhotplugtest.c is the only place any of these individual functions
+is called other than qemuDomainDetachDeviceLive() itself. Fortunately,
+qemuDomainDetachDeviceLive() provides exactly the functionality needed
+by the test driver (except that it supports detach of more device
+types than the test driver has tests for).
+
+This patch replaces the calls to
+qemuDomainDetach(Chr|Shmen|Watchdog|Disk)Device with a single call to
+the higher level function, allowing us to shift functionality between
+the lower level functions without breaking the tests.
+
+Signed-off-by: Laine Stump <laine@laine.org>
+ACKed-by: Peter Krempa <pkrempa@redhat.com>
+(cherry picked from commit d3aab99096bb8f81600437682398235c17084d22)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-32-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ tests/qemuhotplugtest.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
+index afaf706d27..f27fdbbb09 100644
+--- a/tests/qemuhotplugtest.c
++++ b/tests/qemuhotplugtest.c
+@@ -149,16 +149,10 @@ testQemuHotplugDetach(virDomainObjPtr vm,
+ 
+     switch (dev->type) {
+     case VIR_DOMAIN_DEVICE_DISK:
+-        ret = qemuDomainDetachDeviceDiskLive(&driver, vm, dev, async);
+-        break;
+     case VIR_DOMAIN_DEVICE_CHR:
+-        ret = qemuDomainDetachChrDevice(&driver, vm, dev->data.chr, async);
+-        break;
+     case VIR_DOMAIN_DEVICE_SHMEM:
+-        ret = qemuDomainDetachShmemDevice(&driver, vm, dev->data.shmem, async);
+-        break;
+     case VIR_DOMAIN_DEVICE_WATCHDOG:
+-        ret = qemuDomainDetachWatchdog(&driver, vm, dev->data.watchdog, async);
++        ret = qemuDomainDetachDeviceLive(vm, dev, &driver, async);
+         break;
+     default:
+         VIR_TEST_VERBOSE("device type '%s' cannot be detached\n",
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-tests-Add-more-tests-to-qemucaps2xml.patch b/SOURCES/libvirt-tests-Add-more-tests-to-qemucaps2xml.patch
new file mode 100644
index 0000000..e5e79a9
--- /dev/null
+++ b/SOURCES/libvirt-tests-Add-more-tests-to-qemucaps2xml.patch
@@ -0,0 +1,1090 @@
+From 28e7a0e77e32354ae1e485c4ea5a74a7ed17eadb Mon Sep 17 00:00:00 2001
+Message-Id: <28e7a0e77e32354ae1e485c4ea5a74a7ed17eadb@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Fri, 5 Apr 2019 10:57:39 +0200
+Subject: [PATCH] tests: Add more tests to qemucaps2xml
+
+More specifically, everything that's tested by qemucapabilities
+now goes through qemucaps2xml as well.
+
+Ideally we'll rewrite both so that listing all test cases is
+unnecessary and they get picked up automatically by listing the
+contents of the input directory instead, but that's a refactor
+for another day :)
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit a3676f3763625d06778ee14dd6b006b3ba91846a)
+
+Changes from upstream:
+
+  * Removed references to RISC-V architectures.
+    Necessary for the test suite to pass because we never
+    picked up 869cb692fa1d downstream.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628469
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190405085744.8179-3-abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ tests/qemucapabilitiestest.c                  |  1 +
+ .../qemucaps2xmloutdata/caps_1.5.3.x86_64.xml | 30 +++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_1.7.0.x86_64.xml | 30 +++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.1.1.x86_64.xml | 30 +++++++++++++++++++
+ .../caps_2.10.0.aarch64.xml                   | 29 ++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.10.0.ppc64.xml | 28 +++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.10.0.s390x.xml | 28 +++++++++++++++++
+ .../caps_2.10.0.x86_64.xml                    | 30 +++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.11.0.s390x.xml | 28 +++++++++++++++++
+ .../caps_2.11.0.x86_64.xml                    | 30 +++++++++++++++++++
+ .../caps_2.12.0.aarch64.xml                   | 29 ++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.12.0.ppc64.xml | 28 +++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.12.0.s390x.xml | 28 +++++++++++++++++
+ .../caps_2.12.0.x86_64.xml                    | 30 +++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.4.0.x86_64.xml | 30 +++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.5.0.x86_64.xml | 30 +++++++++++++++++++
+ .../caps_2.6.0.aarch64.xml                    | 29 ++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.6.0.ppc64.xml  | 28 +++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.6.0.x86_64.xml | 30 +++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.7.0.s390x.xml  | 28 +++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.7.0.x86_64.xml | 30 +++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.8.0.s390x.xml  | 28 +++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.8.0.x86_64.xml | 30 +++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.9.0.ppc64.xml  | 28 +++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.9.0.s390x.xml  | 28 +++++++++++++++++
+ .../qemucaps2xmloutdata/caps_2.9.0.x86_64.xml | 30 +++++++++++++++++++
+ .../qemucaps2xmloutdata/caps_3.0.0.ppc64.xml  | 28 +++++++++++++++++
+ .../qemucaps2xmloutdata/caps_3.0.0.x86_64.xml | 30 +++++++++++++++++++
+ tests/qemucaps2xmltest.c                      | 28 +++++++++++++++++
+ 29 files changed, 814 insertions(+)
+ create mode 100644 tests/qemucaps2xmloutdata/caps_1.5.3.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_1.7.0.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.1.1.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.10.0.aarch64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.10.0.ppc64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.10.0.s390x.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.10.0.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.11.0.s390x.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.11.0.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.12.0.aarch64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.12.0.ppc64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.12.0.s390x.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.12.0.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.4.0.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.5.0.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.6.0.aarch64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.6.0.ppc64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.6.0.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.7.0.s390x.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.7.0.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.8.0.s390x.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.8.0.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.9.0.ppc64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.9.0.s390x.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_2.9.0.x86_64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_3.0.0.ppc64.xml
+ create mode 100644 tests/qemucaps2xmloutdata/caps_3.0.0.x86_64.xml
+
+diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
+index 4aec175968..828e3d106c 100644
+--- a/tests/qemucapabilitiestest.c
++++ b/tests/qemucapabilitiestest.c
+@@ -163,6 +163,7 @@ mymain(void)
+             ret = -1; \
+     } while (0)
+ 
++    /* Keep this in sync with qemucaps2xmltest */
+     DO_TEST("x86_64", "caps_1.5.3");
+     DO_TEST("x86_64", "caps_1.6.0");
+     DO_TEST("x86_64", "caps_1.7.0");
+diff --git a/tests/qemucaps2xmloutdata/caps_1.5.3.x86_64.xml b/tests/qemucaps2xmloutdata/caps_1.5.3.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_1.5.3.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_1.7.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_1.7.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_1.7.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.1.1.x86_64.xml b/tests/qemucaps2xmloutdata/caps_2.1.1.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.1.1.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.10.0.aarch64.xml b/tests/qemucaps2xmloutdata/caps_2.10.0.aarch64.xml
+new file mode 100644
+index 0000000000..a879d67df3
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.10.0.aarch64.xml
+@@ -0,0 +1,29 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>aarch64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='aarch64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-aarch64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-aarch64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.10.0.ppc64.xml b/tests/qemucaps2xmloutdata/caps_2.10.0.ppc64.xml
+new file mode 100644
+index 0000000000..74eaf3ba0e
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.10.0.ppc64.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>ppc64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='ppc64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-ppc64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-ppc64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.10.0.s390x.xml b/tests/qemucaps2xmloutdata/caps_2.10.0.s390x.xml
+new file mode 100644
+index 0000000000..20ef995d62
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.10.0.s390x.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>s390x</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='s390x'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-s390x</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-s390x</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.10.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_2.10.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.10.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.11.0.s390x.xml b/tests/qemucaps2xmloutdata/caps_2.11.0.s390x.xml
+new file mode 100644
+index 0000000000..20ef995d62
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.11.0.s390x.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>s390x</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='s390x'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-s390x</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-s390x</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.11.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_2.11.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.11.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.12.0.aarch64.xml b/tests/qemucaps2xmloutdata/caps_2.12.0.aarch64.xml
+new file mode 100644
+index 0000000000..a879d67df3
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.12.0.aarch64.xml
+@@ -0,0 +1,29 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>aarch64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='aarch64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-aarch64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-aarch64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.12.0.ppc64.xml b/tests/qemucaps2xmloutdata/caps_2.12.0.ppc64.xml
+new file mode 100644
+index 0000000000..74eaf3ba0e
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.12.0.ppc64.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>ppc64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='ppc64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-ppc64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-ppc64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.12.0.s390x.xml b/tests/qemucaps2xmloutdata/caps_2.12.0.s390x.xml
+new file mode 100644
+index 0000000000..20ef995d62
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.12.0.s390x.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>s390x</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='s390x'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-s390x</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-s390x</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.12.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_2.12.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.12.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.4.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_2.4.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.4.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.5.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_2.5.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.5.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.6.0.aarch64.xml b/tests/qemucaps2xmloutdata/caps_2.6.0.aarch64.xml
+new file mode 100644
+index 0000000000..a879d67df3
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.6.0.aarch64.xml
+@@ -0,0 +1,29 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>aarch64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='aarch64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-aarch64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-aarch64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.6.0.ppc64.xml b/tests/qemucaps2xmloutdata/caps_2.6.0.ppc64.xml
+new file mode 100644
+index 0000000000..74eaf3ba0e
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.6.0.ppc64.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>ppc64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='ppc64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-ppc64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-ppc64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.6.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_2.6.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.6.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.7.0.s390x.xml b/tests/qemucaps2xmloutdata/caps_2.7.0.s390x.xml
+new file mode 100644
+index 0000000000..20ef995d62
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.7.0.s390x.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>s390x</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='s390x'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-s390x</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-s390x</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.7.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_2.7.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.7.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.8.0.s390x.xml b/tests/qemucaps2xmloutdata/caps_2.8.0.s390x.xml
+new file mode 100644
+index 0000000000..20ef995d62
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.8.0.s390x.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>s390x</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='s390x'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-s390x</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-s390x</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.8.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_2.8.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.8.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.9.0.ppc64.xml b/tests/qemucaps2xmloutdata/caps_2.9.0.ppc64.xml
+new file mode 100644
+index 0000000000..74eaf3ba0e
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.9.0.ppc64.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>ppc64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='ppc64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-ppc64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-ppc64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.9.0.s390x.xml b/tests/qemucaps2xmloutdata/caps_2.9.0.s390x.xml
+new file mode 100644
+index 0000000000..20ef995d62
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.9.0.s390x.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>s390x</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='s390x'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-s390x</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-s390x</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_2.9.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_2.9.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_2.9.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_3.0.0.ppc64.xml b/tests/qemucaps2xmloutdata/caps_3.0.0.ppc64.xml
+new file mode 100644
+index 0000000000..74eaf3ba0e
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_3.0.0.ppc64.xml
+@@ -0,0 +1,28 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>ppc64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='ppc64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-ppc64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-ppc64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmloutdata/caps_3.0.0.x86_64.xml b/tests/qemucaps2xmloutdata/caps_3.0.0.x86_64.xml
+new file mode 100644
+index 0000000000..b58f54fefd
+--- /dev/null
++++ b/tests/qemucaps2xmloutdata/caps_3.0.0.x86_64.xml
+@@ -0,0 +1,30 @@
++<capabilities>
++
++  <host>
++    <cpu>
++      <arch>x86_64</arch>
++    </cpu>
++    <power_management/>
++    <iommu support='no'/>
++  </host>
++
++  <guest>
++    <os_type>hvm</os_type>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      <domain type='qemu'/>
++      <domain type='kvm'>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
++      </domain>
++    </arch>
++    <features>
++      <cpuselection/>
++      <deviceboot/>
++      <disksnapshot default='on' toggle='no'/>
++      <acpi default='on' toggle='yes'/>
++      <apic default='on' toggle='no'/>
++    </features>
++  </guest>
++
++</capabilities>
+diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c
+index 65dd97c0a4..cd951b2bb4 100644
+--- a/tests/qemucaps2xmltest.c
++++ b/tests/qemucaps2xmltest.c
+@@ -187,7 +187,35 @@ mymain(void)
+     if (virTestRun(name "(" arch ")", testQemuCapsXML, &data) < 0) \
+         ret = -1
+ 
++    /* Keep this in sync with qemucapabilitiestest */
++    DO_TEST("x86_64", "caps_1.5.3");
+     DO_TEST("x86_64", "caps_1.6.0");
++    DO_TEST("x86_64", "caps_1.7.0");
++    DO_TEST("x86_64", "caps_2.1.1");
++    DO_TEST("x86_64", "caps_2.4.0");
++    DO_TEST("x86_64", "caps_2.5.0");
++    DO_TEST("x86_64", "caps_2.6.0");
++    DO_TEST("x86_64", "caps_2.7.0");
++    DO_TEST("x86_64", "caps_2.8.0");
++    DO_TEST("x86_64", "caps_2.9.0");
++    DO_TEST("x86_64", "caps_2.10.0");
++    DO_TEST("x86_64", "caps_2.11.0");
++    DO_TEST("x86_64", "caps_2.12.0");
++    DO_TEST("x86_64", "caps_3.0.0");
++    DO_TEST("aarch64", "caps_2.6.0");
++    DO_TEST("aarch64", "caps_2.10.0");
++    DO_TEST("aarch64", "caps_2.12.0");
++    DO_TEST("ppc64", "caps_2.6.0");
++    DO_TEST("ppc64", "caps_2.9.0");
++    DO_TEST("ppc64", "caps_2.10.0");
++    DO_TEST("ppc64", "caps_2.12.0");
++    DO_TEST("ppc64", "caps_3.0.0");
++    DO_TEST("s390x", "caps_2.7.0");
++    DO_TEST("s390x", "caps_2.8.0");
++    DO_TEST("s390x", "caps_2.9.0");
++    DO_TEST("s390x", "caps_2.10.0");
++    DO_TEST("s390x", "caps_2.11.0");
++    DO_TEST("s390x", "caps_2.12.0");
+ 
+     return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+ }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-tests-Add-storagepool-xml-test-for-netfs-auto.patch b/SOURCES/libvirt-tests-Add-storagepool-xml-test-for-netfs-auto.patch
new file mode 100644
index 0000000..f9d5afe
--- /dev/null
+++ b/SOURCES/libvirt-tests-Add-storagepool-xml-test-for-netfs-auto.patch
@@ -0,0 +1,117 @@
+From c1496d42e09be681644df89059ffa9fbb5417401 Mon Sep 17 00:00:00 2001
+Message-Id: <c1496d42e09be681644df89059ffa9fbb5417401@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 09:12:17 -0400
+Subject: [PATCH] tests: Add storagepool xml test for netfs-auto
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+Cover the case where @netauto would be used to create the command
+line in virStorageBackendFileSystemMountCmd. Essentially when the
+pool type is "netfs", but the "source.format" is empty, create the
+command line properly.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+ACKed-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit 515aa0c1847180f8da4287270f872c161993a047)
+Message-Id: <20190403131219.16385-6-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ .../pool-netfs-auto.argv                      |  1 +
+ tests/storagepoolxml2argvtest.c               |  1 +
+ .../storagepoolxml2xmlin/pool-netfs-auto.xml  | 19 ++++++++++++++++++
+ .../storagepoolxml2xmlout/pool-netfs-auto.xml | 20 +++++++++++++++++++
+ tests/storagepoolxml2xmltest.c                |  1 +
+ 5 files changed, 42 insertions(+)
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-auto.argv
+ create mode 100644 tests/storagepoolxml2xmlin/pool-netfs-auto.xml
+ create mode 100644 tests/storagepoolxml2xmlout/pool-netfs-auto.xml
+
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-auto.argv b/tests/storagepoolxml2argvdata/pool-netfs-auto.argv
+new file mode 100644
+index 0000000000..888a0161b8
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-auto.argv
+@@ -0,0 +1 @@
++mount localhost:/var/lib/libvirt/images /mnt
+diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c
+index 54bc07b4e1..3bf2c3b003 100644
+--- a/tests/storagepoolxml2argvtest.c
++++ b/tests/storagepoolxml2argvtest.c
+@@ -146,6 +146,7 @@ mymain(void)
+     DO_TEST_FAIL("pool-iscsi");
+     DO_TEST_FAIL("pool-iscsi-auth");
+     DO_TEST("pool-netfs");
++    DO_TEST("pool-netfs-auto");
+     DO_TEST("pool-netfs-gluster");
+     DO_TEST("pool-netfs-cifs");
+     DO_TEST_FAIL("pool-scsi");
+diff --git a/tests/storagepoolxml2xmlin/pool-netfs-auto.xml b/tests/storagepoolxml2xmlin/pool-netfs-auto.xml
+new file mode 100644
+index 0000000000..d7f7ce8168
+--- /dev/null
++++ b/tests/storagepoolxml2xmlin/pool-netfs-auto.xml
+@@ -0,0 +1,19 @@
++<pool type='netfs'>
++  <name>nfsimages</name>
++  <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
++  <capacity>0</capacity>
++  <allocation>0</allocation>
++  <available>0</available>
++  <source>
++    <host name='localhost'/>
++    <dir path='/var/lib/libvirt/images'/>
++  </source>
++  <target>
++    <path>/mnt</path>
++    <permissions>
++      <mode>0700</mode>
++      <owner>0</owner>
++      <group>0</group>
++    </permissions>
++  </target>
++</pool>
+diff --git a/tests/storagepoolxml2xmlout/pool-netfs-auto.xml b/tests/storagepoolxml2xmlout/pool-netfs-auto.xml
+new file mode 100644
+index 0000000000..a180ca521c
+--- /dev/null
++++ b/tests/storagepoolxml2xmlout/pool-netfs-auto.xml
+@@ -0,0 +1,20 @@
++<pool type='netfs'>
++  <name>nfsimages</name>
++  <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
++  <capacity unit='bytes'>0</capacity>
++  <allocation unit='bytes'>0</allocation>
++  <available unit='bytes'>0</available>
++  <source>
++    <host name='localhost'/>
++    <dir path='/var/lib/libvirt/images'/>
++    <format type='auto'/>
++  </source>
++  <target>
++    <path>/mnt</path>
++    <permissions>
++      <mode>0700</mode>
++      <owner>0</owner>
++      <group>0</group>
++    </permissions>
++  </target>
++</pool>
+diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c
+index 974f0afe39..29c0e42479 100644
+--- a/tests/storagepoolxml2xmltest.c
++++ b/tests/storagepoolxml2xmltest.c
+@@ -85,6 +85,7 @@ mymain(void)
+     DO_TEST("pool-iscsi");
+     DO_TEST("pool-iscsi-auth");
+     DO_TEST("pool-netfs");
++    DO_TEST("pool-netfs-auto");
+     DO_TEST("pool-netfs-gluster");
+     DO_TEST("pool-netfs-cifs");
+     DO_TEST("pool-scsi");
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-tests-Follow-up-on-qemucaps2xmldata-rename.patch b/SOURCES/libvirt-tests-Follow-up-on-qemucaps2xmldata-rename.patch
new file mode 100644
index 0000000..08a2c71
--- /dev/null
+++ b/SOURCES/libvirt-tests-Follow-up-on-qemucaps2xmldata-rename.patch
@@ -0,0 +1,38 @@
+From fddead1319d13ceaa0dd5aa8bdc740f05e0fff58 Mon Sep 17 00:00:00 2001
+Message-Id: <fddead1319d13ceaa0dd5aa8bdc740f05e0fff58@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Fri, 5 Apr 2019 10:57:44 +0200
+Subject: [PATCH] tests: Follow up on qemucaps2xmldata rename
+
+The directory has been renamed in 562990849a9d, but a
+reference to it was not updated at the same time, causing
+'make dist' to fail ever since. Fix it.
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+(cherry picked from commit d52dd5911b32a31bb17ee97bb9df5683741603b0)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628469
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190405085744.8179-8-abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ tests/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 858076df7b..4d0b4f9509 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -122,7 +122,7 @@ EXTRA_DIST = \
+ 	qemuargv2xmldata \
+ 	qemublocktestdata \
+ 	qemucapabilitiesdata \
+-	qemucaps2xmldata \
++	qemucaps2xmloutdata \
+ 	qemuhotplugtestcpus \
+ 	qemuhotplugtestdevices \
+ 	qemuhotplugtestdomains \
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-tests-Introduce-tests-for-storage-pool-xml-to-argv-checks.patch b/SOURCES/libvirt-tests-Introduce-tests-for-storage-pool-xml-to-argv-checks.patch
new file mode 100644
index 0000000..6a7042b
--- /dev/null
+++ b/SOURCES/libvirt-tests-Introduce-tests-for-storage-pool-xml-to-argv-checks.patch
@@ -0,0 +1,293 @@
+From c549a110d3705473ab4435bd164a8e48d5da64a1 Mon Sep 17 00:00:00 2001
+Message-Id: <c549a110d3705473ab4435bd164a8e48d5da64a1@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 09:12:16 -0400
+Subject: [PATCH] tests: Introduce tests for storage pool xml to argv checks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+Similar to qemuxml2argv and storagevolxml2argv, let's create some
+tests to ensure that the XML generates a consistent command line.
+
+Using the same list of pools as storagepoolxml2xmltest, start with
+the file system tests (fs, netfs, netfs-cifs, netfs-gluster).
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+ACKed-by: Michal Privoznik <mprivozn@redhat.com>
+(cherry picked from commit f2f84b4d4ab289e736e367d2867cf945d17d0b20)
+
+Resolved some build issues:
+
+ * Removed the VIR_FREE defs and used the VIR_FREE for @src. Turns out
+   it was unnecessary for @actualCmdline and was removed in commit
+   5f02df444beea79ef7c94f923c0c36135102d562
+
+ * Removed VIR_STORAGE_POOL_ISCSI_DIRECT from switch since it's not
+   a downstream symbol/option
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Message-Id: <20190403131219.16385-5-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ tests/Makefile.am                             |  12 ++
+ tests/storagepoolxml2argvdata/pool-fs.argv    |   1 +
+ .../pool-netfs-cifs.argv                      |   1 +
+ .../pool-netfs-gluster.argv                   |   1 +
+ tests/storagepoolxml2argvdata/pool-netfs.argv |   1 +
+ tests/storagepoolxml2argvtest.c               | 172 ++++++++++++++++++
+ 6 files changed, 188 insertions(+)
+ create mode 100644 tests/storagepoolxml2argvdata/pool-fs.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-cifs.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-gluster.argv
+ create mode 100644 tests/storagepoolxml2argvdata/pool-netfs.argv
+ create mode 100644 tests/storagepoolxml2argvtest.c
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index a4ebed489a..858076df7b 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -141,6 +141,7 @@ EXTRA_DIST = \
+ 	storagepoolschemadata \
+ 	storagepoolxml2xmlin \
+ 	storagepoolxml2xmlout \
++	storagepoolxml2argvdata \
+ 	storagevolschemadata \
+ 	storagevolxml2argvdata \
+ 	storagevolxml2xmlin \
+@@ -363,6 +364,7 @@ endif WITH_NWFILTER
+ 
+ if WITH_STORAGE
+ test_programs += storagevolxml2argvtest
++test_programs += storagepoolxml2argvtest
+ test_programs += virstorageutiltest
+ endif WITH_STORAGE
+ 
+@@ -901,6 +903,16 @@ storagevolxml2argvtest_LDADD = \
+ 	../src/libvirt_util.la \
+ 	$(LDADDS)
+ 
++storagepoolxml2argvtest_SOURCES = \
++    storagepoolxml2argvtest.c \
++    testutils.c testutils.h
++storagepoolxml2argvtest_LDADD = \
++	$(LIBXML_LIBS) \
++	../src/libvirt_driver_storage_impl.la \
++	../src/libvirt_conf.la \
++	../src/libvirt_util.la \
++	$(LDADDS)
++
+ else ! WITH_STORAGE
+ EXTRA_DIST += storagevolxml2argvtest.c
+ EXTRA_DIST += virstorageutiltest.c
+diff --git a/tests/storagepoolxml2argvdata/pool-fs.argv b/tests/storagepoolxml2argvdata/pool-fs.argv
+new file mode 100644
+index 0000000000..537ce4cee5
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-fs.argv
+@@ -0,0 +1 @@
++mount -t ext3 /dev/sda6 /mnt
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-cifs.argv b/tests/storagepoolxml2argvdata/pool-netfs-cifs.argv
+new file mode 100644
+index 0000000000..2fef6f5782
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-cifs.argv
+@@ -0,0 +1 @@
++mount -t cifs //example.com/samba_share /mnt/cifs -o guest
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv b/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv
+new file mode 100644
+index 0000000000..4303d514ef
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv
+@@ -0,0 +1 @@
++mount -t glusterfs example.com:/volume -o direct-io-mode=1 /mnt/gluster
+diff --git a/tests/storagepoolxml2argvdata/pool-netfs.argv b/tests/storagepoolxml2argvdata/pool-netfs.argv
+new file mode 100644
+index 0000000000..04127c5087
+--- /dev/null
++++ b/tests/storagepoolxml2argvdata/pool-netfs.argv
+@@ -0,0 +1 @@
++mount -t nfs localhost:/var/lib/libvirt/images /mnt
+diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c
+new file mode 100644
+index 0000000000..54bc07b4e1
+--- /dev/null
++++ b/tests/storagepoolxml2argvtest.c
+@@ -0,0 +1,172 @@
++#include <config.h>
++
++#include "internal.h"
++#include "testutils.h"
++#include "datatypes.h"
++#include "storage/storage_util.h"
++#include "testutilsqemu.h"
++#include "virstring.h"
++
++#define VIR_FROM_THIS VIR_FROM_NONE
++
++
++static int
++testCompareXMLToArgvFiles(bool shouldFail,
++                          const char *poolxml,
++                          const char *cmdline)
++{
++    char *actualCmdline = NULL;
++    char *src = NULL;
++    int ret = -1;
++    virCommandPtr cmd = NULL;
++    virStoragePoolDefPtr def = NULL;
++    virStoragePoolObjPtr pool = NULL;
++
++    if (!(def = virStoragePoolDefParseFile(poolxml)))
++        goto cleanup;
++
++    switch ((virStoragePoolType)def->type) {
++    case VIR_STORAGE_POOL_FS:
++    case VIR_STORAGE_POOL_NETFS:
++        if (!(pool = virStoragePoolObjNew())) {
++            VIR_TEST_DEBUG("pool type %d alloc pool obj fails\n", def->type);
++            virStoragePoolDefFree(def);
++            goto cleanup;
++        }
++        virStoragePoolObjSetDef(pool, def);
++
++        if (!(src = virStorageBackendFileSystemGetPoolSource(pool))) {
++            VIR_TEST_DEBUG("pool type %d has no pool source\n", def->type);
++            goto cleanup;
++        }
++
++        cmd = virStorageBackendFileSystemMountCmd(def, src);
++        break;
++
++    case VIR_STORAGE_POOL_DIR:
++    case VIR_STORAGE_POOL_LOGICAL:
++    case VIR_STORAGE_POOL_DISK:
++    case VIR_STORAGE_POOL_ISCSI:
++    case VIR_STORAGE_POOL_SCSI:
++    case VIR_STORAGE_POOL_MPATH:
++    case VIR_STORAGE_POOL_RBD:
++    case VIR_STORAGE_POOL_SHEEPDOG:
++    case VIR_STORAGE_POOL_GLUSTER:
++    case VIR_STORAGE_POOL_ZFS:
++    case VIR_STORAGE_POOL_VSTORAGE:
++    case VIR_STORAGE_POOL_LAST:
++    default:
++        VIR_TEST_DEBUG("pool type %d has no xml2argv test\n", def->type);
++        goto cleanup;
++    };
++
++    if (!(actualCmdline = virCommandToString(cmd))) {
++        VIR_TEST_DEBUG("pool type %d failed to get commandline\n", def->type);
++        goto cleanup;
++    }
++
++    virTestClearCommandPath(actualCmdline);
++    if (virTestCompareToFile(actualCmdline, cmdline) < 0)
++        goto cleanup;
++
++    ret = 0;
++
++ cleanup:
++    virCommandFree(cmd);
++    VIR_FREE(src);
++    VIR_FREE(actualCmdline);
++    virStoragePoolObjEndAPI(&pool);
++    if (shouldFail) {
++        virResetLastError();
++        ret = 0;
++    }
++    return ret;
++}
++
++struct testInfo {
++    bool shouldFail;
++    const char *pool;
++};
++
++static int
++testCompareXMLToArgvHelper(const void *data)
++{
++    int result = -1;
++    const struct testInfo *info = data;
++    char *poolxml = NULL;
++    char *cmdline = NULL;
++
++    if (virAsprintf(&poolxml, "%s/storagepoolxml2xmlin/%s.xml",
++                    abs_srcdir, info->pool) < 0)
++        goto cleanup;
++
++    if (virAsprintf(&cmdline, "%s/storagepoolxml2argvdata/%s.argv",
++                    abs_srcdir, info->pool) < 0 && !info->shouldFail)
++        goto cleanup;
++
++    result = testCompareXMLToArgvFiles(info->shouldFail, poolxml, cmdline);
++
++ cleanup:
++    VIR_FREE(poolxml);
++    VIR_FREE(cmdline);
++
++    return result;
++}
++
++
++static int
++mymain(void)
++{
++    int ret = 0;
++
++#define DO_TEST_FULL(shouldFail, pool) \
++    do { \
++        struct testInfo info = { shouldFail, pool }; \
++        if (virTestRun("Storage Pool XML-2-argv " pool, \
++                       testCompareXMLToArgvHelper, &info) < 0) \
++            ret = -1; \
++       } \
++    while (0);
++
++#define DO_TEST(pool, ...) \
++    DO_TEST_FULL(false, pool)
++
++#define DO_TEST_FAIL(pool, ...) \
++    DO_TEST_FULL(true, pool)
++
++    DO_TEST_FAIL("pool-dir");
++    DO_TEST_FAIL("pool-dir-naming");
++    DO_TEST("pool-fs");
++    DO_TEST_FAIL("pool-logical");
++    DO_TEST_FAIL("pool-logical-nopath");
++    DO_TEST_FAIL("pool-logical-create");
++    DO_TEST_FAIL("pool-logical-noname");
++    DO_TEST_FAIL("pool-disk");
++    DO_TEST_FAIL("pool-disk-device-nopartsep");
++    DO_TEST_FAIL("pool-iscsi");
++    DO_TEST_FAIL("pool-iscsi-auth");
++    DO_TEST("pool-netfs");
++    DO_TEST("pool-netfs-gluster");
++    DO_TEST("pool-netfs-cifs");
++    DO_TEST_FAIL("pool-scsi");
++    DO_TEST_FAIL("pool-scsi-type-scsi-host");
++    DO_TEST_FAIL("pool-scsi-type-fc-host");
++    DO_TEST_FAIL("pool-scsi-type-fc-host-managed");
++    DO_TEST_FAIL("pool-mpath");
++    DO_TEST_FAIL("pool-iscsi-multiiqn");
++    DO_TEST_FAIL("pool-iscsi-vendor-product");
++    DO_TEST_FAIL("pool-sheepdog");
++    DO_TEST_FAIL("pool-gluster");
++    DO_TEST_FAIL("pool-gluster-sub");
++    DO_TEST_FAIL("pool-scsi-type-scsi-host-stable");
++    DO_TEST_FAIL("pool-zfs");
++    DO_TEST_FAIL("pool-zfs-sourcedev");
++    DO_TEST_FAIL("pool-rbd");
++    DO_TEST_FAIL("pool-vstorage");
++    DO_TEST_FAIL("pool-iscsi-direct-auth");
++    DO_TEST_FAIL("pool-iscsi-direct");
++
++    return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
++}
++
++VIR_TEST_MAIN(mymain)
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-tests-Reuse-qemucapabilities-data-for-qemucaps2xml.patch b/SOURCES/libvirt-tests-Reuse-qemucapabilities-data-for-qemucaps2xml.patch
new file mode 100644
index 0000000..ffa65d5
--- /dev/null
+++ b/SOURCES/libvirt-tests-Reuse-qemucapabilities-data-for-qemucaps2xml.patch
@@ -0,0 +1,479 @@
+From 479f1a10b13e3029ea71003bdd8d1158711816d8 Mon Sep 17 00:00:00 2001
+Message-Id: <479f1a10b13e3029ea71003bdd8d1158711816d8@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Fri, 5 Apr 2019 10:57:38 +0200
+Subject: [PATCH] tests: Reuse qemucapabilities data for qemucaps2xml
+
+While qemucaps2xml has a meager two test cases to its name, we
+have plenty of data from qemucapabilities which is taken from
+actual QEMU binaries, covers pretty much all supported QEMU
+versions and architectures and is even in the right format already!
+
+Rewrite qemucaps2xml so that it uses qemucapabilities data as
+input. Right now we have a single test case, but we're going to
+add a lot more next.
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit 562990849a9de255b5fefa39be3f301b1bddfa6e)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1628469
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190405085744.8179-2-abologna@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ tests/qemucaps2xmldata/all_1.6.0-1.caps       | 129 ------------------
+ .../nodisksnapshot_1.6.0-1.caps               | 128 -----------------
+ .../nodisksnapshot_1.6.0-1.xml                |  32 -----
+ .../caps_1.6.0.x86_64.xml}                    |  12 +-
+ tests/qemucaps2xmltest.c                      |  33 +++--
+ 5 files changed, 23 insertions(+), 311 deletions(-)
+ delete mode 100644 tests/qemucaps2xmldata/all_1.6.0-1.caps
+ delete mode 100644 tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
+ delete mode 100644 tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
+ rename tests/{qemucaps2xmldata/all_1.6.0-1.xml => qemucaps2xmloutdata/caps_1.6.0.x86_64.xml} (67%)
+
+diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.caps b/tests/qemucaps2xmldata/all_1.6.0-1.caps
+deleted file mode 100644
+index d39d0bebbf..0000000000
+--- a/tests/qemucaps2xmldata/all_1.6.0-1.caps
++++ /dev/null
+@@ -1,129 +0,0 @@
+-  <qemuCaps>
+-    <flag name='mem-path'/>
+-    <flag name='drive-serial'/>
+-    <flag name='chardev'/>
+-    <flag name='enable-kvm'/>
+-    <flag name='monitor-json'/>
+-    <flag name='balloon'/>
+-    <flag name='device'/>
+-    <flag name='sdl'/>
+-    <flag name='smp-topology'/>
+-    <flag name='netdev'/>
+-    <flag name='rtc'/>
+-    <flag name='vhost-net'/>
+-    <flag name='no-hpet'/>
+-    <flag name='no-kvm-pit'/>
+-    <flag name='pci-configfd'/>
+-    <flag name='nodefconfig'/>
+-    <flag name='boot-menu'/>
+-    <flag name='fsdev'/>
+-    <flag name='name-process'/>
+-    <flag name='drive-readonly'/>
+-    <flag name='smbios-type'/>
+-    <flag name='vga-qxl'/>
+-    <flag name='spice'/>
+-    <flag name='vga-none'/>
+-    <flag name='boot-index'/>
+-    <flag name='hda-duplex'/>
+-    <flag name='drive-aio'/>
+-    <flag name='pci-multibus'/>
+-    <flag name='pci-bootindex'/>
+-    <flag name='ccid-emulated'/>
+-    <flag name='ccid-passthru'/>
+-    <flag name='chardev-spicevmc'/>
+-    <flag name='virtio-tx-alg'/>
+-    <flag name='device-qxl-vga'/>
+-    <flag name='pci-multifunction'/>
+-    <flag name='virtio-blk-pci.ioeventfd'/>
+-    <flag name='sga'/>
+-    <flag name='virtio-blk-pci.event_idx'/>
+-    <flag name='virtio-net-pci.event_idx'/>
+-    <flag name='cache-directsync'/>
+-    <flag name='piix3-usb-uhci'/>
+-    <flag name='piix4-usb-uhci'/>
+-    <flag name='usb-ehci'/>
+-    <flag name='ich9-usb-ehci1'/>
+-    <flag name='vt82c686b-usb-uhci'/>
+-    <flag name='pci-ohci'/>
+-    <flag name='usb-hub'/>
+-    <flag name='no-shutdown'/>
+-    <flag name='cache-unsafe'/>
+-    <flag name='rombar'/>
+-    <flag name='ich9-ahci'/>
+-    <flag name='no-acpi'/>
+-    <flag name='fsdev-readonly'/>
+-    <flag name='virtio-blk-pci.scsi'/>
+-    <flag name='blk-sg-io'/>
+-    <flag name='drive-copy-on-read'/>
+-    <flag name='cpu-host'/>
+-    <flag name='fsdev-writeout'/>
+-    <flag name='drive-iotune'/>
+-    <flag name='system_wakeup'/>
+-    <flag name='scsi-disk.channel'/>
+-    <flag name='scsi-block'/>
+-    <flag name='transaction'/>
+-    <flag name='block-job-async'/>
+-    <flag name='scsi-cd'/>
+-    <flag name='ide-cd'/>
+-    <flag name='no-user-config'/>
+-    <flag name='hda-micro'/>
+-    <flag name='dump-guest-memory'/>
+-    <flag name='nec-usb-xhci'/>
+-    <flag name='balloon-event'/>
+-    <flag name='bridge'/>
+-    <flag name='lsi'/>
+-    <flag name='virtio-scsi-pci'/>
+-    <flag name='blockio'/>
+-    <flag name='disable-s3'/>
+-    <flag name='disable-s4'/>
+-    <flag name='ide-drive.wwn'/>
+-    <flag name='scsi-disk.wwn'/>
+-    <flag name='seccomp-sandbox'/>
+-    <flag name='dump-guest-core'/>
+-    <flag name='seamless-migration'/>
+-    <flag name='block-commit'/>
+-    <flag name='vnc'/>
+-    <flag name='drive-mirror'/>
+-    <flag name='usb-host.bootindex'/>
+-    <flag name='blockdev-snapshot-sync'/>
+-    <flag name='qxl'/>
+-    <flag name='VGA'/>
+-    <flag name='cirrus-vga'/>
+-    <flag name='vmware-svga'/>
+-    <flag name='device-video-primary'/>
+-    <flag name='usb-serial'/>
+-    <flag name='usb-net'/>
+-    <flag name='add-fd'/>
+-    <flag name='nbd-server'/>
+-    <flag name='virtio-rng'/>
+-    <flag name='rng-random'/>
+-    <flag name='rng-egd'/>
+-    <flag name='dtb'/>
+-    <flag name='megasas'/>
+-    <flag name='ipv6-migration'/>
+-    <flag name='machine-opt'/>
+-    <flag name='machine-usb-opt'/>
+-    <flag name='pci-bridge'/>
+-    <flag name='vfio-pci'/>
+-    <flag name='vfio-pci.bootindex'/>
+-    <flag name='scsi-generic'/>
+-    <flag name='scsi-generic.bootindex'/>
+-    <flag name='mem-merge'/>
+-    <flag name='vnc-websocket'/>
+-    <flag name='mlock'/>
+-    <flag name='vnc-share-policy'/>
+-    <flag name='device-del-event'/>
+-    <flag name='dmi-to-pci-bridge'/>
+-    <flag name='i440fx-pci-hole64-size'/>
+-    <flag name='q35-pci-hole64-size'/>
+-    <flag name='usb-storage'/>
+-    <flag name='usb-storage.removable'/>
+-    <flag name='virtio-mmio'/>
+-    <flag name='ich9-intel-hda'/>
+-    <flag name='kvm-pit-lost-tick-policy'/>
+-    <flag name='boot-strict'/>
+-    <flag name='pvpanic'/>
+-    <flag name='reboot-timeout'/>
+-    <flag name='enable-fips'/>
+-    <flag name='name-guest'/>
+-  </qemuCaps>
+diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
+deleted file mode 100644
+index 5a0372c917..0000000000
+--- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
++++ /dev/null
+@@ -1,128 +0,0 @@
+-  <qemuCaps>
+-    <flag name='mem-path'/>
+-    <flag name='drive-serial'/>
+-    <flag name='chardev'/>
+-    <flag name='enable-kvm'/>
+-    <flag name='monitor-json'/>
+-    <flag name='balloon'/>
+-    <flag name='device'/>
+-    <flag name='sdl'/>
+-    <flag name='smp-topology'/>
+-    <flag name='netdev'/>
+-    <flag name='rtc'/>
+-    <flag name='vhost-net'/>
+-    <flag name='no-hpet'/>
+-    <flag name='no-kvm-pit'/>
+-    <flag name='pci-configfd'/>
+-    <flag name='nodefconfig'/>
+-    <flag name='boot-menu'/>
+-    <flag name='fsdev'/>
+-    <flag name='name-process'/>
+-    <flag name='drive-readonly'/>
+-    <flag name='smbios-type'/>
+-    <flag name='vga-qxl'/>
+-    <flag name='spice'/>
+-    <flag name='vga-none'/>
+-    <flag name='boot-index'/>
+-    <flag name='hda-duplex'/>
+-    <flag name='drive-aio'/>
+-    <flag name='pci-multibus'/>
+-    <flag name='pci-bootindex'/>
+-    <flag name='ccid-emulated'/>
+-    <flag name='ccid-passthru'/>
+-    <flag name='chardev-spicevmc'/>
+-    <flag name='virtio-tx-alg'/>
+-    <flag name='device-qxl-vga'/>
+-    <flag name='pci-multifunction'/>
+-    <flag name='virtio-blk-pci.ioeventfd'/>
+-    <flag name='sga'/>
+-    <flag name='virtio-blk-pci.event_idx'/>
+-    <flag name='virtio-net-pci.event_idx'/>
+-    <flag name='cache-directsync'/>
+-    <flag name='piix3-usb-uhci'/>
+-    <flag name='piix4-usb-uhci'/>
+-    <flag name='usb-ehci'/>
+-    <flag name='ich9-usb-ehci1'/>
+-    <flag name='vt82c686b-usb-uhci'/>
+-    <flag name='pci-ohci'/>
+-    <flag name='usb-hub'/>
+-    <flag name='no-shutdown'/>
+-    <flag name='cache-unsafe'/>
+-    <flag name='rombar'/>
+-    <flag name='ich9-ahci'/>
+-    <flag name='no-acpi'/>
+-    <flag name='fsdev-readonly'/>
+-    <flag name='virtio-blk-pci.scsi'/>
+-    <flag name='blk-sg-io'/>
+-    <flag name='drive-copy-on-read'/>
+-    <flag name='cpu-host'/>
+-    <flag name='fsdev-writeout'/>
+-    <flag name='drive-iotune'/>
+-    <flag name='system_wakeup'/>
+-    <flag name='scsi-disk.channel'/>
+-    <flag name='scsi-block'/>
+-    <flag name='transaction'/>
+-    <flag name='block-job-async'/>
+-    <flag name='scsi-cd'/>
+-    <flag name='ide-cd'/>
+-    <flag name='no-user-config'/>
+-    <flag name='hda-micro'/>
+-    <flag name='dump-guest-memory'/>
+-    <flag name='nec-usb-xhci'/>
+-    <flag name='balloon-event'/>
+-    <flag name='bridge'/>
+-    <flag name='lsi'/>
+-    <flag name='virtio-scsi-pci'/>
+-    <flag name='blockio'/>
+-    <flag name='disable-s3'/>
+-    <flag name='disable-s4'/>
+-    <flag name='ide-drive.wwn'/>
+-    <flag name='scsi-disk.wwn'/>
+-    <flag name='seccomp-sandbox'/>
+-    <flag name='dump-guest-core'/>
+-    <flag name='seamless-migration'/>
+-    <flag name='block-commit'/>
+-    <flag name='vnc'/>
+-    <flag name='drive-mirror'/>
+-    <flag name='usb-host.bootindex'/>
+-    <flag name='qxl'/>
+-    <flag name='VGA'/>
+-    <flag name='cirrus-vga'/>
+-    <flag name='vmware-svga'/>
+-    <flag name='device-video-primary'/>
+-    <flag name='usb-serial'/>
+-    <flag name='usb-net'/>
+-    <flag name='add-fd'/>
+-    <flag name='nbd-server'/>
+-    <flag name='virtio-rng'/>
+-    <flag name='rng-random'/>
+-    <flag name='rng-egd'/>
+-    <flag name='dtb'/>
+-    <flag name='megasas'/>
+-    <flag name='ipv6-migration'/>
+-    <flag name='machine-opt'/>
+-    <flag name='machine-usb-opt'/>
+-    <flag name='pci-bridge'/>
+-    <flag name='vfio-pci'/>
+-    <flag name='vfio-pci.bootindex'/>
+-    <flag name='scsi-generic'/>
+-    <flag name='scsi-generic.bootindex'/>
+-    <flag name='mem-merge'/>
+-    <flag name='vnc-websocket'/>
+-    <flag name='mlock'/>
+-    <flag name='vnc-share-policy'/>
+-    <flag name='device-del-event'/>
+-    <flag name='dmi-to-pci-bridge'/>
+-    <flag name='i440fx-pci-hole64-size'/>
+-    <flag name='q35-pci-hole64-size'/>
+-    <flag name='usb-storage'/>
+-    <flag name='usb-storage.removable'/>
+-    <flag name='virtio-mmio'/>
+-    <flag name='ich9-intel-hda'/>
+-    <flag name='kvm-pit-lost-tick-policy'/>
+-    <flag name='boot-strict'/>
+-    <flag name='pvpanic'/>
+-    <flag name='reboot-timeout'/>
+-    <flag name='enable-fips'/>
+-    <flag name='name-guest'/>
+-  </qemuCaps>
+diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
+deleted file mode 100644
+index 981344e6fd..0000000000
+--- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
++++ /dev/null
+@@ -1,32 +0,0 @@
+-<capabilities>
+-
+-  <host>
+-    <cpu>
+-      <arch>i686</arch>
+-    </cpu>
+-    <power_management/>
+-    <iommu support='no'/>
+-  </host>
+-
+-  <guest>
+-    <os_type>hvm</os_type>
+-    <arch name='i686'>
+-      <wordsize>32</wordsize>
+-      <emulator>/usr/bin/qemu-system-i386</emulator>
+-      <domain type='qemu'/>
+-      <domain type='kvm'>
+-        <emulator>/usr/bin/qemu-system-i386</emulator>
+-      </domain>
+-    </arch>
+-    <features>
+-      <cpuselection/>
+-      <deviceboot/>
+-      <disksnapshot default='off' toggle='no'/>
+-      <acpi default='on' toggle='yes'/>
+-      <apic default='on' toggle='no'/>
+-      <pae/>
+-      <nonpae/>
+-    </features>
+-  </guest>
+-
+-</capabilities>
+diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.xml b/tests/qemucaps2xmloutdata/caps_1.6.0.x86_64.xml
+similarity index 67%
+rename from tests/qemucaps2xmldata/all_1.6.0-1.xml
+rename to tests/qemucaps2xmloutdata/caps_1.6.0.x86_64.xml
+index efe86b9a12..b58f54fefd 100644
+--- a/tests/qemucaps2xmldata/all_1.6.0-1.xml
++++ b/tests/qemucaps2xmloutdata/caps_1.6.0.x86_64.xml
+@@ -2,7 +2,7 @@
+ 
+   <host>
+     <cpu>
+-      <arch>i686</arch>
++      <arch>x86_64</arch>
+     </cpu>
+     <power_management/>
+     <iommu support='no'/>
+@@ -10,12 +10,12 @@
+ 
+   <guest>
+     <os_type>hvm</os_type>
+-    <arch name='i686'>
+-      <wordsize>32</wordsize>
+-      <emulator>/usr/bin/qemu-system-i386</emulator>
++    <arch name='x86_64'>
++      <wordsize>64</wordsize>
++      <emulator>/usr/bin/qemu-system-x86_64</emulator>
+       <domain type='qemu'/>
+       <domain type='kvm'>
+-        <emulator>/usr/bin/qemu-system-i386</emulator>
++        <emulator>/usr/bin/qemu-system-x86_64</emulator>
+       </domain>
+     </arch>
+     <features>
+@@ -24,8 +24,6 @@
+       <disksnapshot default='on' toggle='no'/>
+       <acpi default='on' toggle='yes'/>
+       <apic default='on' toggle='no'/>
+-      <pae/>
+-      <nonpae/>
+     </features>
+   </guest>
+ 
+diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c
+index 5b9152b04d..65dd97c0a4 100644
+--- a/tests/qemucaps2xmltest.c
++++ b/tests/qemucaps2xmltest.c
+@@ -32,7 +32,7 @@ typedef struct _testQemuData testQemuData;
+ typedef testQemuData *testQemuDataPtr;
+ struct _testQemuData {
+     const char *base;
+-    virArch guestarch;
++    const char *archName;
+ };
+ 
+ static virQEMUCapsPtr
+@@ -87,23 +87,28 @@ testGetCaps(char *capsData, const testQemuData *data)
+ {
+     virQEMUCapsPtr qemuCaps = NULL;
+     virCapsPtr caps = NULL;
++    virArch arch = virArchFromString(data->archName);
++    char *binary = NULL;
++
++    if (virAsprintf(&binary, "/usr/bin/qemu-system-%s", data->archName) < 0)
++        goto error;
+ 
+     if ((qemuCaps = testQemuGetCaps(capsData)) == NULL) {
+         fprintf(stderr, "failed to parse qemu capabilities flags");
+         goto error;
+     }
+ 
+-    if ((caps = virCapabilitiesNew(data->guestarch, false, false)) == NULL) {
++    if ((caps = virCapabilitiesNew(arch, false, false)) == NULL) {
+         fprintf(stderr, "failed to create the fake capabilities");
+         goto error;
+     }
+ 
+     if (virQEMUCapsInitGuestFromBinary(caps,
+-                                       "/usr/bin/qemu-system-i386",
++                                       binary,
+                                        qemuCaps,
+                                        NULL,
+                                        NULL,
+-                                       data->guestarch) < 0) {
++                                       arch) < 0) {
+         fprintf(stderr, "failed to create the capabilities from qemu");
+         goto error;
+     }
+@@ -114,6 +119,7 @@ testGetCaps(char *capsData, const testQemuData *data)
+  error:
+     virObjectUnref(qemuCaps);
+     virObjectUnref(caps);
++    VIR_FREE(binary);
+     return NULL;
+ }
+ 
+@@ -127,12 +133,12 @@ testQemuCapsXML(const void *opaque)
+     char *capsXml = NULL;
+     virCapsPtr capsProvided = NULL;
+ 
+-    if (virAsprintf(&xmlFile, "%s/qemucaps2xmldata/%s.xml",
+-                    abs_srcdir, data->base) < 0)
++    if (virAsprintf(&xmlFile, "%s/qemucaps2xmloutdata/%s.%s.xml",
++                    abs_srcdir, data->base, data->archName) < 0)
+         goto cleanup;
+ 
+-    if (virAsprintf(&capsFile, "%s/qemucaps2xmldata/%s.caps",
+-                    abs_srcdir, data->base) < 0)
++    if (virAsprintf(&capsFile, "%s/qemucapabilitiesdata/%s.%s.xml",
++                    abs_srcdir, data->base, data->archName) < 0)
+         goto cleanup;
+ 
+     if (virTestLoadFile(capsFile, &capsData) < 0)
+@@ -175,16 +181,13 @@ mymain(void)
+ 
+     virEventRegisterDefaultImpl();
+ 
+-#define DO_TEST_FULL(name, guest) \
++#define DO_TEST(arch, name) \
++    data.archName = arch; \
+     data.base = name; \
+-    data.guestarch = guest; \
+-    if (virTestRun(name, testQemuCapsXML, &data) < 0) \
++    if (virTestRun(name "(" arch ")", testQemuCapsXML, &data) < 0) \
+         ret = -1
+ 
+-#define DO_TEST(name) DO_TEST_FULL(name, VIR_ARCH_I686)
+-
+-    DO_TEST("all_1.6.0-1");
+-    DO_TEST("nodisksnapshot_1.6.0-1");
++    DO_TEST("x86_64", "caps_1.6.0");
+ 
+     return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+ }
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-tests-add-channel-unix-guestfwd.patch b/SOURCES/libvirt-tests-add-channel-unix-guestfwd.patch
new file mode 100644
index 0000000..7b6aebc
--- /dev/null
+++ b/SOURCES/libvirt-tests-add-channel-unix-guestfwd.patch
@@ -0,0 +1,169 @@
+From 846887a895a0b2b1fceeedffed8fdbeb15e355cc Mon Sep 17 00:00:00 2001
+Message-Id: <846887a895a0b2b1fceeedffed8fdbeb15e355cc@dist-git>
+From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
+Date: Thu, 11 Apr 2019 15:14:15 -0400
+Subject: [PATCH] tests: add channel-unix-guestfwd
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Test guestfwd channels backed by UNIX sockets.
+
+Signed-off-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 8e0266d5bb4004c009080543982bfed6b93a3476)
+
+Partially-Resolves: https://bugzilla.redhat.com/1658198
+Signed-off-by: Laine Stump <laine@redhat.com>
+Signed-off-by: Laine Stump <laine@laine.org>
+Message-Id: <20190411191453.24055-4-laine@redhat.com>
+Acked-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ .../channel-unix-guestfwd.x86_64-2.5.0.args   | 33 +++++++++++++++++
+ .../channel-unix-guestfwd.x86_64-latest.args  | 36 ++++++++++++++++++
+ .../channel-unix-guestfwd.xml                 | 37 +++++++++++++++++++
+ tests/qemuxml2argvtest.c                      |  2 +
+ 4 files changed, 108 insertions(+)
+ create mode 100644 tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args
+ create mode 100644 tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args
+ create mode 100644 tests/qemuxml2argvdata/channel-unix-guestfwd.xml
+
+diff --git a/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args
+new file mode 100644
+index 0000000000..f0e718e4a2
+--- /dev/null
++++ b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-2.5.0.args
+@@ -0,0 +1,33 @@
++LC_ALL=C \
++PATH=/bin \
++HOME=/home/test \
++USER=test \
++LOGNAME=test \
++QEMU_AUDIO_DRV=none \
++/usr/bin/qemu-system-x86_64 \
++-name guest=QEMUGuest1,debug-threads=on \
++-S \
++-machine pc-i440fx-2.5,accel=kvm,usb=off,dump-guest-core=off \
++-m 214 \
++-realtime mlock=off \
++-smp 1,sockets=1,cores=1,threads=1 \
++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
++-display none \
++-no-user-config \
++-nodefaults \
++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
++server,nowait \
++-mon chardev=charmonitor,id=monitor,mode=control \
++-rtc base=utc \
++-no-shutdown \
++-no-acpi \
++-boot strict=on \
++-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
++-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
++-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
++-chardev socket,id=charchannel0,path=/tmp/guestfwd-listen.socket,server,nowait \
++-netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=user-channel0 \
++-chardev socket,id=charchannel1,path=/tmp/guestfwd-connect.socket \
++-netdev user,guestfwd=tcp:10.0.2.1:4601-chardev:charchannel1,id=user-channel1 \
++-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
++-msg timestamp=on
+diff --git a/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args
+new file mode 100644
+index 0000000000..f9b9ee5fdb
+--- /dev/null
++++ b/tests/qemuxml2argvdata/channel-unix-guestfwd.x86_64-latest.args
+@@ -0,0 +1,36 @@
++LC_ALL=C \
++PATH=/bin \
++HOME=/home/test \
++USER=test \
++LOGNAME=test \
++QEMU_AUDIO_DRV=none \
++/usr/bin/qemu-system-x86_64 \
++-name guest=QEMUGuest1,debug-threads=on \
++-S \
++-object secret,id=masterKey0,format=raw,\
++file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
++-machine pc,accel=kvm,usb=off,dump-guest-core=off \
++-m 214 \
++-realtime mlock=off \
++-smp 1,sockets=1,cores=1,threads=1 \
++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
++-display none \
++-no-user-config \
++-nodefaults \
++-chardev socket,id=charmonitor,fd=1729,server,nowait \
++-mon chardev=charmonitor,id=monitor,mode=control \
++-rtc base=utc \
++-no-shutdown \
++-no-acpi \
++-boot strict=on \
++-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
++-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
++-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
++-chardev socket,id=charchannel0,fd=1729,server,nowait \
++-netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=user-channel0 \
++-chardev socket,id=charchannel1,path=/tmp/guestfwd-connect.socket \
++-netdev user,guestfwd=tcp:10.0.2.1:4601-chardev:charchannel1,id=user-channel1 \
++-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
++-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
++resourcecontrol=deny \
++-msg timestamp=on
+diff --git a/tests/qemuxml2argvdata/channel-unix-guestfwd.xml b/tests/qemuxml2argvdata/channel-unix-guestfwd.xml
+new file mode 100644
+index 0000000000..c9698a1259
+--- /dev/null
++++ b/tests/qemuxml2argvdata/channel-unix-guestfwd.xml
+@@ -0,0 +1,37 @@
++<domain type='kvm'>
++  <name>QEMUGuest1</name>
++  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
++  <memory unit='KiB'>219100</memory>
++  <currentMemory unit='KiB'>219100</currentMemory>
++  <vcpu>1</vcpu>
++  <os>
++    <type arch='x86_64' machine='pc'>hvm</type>
++    <boot dev='hd'/>
++  </os>
++  <clock offset='utc'/>
++  <on_poweroff>destroy</on_poweroff>
++  <on_reboot>restart</on_reboot>
++  <on_crash>destroy</on_crash>
++  <devices>
++    <emulator>/usr/bin/qemu-system-x86_64</emulator>
++    <disk type='block' device='disk'>
++      <source dev='/dev/HostVG/QEMUGuest1'/>
++      <target dev='hda' bus='ide'/>
++      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
++    </disk>
++    <controller type='usb' index='0'/>
++    <controller type='ide' index='0'/>
++    <controller type='pci' index='0' model='pci-root'/>
++    <channel type='unix'>
++      <source mode='bind' path='/tmp/guestfwd-listen.socket'/>
++      <target type='guestfwd' address='10.0.2.1' port='4600'/>
++    </channel>
++    <channel type='unix'>
++      <source mode='connect' path='/tmp/guestfwd-connect.socket'/>
++      <target type='guestfwd' address='10.0.2.1' port='4601'/>
++    </channel>
++    <input type='mouse' bus='ps2'/>
++    <input type='keyboard' bus='ps2'/>
++    <memballoon model='virtio'/>
++  </devices>
++</domain>
+diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
+index f401076731..693e768d66 100644
+--- a/tests/qemuxml2argvtest.c
++++ b/tests/qemuxml2argvtest.c
+@@ -1403,6 +1403,8 @@ mymain(void)
+             QEMU_CAPS_DEVICE_PCI_SERIAL);
+ 
+     DO_TEST("channel-guestfwd", NONE);
++    DO_TEST_CAPS_VER("channel-unix-guestfwd", "2.5.0");
++    DO_TEST_CAPS_LATEST("channel-unix-guestfwd");
+     DO_TEST("channel-virtio", NONE);
+     DO_TEST("channel-virtio-state", NONE);
+     DO_TEST("channel-virtio-auto", NONE);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Add-MBA-allocation-to-virresctrl.patch b/SOURCES/libvirt-util-Add-MBA-allocation-to-virresctrl.patch
new file mode 100644
index 0000000..289d5a9
--- /dev/null
+++ b/SOURCES/libvirt-util-Add-MBA-allocation-to-virresctrl.patch
@@ -0,0 +1,160 @@
+From 6013f8d130b617ab0ff14075e225b4bb8836702e Mon Sep 17 00:00:00 2001
+Message-Id: <6013f8d130b617ab0ff14075e225b4bb8836702e@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:49 +0200
+Subject: [PATCH] util: Add MBA allocation to virresctrl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add memory bandwidth allocation support to virresctrl class.
+Introducing virResctrlAllocMemBW which is used for allocating memory
+bandwidth. Following virResctrlAllocPerType, it also employs a
+nested sparse array to indicate whether allocation is available for
+particular last level cache.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 4c727dacbf1bd2a8c4797daf6192b81b85f872f1)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <6c5c1d7dfd4415699a0bf7a5461c99e915dfea1b.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 63 ++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 59 insertions(+), 4 deletions(-)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index f454868f1e..8a25798f7d 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -36,9 +36,9 @@ VIR_LOG_INIT("util.virresctrl")
+ 
+ 
+ /* Resctrl is short for Resource Control.  It might be implemented for various
+- * resources, but at the time of this writing this is only supported for cache
+- * allocation technology (aka CAT).  Hence the reson for leaving 'Cache' out of
+- * all the structure and function names for now (can be added later if needed.
++ * resources. Currently this supports cache allocation technology (aka CAT) and
++ * memory bandwidth allocation (aka MBA). More resources technologies may be
++ * added in the future.
+  */
+ 
+ 
+@@ -89,6 +89,9 @@ typedef virResctrlAllocPerType *virResctrlAllocPerTypePtr;
+ typedef struct _virResctrlAllocPerLevel virResctrlAllocPerLevel;
+ typedef virResctrlAllocPerLevel *virResctrlAllocPerLevelPtr;
+ 
++typedef struct _virResctrlAllocMemBW virResctrlAllocMemBW;
++typedef virResctrlAllocMemBW *virResctrlAllocMemBWPtr;
++
+ 
+ /* Class definitions and initializations */
+ static virClassPtr virResctrlInfoClass;
+@@ -180,7 +183,10 @@ virResctrlInfoDispose(void *obj)
+  * consequently a directory under /sys/fs/resctrl).  Since it can have multiple
+  * parts of multiple caches allocated it is represented as bunch of nested
+  * sparse arrays (by sparse I mean array of pointers so that each might be NULL
+- * in case there is no allocation for that particular one (level, cache, ...)).
++ * in case there is no allocation for that particular cache allocation (level,
++ * cache, ...) or memory allocation for particular node).
++ *
++ * =====Cache allocation technology (CAT)=====
+  *
+  * Since one allocation can be made for caches on different levels, the first
+  * nested sparse array is of types virResctrlAllocPerLevel.  For example if you
+@@ -205,6 +211,17 @@ virResctrlInfoDispose(void *obj)
+  * all of them.  While doing that we store the bitmask in a sparse array of
+  * virBitmaps named `masks` indexed the same way as `sizes`.  The upper bounds
+  * of the sparse arrays are stored in nmasks or nsizes, respectively.
++ + *
++ * =====Memory Bandwidth allocation technology (MBA)=====
++ *
++ * The memory bandwidth allocation support in virResctrlAlloc works in the
++ * same fashion as CAT. However, memory bandwidth controller doesn't have a
++ * hierarchy organization as cache, each node have one memory bandwidth
++ * controller to memory bandwidth distribution. The number of memory bandwidth
++ * controller is identical with number of last level cache. So MBA also employs
++ * a sparse array to represent whether a memory bandwidth allocation happens
++ * on corresponding node. The available memory controller number is collected
++ * in 'virResctrlInfo'.
+  */
+ struct _virResctrlAllocPerType {
+     /* There could be bool saying whether this is set or not, but since everything
+@@ -225,12 +242,24 @@ struct _virResctrlAllocPerLevel {
+      * VIR_CACHE_TYPE_LAST number of items */
+ };
+ 
++/*
++ * virResctrlAllocMemBW represents one memory bandwidth allocation.
++ * Since it can have several last level caches in a NUMA system, it is
++ * also represented as a nested sparse arrays as virRestrlAllocPerLevel.
++ */
++struct _virResctrlAllocMemBW {
++    unsigned int **bandwidths;
++    size_t nbandwidths;
++};
++
+ struct _virResctrlAlloc {
+     virObject parent;
+ 
+     virResctrlAllocPerLevelPtr *levels;
+     size_t nlevels;
+ 
++    virResctrlAllocMemBWPtr mem_bw;
++
+     /* The identifier (any unique string for now) */
+     char *id;
+     /* libvirt-generated path in /sys/fs/resctrl for this particular
+@@ -274,6 +303,13 @@ virResctrlAllocDispose(void *obj)
+         VIR_FREE(level);
+     }
+ 
++    if (alloc->mem_bw) {
++        virResctrlAllocMemBWPtr mem_bw = alloc->mem_bw;
++        for (i = 0; i < mem_bw->nbandwidths; i++)
++            VIR_FREE(mem_bw->bandwidths[i]);
++        VIR_FREE(alloc->mem_bw);
++    }
++
+     VIR_FREE(alloc->id);
+     VIR_FREE(alloc->path);
+     VIR_FREE(alloc->levels);
+@@ -692,6 +728,9 @@ virResctrlAllocIsEmpty(virResctrlAllocPtr alloc)
+     if (!alloc)
+         return true;
+ 
++    if (alloc->mem_bw)
++        return false;
++
+     for (i = 0; i < alloc->nlevels; i++) {
+         virResctrlAllocPerLevelPtr a_level = alloc->levels[i];
+ 
+@@ -1266,6 +1305,22 @@ virResctrlAllocNewFromInfo(virResctrlInfoPtr info)
+         }
+     }
+ 
++    /* set default free memory bandwidth to 100%*/
++    if (info->membw_info) {
++        if (VIR_ALLOC(ret->mem_bw) < 0)
++            goto error;
++
++        if (VIR_EXPAND_N(ret->mem_bw->bandwidths, ret->mem_bw->nbandwidths,
++                         info->membw_info->max_id + 1) < 0)
++            goto error;
++
++        for (i = 0; i < ret->mem_bw->nbandwidths; i++) {
++            if (VIR_ALLOC(ret->mem_bw->bandwidths[i]) < 0)
++                goto error;
++            *(ret->mem_bw->bandwidths[i]) = 100;
++        }
++    }
++
+  cleanup:
+     virBitmapFree(mask);
+     return ret;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Add-MBA-capability-information-query-to-resctrl.patch b/SOURCES/libvirt-util-Add-MBA-capability-information-query-to-resctrl.patch
new file mode 100644
index 0000000..e5a5d8c
--- /dev/null
+++ b/SOURCES/libvirt-util-Add-MBA-capability-information-query-to-resctrl.patch
@@ -0,0 +1,163 @@
+From c402803b725543f690abd96175df12dbee224c58 Mon Sep 17 00:00:00 2001
+Message-Id: <c402803b725543f690abd96175df12dbee224c58@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:47 +0200
+Subject: [PATCH] util: Add MBA capability information query to resctrl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Introducing virResctrlInfoMemBW for the information memory bandwidth
+allocation information.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit a24da791b8d489600807158c45451012ae1a8270)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <5bf94bb7ee189420dfd99b19ff423c9650b1e637.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 84 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 84 insertions(+)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index a38c9261b6..b12a05cb0f 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -80,6 +80,9 @@ typedef virResctrlInfoPerType *virResctrlInfoPerTypePtr;
+ typedef struct _virResctrlInfoPerLevel virResctrlInfoPerLevel;
+ typedef virResctrlInfoPerLevel *virResctrlInfoPerLevelPtr;
+ 
++typedef struct _virResctrlInfoMemBW virResctrlInfoMemBW;
++typedef virResctrlInfoMemBW *virResctrlInfoMemBWPtr;
++
+ typedef struct _virResctrlAllocPerType virResctrlAllocPerType;
+ typedef virResctrlAllocPerType *virResctrlAllocPerTypePtr;
+ 
+@@ -116,11 +119,30 @@ struct _virResctrlInfoPerLevel {
+     virResctrlInfoPerTypePtr *types;
+ };
+ 
++/* Information about memory bandwidth allocation */
++struct _virResctrlInfoMemBW {
++    /* minimum memory bandwidth allowed */
++    unsigned int min_bandwidth;
++    /* bandwidth granularity */
++    unsigned int bandwidth_granularity;
++    /* Maximum number of simultaneous allocations */
++    unsigned int max_allocation;
++    /* level number of last level cache */
++    unsigned int last_level_cache;
++    /* max id of last level cache, this is used to track
++     * how many last level cache available in host system,
++     * the number of memory bandwidth allocation controller
++     * is identical with last level cache. */
++    unsigned int max_id;
++};
++
+ struct _virResctrlInfo {
+     virObject parent;
+ 
+     virResctrlInfoPerLevelPtr *levels;
+     size_t nlevels;
++
++    virResctrlInfoMemBWPtr membw_info;
+ };
+ 
+ 
+@@ -146,6 +168,7 @@ virResctrlInfoDispose(void *obj)
+         VIR_FREE(level);
+     }
+ 
++    VIR_FREE(resctrl->membw_info);
+     VIR_FREE(resctrl->levels);
+ }
+ 
+@@ -442,6 +465,60 @@ virResctrlGetCacheInfo(virResctrlInfoPtr resctrl,
+ }
+ 
+ 
++static int
++virResctrlGetMemoryBandwidthInfo(virResctrlInfoPtr resctrl)
++{
++    int ret = -1;
++    int rv = -1;
++    virResctrlInfoMemBWPtr i_membw = NULL;
++
++    /* query memory bandwidth allocation info */
++    if (VIR_ALLOC(i_membw) < 0)
++        goto cleanup;
++    rv = virFileReadValueUint(&i_membw->bandwidth_granularity,
++                              SYSFS_RESCTRL_PATH "/info/MB/bandwidth_gran");
++    if (rv == -2) {
++        /* The file doesn't exist, so it's unusable for us,
++         * probably memory bandwidth allocation unsupported */
++        VIR_INFO("The path '" SYSFS_RESCTRL_PATH "/info/MB/bandwidth_gran'"
++                 "does not exist");
++        ret = 0;
++        goto cleanup;
++    } else if (rv < 0) {
++        /* Other failures are fatal, so just quit */
++        goto cleanup;
++    }
++
++    rv = virFileReadValueUint(&i_membw->min_bandwidth,
++                              SYSFS_RESCTRL_PATH "/info/MB/min_bandwidth");
++    if (rv == -2) {
++        /* If the previous file exists, so should this one. Hence -2 is
++         * fatal in this case (errors out in next condition) - the kernel
++         * interface might've changed too much or something else is wrong. */
++        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++                       _("Cannot get min bandwidth from resctrl memory info"));
++    }
++    if (rv < 0)
++        goto cleanup;
++
++    rv = virFileReadValueUint(&i_membw->max_allocation,
++                              SYSFS_RESCTRL_PATH "/info/MB/num_closids");
++    if (rv == -2) {
++         /* Similar reasoning to min_bandwidth above. */
++        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++                       _("Cannot get max allocation from resctrl memory info"));
++    }
++    if (rv < 0)
++        goto cleanup;
++
++    VIR_STEAL_PTR(resctrl->membw_info, i_membw);
++    ret = 0;
++ cleanup:
++    VIR_FREE(i_membw);
++    return ret;
++}
++
++
+ static int
+ virResctrlGetInfo(virResctrlInfoPtr resctrl)
+ {
+@@ -452,6 +529,10 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl)
+     if (ret <= 0)
+         goto cleanup;
+ 
++    ret = virResctrlGetMemoryBandwidthInfo(resctrl);
++    if (ret < 0)
++        goto cleanup;
++
+     ret = virResctrlGetCacheInfo(resctrl, dirp);
+     if (ret < 0)
+         goto cleanup;
+@@ -493,6 +574,9 @@ virResctrlInfoIsEmpty(virResctrlInfoPtr resctrl)
+     if (!resctrl)
+         return true;
+ 
++    if (resctrl->membw_info)
++        return false;
++
+     for (i = 0; i < resctrl->nlevels; i++) {
+         virResctrlInfoPerLevelPtr i_level = resctrl->levels[i];
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Add-MBA-check-to-virResctrlInfoGetCache.patch b/SOURCES/libvirt-util-Add-MBA-check-to-virResctrlInfoGetCache.patch
new file mode 100644
index 0000000..8b65969
--- /dev/null
+++ b/SOURCES/libvirt-util-Add-MBA-check-to-virResctrlInfoGetCache.patch
@@ -0,0 +1,56 @@
+From 95f014690bab53caa5eac8859c03917ba96466dc Mon Sep 17 00:00:00 2001
+Message-Id: <95f014690bab53caa5eac8859c03917ba96466dc@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:48 +0200
+Subject: [PATCH] util: Add MBA check to virResctrlInfoGetCache
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If we have some membw_info data, then we need to calculate the number
+of MBA controllers on the system. The value cannot be obtained from a
+direct query to the RDT kernel module, but it is the same as the last
+level cache value which is calculated by traversing the cache hierarchy
+of host(/sys/bus/cpu/devices/cpuX/cache/).
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 5aae2b3968c3e474e288cff68547f7aedac86921)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <bbacef44dd5c6d0a2d3760f4414e6e2701bd5175.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index b12a05cb0f..f454868f1e 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -608,6 +608,20 @@ virResctrlInfoGetCache(virResctrlInfoPtr resctrl,
+     if (virResctrlInfoIsEmpty(resctrl))
+         return 0;
+ 
++    /* Let's take the opportunity to update the number of last level
++     * cache. This number of memory bandwidth controller is same with
++     * last level cache */
++    if (resctrl->membw_info) {
++        virResctrlInfoMemBWPtr membw_info = resctrl->membw_info;
++
++        if (level > membw_info->last_level_cache) {
++            membw_info->last_level_cache = level;
++            membw_info->max_id = 0;
++        } else if (membw_info->last_level_cache == level) {
++            membw_info->max_id++;
++        }
++    }
++
+     if (level >= resctrl->nlevels)
+         return 0;
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Add-MBA-schemata-parse-and-format-methods.patch b/SOURCES/libvirt-util-Add-MBA-schemata-parse-and-format-methods.patch
new file mode 100644
index 0000000..41abc9d
--- /dev/null
+++ b/SOURCES/libvirt-util-Add-MBA-schemata-parse-and-format-methods.patch
@@ -0,0 +1,194 @@
+From 19f434a391d8675609adc02ada6398ef1db32830 Mon Sep 17 00:00:00 2001
+Message-Id: <19f434a391d8675609adc02ada6398ef1db32830@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:50 +0200
+Subject: [PATCH] util: Add MBA schemata parse and format methods
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Introduce virResctrlAllocMemoryBandwidthFormat and
+virResctrlAllocParseMemoryBandwidthLine which will format
+and parse an entry in the schemata file for MBA.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 34a2ba2c466fe62611c9284d7de923879821b11a)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <48c9580bb6f7ce738b567c72a54d3ecfe930a2a9.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 140 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 140 insertions(+)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index 8a25798f7d..3148184d28 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -986,6 +986,138 @@ virResctrlAllocGetID(virResctrlAllocPtr alloc)
+ }
+ 
+ 
++/* Format the Memory Bandwidth Allocation line that will be found in
++ * the schemata files. The line should be start with "MB:" and be
++ * followed by "id=value" pairs separated by a semi-colon such as:
++ *
++ *     MB:0=100;1=100
++ *
++ * which indicates node id 0 has 100 percent bandwith and node id 1
++ * has 100 percent bandwidth. A trailing semi-colon is not formatted.
++ */
++static int
++virResctrlAllocMemoryBandwidthFormat(virResctrlAllocPtr alloc,
++                                     virBufferPtr buf)
++{
++    size_t i;
++
++    if (!alloc->mem_bw)
++        return 0;
++
++    virBufferAddLit(buf, "MB:");
++
++    for (i = 0; i < alloc->mem_bw->nbandwidths; i++) {
++        if (alloc->mem_bw->bandwidths[i]) {
++            virBufferAsprintf(buf, "%zd=%u;", i,
++                              *(alloc->mem_bw->bandwidths[i]));
++        }
++    }
++
++    virBufferTrim(buf, ";", 1);
++    virBufferAddChar(buf, '\n');
++    return virBufferCheckError(buf);
++}
++
++
++static int
++virResctrlAllocParseProcessMemoryBandwidth(virResctrlInfoPtr resctrl,
++                                           virResctrlAllocPtr alloc,
++                                           char *mem_bw)
++{
++    unsigned int bandwidth;
++    unsigned int id;
++    char *tmp = NULL;
++
++    tmp = strchr(mem_bw, '=');
++    if (!tmp)
++        return 0;
++    *tmp = '\0';
++    tmp++;
++
++    if (virStrToLong_uip(mem_bw, NULL, 10, &id) < 0) {
++        virReportError(VIR_ERR_INTERNAL_ERROR,
++                       _("Invalid node id %u "), id);
++        return -1;
++    }
++    if (virStrToLong_uip(tmp, NULL, 10, &bandwidth) < 0) {
++        virReportError(VIR_ERR_INTERNAL_ERROR,
++                       _("Invalid bandwidth %u"), bandwidth);
++        return -1;
++    }
++    if (bandwidth < resctrl->membw_info->min_bandwidth ||
++        id > resctrl->membw_info->max_id) {
++        virReportError(VIR_ERR_INTERNAL_ERROR,
++                       _("Missing or inconsistent resctrl info for "
++                         "memory bandwidth node '%u'"), id);
++        return -1;
++    }
++    if (alloc->mem_bw->nbandwidths <= id &&
++        VIR_EXPAND_N(alloc->mem_bw->bandwidths, alloc->mem_bw->nbandwidths,
++                     id - alloc->mem_bw->nbandwidths + 1) < 0) {
++        return -1;
++    }
++    if (!alloc->mem_bw->bandwidths[id]) {
++        if (VIR_ALLOC(alloc->mem_bw->bandwidths[id]) < 0)
++            return -1;
++    }
++
++    *(alloc->mem_bw->bandwidths[id]) = bandwidth;
++    return 0;
++}
++
++
++/* Parse a schemata formatted MB: entry. Format details are described in
++ * virResctrlAllocMemoryBandwidthFormat.
++ */
++static int
++virResctrlAllocParseMemoryBandwidthLine(virResctrlInfoPtr resctrl,
++                                        virResctrlAllocPtr alloc,
++                                        char *line)
++{
++    char **mbs = NULL;
++    char *tmp = NULL;
++    size_t nmbs = 0;
++    size_t i;
++    int ret = -1;
++
++    /* For no reason there can be spaces */
++    virSkipSpaces((const char **) &line);
++
++    if (STRNEQLEN(line, "MB", 2))
++        return 0;
++
++    if (!resctrl || !resctrl->membw_info ||
++        !resctrl->membw_info->min_bandwidth ||
++        !resctrl->membw_info->bandwidth_granularity) {
++        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++                       _("Missing or inconsistent resctrl info for "
++                         "memory bandwidth allocation"));
++        return -1;
++    }
++
++    if (!alloc->mem_bw) {
++        if (VIR_ALLOC(alloc->mem_bw) < 0)
++            return -1;
++    }
++
++    tmp = strchr(line, ':');
++    if (!tmp)
++        return 0;
++    tmp++;
++
++    mbs = virStringSplitCount(tmp, ";", 0, &nmbs);
++    for (i = 0; i < nmbs; i++) {
++        if (virResctrlAllocParseProcessMemoryBandwidth(resctrl, alloc, mbs[i]) < 0)
++            goto cleanup;
++    }
++
++    ret = 0;
++ cleanup:
++    virStringListFree(mbs);
++    return ret;
++}
++
++
+ static int
+ virResctrlAllocFormatCache(virResctrlAllocPtr alloc,
+                            virBufferPtr buf)
+@@ -1045,6 +1177,11 @@ virResctrlAllocFormat(virResctrlAllocPtr alloc)
+         return NULL;
+     }
+ 
++    if (virResctrlAllocMemoryBandwidthFormat(alloc, &buf) < 0) {
++        virBufferFreeAndReset(&buf);
++        return NULL;
++    }
++
+     return virBufferContentAndReset(&buf);
+ }
+ 
+@@ -1173,6 +1310,9 @@ virResctrlAllocParse(virResctrlInfoPtr resctrl,
+     for (i = 0; i < nlines; i++) {
+         if (virResctrlAllocParseCacheLine(resctrl, alloc, lines[i]) < 0)
+             goto cleanup;
++        if (virResctrlAllocParseMemoryBandwidthLine(resctrl, alloc, lines[i]) < 0)
++            goto cleanup;
++
+     }
+ 
+     ret = 0;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Add-support-to-calculate-MBA-utilization.patch b/SOURCES/libvirt-util-Add-support-to-calculate-MBA-utilization.patch
new file mode 100644
index 0000000..c4d25af
--- /dev/null
+++ b/SOURCES/libvirt-util-Add-support-to-calculate-MBA-utilization.patch
@@ -0,0 +1,181 @@
+From e7c6fd7c476effdc12330c22ea716186310226ec Mon Sep 17 00:00:00 2001
+Message-Id: <e7c6fd7c476effdc12330c22ea716186310226ec@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:51 +0200
+Subject: [PATCH] util: Add support to calculate MBA utilization
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Introduce virResctrlMemoryBandwidthSubtract and
+virResctrlAllocMemoryBandwidth to be used as part of
+the virResctrlAllocAssign processing to configure
+the available memory bandwidth.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit f977ad89e0202b5bcf5a90de45e19afb0159b458)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <5d177636966efd2f1132ad5a1a38b5bb2fad7e92.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 105 +++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 93 insertions(+), 12 deletions(-)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index 3148184d28..21a9247cb6 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -1408,6 +1408,22 @@ virResctrlAllocSubtract(virResctrlAllocPtr dst,
+ }
+ 
+ 
++static void
++virResctrlMemoryBandwidthSubtract(virResctrlAllocPtr free,
++                                  virResctrlAllocPtr used)
++{
++    size_t i;
++
++    if (!used->mem_bw)
++        return;
++
++    for (i = 0; i < used->mem_bw->nbandwidths; i++) {
++        if (used->mem_bw->bandwidths[i])
++            *(free->mem_bw->bandwidths[i]) -= *(used->mem_bw->bandwidths[i]);
++    }
++}
++
++
+ static virResctrlAllocPtr
+ virResctrlAllocNewFromInfo(virResctrlInfoPtr info)
+ {
+@@ -1471,14 +1487,15 @@ virResctrlAllocNewFromInfo(virResctrlInfoPtr info)
+ }
+ 
+ /*
+- * This function creates an allocation that represents all unused parts of all
+- * caches in the system.  It uses virResctrlInfo for creating a new full
+- * allocation with all bits set (using virResctrlAllocNewFromInfo()) and then
+- * scans for all allocations under /sys/fs/resctrl and subtracts each one of
+- * them from it.  That way it can then return an allocation with only bit set
+- * being those that are not mentioned in any other allocation.  It is used for
+- * two things, a) calculating the masks when creating allocations and b) from
+- * tests.
++ * This function creates an allocation that represents all unused parts of
++ * all caches and memory bandwidth in the system. It uses virResctrlInfo
++ * for creating a new full allocation with all bits set (using the
++ * virResctrlAllocNewFromInfo()), sets memory bandwidth 100%, and then scans
++ * for all allocations under /sys/fs/resctrl and subtracts each one of them
++ * from it. That way it can then return an allocation with only bit set
++ * being those that are not mentioned in any other allocation for CAT and
++ * available memory bandwidth for MBA. It is used for two things, calculating
++ * the masks and bandwidth available when creating allocations and from tests.
+  */
+ virResctrlAllocPtr
+ virResctrlAllocGetUnused(virResctrlInfoPtr resctrl)
+@@ -1524,6 +1541,7 @@ virResctrlAllocGetUnused(virResctrlInfoPtr resctrl)
+             goto error;
+         }
+ 
++        virResctrlMemoryBandwidthSubtract(ret, alloc);
+         virResctrlAllocSubtract(ret, alloc);
+         virObjectUnref(alloc);
+         alloc = NULL;
+@@ -1674,6 +1692,66 @@ virResctrlAllocFindUnused(virResctrlAllocPtr alloc,
+ }
+ 
+ 
++static int
++virResctrlAllocMemoryBandwidth(virResctrlInfoPtr resctrl,
++                               virResctrlAllocPtr alloc,
++                               virResctrlAllocPtr free)
++{
++    size_t i;
++    virResctrlAllocMemBWPtr mem_bw_alloc = alloc->mem_bw;
++    virResctrlAllocMemBWPtr mem_bw_free = free->mem_bw;
++    virResctrlInfoMemBWPtr mem_bw_info = resctrl->membw_info;
++
++    if (!mem_bw_alloc)
++        return 0;
++
++    if (mem_bw_alloc && !mem_bw_info) {
++        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
++                       _("RDT Memory Bandwidth allocation unsupported"));
++        return -1;
++    }
++
++    for (i = 0; i < mem_bw_alloc->nbandwidths; i++) {
++        if (!mem_bw_alloc->bandwidths[i])
++            continue;
++
++        if (*(mem_bw_alloc->bandwidths[i]) % mem_bw_info->bandwidth_granularity) {
++            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
++                           _("Memory Bandwidth allocation of size "
++                             "%u is not divisible by granularity %u"),
++                           *(mem_bw_alloc->bandwidths[i]),
++                           mem_bw_info->bandwidth_granularity);
++            return -1;
++        }
++        if (*(mem_bw_alloc->bandwidths[i]) < mem_bw_info->min_bandwidth) {
++            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
++                           _("Memory Bandwidth allocation of size "
++                             "%u is smaller than the minimum "
++                             "allowed allocation %u"),
++                           *(mem_bw_alloc->bandwidths[i]),
++                           mem_bw_info->min_bandwidth);
++            return -1;
++        }
++        if (i > mem_bw_info->max_id) {
++            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
++                           _("bandwidth controller id %zd does not "
++                             "exist, max controller id %u"),
++                           i, mem_bw_info->max_id);
++            return -1;
++        }
++        if (*(mem_bw_alloc->bandwidths[i]) > *(mem_bw_free->bandwidths[i])) {
++            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
++                           _("Not enough room for allocation of %u%% "
++                             "bandwidth on node %zd, available bandwidth %u%%"),
++                           *(mem_bw_alloc->bandwidths[i]), i,
++                           *(mem_bw_free->bandwidths[i]));
++            return -1;
++        }
++    }
++    return 0;
++}
++
++
+ static int
+ virResctrlAllocCopyMasks(virResctrlAllocPtr dst,
+                          virResctrlAllocPtr src)
+@@ -1713,10 +1791,10 @@ virResctrlAllocCopyMasks(virResctrlAllocPtr dst,
+ 
+ 
+ /*
+- * This function is called when creating an allocation in the system.  What it
+- * does is that it gets all the unused bits using virResctrlAllocGetUnused() and
+- * then tries to find a proper space for every requested allocation effectively
+- * transforming `sizes` into `masks`.
++ * This function is called when creating an allocation in the system.
++ * What it does is that it gets all the unused resources using
++ * virResctrlAllocGetUnused and then tries to find a proper space for
++ * every requested allocation effectively transforming `sizes` into `masks`.
+  */
+ static int
+ virResctrlAllocAssign(virResctrlInfoPtr resctrl,
+@@ -1735,6 +1813,9 @@ virResctrlAllocAssign(virResctrlInfoPtr resctrl,
+     if (!alloc_default)
+         goto cleanup;
+ 
++    if (virResctrlAllocMemoryBandwidth(resctrl, alloc, alloc_free) < 0)
++        goto cleanup;
++
+     if (virResctrlAllocCopyMasks(alloc, alloc_default) < 0)
+         goto cleanup;
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Add-virHostCPUGetTscInfo.patch b/SOURCES/libvirt-util-Add-virHostCPUGetTscInfo.patch
new file mode 100644
index 0000000..9673e62
--- /dev/null
+++ b/SOURCES/libvirt-util-Add-virHostCPUGetTscInfo.patch
@@ -0,0 +1,154 @@
+From 8953e599b13320239ced8e2422f95a1286847d93 Mon Sep 17 00:00:00 2001
+Message-Id: <8953e599b13320239ced8e2422f95a1286847d93@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Tue, 4 Jun 2019 13:04:29 +0200
+Subject: [PATCH] util: Add virHostCPUGetTscInfo
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On a KVM x86_64 host which supports invariant TSC this function can be
+used to detect the TSC frequency and the availability of TSC scaling.
+
+The magic MSR numbers required to check if VMX scaling is supported on
+the host are documented in Volume 3 of the Intel® 64 and IA-32
+Architectures Software Developer’s Manual.
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit f0f6faba63becfab38c928905ac6ed79f9a318b8)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Conflicts:
+	src/util/virhostcpu.h
+            - virenum.h doesn't exist downstream, the content is still
+              in virutil.h
+            - the comment after #endif changed upstream
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <b44a5f67b95fde34eacabf86c47c1c278d4cf03f.1559646067.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virhostcpu.c | 71 +++++++++++++++++++++++++++++++++++++++++++
+ src/util/virhostcpu.h | 11 +++++++
+ 2 files changed, 82 insertions(+)
+
+diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
+index 1b6570568c..0f84780e09 100644
+--- a/src/util/virhostcpu.c
++++ b/src/util/virhostcpu.c
+@@ -1364,6 +1364,69 @@ virHostCPUGetMSR(unsigned long index,
+     return virHostCPUGetMSRFromKVM(index, msr);
+ }
+ 
++
++# define VMX_PROCBASED_CTLS2_MSR 0x48b
++# define VMX_USE_TSC_SCALING (1 << 25)
++
++/*
++ * This function should only be called when the host CPU supports invariant TSC
++ * (invtsc CPUID feature).
++ *
++ * Returns pointer to the TSC info structure on success,
++ *         NULL when TSC cannot be probed otherwise.
++ */
++virHostCPUTscInfoPtr
++virHostCPUGetTscInfo(void)
++{
++    virHostCPUTscInfoPtr info;
++    VIR_AUTOCLOSE kvmFd = -1;
++    VIR_AUTOCLOSE vmFd = -1;
++    VIR_AUTOCLOSE vcpuFd = -1;
++    uint64_t msr = 0;
++    int rc;
++
++    if ((kvmFd = open(KVM_DEVICE, O_RDONLY)) < 0) {
++        virReportSystemError(errno, _("Unable to open %s"), KVM_DEVICE);
++        return NULL;
++    }
++
++    if ((vmFd = ioctl(kvmFd, KVM_CREATE_VM, 0)) < 0) {
++        virReportSystemError(errno, "%s",
++                             _("Unable to create KVM VM for TSC probing"));
++        return NULL;
++    }
++
++    if ((vcpuFd = ioctl(vmFd, KVM_CREATE_VCPU, 0)) < 0) {
++        virReportSystemError(errno, "%s",
++                             _("Unable to create KVM vCPU for TSC probing"));
++        return NULL;
++    }
++
++    if ((rc = ioctl(vcpuFd, KVM_GET_TSC_KHZ)) < 0) {
++        virReportSystemError(errno, "%s",
++                             _("Unable to probe TSC frequency"));
++        return NULL;
++    }
++
++    if (VIR_ALLOC(info) < 0)
++        return NULL;
++
++    info->frequency = rc * 1000ULL;
++
++    if (virHostCPUGetMSR(VMX_PROCBASED_CTLS2_MSR, &msr) == 0) {
++        /* High 32 bits of the MSR value indicate whether specific control
++         * can be set to 1. */
++        msr >>= 32;
++
++        info->scaling = virTristateBoolFromBool(!!(msr & VMX_USE_TSC_SCALING));
++    }
++
++    VIR_DEBUG("Detected TSC frequency %llu Hz, scaling %s",
++              info->frequency, virTristateBoolTypeToString(info->scaling));
++
++    return info;
++}
++
+ #else
+ 
+ int
+@@ -1375,6 +1438,14 @@ virHostCPUGetMSR(unsigned long index ATTRIBUTE_UNUSED,
+     return -1;
+ }
+ 
++virHostCPUTscInfoPtr
++virHostCPUGetTscInfo(void)
++{
++    virReportSystemError(ENOSYS, "%s",
++                         _("Probing TSC is not supported on this platform"));
++    return NULL;
++}
++
+ #endif /* HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) && \
+           (defined(__i386__) || defined(__x86_64__)) && \
+           (defined(__linux__) || defined(__FreeBSD__)) */
+diff --git a/src/util/virhostcpu.h b/src/util/virhostcpu.h
+index e705623d4f..ee9d755c83 100644
+--- a/src/util/virhostcpu.h
++++ b/src/util/virhostcpu.h
+@@ -27,6 +27,15 @@
+ # include "internal.h"
+ # include "virarch.h"
+ # include "virbitmap.h"
++# include "virutil.h"
++
++
++typedef struct _virHostCPUTscInfo virHostCPUTscInfo;
++typedef virHostCPUTscInfo *virHostCPUTscInfoPtr;
++struct _virHostCPUTscInfo {
++    unsigned long long frequency;
++    virTristateBool scaling;
++};
+ 
+ 
+ int virHostCPUGetStats(int cpuNum,
+@@ -71,4 +80,6 @@ unsigned int virHostCPUGetMicrocodeVersion(void);
+ int virHostCPUGetMSR(unsigned long index,
+                      uint64_t *msr);
+ 
++virHostCPUTscInfoPtr virHostCPUGetTscInfo(void);
++
+ #endif /* __VIR_HOSTCPU_H__*/
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Don-t-overflow-in-virRandomBits.patch b/SOURCES/libvirt-util-Don-t-overflow-in-virRandomBits.patch
index 672eb72..aade0f4 100644
--- a/SOURCES/libvirt-util-Don-t-overflow-in-virRandomBits.patch
+++ b/SOURCES/libvirt-util-Don-t-overflow-in-virRandomBits.patch
@@ -1,5 +1,5 @@
-From 9f6fbc0d4d4fd12d51ae8e9ac4152bc0bc835c24 Mon Sep 17 00:00:00 2001
-Message-Id: <9f6fbc0d4d4fd12d51ae8e9ac4152bc0bc835c24@dist-git>
+From f7a3585a8bee3d91b1cd57dabd4c2b506afef596 Mon Sep 17 00:00:00 2001
+Message-Id: <f7a3585a8bee3d91b1cd57dabd4c2b506afef596@dist-git>
 From: Michal Privoznik <mprivozn@redhat.com>
 Date: Mon, 21 Jan 2019 09:04:10 -0500
 Subject: [PATCH] util: Don't overflow in virRandomBits
@@ -42,5 +42,5 @@ index 01cc82a052..3c011a8615 100644
  }
  
 -- 
-2.20.1
+2.21.0
 
diff --git a/SOURCES/libvirt-util-Introduce-virBitmapUnion.patch b/SOURCES/libvirt-util-Introduce-virBitmapUnion.patch
new file mode 100644
index 0000000..d80edb7
--- /dev/null
+++ b/SOURCES/libvirt-util-Introduce-virBitmapUnion.patch
@@ -0,0 +1,149 @@
+From a760b1ce1cf91d5aa83409fce9421c39633784fd Mon Sep 17 00:00:00 2001
+Message-Id: <a760b1ce1cf91d5aa83409fce9421c39633784fd@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Tue, 4 Jun 2019 16:22:04 +0200
+Subject: [PATCH] util: Introduce virBitmapUnion()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 1b2ac8010cc1fe871f538b3f48c5e48213c5c074)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1703661
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190604142207.2036-4-abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/libvirt_private.syms |  1 +
+ src/util/virbitmap.c     | 27 +++++++++++++++++++++++++++
+ src/util/virbitmap.h     |  4 ++++
+ tests/virbitmaptest.c    | 38 ++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 70 insertions(+)
+
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index 3a99cb6774..e9c5b5ea33 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -1475,6 +1475,7 @@ virBitmapSubtract;
+ virBitmapToData;
+ virBitmapToDataBuf;
+ virBitmapToString;
++virBitmapUnion;
+ 
+ 
+ # util/virbuffer.h
+diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
+index d6715025d4..7df0a2d4f3 100644
+--- a/src/util/virbitmap.c
++++ b/src/util/virbitmap.c
+@@ -1269,6 +1269,33 @@ virBitmapIntersect(virBitmapPtr a,
+ }
+ 
+ 
++/**
++ * virBitmapUnion:
++ * @a: bitmap, modified to contain result
++ * @b: other bitmap
++ *
++ * Performs union of two bitmaps: a = union(a, b)
++ *
++ * Returns 0 on success, <0 on failure.
++ */
++int
++virBitmapUnion(virBitmapPtr a,
++               const virBitmap *b)
++{
++    size_t i;
++
++    if (a->nbits < b->nbits &&
++        virBitmapExpand(a, b->nbits - 1) < 0) {
++        return -1;
++    }
++
++    for (i = 0; i < b->map_len; i++)
++        a->map[i] |= b->map[i];
++
++    return 0;
++}
++
++
+ /**
+  * virBitmapSubtract:
+  * @a: minuend/result
+diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h
+index 312e7e2933..5934508d11 100644
+--- a/src/util/virbitmap.h
++++ b/src/util/virbitmap.h
+@@ -151,6 +151,10 @@ bool virBitmapOverlaps(virBitmapPtr b1,
+ void virBitmapIntersect(virBitmapPtr a, virBitmapPtr b)
+     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ 
++int virBitmapUnion(virBitmapPtr a,
++                   const virBitmap *b)
++    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
++
+ void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b)
+     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ 
+diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c
+index 2fbafc0a76..cafe865dde 100644
+--- a/tests/virbitmaptest.c
++++ b/tests/virbitmaptest.c
+@@ -740,6 +740,34 @@ test14(const void *opaque)
+     return ret;
+ }
+ 
++/* virBitmapUnion() */
++static int
++test15(const void *opaque)
++{
++    const struct testBinaryOpData *data = opaque;
++    VIR_AUTOPTR(virBitmap) amap = NULL;
++    VIR_AUTOPTR(virBitmap) bmap = NULL;
++    VIR_AUTOPTR(virBitmap) resmap = NULL;
++
++    if (!(amap = virBitmapParseUnlimited(data->a)) ||
++        !(bmap = virBitmapParseUnlimited(data->b)) ||
++        !(resmap = virBitmapParseUnlimited(data->res))) {
++        return -1;
++    }
++
++    if (virBitmapUnion(amap, bmap) < 0)
++        return -1;
++
++    if (!virBitmapEqual(amap, resmap)) {
++        fprintf(stderr,
++                "\n bitmap union failed: union('%s', '%s') != '%s'\n",
++                data->a, data->b, data->res);
++        return -1;
++    }
++
++    return 0;
++}
++
+ 
+ #define TESTBINARYOP(A, B, RES, FUNC) \
+     testBinaryOpData.a = A; \
+@@ -798,6 +826,16 @@ mymain(void)
+     TESTBINARYOP("0-3", "0,^0", "0-3", test14);
+     TESTBINARYOP("0,2", "1,3", "0,2", test14);
+ 
++    /* virBitmapUnion() */
++    virTestCounterReset("test15-");
++    TESTBINARYOP("0-1", "0-1", "0-1", test15);
++    TESTBINARYOP("0", "1", "0-1", test15);
++    TESTBINARYOP("0-1", "2-3", "0-3", test15);
++    TESTBINARYOP("0-3", "1-2", "0-3", test15);
++    TESTBINARYOP("0,^0", "12345", "12345", test15);
++    TESTBINARYOP("12345", "0,^0", "12345", test15);
++    TESTBINARYOP("0,^0", "0,^0", "0,^0", test15);
++
+     return ret;
+ }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Introduce-virHostGetDRMRenderNode-helper.patch b/SOURCES/libvirt-util-Introduce-virHostGetDRMRenderNode-helper.patch
new file mode 100644
index 0000000..e5621ee
--- /dev/null
+++ b/SOURCES/libvirt-util-Introduce-virHostGetDRMRenderNode-helper.patch
@@ -0,0 +1,119 @@
+From a3e0637aa224b31438a8ae550344362ee02a327b Mon Sep 17 00:00:00 2001
+Message-Id: <a3e0637aa224b31438a8ae550344362ee02a327b@dist-git>
+From: Erik Skultety <eskultet@redhat.com>
+Date: Tue, 9 Apr 2019 08:34:25 +0200
+Subject: [PATCH] util: Introduce virHostGetDRMRenderNode helper
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is the first step towards libvirt picking the first available
+render node instead of QEMU. It also makes sense for us to be able to do
+that, since we allow specifying the node directly for SPICE, so if
+there's no render node specified by the user, we should pick the first
+available one. The algorithm used for that is essentially the same as
+the one QEMU uses.
+
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 394809694a5bcb6e1e6890f360c60993c0b63a74)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
+Signed-off-by: Erik Skultety <eskultet@redhat.com>
+Message-Id: <48159f44f12685eb8c52061e09c27e37a5a157ea.1554791287.git.eskultet@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/libvirt_private.syms |  1 +
+ src/util/virutil.c       | 53 ++++++++++++++++++++++++++++++++++++++++
+ src/util/virutil.h       |  2 ++
+ 3 files changed, 56 insertions(+)
+
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index af9b61fbdc..6655dfdecc 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -3116,6 +3116,7 @@ virGetUserName;
+ virGetUserRuntimeDirectory;
+ virGetUserShell;
+ virHexToBin;
++virHostGetDRMRenderNode;
+ virHostHasIOMMU;
+ virIndexToDiskName;
+ virIsDevMapperDevice;
+diff --git a/src/util/virutil.c b/src/util/virutil.c
+index a908422feb..b25d2a5ca4 100644
+--- a/src/util/virutil.c
++++ b/src/util/virutil.c
+@@ -2115,3 +2115,56 @@ virHostHasIOMMU(void)
+     VIR_DIR_CLOSE(iommuDir);
+     return ret;
+ }
++
++
++/**
++ * virHostGetDRMRenderNode:
++ *
++ * Picks the first DRM render node available. Missing DRI or missing DRM render
++ * nodes in the system results in an error.
++ *
++ * Returns an absolute path to the first render node available or NULL in case
++ * of an error with the error being reported.
++ * Caller is responsible for freeing the result string.
++ *
++ */
++char *
++virHostGetDRMRenderNode(void)
++{
++    char *ret = NULL;
++    DIR *driDir = NULL;
++    const char *driPath = "/dev/dri";
++    struct dirent *ent = NULL;
++    int dirErr = 0;
++    bool have_rendernode = false;
++
++    if (virDirOpen(&driDir, driPath) < 0)
++        return NULL;
++
++    while ((dirErr = virDirRead(driDir, &ent, driPath)) > 0) {
++        if (ent->d_type != DT_CHR)
++            continue;
++
++        if (STRPREFIX(ent->d_name, "renderD")) {
++            have_rendernode = true;
++            break;
++        }
++    }
++
++    if (dirErr < 0)
++        goto cleanup;
++
++    /* even if /dev/dri exists, there might be no renderDX nodes available */
++    if (!have_rendernode) {
++        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++                       _("No DRM render nodes available"));
++        goto cleanup;
++    }
++
++    if (virAsprintf(&ret, "%s/%s", driPath, ent->d_name) < 0)
++        goto cleanup;
++
++ cleanup:
++    VIR_DIR_CLOSE(driDir);
++    return ret;
++}
+diff --git a/src/util/virutil.h b/src/util/virutil.h
+index 1ba9635bd9..284c713be4 100644
+--- a/src/util/virutil.h
++++ b/src/util/virutil.h
+@@ -218,6 +218,8 @@ unsigned long long virMemoryMaxValue(bool ulong) ATTRIBUTE_NOINLINE;
+ 
+ bool virHostHasIOMMU(void);
+ 
++char *virHostGetDRMRenderNode(void);
++
+ /**
+  * VIR_ASSIGN_IS_OVERFLOW:
+  * @rvalue: value that is checked (evaluated twice)
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Introduce-virNumaNodesetToCPUset.patch b/SOURCES/libvirt-util-Introduce-virNumaNodesetToCPUset.patch
new file mode 100644
index 0000000..ab6bfea
--- /dev/null
+++ b/SOURCES/libvirt-util-Introduce-virNumaNodesetToCPUset.patch
@@ -0,0 +1,128 @@
+From 58c87fb5d45a70bc10593398d9db5a91a43eb280 Mon Sep 17 00:00:00 2001
+Message-Id: <58c87fb5d45a70bc10593398d9db5a91a43eb280@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Tue, 4 Jun 2019 16:22:05 +0200
+Subject: [PATCH] util: Introduce virNumaNodesetToCPUset()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This helper converts a set of NUMA node to the set of CPUs
+they contain.
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit 2d2b26f96fed1e95dd4495168cee73c5c4092634)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1703661
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190604142207.2036-5-abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/libvirt_private.syms |  1 +
+ src/util/virnuma.c       | 55 ++++++++++++++++++++++++++++++++++++++++
+ src/util/virnuma.h       |  2 ++
+ 3 files changed, 58 insertions(+)
+
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index e9c5b5ea33..bf99930802 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -2475,6 +2475,7 @@ virNumaGetPages;
+ virNumaIsAvailable;
+ virNumaNodeIsAvailable;
+ virNumaNodesetIsAvailable;
++virNumaNodesetToCPUset;
+ virNumaSetPagePoolSize;
+ virNumaSetupMemoryPolicy;
+ 
+diff --git a/src/util/virnuma.c b/src/util/virnuma.c
+index fd15714553..75f80dcd30 100644
+--- a/src/util/virnuma.c
++++ b/src/util/virnuma.c
+@@ -311,6 +311,49 @@ virNumaGetNodeCPUs(int node,
+ # undef MASK_CPU_ISSET
+ # undef n_bits
+ 
++/**
++ * virNumaNodesetToCPUset:
++ * @nodeset: bitmap containing a set of NUMA nodes
++ * @cpuset: return location for a bitmap containing a set of CPUs
++ *
++ * Convert a set of NUMA node to the set of CPUs they contain.
++ *
++ * Returns 0 on success, <0 on failure.
++ */
++int
++virNumaNodesetToCPUset(virBitmapPtr nodeset,
++                       virBitmapPtr *cpuset)
++{
++    VIR_AUTOPTR(virBitmap) allNodesCPUs = NULL;
++    size_t nodesetSize;
++    size_t i;
++
++    *cpuset = NULL;
++
++    if (!nodeset)
++        return 0;
++
++    allNodesCPUs = virBitmapNewEmpty();
++    nodesetSize = virBitmapSize(nodeset);
++
++    for (i = 0; i < nodesetSize; i++) {
++        VIR_AUTOPTR(virBitmap) nodeCPUs = NULL;
++
++        if (!virBitmapIsBitSet(nodeset, i))
++            continue;
++
++        if (virNumaGetNodeCPUs(i, &nodeCPUs) < 0)
++            return -1;
++
++        if (virBitmapUnion(allNodesCPUs, nodeCPUs) < 0)
++            return -1;
++    }
++
++    VIR_STEAL_PTR(*cpuset, allNodesCPUs);
++
++    return 0;
++}
++
+ #else /* !WITH_NUMACTL */
+ 
+ int
+@@ -365,6 +408,18 @@ virNumaGetNodeCPUs(int node ATTRIBUTE_UNUSED,
+                    _("NUMA isn't available on this host"));
+     return -1;
+ }
++
++int
++virNumaNodesetToCPUset(virBitmapPtr nodeset ATTRIBUTE_UNUSED,
++                       virBitmapPtr *cpuset)
++{
++    *cpuset = NULL;
++
++    virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++                   _("NUMA isn't available on this host"));
++    return -1;
++}
++
+ #endif /* !WITH_NUMACTL */
+ 
+ /**
+diff --git a/src/util/virnuma.h b/src/util/virnuma.h
+index a3ffb6d6c7..df7911db4e 100644
+--- a/src/util/virnuma.h
++++ b/src/util/virnuma.h
+@@ -48,6 +48,8 @@ int virNumaGetNodeMemory(int node,
+ unsigned int virNumaGetMaxCPUs(void);
+ 
+ int virNumaGetNodeCPUs(int node, virBitmapPtr *cpus) ATTRIBUTE_NOINLINE;
++int virNumaNodesetToCPUset(virBitmapPtr nodeset,
++                           virBitmapPtr *cpuset);
+ 
+ int virNumaGetPageInfo(int node,
+                        unsigned int page_size,
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Introduce-virResctrlAllocForeachMemory.patch b/SOURCES/libvirt-util-Introduce-virResctrlAllocForeachMemory.patch
new file mode 100644
index 0000000..f6c1df5
--- /dev/null
+++ b/SOURCES/libvirt-util-Introduce-virResctrlAllocForeachMemory.patch
@@ -0,0 +1,113 @@
+From b6573a089823817a1aa7ae19d7df3aed4845508e Mon Sep 17 00:00:00 2001
+Message-Id: <b6573a089823817a1aa7ae19d7df3aed4845508e@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:52 +0200
+Subject: [PATCH] util: Introduce virResctrlAllocForeachMemory
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Introduce an API that will traverse the memory bandwidth data calling
+a callback function for each defined bandwidth entry.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 10e699dac9f86a4a266a43a5190def7756f3b762)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <40beb201ddf7c987958e792e47925e8438a5984f.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/libvirt_private.syms |  1 +
+ src/util/virresctrl.c    | 33 +++++++++++++++++++++++++++++++++
+ src/util/virresctrl.h    |  9 +++++++++
+ 3 files changed, 43 insertions(+)
+
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index a3b30bf675..de328d7d22 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -2658,6 +2658,7 @@ virResctrlAllocAddPID;
+ virResctrlAllocCreate;
+ virResctrlAllocDeterminePath;
+ virResctrlAllocForeachCache;
++virResctrlAllocForeachMemory;
+ virResctrlAllocFormat;
+ virResctrlAllocGetID;
+ virResctrlAllocGetUnused;
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index 21a9247cb6..45fc6fc847 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -965,6 +965,39 @@ virResctrlAllocForeachCache(virResctrlAllocPtr alloc,
+ }
+ 
+ 
++/* virResctrlAllocForeachMemory
++ * @alloc: Pointer to an active allocation
++ * @cb: Callback function
++ * @opaque: Opaque data to be passed to @cb
++ *
++ * If available, traverse the defined memory bandwidth allocations and
++ * call the @cb function.
++ *
++ * Returns 0 on success, -1 and immediate failure if the @cb has any failure.
++ */
++int
++virResctrlAllocForeachMemory(virResctrlAllocPtr alloc,
++                             virResctrlAllocForeachMemoryCallback cb,
++                             void *opaque)
++{
++    size_t i = 0;
++    virResctrlAllocMemBWPtr mem_bw;
++
++    if (!alloc || !alloc->mem_bw)
++        return 0;
++
++    mem_bw = alloc->mem_bw;
++    for (i = 0; i < mem_bw->nbandwidths; i++) {
++        if (mem_bw->bandwidths[i]) {
++            if (cb(i, *mem_bw->bandwidths[i], opaque) < 0)
++                return -1;
++        }
++    }
++
++    return 0;
++}
++
++
+ int
+ virResctrlAllocSetID(virResctrlAllocPtr alloc,
+                      const char *id)
+diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h
+index d657c06008..5ea5b27d3b 100644
+--- a/src/util/virresctrl.h
++++ b/src/util/virresctrl.h
+@@ -73,6 +73,10 @@ typedef int virResctrlAllocForeachCacheCallback(unsigned int level,
+                                                 unsigned long long size,
+                                                 void *opaque);
+ 
++typedef int virResctrlAllocForeachMemoryCallback(unsigned int id,
++                                                 unsigned int size,
++                                                 void *opaque);
++
+ virResctrlAllocPtr
+ virResctrlAllocNew(void);
+ 
+@@ -91,6 +95,11 @@ virResctrlAllocForeachCache(virResctrlAllocPtr alloc,
+                             virResctrlAllocForeachCacheCallback cb,
+                             void *opaque);
+ 
++int
++virResctrlAllocForeachMemory(virResctrlAllocPtr resctrl,
++                             virResctrlAllocForeachMemoryCallback cb,
++                             void *opaque);
++
+ int
+ virResctrlAllocSetID(virResctrlAllocPtr alloc,
+                      const char *id);
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Introduce-virResctrlAllocSetMemoryBandwidth.patch b/SOURCES/libvirt-util-Introduce-virResctrlAllocSetMemoryBandwidth.patch
new file mode 100644
index 0000000..b66d586
--- /dev/null
+++ b/SOURCES/libvirt-util-Introduce-virResctrlAllocSetMemoryBandwidth.patch
@@ -0,0 +1,116 @@
+From 32abc89753dc271ae469609af416fb8cd0e4e875 Mon Sep 17 00:00:00 2001
+Message-Id: <32abc89753dc271ae469609af416fb8cd0e4e875@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:53 +0200
+Subject: [PATCH] util: Introduce virResctrlAllocSetMemoryBandwidth
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Introduce an API to allow setting of the MBA from domain XML.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 5b66c6cc85d30c85606088d458fbff6ef064dd3a)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <2d676721246084d1050b5cfad665637645bf9689.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/libvirt_private.syms |  1 +
+ src/util/virresctrl.c    | 48 ++++++++++++++++++++++++++++++++++++++++
+ src/util/virresctrl.h    |  5 +++++
+ 3 files changed, 54 insertions(+)
+
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index de328d7d22..af9b61fbdc 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -2666,6 +2666,7 @@ virResctrlAllocNew;
+ virResctrlAllocRemove;
+ virResctrlAllocSetCacheSize;
+ virResctrlAllocSetID;
++virResctrlAllocSetMemoryBandwidth;
+ virResctrlInfoGetCache;
+ virResctrlInfoNew;
+ 
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index 45fc6fc847..adf36a7c0a 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -965,6 +965,54 @@ virResctrlAllocForeachCache(virResctrlAllocPtr alloc,
+ }
+ 
+ 
++/* virResctrlAllocSetMemoryBandwidth
++ * @alloc: Pointer to an active allocation
++ * @id: node id of MBA to be set
++ * @memory_bandwidth: new memory bandwidth value
++ *
++ * Set the @memory_bandwidth for the node @id entry in the @alloc.
++ *
++ * Returns 0 on success, -1 on failure with error message set.
++ */
++int
++virResctrlAllocSetMemoryBandwidth(virResctrlAllocPtr alloc,
++                                  unsigned int id,
++                                  unsigned int memory_bandwidth)
++{
++    virResctrlAllocMemBWPtr mem_bw = alloc->mem_bw;
++
++    if (memory_bandwidth > 100) {
++        virReportError(VIR_ERR_XML_ERROR, "%s",
++                       _("Memory Bandwidth value exceeding 100 is invalid."));
++        return -1;
++    }
++
++    if (!mem_bw) {
++        if (VIR_ALLOC(mem_bw) < 0)
++            return -1;
++        alloc->mem_bw = mem_bw;
++    }
++
++    if (mem_bw->nbandwidths <= id &&
++        VIR_EXPAND_N(mem_bw->bandwidths, mem_bw->nbandwidths,
++                     id - mem_bw->nbandwidths + 1) < 0)
++        return -1;
++
++    if (mem_bw->bandwidths[id]) {
++        virReportError(VIR_ERR_XML_ERROR,
++                       _("Memory Bandwidth already defined for node %u"),
++                       id);
++        return -1;
++    }
++
++    if (VIR_ALLOC(mem_bw->bandwidths[id]) < 0)
++        return -1;
++
++    *(mem_bw->bandwidths[id]) = memory_bandwidth;
++    return 0;
++}
++
++
+ /* virResctrlAllocForeachMemory
+  * @alloc: Pointer to an active allocation
+  * @cb: Callback function
+diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h
+index 5ea5b27d3b..8d62517aa1 100644
+--- a/src/util/virresctrl.h
++++ b/src/util/virresctrl.h
+@@ -95,6 +95,11 @@ virResctrlAllocForeachCache(virResctrlAllocPtr alloc,
+                             virResctrlAllocForeachCacheCallback cb,
+                             void *opaque);
+ 
++int
++virResctrlAllocSetMemoryBandwidth(virResctrlAllocPtr alloc,
++                                  unsigned int id,
++                                  unsigned int memory_bandwidth);
++
+ int
+ virResctrlAllocForeachMemory(virResctrlAllocPtr resctrl,
+                              virResctrlAllocForeachMemoryCallback cb,
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Introduce-virStorageFileGetNPIVKey.patch b/SOURCES/libvirt-util-Introduce-virStorageFileGetNPIVKey.patch
index 60a44ef..6694c02 100644
--- a/SOURCES/libvirt-util-Introduce-virStorageFileGetNPIVKey.patch
+++ b/SOURCES/libvirt-util-Introduce-virStorageFileGetNPIVKey.patch
@@ -1,5 +1,5 @@
-From 049bb8956ce077d7ea5e8ac613ebb20c7a6b8715 Mon Sep 17 00:00:00 2001
-Message-Id: <049bb8956ce077d7ea5e8ac613ebb20c7a6b8715@dist-git>
+From 0fffd7d7d2767d8f03407c2c61da6baf0ac181c5 Mon Sep 17 00:00:00 2001
+Message-Id: <0fffd7d7d2767d8f03407c2c61da6baf0ac181c5@dist-git>
 From: John Ferlan <jferlan@redhat.com>
 Date: Tue, 12 Mar 2019 13:55:58 -0400
 Subject: [PATCH] util: Introduce virStorageFileGetNPIVKey
diff --git a/SOURCES/libvirt-util-Modify-virStorageFileGetSCSIKey-return.patch b/SOURCES/libvirt-util-Modify-virStorageFileGetSCSIKey-return.patch
index 0581370..e0ed854 100644
--- a/SOURCES/libvirt-util-Modify-virStorageFileGetSCSIKey-return.patch
+++ b/SOURCES/libvirt-util-Modify-virStorageFileGetSCSIKey-return.patch
@@ -1,5 +1,5 @@
-From 8c7d0ccfbf1213a2986e8290b90f1b860fd5c3ce Mon Sep 17 00:00:00 2001
-Message-Id: <8c7d0ccfbf1213a2986e8290b90f1b860fd5c3ce@dist-git>
+From 9f4490dfb43f8b1a28adfb2675b5e278605bcbf6 Mon Sep 17 00:00:00 2001
+Message-Id: <9f4490dfb43f8b1a28adfb2675b5e278605bcbf6@dist-git>
 From: John Ferlan <jferlan@redhat.com>
 Date: Tue, 12 Mar 2019 13:55:56 -0400
 Subject: [PATCH] util: Modify virStorageFileGetSCSIKey return
diff --git a/SOURCES/libvirt-util-Propagate-numad-failures-correctly.patch b/SOURCES/libvirt-util-Propagate-numad-failures-correctly.patch
new file mode 100644
index 0000000..af844fd
--- /dev/null
+++ b/SOURCES/libvirt-util-Propagate-numad-failures-correctly.patch
@@ -0,0 +1,60 @@
+From 0d92907e2924ee8e0ee6577368e71375637f38c1 Mon Sep 17 00:00:00 2001
+Message-Id: <0d92907e2924ee8e0ee6577368e71375637f38c1@dist-git>
+From: Andrea Bolognani <abologna@redhat.com>
+Date: Tue, 4 Jun 2019 13:24:13 +0200
+Subject: [PATCH] util: Propagate numad failures correctly
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Right now, if numad fails, we raise an error but return an
+empty string to the caller instead of a NULL pointer, which
+means processing will continue and the user will see
+
+  # virsh start guest
+  error: Failed to start domain guest
+  error: invalid argument: Failed to parse bitmap ''
+
+instead of a more reasonable
+
+  # virsh start guest
+  error: Failed to start domain guest
+  error: operation failed: Failed to query numad for the advisory nodeset
+
+Make sure the user gets a better error message.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1716387
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit b34fb1fb6f99628932ad68db1ce4985a06def17f)
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190604112413.361-2-abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virnuma.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/util/virnuma.c b/src/util/virnuma.c
+index 784db0a7ce..fd15714553 100644
+--- a/src/util/virnuma.c
++++ b/src/util/virnuma.c
+@@ -66,10 +66,12 @@ virNumaGetAutoPlacementAdvice(unsigned short vcpus,
+ 
+     virCommandSetOutputBuffer(cmd, &output);
+ 
+-    if (virCommandRun(cmd, NULL) < 0)
+-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
++    if (virCommandRun(cmd, NULL) < 0) {
++        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                        _("Failed to query numad for the "
+                          "advisory nodeset"));
++        VIR_FREE(output);
++    }
+ 
+     virCommandFree(cmd);
+     return output;
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Refactor-virResctrlAllocFormat-of-virresctrl.patch b/SOURCES/libvirt-util-Refactor-virResctrlAllocFormat-of-virresctrl.patch
new file mode 100644
index 0000000..6d4c322
--- /dev/null
+++ b/SOURCES/libvirt-util-Refactor-virResctrlAllocFormat-of-virresctrl.patch
@@ -0,0 +1,106 @@
+From bd5cb5d5dfff79f092c843116876837d50b60250 Mon Sep 17 00:00:00 2001
+Message-Id: <bd5cb5d5dfff79f092c843116876837d50b60250@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:46 +0200
+Subject: [PATCH] util: Refactor virResctrlAllocFormat of virresctrl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Refactor virResctrlAllocFormat so that it is easy to support other
+resource allocation technologies.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 65bae2f18c27c4a30a8ea675b7c3767cdfbe4c70)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <18dd3a283af009213d718a81f66fe625f6335ece.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 41 ++++++++++++++++++++++++++---------------
+ 1 file changed, 26 insertions(+), 15 deletions(-)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index 313f964f21..a38c9261b6 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -849,17 +849,14 @@ virResctrlAllocGetID(virResctrlAllocPtr alloc)
+ }
+ 
+ 
+-char *
+-virResctrlAllocFormat(virResctrlAllocPtr alloc)
++static int
++virResctrlAllocFormatCache(virResctrlAllocPtr alloc,
++                           virBufferPtr buf)
+ {
+-    virBuffer buf = VIR_BUFFER_INITIALIZER;
+     unsigned int level = 0;
+     unsigned int type = 0;
+     unsigned int cache = 0;
+ 
+-    if (!alloc)
+-        return NULL;
+-
+     for (level = 0; level < alloc->nlevels; level++) {
+         virResctrlAllocPerLevelPtr a_level = alloc->levels[level];
+ 
+@@ -872,7 +869,7 @@ virResctrlAllocFormat(virResctrlAllocPtr alloc)
+             if (!a_type)
+                 continue;
+ 
+-            virBufferAsprintf(&buf, "L%u%s:", level, virResctrlTypeToString(type));
++            virBufferAsprintf(buf, "L%u%s:", level, virResctrlTypeToString(type));
+ 
+             for (cache = 0; cache < a_type->nmasks; cache++) {
+                 virBitmapPtr mask = a_type->masks[cache];
+@@ -882,21 +879,35 @@ virResctrlAllocFormat(virResctrlAllocPtr alloc)
+                     continue;
+ 
+                 mask_str = virBitmapToString(mask, false, true);
+-                if (!mask_str) {
+-                    virBufferFreeAndReset(&buf);
+-                    return NULL;
+-                }
++                if (!mask_str)
++                    return -1;
+ 
+-                virBufferAsprintf(&buf, "%u=%s;", cache, mask_str);
++                virBufferAsprintf(buf, "%u=%s;", cache, mask_str);
+                 VIR_FREE(mask_str);
+             }
+ 
+-            virBufferTrim(&buf, ";", 1);
+-            virBufferAddChar(&buf, '\n');
++            virBufferTrim(buf, ";", 1);
++            virBufferAddChar(buf, '\n');
+         }
+     }
+ 
+-    virBufferCheckError(&buf);
++    return virBufferCheckError(buf);
++}
++
++
++char *
++virResctrlAllocFormat(virResctrlAllocPtr alloc)
++{
++    virBuffer buf = VIR_BUFFER_INITIALIZER;
++
++    if (!alloc)
++        return NULL;
++
++    if (virResctrlAllocFormatCache(alloc, &buf) < 0) {
++        virBufferFreeAndReset(&buf);
++        return NULL;
++    }
++
+     return virBufferContentAndReset(&buf);
+ }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Refactor-virResctrlGetInfo-in-virresctrl.patch b/SOURCES/libvirt-util-Refactor-virResctrlGetInfo-in-virresctrl.patch
new file mode 100644
index 0000000..a96ea35
--- /dev/null
+++ b/SOURCES/libvirt-util-Refactor-virResctrlGetInfo-in-virresctrl.patch
@@ -0,0 +1,92 @@
+From dc61761ead7f2a196b97a36a51076a953461838f Mon Sep 17 00:00:00 2001
+Message-Id: <dc61761ead7f2a196b97a36a51076a953461838f@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:45 +0200
+Subject: [PATCH] util: Refactor virResctrlGetInfo in virresctrl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Separate resctrl common information parts from CAT specific parts,
+so that common information parts can be reused among different
+resource allocation technologies.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit 3a1356d461d6ad6ac2a0371827ceaba7de5f12c5)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <04b97c88620bd7f690d697932b2ff88af1f8e325.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 32 +++++++++++++++++++++++---------
+ 1 file changed, 23 insertions(+), 9 deletions(-)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index 6d69c8d4e2..313f964f21 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -318,9 +318,9 @@ virResctrlUnlock(int fd)
+ 
+ /* virResctrlInfo-related definitions */
+ static int
+-virResctrlGetInfo(virResctrlInfoPtr resctrl)
++virResctrlGetCacheInfo(virResctrlInfoPtr resctrl,
++                       DIR *dirp)
+ {
+-    DIR *dirp = NULL;
+     char *endptr = NULL;
+     char *tmp_str = NULL;
+     int ret = -1;
+@@ -332,12 +332,6 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl)
+     virResctrlInfoPerLevelPtr i_level = NULL;
+     virResctrlInfoPerTypePtr i_type = NULL;
+ 
+-    rv = virDirOpenIfExists(&dirp, SYSFS_RESCTRL_PATH "/info");
+-    if (rv <= 0) {
+-        ret = rv;
+-        goto cleanup;
+-    }
+-
+     while ((rv = virDirRead(dirp, &ent, SYSFS_RESCTRL_PATH "/info")) > 0) {
+         VIR_DEBUG("Parsing info type '%s'", ent->d_name);
+         if (ent->d_name[0] != 'L')
+@@ -443,12 +437,32 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl)
+ 
+     ret = 0;
+  cleanup:
+-    VIR_DIR_CLOSE(dirp);
+     VIR_FREE(i_type);
+     return ret;
+ }
+ 
+ 
++static int
++virResctrlGetInfo(virResctrlInfoPtr resctrl)
++{
++    DIR *dirp = NULL;
++    int ret = -1;
++
++    ret = virDirOpenIfExists(&dirp, SYSFS_RESCTRL_PATH "/info");
++    if (ret <= 0)
++        goto cleanup;
++
++    ret = virResctrlGetCacheInfo(resctrl, dirp);
++    if (ret < 0)
++        goto cleanup;
++
++    ret = 0;
++ cleanup:
++    VIR_DIR_CLOSE(dirp);
++    return ret;
++}
++
++
+ virResctrlInfoPtr
+ virResctrlInfoNew(void)
+ {
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-Rename-some-functions-of-virresctrl.patch b/SOURCES/libvirt-util-Rename-some-functions-of-virresctrl.patch
new file mode 100644
index 0000000..33caa1a
--- /dev/null
+++ b/SOURCES/libvirt-util-Rename-some-functions-of-virresctrl.patch
@@ -0,0 +1,201 @@
+From 9bb6096b3d4cff38af3515c3b45a6a227b407cd4 Mon Sep 17 00:00:00 2001
+Message-Id: <9bb6096b3d4cff38af3515c3b45a6a227b407cd4@dist-git>
+From: Bing Niu <bing.niu@intel.com>
+Date: Mon, 15 Apr 2019 17:32:44 +0200
+Subject: [PATCH] util: Rename some functions of virresctrl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Some functions in virresctrl are for CAT only, while some of other
+functions are for resource allocation, not just CAT. So change
+their names to reflect the reality.
+
+Signed-off-by: Bing Niu <bing.niu@intel.com>
+Reviewed-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit f7c7f8ea656facd44152e224bfcf5dc04a023cf1)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <a67fa07cb0ebe995a4486d18259feb34c5a3ed41.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/conf/domain_conf.c   |  8 ++++----
+ src/libvirt_private.syms |  4 ++--
+ src/util/virresctrl.c    | 30 +++++++++++++++---------------
+ src/util/virresctrl.h    | 26 +++++++++++++-------------
+ 4 files changed, 34 insertions(+), 34 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index 1096499831..e04edd97dc 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -19108,7 +19108,7 @@ virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt,
+                                   ULLONG_MAX, true) < 0)
+         goto cleanup;
+ 
+-    if (virResctrlAllocSetSize(alloc, level, type, cache, size) < 0)
++    if (virResctrlAllocSetCacheSize(alloc, level, type, cache, size) < 0)
+         goto cleanup;
+ 
+     ret = 0;
+@@ -27061,9 +27061,9 @@ virDomainCachetuneDefFormat(virBufferPtr buf,
+     int ret = -1;
+ 
+     virBufferSetChildIndent(&childrenBuf, buf);
+-    virResctrlAllocForeachSize(cachetune->alloc,
+-                               virDomainCachetuneDefFormatHelper,
+-                               &childrenBuf);
++    virResctrlAllocForeachCache(cachetune->alloc,
++                                virDomainCachetuneDefFormatHelper,
++                                &childrenBuf);
+ 
+ 
+     if (virBufferCheckError(&childrenBuf) < 0)
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index 3000d6ee0a..a3b30bf675 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -2657,14 +2657,14 @@ virCacheTypeToString;
+ virResctrlAllocAddPID;
+ virResctrlAllocCreate;
+ virResctrlAllocDeterminePath;
+-virResctrlAllocForeachSize;
++virResctrlAllocForeachCache;
+ virResctrlAllocFormat;
+ virResctrlAllocGetID;
+ virResctrlAllocGetUnused;
+ virResctrlAllocNew;
+ virResctrlAllocRemove;
++virResctrlAllocSetCacheSize;
+ virResctrlAllocSetID;
+-virResctrlAllocSetSize;
+ virResctrlInfoGetCache;
+ virResctrlInfoNew;
+ 
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index e492a63b80..6d69c8d4e2 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -754,11 +754,11 @@ virResctrlAllocCheckCollision(virResctrlAllocPtr alloc,
+ 
+ 
+ int
+-virResctrlAllocSetSize(virResctrlAllocPtr alloc,
+-                       unsigned int level,
+-                       virCacheType type,
+-                       unsigned int cache,
+-                       unsigned long long size)
++virResctrlAllocSetCacheSize(virResctrlAllocPtr alloc,
++                            unsigned int level,
++                            virCacheType type,
++                            unsigned int cache,
++                            unsigned long long size)
+ {
+     if (virResctrlAllocCheckCollision(alloc, level, type, cache)) {
+         virReportError(VIR_ERR_XML_ERROR,
+@@ -773,9 +773,9 @@ virResctrlAllocSetSize(virResctrlAllocPtr alloc,
+ 
+ 
+ int
+-virResctrlAllocForeachSize(virResctrlAllocPtr alloc,
+-                           virResctrlAllocForeachSizeCallback cb,
+-                           void *opaque)
++virResctrlAllocForeachCache(virResctrlAllocPtr alloc,
++                            virResctrlAllocForeachCacheCallback cb,
++                            void *opaque)
+ {
+     int ret = 0;
+     unsigned int level = 0;
+@@ -939,9 +939,9 @@ virResctrlAllocParseProcessCache(virResctrlInfoPtr resctrl,
+ 
+ 
+ static int
+-virResctrlAllocParseProcessLine(virResctrlInfoPtr resctrl,
+-                                virResctrlAllocPtr alloc,
+-                                char *line)
++virResctrlAllocParseCacheLine(virResctrlInfoPtr resctrl,
++                              virResctrlAllocPtr alloc,
++                              char *line)
+ {
+     char **caches = NULL;
+     char *tmp = NULL;
+@@ -1009,7 +1009,7 @@ virResctrlAllocParse(virResctrlInfoPtr resctrl,
+ 
+     lines = virStringSplitCount(schemata, "\n", 0, &nlines);
+     for (i = 0; i < nlines; i++) {
+-        if (virResctrlAllocParseProcessLine(resctrl, alloc, lines[i]) < 0)
++        if (virResctrlAllocParseCacheLine(resctrl, alloc, lines[i]) < 0)
+             goto cleanup;
+     }
+ 
+@@ -1401,8 +1401,8 @@ virResctrlAllocCopyMasks(virResctrlAllocPtr dst,
+  * transforming `sizes` into `masks`.
+  */
+ static int
+-virResctrlAllocMasksAssign(virResctrlInfoPtr resctrl,
+-                           virResctrlAllocPtr alloc)
++virResctrlAllocAssign(virResctrlInfoPtr resctrl,
++                      virResctrlAllocPtr alloc)
+ {
+     int ret = -1;
+     unsigned int level = 0;
+@@ -1526,7 +1526,7 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl,
+     if (lockfd < 0)
+         goto cleanup;
+ 
+-    if (virResctrlAllocMasksAssign(resctrl, alloc) < 0)
++    if (virResctrlAllocAssign(resctrl, alloc) < 0)
+         goto cleanup;
+ 
+     alloc_str = virResctrlAllocFormat(alloc);
+diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h
+index 9052a2b19a..d657c06008 100644
+--- a/src/util/virresctrl.h
++++ b/src/util/virresctrl.h
+@@ -67,11 +67,11 @@ virResctrlInfoGetCache(virResctrlInfoPtr resctrl,
+ typedef struct _virResctrlAlloc virResctrlAlloc;
+ typedef virResctrlAlloc *virResctrlAllocPtr;
+ 
+-typedef int virResctrlAllocForeachSizeCallback(unsigned int level,
+-                                               virCacheType type,
+-                                               unsigned int cache,
+-                                               unsigned long long size,
+-                                               void *opaque);
++typedef int virResctrlAllocForeachCacheCallback(unsigned int level,
++                                                virCacheType type,
++                                                unsigned int cache,
++                                                unsigned long long size,
++                                                void *opaque);
+ 
+ virResctrlAllocPtr
+ virResctrlAllocNew(void);
+@@ -80,16 +80,16 @@ bool
+ virResctrlAllocIsEmpty(virResctrlAllocPtr alloc);
+ 
+ int
+-virResctrlAllocSetSize(virResctrlAllocPtr alloc,
+-                       unsigned int level,
+-                       virCacheType type,
+-                       unsigned int cache,
+-                       unsigned long long size);
++virResctrlAllocSetCacheSize(virResctrlAllocPtr alloc,
++                            unsigned int level,
++                            virCacheType type,
++                            unsigned int cache,
++                            unsigned long long size);
+ 
+ int
+-virResctrlAllocForeachSize(virResctrlAllocPtr alloc,
+-                           virResctrlAllocForeachSizeCallback cb,
+-                           void *opaque);
++virResctrlAllocForeachCache(virResctrlAllocPtr alloc,
++                            virResctrlAllocForeachCacheCallback cb,
++                            void *opaque);
+ 
+ int
+ virResctrlAllocSetID(virResctrlAllocPtr alloc,
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-alloc-add-macros-for-implementing-automatic-cleanup-functionality.patch b/SOURCES/libvirt-util-alloc-add-macros-for-implementing-automatic-cleanup-functionality.patch
new file mode 100644
index 0000000..77e1cee
--- /dev/null
+++ b/SOURCES/libvirt-util-alloc-add-macros-for-implementing-automatic-cleanup-functionality.patch
@@ -0,0 +1,82 @@
+From 61ed471220064f39afe088eb76630a4f7fe35b43 Mon Sep 17 00:00:00 2001
+Message-Id: <61ed471220064f39afe088eb76630a4f7fe35b43@dist-git>
+From: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
+Date: Tue, 4 Jun 2019 16:22:02 +0200
+Subject: [PATCH] util: alloc: add macros for implementing automatic cleanup
+ functionality
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+New macros are introduced which help in adding GNU C's cleanup
+attribute to variable declarations. Variables declared with these
+macros will have their allocated memory freed automatically when
+they go out of scope.
+
+Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+(cherry picked from commit dcec13f5a2ba17223d403ff9e9fed916a4dd9c04)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1703661
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190604142207.2036-2-abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/viralloc.h | 42 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 42 insertions(+)
+
+diff --git a/src/util/viralloc.h b/src/util/viralloc.h
+index 69d0f904f1..a23aa188bb 100644
+--- a/src/util/viralloc.h
++++ b/src/util/viralloc.h
+@@ -596,4 +596,46 @@ void virAllocTestInit(void);
+ int virAllocTestCount(void);
+ void virAllocTestOOM(int n, int m);
+ void virAllocTestHook(void (*func)(int, void*), void *data);
++
++# define VIR_AUTOPTR_FUNC_NAME(type) type##AutoPtrFree
++
++/**
++ * VIR_DEFINE_AUTOPTR_FUNC:
++ * @type: type of the variable to be freed automatically
++ * @func: cleanup function to be automatically called
++ *
++ * This macro defines a function for automatic freeing of
++ * resources allocated to a variable of type @type. This newly
++ * defined function works as a necessary wrapper around @func.
++ */
++# define VIR_DEFINE_AUTOPTR_FUNC(type, func) \
++    static inline void VIR_AUTOPTR_FUNC_NAME(type)(type **_ptr) \
++    { \
++        if (*_ptr) \
++            (func)(*_ptr); \
++        *_ptr = NULL; \
++    } \
++
++/**
++ * VIR_AUTOFREE:
++ * @type: type of the variable to be freed automatically
++ *
++ * Macro to automatically free the memory allocated to
++ * the variable declared with it by calling virFree
++ * when the variable goes out of scope.
++ */
++# define VIR_AUTOFREE(type) __attribute__((cleanup(virFree))) type
++
++/**
++ * VIR_AUTOPTR:
++ * @type: type of the variable to be freed automatically
++ *
++ * Macro to automatically free the memory allocated to
++ * the variable declared with it by calling the function
++ * defined by VIR_DEFINE_AUTOPTR_FUNC when the variable
++ * goes out of scope.
++ */
++# define VIR_AUTOPTR(type) \
++    __attribute__((cleanup(VIR_AUTOPTR_FUNC_NAME(type)))) type *
++
+ #endif /* __VIR_MEMORY_H_ */
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-bitmap-define-cleanup-function-using-VIR_DEFINE_AUTOPTR_FUNC.patch b/SOURCES/libvirt-util-bitmap-define-cleanup-function-using-VIR_DEFINE_AUTOPTR_FUNC.patch
new file mode 100644
index 0000000..3b95f83
--- /dev/null
+++ b/SOURCES/libvirt-util-bitmap-define-cleanup-function-using-VIR_DEFINE_AUTOPTR_FUNC.patch
@@ -0,0 +1,69 @@
+From 1e01bd7d0102dac3c2a69c95f39de80080973206 Mon Sep 17 00:00:00 2001
+Message-Id: <1e01bd7d0102dac3c2a69c95f39de80080973206@dist-git>
+From: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
+Date: Tue, 4 Jun 2019 16:22:03 +0200
+Subject: [PATCH] util: bitmap: define cleanup function using
+ VIR_DEFINE_AUTOPTR_FUNC
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in
+src/util/viralloc.h, define a new wrapper around an existing
+cleanup function which will be called when a variable declared
+with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant
+viralloc.h include, since that has moved from the source module into the
+header.
+
+When a variable of type virBitmapPtr is declared using
+VIR_AUTOPTR, the function virBitmapFree will be run
+automatically on it when it goes out of scope.
+
+Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+(cherry picked from commit a3c915e662f8c25cac683e20bbc419b497555e13)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1703661
+
+Signed-off-by: Andrea Bolognani <abologna@redhat.com>
+Message-Id: <20190604142207.2036-3-abologna@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virbitmap.c | 1 -
+ src/util/virbitmap.h | 3 +++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
+index 0bc0d068bb..d6715025d4 100644
+--- a/src/util/virbitmap.c
++++ b/src/util/virbitmap.c
+@@ -31,7 +31,6 @@
+ #include <sys/types.h>
+ 
+ #include "virbitmap.h"
+-#include "viralloc.h"
+ #include "virbuffer.h"
+ #include "c-ctype.h"
+ #include "count-one-bits.h"
+diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h
+index 2464814055..312e7e2933 100644
+--- a/src/util/virbitmap.h
++++ b/src/util/virbitmap.h
+@@ -25,6 +25,7 @@
+ # define __BITMAP_H__
+ 
+ # include "internal.h"
++# include "viralloc.h"
+ 
+ # include <sys/types.h>
+ 
+@@ -155,4 +156,6 @@ void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b)
+ 
+ void virBitmapShrink(virBitmapPtr map, size_t b);
+ 
++VIR_DEFINE_AUTOPTR_FUNC(virBitmap, virBitmapFree)
++
+ #endif
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-file-introduce-VIR_AUTOCLOSE-macro-to-close-fd-of-the-file-automatically.patch b/SOURCES/libvirt-util-file-introduce-VIR_AUTOCLOSE-macro-to-close-fd-of-the-file-automatically.patch
new file mode 100644
index 0000000..125d35d
--- /dev/null
+++ b/SOURCES/libvirt-util-file-introduce-VIR_AUTOCLOSE-macro-to-close-fd-of-the-file-automatically.patch
@@ -0,0 +1,68 @@
+From fda8fad673053718fdee4b370476f7a2555437c3 Mon Sep 17 00:00:00 2001
+Message-Id: <fda8fad673053718fdee4b370476f7a2555437c3@dist-git>
+From: Shi Lei <shi_lei@massclouds.com>
+Date: Tue, 4 Jun 2019 13:04:24 +0200
+Subject: [PATCH] util: file: introduce VIR_AUTOCLOSE macro to close fd of the
+ file automatically
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Shi Lei <shi_lei@massclouds.com>
+(cherry picked from commit 09d35afd2c3058688290d5d818343d0f6aa2dd6e)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <e13d3c54954aa3f13bedc3cda5b32723d5212a66.1559646067.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virfile.h | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/src/util/virfile.h b/src/util/virfile.h
+index 51c221e069..fa03269289 100644
+--- a/src/util/virfile.h
++++ b/src/util/virfile.h
+@@ -53,6 +53,11 @@ int virFileClose(int *fdptr, virFileCloseFlags flags)
+ int virFileFclose(FILE **file, bool preserve_errno) ATTRIBUTE_RETURN_CHECK;
+ FILE *virFileFdopen(int *fdptr, const char *mode) ATTRIBUTE_RETURN_CHECK;
+ 
++static inline void virForceCloseHelper(int *fd)
++{
++    ignore_value(virFileClose(fd, VIR_FILE_CLOSE_PRESERVE_ERRNO));
++}
++
+ /* For use on normal paths; caller must check return value,
+    and failure sets errno per close. */
+ # define VIR_CLOSE(FD) virFileClose(&(FD), 0)
+@@ -63,8 +68,7 @@ FILE *virFileFdopen(int *fdptr, const char *mode) ATTRIBUTE_RETURN_CHECK;
+ 
+ /* For use on cleanup paths; errno is unaffected by close,
+    and no return value to worry about. */
+-# define VIR_FORCE_CLOSE(FD) \
+-    ignore_value(virFileClose(&(FD), VIR_FILE_CLOSE_PRESERVE_ERRNO))
++# define VIR_FORCE_CLOSE(FD) virForceCloseHelper(&(FD))
+ # define VIR_FORCE_FCLOSE(FILE) ignore_value(virFileFclose(&(FILE), true))
+ 
+ /* Similar VIR_FORCE_CLOSE() but ignores EBADF errors since they are expected
+@@ -79,6 +83,16 @@ FILE *virFileFdopen(int *fdptr, const char *mode) ATTRIBUTE_RETURN_CHECK;
+                  VIR_FILE_CLOSE_PRESERVE_ERRNO | \
+                  VIR_FILE_CLOSE_DONT_LOG))
+ 
++/**
++ * VIR_AUTOCLOSE:
++ *
++ * Macro to automatically force close the fd by calling virForceCloseHelper
++ * when the fd goes out of scope. It's used to eliminate VIR_FORCE_CLOSE
++ * in cleanup sections.
++ */
++# define VIR_AUTOCLOSE __attribute__((cleanup(virForceCloseHelper))) int
++
++
+ /* Opaque type for managing a wrapper around a fd.  */
+ struct _virFileWrapperFd;
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-require-command-args-to-be-non-NULL.patch b/SOURCES/libvirt-util-require-command-args-to-be-non-NULL.patch
new file mode 100644
index 0000000..83a7db0
--- /dev/null
+++ b/SOURCES/libvirt-util-require-command-args-to-be-non-NULL.patch
@@ -0,0 +1,80 @@
+From 7fcdf3bbd65b4f3e21128089a559c064edbcb8dc Mon Sep 17 00:00:00 2001
+Message-Id: <7fcdf3bbd65b4f3e21128089a559c064edbcb8dc@dist-git>
+From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+Date: Tue, 21 May 2019 11:02:12 +0100
+Subject: [PATCH] util: require command args to be non-NULL
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The virCommand APIs do not expect to be given a NULL value for an arg
+name or value. Such a mistake can lead to execution of the wrong
+command, as the NULL may prematurely terminate the list of args.
+Detect this and report suitable error messages.
+
+This identified a flaw in the storage test which was passing a NULL
+instead of the volume path. This flaw was then validated by an incorrect
+set of qemu-img args as expected data.
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit 912c6b22fc622cd7c7d29c7f8eaeb816b266daac)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1672957
+Message-Id: <20190521100213.16875-2-berrange@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/vircommand.c                                | 10 ++++++++++
+ tests/storagevolxml2argvdata/qcow2-zerocapacity.argv |  2 +-
+ tests/storagevolxml2xmlin/vol-qcow2-zerocapacity.xml |  1 +
+ 3 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/vircommand.c b/src/util/vircommand.c
+index 6dab105f56..68cf63c28a 100644
+--- a/src/util/vircommand.c
++++ b/src/util/vircommand.c
+@@ -1509,6 +1509,12 @@ virCommandAddArg(virCommandPtr cmd, const char *val)
+     if (!cmd || cmd->has_error)
+         return;
+ 
++    if (val == NULL) {
++        cmd->has_error = EINVAL;
++        abort();
++        return;
++    }
++
+     if (VIR_STRDUP_QUIET(arg, val) < 0) {
+         cmd->has_error = ENOMEM;
+         return;
+@@ -1606,6 +1612,10 @@ virCommandAddArgFormat(virCommandPtr cmd, const char *format, ...)
+ void
+ virCommandAddArgPair(virCommandPtr cmd, const char *name, const char *val)
+ {
++    if (name == NULL || val == NULL) {
++        cmd->has_error = EINVAL;
++        return;
++    }
+     virCommandAddArgFormat(cmd, "%s=%s", name, val);
+ }
+ 
+diff --git a/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv b/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
+index d83b08b342..45894931ae 100644
+--- a/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
++++ b/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
+@@ -1 +1 @@
+-qemu-img create -f qcow2 -o compat=0.10  0K
++qemu-img create -f qcow2 -o compat=0.10 /var/lib/libvirt/images/OtherDemo.img 0K
+diff --git a/tests/storagevolxml2xmlin/vol-qcow2-zerocapacity.xml b/tests/storagevolxml2xmlin/vol-qcow2-zerocapacity.xml
+index 1d1e6deac0..027a73b4bf 100644
+--- a/tests/storagevolxml2xmlin/vol-qcow2-zerocapacity.xml
++++ b/tests/storagevolxml2xmlin/vol-qcow2-zerocapacity.xml
+@@ -1,6 +1,7 @@
+ <volume>
+   <name>OtherDemo.img</name>
+   <target>
++    <path>/var/lib/libvirt/images/OtherDemo.img</path>
+     <format type="qcow2"/>
+   </target>
+   <capacity>0</capacity>
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-skip-RDMA-detection-for-non-PCI-network-devices.patch b/SOURCES/libvirt-util-skip-RDMA-detection-for-non-PCI-network-devices.patch
new file mode 100644
index 0000000..6f31e8d
--- /dev/null
+++ b/SOURCES/libvirt-util-skip-RDMA-detection-for-non-PCI-network-devices.patch
@@ -0,0 +1,49 @@
+From 9510cef89c3fb7fed5319f50e213ca9db4990897 Mon Sep 17 00:00:00 2001
+Message-Id: <9510cef89c3fb7fed5319f50e213ca9db4990897@dist-git>
+From: Pavel Hrdina <phrdina@redhat.com>
+Date: Wed, 3 Apr 2019 17:26:21 +0200
+Subject: [PATCH] util: skip RDMA detection for non-PCI network devices
+
+Only PCI devices have '/sys/class/net/<ifname>/device/resource' so we
+need to skip this check for all other network devices.
+
+Without this patch and RDMA enabled libvirt will not detect any network
+device that doesn't have the path above which includes 'lo', 'virbr',
+'tun', etc.
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1639258
+
+Reviewed-by: Andrea Bolognani <abologna@redhat.com>
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+(cherry picked from commit f38ef0fac0582ac0cbb749af9d3f8ba515a6084a)
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <d9ab043c567252fda1f5749234ee44a17ff3f99b.1554305151.git.phrdina@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+Reviewed-by: Andrea Bolognani <abologna@redhat.com>
+---
+ src/util/virnetdev.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
+index bc1e70f0a8..7396a719a8 100644
+--- a/src/util/virnetdev.c
++++ b/src/util/virnetdev.c
+@@ -3016,8 +3016,14 @@ virNetDevRDMAFeature(const char *ifname,
+ 
+     if (virAsprintf(&eth_devpath, SYSFS_NET_DIR "%s/device/resource", ifname) < 0)
+         goto cleanup;
+-    if (!virFileExists(eth_devpath))
++
++    /* If /sys/class/net/<ifname>/device/resource doesn't exist it is not a PCI
++     * device and therefore it will not have RDMA. */
++    if (!virFileExists(eth_devpath)) {
++        ret = 0;
+         goto cleanup;
++    }
++
+     if (virFileReadAll(eth_devpath, RESOURCE_FILE_LEN, &eth_res_buf) < 0)
+         goto cleanup;
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-util-suppress-unimportant-ovs-vsctl-errors-when-getting-interface-stats.patch b/SOURCES/libvirt-util-suppress-unimportant-ovs-vsctl-errors-when-getting-interface-stats.patch
new file mode 100644
index 0000000..d8c07fc
--- /dev/null
+++ b/SOURCES/libvirt-util-suppress-unimportant-ovs-vsctl-errors-when-getting-interface-stats.patch
@@ -0,0 +1,49 @@
+From 299fe2bb28582a9e26453355909ee5132c374936 Mon Sep 17 00:00:00 2001
+Message-Id: <299fe2bb28582a9e26453355909ee5132c374936@dist-git>
+From: Laine Stump <laine@laine.org>
+Date: Thu, 2 May 2019 13:23:35 -0400
+Subject: [PATCH] util: suppress unimportant ovs-vsctl errors when getting
+ interface stats
+
+commit edaf13565 modified the stats retrieval for OVS interfaces to
+not fail when one of the fields was unrecognized by the ovs-vsctl
+command, but ovs-vsctl was still returning an error, and libvirt was
+cluttering the logs with these inconsequential error messages.
+
+This patch modifies the GET_STAT macro to add "--if-exists" to the
+ovs-vsctl command, which causes it to return an empty string (and exit
+with success) if the requested statistic isn't in its database, thus
+eliminating the ugly error messages from the log.
+
+Resolves: https://bugzilla.redhat.com/1683175
+
+Signed-off-by: Laine Stump <laine@laine.org>
+(cherry picked from commit 3f7cba3f5ea1731b9028b89b671cbd7e7d5e0421)
+Signed-off-by: Laine Stump <laine@redhat.com>
+Message-Id: <20190502172335.6691-1-laine@redhat.com>
+Reviewed-by: Andrea Bolognani <abologna@redhat.com>
+---
+ src/util/virnetdevopenvswitch.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
+index f86f698430..f36916a300 100644
+--- a/src/util/virnetdevopenvswitch.c
++++ b/src/util/virnetdevopenvswitch.c
+@@ -363,10 +363,10 @@ virNetDevOpenvswitchInterfaceStats(const char *ifname,
+         virCommandFree(cmd); \
+         cmd = virCommandNew(OVSVSCTL); \
+         virNetDevOpenvswitchAddTimeout(cmd); \
+-        virCommandAddArgList(cmd, "get", "Interface", ifname, \
+-                             "statistics:" name, NULL); \
++        virCommandAddArgList(cmd, "--if-exists", "get", "Interface", \
++                             ifname, "statistics:" name, NULL); \
+         virCommandSetOutputBuffer(cmd, &output); \
+-        if (virCommandRun(cmd, NULL) < 0) { \
++        if (virCommandRun(cmd, NULL) < 0 || !output || !*output || *output == '\n') { \
+             stats->member = -1; \
+         } else { \
+             if (virStrToLong_ll(output, &tmp, 10, &stats->member) < 0 || \
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-virFileIsSharedFSType-Check-for-fuse.glusterfs-too.patch b/SOURCES/libvirt-virFileIsSharedFSType-Check-for-fuse.glusterfs-too.patch
index 6049cf1..642336c 100644
--- a/SOURCES/libvirt-virFileIsSharedFSType-Check-for-fuse.glusterfs-too.patch
+++ b/SOURCES/libvirt-virFileIsSharedFSType-Check-for-fuse.glusterfs-too.patch
@@ -124,5 +124,5 @@ index 378d03ecf0..c87e26bf5b 100644
  virFileFindHugeTLBFS(virHugeTLBFSPtr *ret_fs,
                       size_t *ret_nfs)
 -- 
-2.19.0
+2.21.0
 
diff --git a/SOURCES/libvirt-virFileIsSharedFSType-Detect-direct-mount-points.patch b/SOURCES/libvirt-virFileIsSharedFSType-Detect-direct-mount-points.patch
index 676bba3..09bdf69 100644
--- a/SOURCES/libvirt-virFileIsSharedFSType-Detect-direct-mount-points.patch
+++ b/SOURCES/libvirt-virFileIsSharedFSType-Detect-direct-mount-points.patch
@@ -76,5 +76,5 @@ index 85f22063fe..80ea34bfa4 100644
      return ret != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
  }
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-vircpuhost-Add-support-for-reading-MSRs.patch b/SOURCES/libvirt-vircpuhost-Add-support-for-reading-MSRs.patch
new file mode 100644
index 0000000..e18322d
--- /dev/null
+++ b/SOURCES/libvirt-vircpuhost-Add-support-for-reading-MSRs.patch
@@ -0,0 +1,155 @@
+From 70fd0697564f6a1f9588f4f795956863959d04eb Mon Sep 17 00:00:00 2001
+Message-Id: <70fd0697564f6a1f9588f4f795956863959d04eb@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Tue, 4 Jun 2019 13:04:25 +0200
+Subject: [PATCH] vircpuhost: Add support for reading MSRs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The new virHostCPUGetMSR internal API will try to read the MSR from
+/dev/cpu/0/msr and if it is not possible (the device does not exist or
+libvirt is running unprivileged), it will fallback to asking KVM for the
+MSR using KVM_GET_MSRS ioctl.
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit df4b46737f43a1a67f9b5de2840213a1bd2b3cce)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Conflicts:
+	src/util/virhostcpu.h
+            - context: the comment after #endif changed upstream
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <696430bedbef1fd8f1f65339173eda0e0b042e9c.1559646067.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/libvirt_private.syms |  1 +
+ src/util/virhostcpu.c    | 80 ++++++++++++++++++++++++++++++++++++++++
+ src/util/virhostcpu.h    |  3 ++
+ 3 files changed, 84 insertions(+)
+
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index 984a9be18f..3a99cb6774 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -1961,6 +1961,7 @@ virHostCPUGetInfo;
+ virHostCPUGetKVMMaxVCPUs;
+ virHostCPUGetMap;
+ virHostCPUGetMicrocodeVersion;
++virHostCPUGetMSR;
+ virHostCPUGetOnline;
+ virHostCPUGetOnlineBitmap;
+ virHostCPUGetPresentBitmap;
+diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
+index 3f7d70b87b..2c1404b07a 100644
+--- a/src/util/virhostcpu.c
++++ b/src/util/virhostcpu.c
+@@ -64,6 +64,7 @@
+ VIR_LOG_INIT("util.hostcpu");
+ 
+ #define KVM_DEVICE "/dev/kvm"
++#define MSR_DEVICE "/dev/cpu/0/msr"
+ 
+ 
+ #if defined(__FreeBSD__) || defined(__APPLE__)
+@@ -1294,3 +1295,82 @@ virHostCPUGetMicrocodeVersion(void)
+ }
+ 
+ #endif /* __linux__ */
++
++
++#if HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS)
++static int
++virHostCPUGetMSRFromKVM(unsigned long index,
++                        uint64_t *result)
++{
++    VIR_AUTOCLOSE fd = -1;
++    struct {
++        struct kvm_msrs header;
++        struct kvm_msr_entry entry;
++    } msr = {
++        .header = { .nmsrs = 1 },
++        .entry = { .index = index },
++    };
++
++    if ((fd = open(KVM_DEVICE, O_RDONLY)) < 0) {
++        virReportSystemError(errno, _("Unable to open %s"), KVM_DEVICE);
++        return -1;
++    }
++
++    if (ioctl(fd, KVM_GET_MSRS, &msr) < 0) {
++        VIR_DEBUG("Cannot get MSR 0x%lx from KVM", index);
++        return 1;
++    }
++
++    *result = msr.entry.data;
++    return 0;
++}
++
++#else
++
++static int
++virHostCPUGetMSRFromKVM(unsigned long index ATTRIBUTE_UNUSED,
++                        uint64_t *result ATTRIBUTE_UNUSED)
++{
++    virReportSystemError(ENOSYS, "%s",
++                         _("Reading MSRs via KVM is not supported on this platform"));
++    return -1;
++}
++#endif /* HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) */
++
++
++/*
++ * Returns 0 on success,
++ *         1 when the MSR is not supported by the host CPU,
++*         -1 on error.
++ */
++int
++virHostCPUGetMSR(unsigned long index,
++                 uint64_t *msr)
++{
++    VIR_AUTOCLOSE fd = -1;
++    char ebuf[1024];
++
++    *msr = 0;
++
++    if ((fd = open(MSR_DEVICE, O_RDONLY)) < 0) {
++        VIR_DEBUG("Unable to open %s: %s",
++                  MSR_DEVICE, virStrerror(errno, ebuf, sizeof(ebuf)));
++    } else {
++        int rc = pread(fd, msr, sizeof(*msr), index);
++
++        if (rc == sizeof(*msr))
++            return 0;
++
++        if (rc < 0 && errno == EIO) {
++            VIR_DEBUG("CPU does not support MSR 0x%lx", index);
++            return 1;
++        }
++
++        VIR_DEBUG("Cannot read MSR 0x%lx from %s: %s",
++                  index, MSR_DEVICE, virStrerror(errno, ebuf, sizeof(ebuf)));
++    }
++
++    VIR_DEBUG("Falling back to KVM ioctl");
++
++    return virHostCPUGetMSRFromKVM(index, msr);
++}
+diff --git a/src/util/virhostcpu.h b/src/util/virhostcpu.h
+index f9f3359288..e705623d4f 100644
+--- a/src/util/virhostcpu.h
++++ b/src/util/virhostcpu.h
+@@ -68,4 +68,7 @@ int virHostCPUGetOnline(unsigned int cpu, bool *online);
+ 
+ unsigned int virHostCPUGetMicrocodeVersion(void);
+ 
++int virHostCPUGetMSR(unsigned long index,
++                     uint64_t *msr);
++
+ #endif /* __VIR_HOSTCPU_H__*/
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-virfile-Detect-ceph-as-shared-FS.patch b/SOURCES/libvirt-virfile-Detect-ceph-as-shared-FS.patch
index 6f727e5..cd003af 100644
--- a/SOURCES/libvirt-virfile-Detect-ceph-as-shared-FS.patch
+++ b/SOURCES/libvirt-virfile-Detect-ceph-as-shared-FS.patch
@@ -1,5 +1,5 @@
-From babe3d8cfbf85c23a71cb167008065bc63cc2fb0 Mon Sep 17 00:00:00 2001
-Message-Id: <babe3d8cfbf85c23a71cb167008065bc63cc2fb0@dist-git>
+From 2a740435a960bd08acb0352b70d7e1a85fac7286 Mon Sep 17 00:00:00 2001
+Message-Id: <2a740435a960bd08acb0352b70d7e1a85fac7286@dist-git>
 From: Michal Privoznik <mprivozn@redhat.com>
 Date: Mon, 4 Feb 2019 10:37:50 +0100
 Subject: [PATCH] virfile: Detect ceph as shared FS
@@ -133,5 +133,5 @@ index a246d601ba..972c07fdc5 100644
      return ret != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
  }
 -- 
-2.20.1
+2.21.0
 
diff --git a/SOURCES/libvirt-virfile-Rework-virFileIsSharedFixFUSE.patch b/SOURCES/libvirt-virfile-Rework-virFileIsSharedFixFUSE.patch
index 7e48516..2840ba2 100644
--- a/SOURCES/libvirt-virfile-Rework-virFileIsSharedFixFUSE.patch
+++ b/SOURCES/libvirt-virfile-Rework-virFileIsSharedFixFUSE.patch
@@ -147,5 +147,5 @@ index 80ea34bfa4..be4dbf8910 100644
      return ret != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
  }
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-virfile-Take-symlink-into-account-in-virFileIsSharedFixFUSE.patch b/SOURCES/libvirt-virfile-Take-symlink-into-account-in-virFileIsSharedFixFUSE.patch
index 5f1d252..c7c6b29 100644
--- a/SOURCES/libvirt-virfile-Take-symlink-into-account-in-virFileIsSharedFixFUSE.patch
+++ b/SOURCES/libvirt-virfile-Take-symlink-into-account-in-virFileIsSharedFixFUSE.patch
@@ -182,5 +182,5 @@ index be4dbf8910..a246d601ba 100644
      return ret != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
  }
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-virfile-added-GPFS-as-shared-fs.patch b/SOURCES/libvirt-virfile-added-GPFS-as-shared-fs.patch
index eb111ed..0ab1dc3 100644
--- a/SOURCES/libvirt-virfile-added-GPFS-as-shared-fs.patch
+++ b/SOURCES/libvirt-virfile-added-GPFS-as-shared-fs.patch
@@ -1,7 +1,7 @@
-From e1d05dd50a1147b967afb89c57e77df9b5b5fc2d Mon Sep 17 00:00:00 2001
-Message-Id: <e1d05dd50a1147b967afb89c57e77df9b5b5fc2d@dist-git>
+From 92bca785f753f6bc80e2ebe612363a351f56e3d9 Mon Sep 17 00:00:00 2001
+Message-Id: <92bca785f753f6bc80e2ebe612363a351f56e3d9@dist-git>
 From: Diego Michelotto <diego.michelotto@cnaf.infn.it>
-Date: Tue, 4 Jun 2019 12:12:26 +0200
+Date: Tue, 21 May 2019 16:35:08 +0200
 Subject: [PATCH] virfile: added GPFS as shared fs
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
@@ -18,9 +18,8 @@ BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1679528
 Signed-off-by: Diego Michelotto <diego.michelotto@cnaf.infn.it>
 Signed-off-by: Peter Krempa <pkrempa@redhat.com>
 (cherry picked from commit d163b940a73a0d6b8277a4bccef2b60936933cf0)
-
-https: //bugzilla.redhat.com/show_bug.cgi?id=1715867
-Message-Id: <fa948f8d8b0b236ca7a5207f6d52c13274fe9058.1559642578.git.pkrempa@redhat.com>
+https: //bugzilla.redhat.com/show_bug.cgi?id=1710728 [rhel-7.7]
+Message-Id: <635dc075347096db1132d6d519aa8a5b1baca6aa.1558449212.git.pkrempa@redhat.com>
 Reviewed-by: Ján Tomko <jtomko@redhat.com>
 ---
  src/util/virfile.c            | 9 ++++++++-
diff --git a/SOURCES/libvirt-virfile-fix-cast-align-error.patch b/SOURCES/libvirt-virfile-fix-cast-align-error.patch
index 9c78b0f..120ebfe 100644
--- a/SOURCES/libvirt-virfile-fix-cast-align-error.patch
+++ b/SOURCES/libvirt-virfile-fix-cast-align-error.patch
@@ -91,5 +91,5 @@ index c87e26bf5b..46466ed136 100644
  
      return 0;
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-virfiletest-Fix-test-name-prefix-for-virFileInData-test.patch b/SOURCES/libvirt-virfiletest-Fix-test-name-prefix-for-virFileInData-test.patch
index aac2b72..05c9694 100644
--- a/SOURCES/libvirt-virfiletest-Fix-test-name-prefix-for-virFileInData-test.patch
+++ b/SOURCES/libvirt-virfiletest-Fix-test-name-prefix-for-virFileInData-test.patch
@@ -33,5 +33,5 @@ index a15495e9e8..790911cacb 100644
          DO_TEST_IN_DATA(false, 4, 4, 4);
          DO_TEST_IN_DATA(true, 8, 8, 8);
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-virfiletst-Test-virFileIsSharedFS.patch b/SOURCES/libvirt-virfiletst-Test-virFileIsSharedFS.patch
index 150767b..7a07c39 100644
--- a/SOURCES/libvirt-virfiletst-Test-virFileIsSharedFS.patch
+++ b/SOURCES/libvirt-virfiletst-Test-virFileIsSharedFS.patch
@@ -354,5 +354,5 @@ index 790911cacb..85f22063fe 100644
 -VIR_TEST_MAIN(mymain)
 +VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virfilemock.so")
 -- 
-2.19.1
+2.21.0
 
diff --git a/SOURCES/libvirt-virhostcpu-Make-virHostCPUGetMSR-work-only-on-x86.patch b/SOURCES/libvirt-virhostcpu-Make-virHostCPUGetMSR-work-only-on-x86.patch
new file mode 100644
index 0000000..cead4b4
--- /dev/null
+++ b/SOURCES/libvirt-virhostcpu-Make-virHostCPUGetMSR-work-only-on-x86.patch
@@ -0,0 +1,89 @@
+From d3455f2c6bd6d18623c04d05108662ae5df69852 Mon Sep 17 00:00:00 2001
+Message-Id: <d3455f2c6bd6d18623c04d05108662ae5df69852@dist-git>
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Tue, 4 Jun 2019 13:04:26 +0200
+Subject: [PATCH] virhostcpu: Make virHostCPUGetMSR() work only on x86
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Model specific registers are a thing only on x86. Also, the
+/dev/cpu/0/msr path exists only on Linux and the fallback
+mechanism (asking KVM) exists on Linux and FreeBSD only.
+
+Therefore, move the function within #ifdef that checks all
+aforementioned constraints and provide a dummy stub for all
+other cases.
+
+This fixes the build on my arm box, mingw-* builds, etc.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit ae3d812b006b84c6d06605868d19554ea0156392)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1641702
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <d9ea204e7cab0bd9b0e123b207563708fe92d940.1559646067.git.jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virhostcpu.c | 32 ++++++++++++++++++--------------
+ 1 file changed, 18 insertions(+), 14 deletions(-)
+
+diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
+index 2c1404b07a..1b6570568c 100644
+--- a/src/util/virhostcpu.c
++++ b/src/util/virhostcpu.c
+@@ -1297,7 +1297,9 @@ virHostCPUGetMicrocodeVersion(void)
+ #endif /* __linux__ */
+ 
+ 
+-#if HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS)
++#if HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) && \
++    (defined(__i386__) || defined(__x86_64__)) && \
++    (defined(__linux__) || defined(__FreeBSD__))
+ static int
+ virHostCPUGetMSRFromKVM(unsigned long index,
+                         uint64_t *result)
+@@ -1325,19 +1327,6 @@ virHostCPUGetMSRFromKVM(unsigned long index,
+     return 0;
+ }
+ 
+-#else
+-
+-static int
+-virHostCPUGetMSRFromKVM(unsigned long index ATTRIBUTE_UNUSED,
+-                        uint64_t *result ATTRIBUTE_UNUSED)
+-{
+-    virReportSystemError(ENOSYS, "%s",
+-                         _("Reading MSRs via KVM is not supported on this platform"));
+-    return -1;
+-}
+-#endif /* HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) */
+-
+-
+ /*
+  * Returns 0 on success,
+  *         1 when the MSR is not supported by the host CPU,
+@@ -1374,3 +1363,18 @@ virHostCPUGetMSR(unsigned long index,
+ 
+     return virHostCPUGetMSRFromKVM(index, msr);
+ }
++
++#else
++
++int
++virHostCPUGetMSR(unsigned long index ATTRIBUTE_UNUSED,
++                 uint64_t *msr ATTRIBUTE_UNUSED)
++{
++    virReportSystemError(ENOSYS, "%s",
++                         _("Reading MSRs is not supported on this platform"));
++    return -1;
++}
++
++#endif /* HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) && \
++          (defined(__i386__) || defined(__x86_64__)) && \
++          (defined(__linux__) || defined(__FreeBSD__)) */
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-virnwfilterbindingobj-Introduce-and-use-virNWFilterBindingObjStealDef.patch b/SOURCES/libvirt-virnwfilterbindingobj-Introduce-and-use-virNWFilterBindingObjStealDef.patch
index 852c710..387f054 100644
--- a/SOURCES/libvirt-virnwfilterbindingobj-Introduce-and-use-virNWFilterBindingObjStealDef.patch
+++ b/SOURCES/libvirt-virnwfilterbindingobj-Introduce-and-use-virNWFilterBindingObjStealDef.patch
@@ -1,15 +1,14 @@
-From 48289dddc0f4398036071c132f96644e3c3e03c4 Mon Sep 17 00:00:00 2001
-Message-Id: <48289dddc0f4398036071c132f96644e3c3e03c4@dist-git>
+From 4f488215c980c7473171c5d64dee61c12e95c6d8 Mon Sep 17 00:00:00 2001
+Message-Id: <4f488215c980c7473171c5d64dee61c12e95c6d8@dist-git>
 From: Michal Privoznik <mprivozn@redhat.com>
-Date: Tue, 23 Apr 2019 10:06:17 +0200
+Date: Wed, 3 Apr 2019 15:33:55 +0200
 Subject: [PATCH] virnwfilterbindingobj: Introduce and use
  virNWFilterBindingObjStealDef
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
-RHEL-7.7: https://bugzilla.redhat.com/show_bug.cgi?id=1686927
-RHEL-7.6.z: https://bugzilla.redhat.com/show_bug.cgi?id=1702173
+https://bugzilla.redhat.com/show_bug.cgi?id=1686927
 
 When trying to create a nwfilter binding via
 nwfilterBindingCreateXML() we may encounter a crash. The sequence
@@ -42,8 +41,8 @@ Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
 Reviewed-by: Ján Tomko <jtomko@redhat.com>
 (cherry picked from commit 8c08a99745ddac9f4055c008e82e68a27ed5093d)
 Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
-Message-Id: <a5c2feed107e958bb6a84f7e993cc9feac58c4a2.1556006751.git.mprivozn@redhat.com>
-Reviewed-by: Ján Tomko <jtomko@redhat.com>
+Message-Id: <cbad9c57e17d79202e33234148c29c38d20635e7.1554298431.git.mprivozn@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
 ---
  src/conf/virnwfilterbindingobj.c     | 10 ++++++++++
  src/conf/virnwfilterbindingobj.h     |  3 +++
diff --git a/SOURCES/libvirt-virrandom-Avoid-undefined-behaviour-in-virRandomBits.patch b/SOURCES/libvirt-virrandom-Avoid-undefined-behaviour-in-virRandomBits.patch
index 4358392..b1b798b 100644
--- a/SOURCES/libvirt-virrandom-Avoid-undefined-behaviour-in-virRandomBits.patch
+++ b/SOURCES/libvirt-virrandom-Avoid-undefined-behaviour-in-virRandomBits.patch
@@ -1,5 +1,5 @@
-From cdd5c75a34654abb2516476b851c6730b4bcb11b Mon Sep 17 00:00:00 2001
-Message-Id: <cdd5c75a34654abb2516476b851c6730b4bcb11b@dist-git>
+From 14781719b38ba33f8870eb9d5ef9e3cdb7d40116 Mon Sep 17 00:00:00 2001
+Message-Id: <14781719b38ba33f8870eb9d5ef9e3cdb7d40116@dist-git>
 From: Michal Privoznik <mprivozn@redhat.com>
 Date: Mon, 21 Jan 2019 09:04:11 -0500
 Subject: [PATCH] virrandom: Avoid undefined behaviour in virRandomBits
@@ -38,5 +38,5 @@ index 3c011a8615..7915f6531e 100644
  }
  
 -- 
-2.20.1
+2.21.0
 
diff --git a/SOURCES/libvirt-virresctrl-fix-MBA-memory-leak.patch b/SOURCES/libvirt-virresctrl-fix-MBA-memory-leak.patch
new file mode 100644
index 0000000..583387d
--- /dev/null
+++ b/SOURCES/libvirt-virresctrl-fix-MBA-memory-leak.patch
@@ -0,0 +1,58 @@
+From ab3c999755b0dd9d9c19534fd3f2386b7702a3d7 Mon Sep 17 00:00:00 2001
+Message-Id: <ab3c999755b0dd9d9c19534fd3f2386b7702a3d7@dist-git>
+From: Pavel Hrdina <phrdina@redhat.com>
+Date: Mon, 15 Apr 2019 17:33:05 +0200
+Subject: [PATCH] virresctrl: fix MBA memory leak
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The 'bandwidths' variable is allocated using VIR_RESIZE_N so it has to
+be freed as well.
+
+==118315== 8 bytes in 1 blocks are definitely lost in loss record 299 of 2,401
+==118315==    at 0x4C29DAD: malloc (vg_replace_malloc.c:308)
+==118315==    by 0x4C2C100: realloc (vg_replace_malloc.c:836)
+==118315==    by 0x52C3FAF: virReallocN (viralloc.c:245)
+==118315==    by 0x52C4079: virExpandN (viralloc.c:294)
+==118315==    by 0x532BBA8: virResctrlAllocParseProcessMemoryBandwidth (virresctrl.c:1156)
+==118315==    by 0x532BBA8: virResctrlAllocParseMemoryBandwidthLine (virresctrl.c:1211)
+==118315==    by 0x532BBA8: virResctrlAllocParse (virresctrl.c:1414)
+==118315==    by 0x532BBA8: virResctrlAllocGetGroup (virresctrl.c:1446)
+==118315==    by 0x532C11D: virResctrlAllocGetDefault (virresctrl.c:1464)
+==118315==    by 0x532D15E: virResctrlAllocAssign (virresctrl.c:1923)
+==118315==    by 0x532D15E: virResctrlAllocCreate (virresctrl.c:2042)
+==118315==    by 0x31E1ABEE: qemuProcessResctrlCreate (qemu_process.c:2596)
+==118315==    by 0x31E1ABEE: qemuProcessLaunch (qemu_process.c:6444)
+==118315==    by 0x31E1E341: qemuProcessStart (qemu_process.c:6721)
+==118315==    by 0x31E81315: qemuDomainObjStart.constprop.50 (qemu_driver.c:7288)
+==118315==    by 0x31E81A65: qemuDomainCreateWithFlags (qemu_driver.c:7341)
+==118315==    by 0x54DDB4B: virDomainCreate (libvirt-domain.c:6534)
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+(cherry picked from commit e3c4befef44db8e45a1f0de857ad2ec58d9b961a)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
+
+Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
+Message-Id: <d843d770626fc25ba17c609978a733fede464e43.1555342313.git.phrdina@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ src/util/virresctrl.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
+index f44d1cde8b..87d212d93c 100644
+--- a/src/util/virresctrl.c
++++ b/src/util/virresctrl.c
+@@ -307,6 +307,7 @@ virResctrlAllocDispose(void *obj)
+         virResctrlAllocMemBWPtr mem_bw = alloc->mem_bw;
+         for (i = 0; i < mem_bw->nbandwidths; i++)
+             VIR_FREE(mem_bw->bandwidths[i]);
++        VIR_FREE(alloc->mem_bw->bandwidths);
+         VIR_FREE(alloc->mem_bw);
+     }
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-virsh-Add-missed-fields-to-pool-define-as-item-entry.patch b/SOURCES/libvirt-virsh-Add-missed-fields-to-pool-define-as-item-entry.patch
new file mode 100644
index 0000000..64c2532
--- /dev/null
+++ b/SOURCES/libvirt-virsh-Add-missed-fields-to-pool-define-as-item-entry.patch
@@ -0,0 +1,38 @@
+From c0156a27f2ec169bf5452373f0815622d9fcd6ad Mon Sep 17 00:00:00 2001
+Message-Id: <c0156a27f2ec169bf5452373f0815622d9fcd6ad@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 07:12:37 -0400
+Subject: [PATCH] virsh: Add missed fields to pool-define-as item entry
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1615680
+
+Commit id d45bee449 updated the pool-define-as qualifier descriptions
+to add some new fields, but neglected to modify the command item list
+in order to add those fields as well.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+(cherry picked from commit b0451117b399df8107340dee8b653cb48e8da1c8)
+Message-Id: <20190403111237.2009-1-jferlan@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+---
+ tools/virsh.pod | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tools/virsh.pod b/tools/virsh.pod
+index 0e704bc407..3e9c264fe8 100644
+--- a/tools/virsh.pod
++++ b/tools/virsh.pod
+@@ -3822,7 +3822,9 @@ just I<--build> is provided, then B<pool-build> is called with no flags.
+ [I<--auth-type authtype> I<--auth-username username>
+ [I<--secret-usage usage> | I<--secret-uuid uuid>]]
+ [[I<--adapter-name name>] | [I<--adapter-wwnn> wwnn I<--adapter-wwpn> wwpn]
+-[I<--adapter-parent parent>]]
++[I<--adapter-parent parent> |
++ I<--adapter-parent-wwnn parent_wwnn> I<adapter-parent-wwpn parent_wwpn> |
++ I<--adapter-parent-fabric-wwn parent_fabric_wwn>]]
+ [I<--build>] [[I<--overwrite>] | [I<--no-overwrite>]] [I<--print-xml>]
+ 
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-virsh-Add-source-protocol-ver-for-pool-commands.patch b/SOURCES/libvirt-virsh-Add-source-protocol-ver-for-pool-commands.patch
new file mode 100644
index 0000000..de42e3b
--- /dev/null
+++ b/SOURCES/libvirt-virsh-Add-source-protocol-ver-for-pool-commands.patch
@@ -0,0 +1,93 @@
+From ded068e44e8c6e01774e9fe9a802fb9a370a4945 Mon Sep 17 00:00:00 2001
+Message-Id: <ded068e44e8c6e01774e9fe9a802fb9a370a4945@dist-git>
+From: John Ferlan <jferlan@redhat.com>
+Date: Wed, 3 Apr 2019 09:57:30 -0400
+Subject: [PATCH] virsh: Add source-protocol-ver for pool commands
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1584663
+
+Allow the addition of the <protocol ver='n'/> to the provided XML.
+
+Signed-off-by: John Ferlan <jferlan@redhat.com>
+Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
+(cherry picked from commit a3dbaa364721ae7bc7b8ae700091bf05392818f7)
+Message-Id: <20190403135730.2551-3-jferlan@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+---
+ tools/virsh-pool.c | 12 ++++++++++--
+ tools/virsh.pod    |  5 +++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
+index 6faff781b2..14f9a03396 100644
+--- a/tools/virsh-pool.c
++++ b/tools/virsh-pool.c
+@@ -140,6 +140,10 @@
+     {.name = "adapter-parent-fabric-wwn", \
+      .type = VSH_OT_STRING, \
+      .help = N_("adapter parent scsi_hostN fabric_wwn to be used for underlying vHBA storage") \
++    }, \
++    {.name = "source-protocol-ver", \
++     .type = VSH_OT_STRING, \
++     .help = N_("nfsvers value for NFS pool mount option") \
+     }
+ 
+ virStoragePoolPtr
+@@ -323,7 +327,7 @@ virshBuildPoolXML(vshControl *ctl,
+                *secretUsage = NULL, *adapterName = NULL, *adapterParent = NULL,
+                *adapterWwnn = NULL, *adapterWwpn = NULL, *secretUUID = NULL,
+                *adapterParentWwnn = NULL, *adapterParentWwpn = NULL,
+-               *adapterParentFabricWwn = NULL;
++               *adapterParentFabricWwn = NULL, *protoVer = NULL;
+     virBuffer buf = VIR_BUFFER_INITIALIZER;
+ 
+     VSH_EXCLUSIVE_OPTIONS("secret-usage", "secret-uuid");
+@@ -349,7 +353,8 @@ virshBuildPoolXML(vshControl *ctl,
+         vshCommandOptStringReq(ctl, cmd, "adapter-parent", &adapterParent) < 0 ||
+         vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwnn", &adapterParentWwnn) < 0 ||
+         vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwpn", &adapterParentWwpn) < 0 ||
+-        vshCommandOptStringReq(ctl, cmd, "adapter-parent-fabric-wwn", &adapterParentFabricWwn) < 0)
++        vshCommandOptStringReq(ctl, cmd, "adapter-parent-fabric-wwn", &adapterParentFabricWwn) < 0 ||
++        vshCommandOptStringReq(ctl, cmd, "source-protocol-ver", &protoVer) < 0)
+         goto cleanup;
+ 
+     virBufferAsprintf(&buf, "<pool type='%s'>\n", type);
+@@ -398,6 +403,9 @@ virshBuildPoolXML(vshControl *ctl,
+         if (srcName)
+             virBufferAsprintf(&buf, "<name>%s</name>\n", srcName);
+ 
++        if (protoVer)
++            virBufferAsprintf(&buf, "<protocol ver='%s'/>\n", protoVer);
++
+         virBufferAdjustIndent(&buf, -2);
+         virBufferAddLit(&buf, "</source>\n");
+     }
+diff --git a/tools/virsh.pod b/tools/virsh.pod
+index 79d1efa955..ba35723a4a 100644
+--- a/tools/virsh.pod
++++ b/tools/virsh.pod
+@@ -3843,6 +3843,7 @@ just I<--build> is provided, then B<pool-build> is called with no flags.
+ [I<--source-name name>] [I<--target path>] [I<--source-format format>]
+ [I<--auth-type authtype> I<--auth-username username>
+ [I<--secret-usage usage> | I<--secret-uuid uuid>]]
++[I<--source-protocol-ver ver>]
+ [[I<--adapter-name name>] | [I<--adapter-wwnn> wwnn I<--adapter-wwpn> wwpn]
+ [I<--adapter-parent parent> |
+  I<--adapter-parent-wwnn parent_wwnn> I<adapter-parent-wwpn parent_wwpn> |
+@@ -3885,6 +3886,10 @@ the storage pool. The I<authtype> is either chap for iscsi I<type> pools or
+ ceph for rbd I<type> pools. Either the secret I<usage> or I<uuid> value may
+ be provided, but not both.
+ 
++[I<--source-protocol-ver ver>] provides the NFS protocol version number used
++to contact the server's NFS service via nfs mount option 'nfsvers=n'. It is
++expect the I<ver> value is an unsigned integer.
++
+ [I<--adapter-name name>] defines the scsi_hostN adapter name to be used for
+ the scsi_host adapter type pool.
+ 
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-virsh-Require-explicit-domain-for-domxml-to-native.patch b/SOURCES/libvirt-virsh-Require-explicit-domain-for-domxml-to-native.patch
new file mode 100644
index 0000000..1924ee8
--- /dev/null
+++ b/SOURCES/libvirt-virsh-Require-explicit-domain-for-domxml-to-native.patch
@@ -0,0 +1,85 @@
+From 6d4f6fa057a8c8801530c97c4f78fa477ece6f4a Mon Sep 17 00:00:00 2001
+Message-Id: <6d4f6fa057a8c8801530c97c4f78fa477ece6f4a@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Thu, 4 Apr 2019 11:50:35 +0200
+Subject: [PATCH] virsh: Require explicit --domain for domxml-to-native
+
+The domxml-to-native virsh command accepts either --xml or --domain
+option followed by a file or domain name respectively. The --domain
+option is documented as required, which means an argument with no option
+is treated as --xml. Commit v4.3.0-127-gd86531daf2 broke this by making
+--domain optional and thus an argument with no option was treated as
+--domain.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1633077
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+(cherry picked from commit b7ccd0757de73344a4b973ede946dad40de846c7)
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <5531d22f2eb774ff080d333975557f6aa03e4b9d.1554371431.git.jdenemar@redhat.com>
+Reviewed-by: Andrea Bolognani <abologna@redhat.com>
+---
+ tools/virsh-domain.c | 6 +++---
+ tools/virsh.h        | 8 +++++---
+ 2 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
+index 6aa79f11b9..db4834dd1f 100644
+--- a/tools/virsh-domain.c
++++ b/tools/virsh-domain.c
+@@ -9387,7 +9387,7 @@ static const vshCmdInfo info_qemu_monitor_event[] = {
+ 
+ static const vshCmdOptDef opts_qemu_monitor_event[] = {
+     VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("filter by domain name, id or uuid"),
+-                                      0),
++                                      0, 0),
+     {.name = "event",
+      .type = VSH_OT_STRING,
+      .help = N_("filter by event name")
+@@ -9940,7 +9940,7 @@ static const vshCmdOptDef opts_domxmltonative[] = {
+      .flags = VSH_OFLAG_REQ,
+      .help = N_("target config data type format")
+     },
+-    VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(0),
++    VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(VSH_OFLAG_REQ_OPT, 0),
+     {.name = "xml",
+      .type = VSH_OT_STRING,
+      .help = N_("xml data file to export from")
+@@ -13189,7 +13189,7 @@ static const vshCmdInfo info_event[] = {
+ 
+ static const vshCmdOptDef opts_event[] = {
+     VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("filter by domain name, id or uuid"),
+-                                      0),
++                                      0, 0),
+     {.name = "event",
+      .type = VSH_OT_STRING,
+      .completer = virshDomainEventNameCompleter,
+diff --git a/tools/virsh.h b/tools/virsh.h
+index e164aabcee..b0a3cdbb97 100644
+--- a/tools/virsh.h
++++ b/tools/virsh.h
+@@ -110,16 +110,18 @@
+      .help = _helpstr \
+     }
+ 
+-# define VIRSH_COMMON_OPT_DOMAIN_OT_STRING(_helpstr, cflags) \
++# define VIRSH_COMMON_OPT_DOMAIN_OT_STRING(_helpstr, oflags, cflags) \
+     {.name = "domain", \
+      .type = VSH_OT_STRING, \
++     .flags = oflags, \
+      .help = _helpstr, \
+      .completer = virshDomainNameCompleter, \
+      .completer_flags = cflags, \
+     }
+ 
+-# define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \
+-    VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), cflags)
++# define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(oflags, cflags) \
++    VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), \
++                                      oflags, cflags)
+ 
+ # define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(_helpstr, cflags) \
+     {.name = "domain", \
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-virsh-Strip-XML-declaration-when-extracting-CPU-XMLs.patch b/SOURCES/libvirt-virsh-Strip-XML-declaration-when-extracting-CPU-XMLs.patch
new file mode 100644
index 0000000..f341911
--- /dev/null
+++ b/SOURCES/libvirt-virsh-Strip-XML-declaration-when-extracting-CPU-XMLs.patch
@@ -0,0 +1,61 @@
+From 9681d46b1fab8a779e66859dd8f0670c96e446bd Mon Sep 17 00:00:00 2001
+Message-Id: <9681d46b1fab8a779e66859dd8f0670c96e446bd@dist-git>
+From: Jiri Denemark <jdenemar@redhat.com>
+Date: Thu, 4 Apr 2019 11:48:51 +0200
+Subject: [PATCH] virsh: Strip XML declaration when extracting CPU XMLs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since commit v4.3.0-336-gc84726fbdd all
+{hypervisor-,}cpu-{baseline,compare} commands use a generic
+vshExtractCPUDefXMLs helper for extracting individual CPU definitions
+from the provided input file. The helper wraps the input file in a
+<container> element so that several independent elements can be easily
+parsed from the file. This works fine except when the file starts with
+XML declaration (<?xml version="1.0" ... ?>) because the XML declaration
+cannot be put inside any element. In fact it has to be at the very
+beginning of the XML document without any preceding white space
+characters. We can just simply skip the XML declaration.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1592737
+
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+(cherry picked from commit fcd1c865e168bdb9763b19e790c15e80aa29be66)
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+Message-Id: <40acb521c9fe289277a2863bbcdd9ad5a0935428.1554371326.git.jdenemar@redhat.com>
+Reviewed-by: Andrea Bolognani <abologna@redhat.com>
+---
+ tools/virsh-host.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/tools/virsh-host.c b/tools/virsh-host.c
+index 16f504bafe..b7f86bdd91 100644
+--- a/tools/virsh-host.c
++++ b/tools/virsh-host.c
+@@ -1130,13 +1130,20 @@ vshExtractCPUDefXMLs(vshControl *ctl,
+     xmlDocPtr xml = NULL;
+     xmlXPathContextPtr ctxt = NULL;
+     xmlNodePtr *nodes = NULL;
++    char *doc;
+     size_t i;
+     int n;
+ 
+     if (virFileReadAll(xmlFile, VSH_MAX_XML_FILE, &buffer) < 0)
+         goto error;
+ 
+-    if (virAsprintf(&xmlStr, "<container>%s</container>", buffer) < 0)
++    /* Strip possible XML declaration */
++    if (STRPREFIX(buffer, "<?xml") && (doc = strstr(buffer, "?>")))
++        doc += 2;
++    else
++        doc = buffer;
++
++    if (virAsprintf(&xmlStr, "<container>%s</container>", doc) < 0)
+         goto error;
+ 
+     if (!(xml = virXMLParseStringCtxt(xmlStr, xmlFile, &ctxt)))
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-virsh-man-Document-asynchronous-behaviour-of-detach-device-alias.patch b/SOURCES/libvirt-virsh-man-Document-asynchronous-behaviour-of-detach-device-alias.patch
new file mode 100644
index 0000000..856b881
--- /dev/null
+++ b/SOURCES/libvirt-virsh-man-Document-asynchronous-behaviour-of-detach-device-alias.patch
@@ -0,0 +1,40 @@
+From 3b632d86e7a45ba4ae07fd655340505a144bf942 Mon Sep 17 00:00:00 2001
+Message-Id: <3b632d86e7a45ba4ae07fd655340505a144bf942@dist-git>
+From: Peter Krempa <pkrempa@redhat.com>
+Date: Wed, 3 Apr 2019 16:35:45 +0200
+Subject: [PATCH] virsh: man: Document asynchronous behaviour of
+ detach-device-alias
+
+This command is fully async. Note that users can use virsh event to be
+notified of the guest actually removing the device.
+
+Signed-off-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+(cherry picked from commit 61d1abd5f11cadaf2ac7548e1a42e112bc49ed7e)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1688961
+Message-Id: <50540ced50cfffa59367bf8d026222fe006cd58d.1554302031.git.pkrempa@redhat.com>
+Reviewed-by: Andrea Bolognani <abologna@redhat.com>
+---
+ tools/virsh.pod | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/tools/virsh.pod b/tools/virsh.pod
+index 5321f6806a..79d1efa955 100644
+--- a/tools/virsh.pod
++++ b/tools/virsh.pod
+@@ -3214,7 +3214,10 @@ I<--persistent>.
+ =item B<detach-device-alias> I<domain> I<alias>
+ [[[I<--live>] [I<--config>] | [I<--current>]]]]
+ 
+-Detach a device with given I<alias> from the I<domain>.
++Detach a device with given I<alias> from the I<domain>. This command returns
++successfully after the unplug request was sent to the hypervisor. The actual
++removal of the device is notified asynchronously via libvirt events
++(see virsh event).
+ 
+ If I<--live> is specified, affect a running domain.
+ If I<--config> is specified, affect the next startup of a persistent domain.
+-- 
+2.21.0
+
diff --git a/SOURCES/libvirt-virsh-man-Document-quirks-of-device-detach-and-friends.patch b/SOURCES/libvirt-virsh-man-Document-quirks-of-device-detach-and-friends.patch
new file mode 100644
index 0000000..c6fa2a0
--- /dev/null
+++ b/SOURCES/libvirt-virsh-man-Document-quirks-of-device-detach-and-friends.patch
@@ -0,0 +1,62 @@
+From 88a1a0d9cde76b79a59e6177a1dcdf036ec4cea0 Mon Sep 17 00:00:00 2001
+Message-Id: <88a1a0d9cde76b79a59e6177a1dcdf036ec4cea0@dist-git>
+From: Peter Krempa <pkrempa@redhat.com>
+Date: Wed, 3 Apr 2019 16:35:44 +0200
+Subject: [PATCH] virsh: man: Document quirks of device-detach and friends
+
+Mention that successful return does not equal to device being detached
+similarly as we do at the API level.
+
+Signed-off-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Erik Skultety <eskultet@redhat.com>
+(cherry picked from commit e95a66349a751694cf173efa1581712b6fb99851)
+
+https: //bugzilla.redhat.com/show_bug.cgi?id=1688961
+Message-Id: <7d04a65a6b2dbb7f4ca69d128838437b3e05c5b7.1554302031.git.pkrempa@redhat.com>
+Reviewed-by: Andrea Bolognani <abologna@redhat.com>
+---
+ tools/virsh.pod | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/tools/virsh.pod b/tools/virsh.pod
+index 00cbee19b6..5321f6806a 100644
+--- a/tools/virsh.pod
++++ b/tools/virsh.pod
+@@ -3188,6 +3188,16 @@ or attempting to detach a device that is not present in the domain XML,
+ but shares some specific attributes with one that is present,
+ may lead to unexpected results.
+ 
++B<Quirk>: Device unplug is asynchronous in most cases and requires guest
++cooperation. This means that it's up to the discretion of the guest to disallow
++or delay the unplug arbitrarily. As the libvirt API used in this command was
++designed as synchronous it returns success after some timeout even if the device
++was not unplugged yet to allow further interactions with the domain e.g. if the
++guest is unresponsive. Callers which need to make sure that the
++device was unplugged can use libvirt events (see virsh event) to be notified
++when the device is removed. Note that the event may arrive before the command
++returns.
++
+ If I<--live> is specified, affect a running domain.
+ If I<--config> is specified, affect the next startup of a persistent domain.
+ If I<--current> is specified, affect the current domain state.
+@@ -3235,6 +3245,8 @@ I<--persistent>.
+ If B<--print-xml> is specified, then the XML which would be used to detach the
+ disk is printed instead.
+ 
++Please see documentation for B<detach-device> for known quirks.
++
+ =item B<detach-interface> I<domain> I<type> [I<--mac mac>]
+ [[[I<--live>] [I<--config>] | [I<--current>]] | [I<--persistent>]]
+ 
+@@ -3257,6 +3269,8 @@ an offline domain, and like I<--live> I<--config> for a running domain.
+ Note that older versions of virsh used I<--config> as an alias for
+ I<--persistent>.
+ 
++Please see documentation for B<detach-device> for known quirks.
++
+ =item B<update-device> I<domain> I<file> [I<--force>]
+ [[[I<--live>] [I<--config>] | [I<--current>]] | [I<--persistent>]]
+ 
+-- 
+2.21.0
+
diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec
index 6bbbf4f..f4b1c12 100644
--- a/SPECS/libvirt.spec
+++ b/SPECS/libvirt.spec
@@ -253,7 +253,7 @@
 Summary: Library providing a simple virtualization API
 Name: libvirt
 Version: 4.5.0
-Release: 10%{?dist}.12%{?extra_release}
+Release: 23%{?dist}%{?extra_release}
 License: LGPLv2+
 URL: https://libvirt.org/
 
@@ -411,19 +411,174 @@ Patch145: libvirt-util-Modify-virStorageFileGetSCSIKey-return.patch
 Patch146: libvirt-storage-Rework-virStorageBackendSCSISerial.patch
 Patch147: libvirt-util-Introduce-virStorageFileGetNPIVKey.patch
 Patch148: libvirt-storage-Fetch-a-unique-key-for-vHBA-NPIV-LUNs.patch
-Patch149: libvirt-cpu_x86-Do-not-cache-microcode-version.patch
-Patch150: libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E3-1225-v5.patch
-Patch151: libvirt-cpu_map-Define-md-clear-CPUID-bit.patch
-Patch152: libvirt-qemu-Don-t-cache-microcode-version.patch
-Patch153: libvirt-virnwfilterbindingobj-Introduce-and-use-virNWFilterBindingObjStealDef.patch
-Patch154: libvirt-admin-reject-clients-unless-their-UID-matches-the-current-UID.patch
-Patch155: libvirt-locking-restrict-sockets-to-mode-0600.patch
-Patch156: libvirt-logging-restrict-sockets-to-mode-0600.patch
-Patch157: libvirt-virfile-added-GPFS-as-shared-fs.patch
-Patch158: libvirt-api-disallow-virDomainSaveImageGetXMLDesc-on-read-only-connections.patch
-Patch159: libvirt-api-disallow-virDomainManagedSaveDefineXML-on-read-only-connections.patch
-Patch160: libvirt-api-disallow-virConnectGetDomainCapabilities-on-read-only-connections.patch
-Patch161: libvirt-api-disallow-virConnect-HypervisorCPU-on-read-only-connections.patch
+Patch149: libvirt-RHEL-qemu-Alter-val-usage-in-qemuSetUnprivSGIO.patch
+Patch150: libvirt-RHEL-qemu-Alter-qemuSetUnprivSGIO-hostdev-shareable-logic.patch
+Patch151: libvirt-qemu-Filter-non-SCSI-hostdevs-in-qemuHostdevPrepareSCSIDevices.patch
+Patch152: libvirt-qemu-Fix-logic-error-in-qemuSetUnprivSGIO.patch
+Patch153: libvirt-qemu-Fix-crash-trying-to-use-iSCSI-hostdev.patch
+Patch154: libvirt-src-Document-autostart-for-session-demon.patch
+Patch155: libvirt-nwfilter-Add-extra-verbiage-for-binding-create-delete.patch
+Patch156: libvirt-qemu-Remove-duplicated-qemuAgentCheckError.patch
+Patch157: libvirt-qemu-require-reply-from-guest-agent-in-qemuAgentGetInterfaces.patch
+Patch158: libvirt-virsh-Add-missed-fields-to-pool-define-as-item-entry.patch
+Patch159: libvirt-qemu-Add-entry-for-balloon-stat-stat-disk-caches.patch
+Patch160: libvirt-qemu-Set-identity-for-the-reconnect-all-thread.patch
+Patch161: libvirt-docs-schemas-Fix-missing-timestamp-inside-backingStore.patch
+Patch162: libvirt-storage-Remove-secretPath-from-_virStorageBackendQemuImgInfo.patch
+Patch163: libvirt-storage-Allow-for-inputvol-to-have-any-format-for-encryption.patch
+Patch164: libvirt-storage-Allow-inputvol-to-be-encrypted.patch
+Patch165: libvirt-virsh-man-Document-quirks-of-device-detach-and-friends.patch
+Patch166: libvirt-virsh-man-Document-asynchronous-behaviour-of-detach-device-alias.patch
+Patch167: libvirt-access-Modify-the-VIR_ERR_ACCESS_DENIED-to-include-driverName.patch
+Patch168: libvirt-qemu-Put-format-raw-onto-cmd-line-for-SCSI-passthrough.patch
+Patch169: libvirt-virnwfilterbindingobj-Introduce-and-use-virNWFilterBindingObjStealDef.patch
+Patch170: libvirt-logging-ensure-pending-I-O-is-drained-before-reading-position.patch
+Patch171: libvirt-conf-Fix-check-for-chardev-source-path.patch
+Patch172: libvirt-util-skip-RDMA-detection-for-non-PCI-network-devices.patch
+Patch173: libvirt-qemu-Set-job-statsType-for-external-memory-snapshot.patch
+Patch174: libvirt-virsh-Strip-XML-declaration-when-extracting-CPU-XMLs.patch
+Patch175: libvirt-virsh-Require-explicit-domain-for-domxml-to-native.patch
+Patch176: libvirt-storage-Extract-out-mount-command-creation-for-FS-Backend.patch
+Patch177: libvirt-storage-Move-FS-backend-mount-creation-command-helper.patch
+Patch178: libvirt-storage-Move-virStorageBackendFileSystemGetPoolSource.patch
+Patch179: libvirt-tests-Introduce-tests-for-storage-pool-xml-to-argv-checks.patch
+Patch180: libvirt-tests-Add-storagepool-xml-test-for-netfs-auto.patch
+Patch181: libvirt-storage-Rework-virStorageBackendFileSystemMountCmd.patch
+Patch182: libvirt-storage-Add-default-mount-options-for-fs-netfs-storage-pools.patch
+Patch183: libvirt-conf-Add-optional-NFS-Source-Pool-protocol-ver-n-option.patch
+Patch184: libvirt-storage-Add-the-nfsvers-to-the-command-line.patch
+Patch185: libvirt-virsh-Add-source-protocol-ver-for-pool-commands.patch
+Patch186: libvirt-RHEL-conf-storage-Fix-a-memory-leak-in-virStoragePoolDefParseSource.patch
+Patch187: libvirt-tests-Reuse-qemucapabilities-data-for-qemucaps2xml.patch
+Patch188: libvirt-tests-Add-more-tests-to-qemucaps2xml.patch
+Patch189: libvirt-qemu-Drop-QEMU_CAPS_ENABLE_KVM.patch
+Patch190: libvirt-qemu-Avoid-probing-non-native-binaries-all-the-time.patch
+Patch191: libvirt-qemu-Clarify-QEMU_CAPS_KVM.patch
+Patch192: libvirt-qemu-Don-t-check-for-dev-kvm-presence.patch
+Patch193: libvirt-tests-Follow-up-on-qemucaps2xmldata-rename.patch
+Patch194: libvirt-qemu-hotplug-Don-t-generate-alias-when-detaching-disk.patch
+Patch195: libvirt-qemu-hotplug-Don-t-generate-alias-when-detaching-controllers.patch
+Patch196: libvirt-tests-add-channel-unix-guestfwd.patch
+Patch197: libvirt-qemu-Use-tmpChr-in-qemuDomainDetachChrDevice-to-build-device-string.patch
+Patch198: libvirt-qemuL-Drop-user-prefix-for-guestfwd-netdev.patch
+Patch199: libvirt-qemu_hotplug-Attach-guestfwd-using-netdev_add.patch
+Patch200: libvirt-qemu_hotplug-Detach-guestfwd-using-netdev_del.patch
+Patch201: libvirt-qemuhotplugtest-Test-guestfwd-attach-and-detach.patch
+Patch202: libvirt-qemu_hotplug-Don-t-build-device-string-in-qemuDomainDetachChrDevice.patch
+Patch203: libvirt-qemu_hotplug-Assume-chardev-alias-always-exists-in-qemuDomainDetachChrDevice.patch
+Patch204: libvirt-qemu-fix-device-name-passed-to-error-report.patch
+Patch205: libvirt-qemu_hotplug-Properly-check-for-qemuMonitorDelDevice-retval.patch
+Patch206: libvirt-qemu_hotplug-Introduce-and-use-qemuDomainDeleteDevice.patch
+Patch207: libvirt-qemu-hotplug-Remove-ret-variable-in-qemuDomainDetachDeviceDiskLive.patch
+Patch208: libvirt-qemu-hotplug-Use-typecasted-enum-in-qemuDomainDetachDeviceDiskLive.patch
+Patch209: libvirt-qemu-hotplug-Use-switch-statement-for-selecting-disk-bus-function.patch
+Patch210: libvirt-qemu-hotplug-Merge-virtio-and-non-virtio-disk-unplug-code.patch
+Patch211: libvirt-qemu_hotplug-remove-unnecessary-check-for-valid-PCI-address.patch
+Patch212: libvirt-qemu_hotplug-rename-a-virDomainDeviceInfoPtr-to-avoid-confusion.patch
+Patch213: libvirt-qemu_hotplug-eliminate-multiple-identical-qemuDomainDetachHost-Device-functions.patch
+Patch214: libvirt-qemu_hotplug-eliminate-unnecessary-call-to-qemuDomainDetachNetDevice.patch
+Patch215: libvirt-qemu_hotplug-refactor-qemuDomainDetachDiskLive-and-qemuDomainDetachDiskDevice.patch
+Patch216: libvirt-qemu_hotplug-don-t-call-DetachThisHostDevice-for-hostdev-network-devices.patch
+Patch217: libvirt-qemu_hotplug-merge-qemuDomainDetachThisHostDevice-into-qemuDomainDetachHostDevice.patch
+Patch218: libvirt-qemu_hotplug-move-qemuDomainChangeGraphicsPasswords.patch
+Patch219: libvirt-qemu_hotplug-move-almost-all-qemuDomainDetach-functions-together.patch
+Patch220: libvirt-qemu_hotplug-move-Attach-Detach-Lease-functions-with-others-of-same-type.patch
+Patch221: libvirt-qemu_hotplug-move-qemuDomainDetachDeviceLive-to-qemu_hotplug.c.patch
+Patch222: libvirt-qemu_hotplug-remove-extra-function-in-middle-of-DetachController-call-chain.patch
+Patch223: libvirt-qemu_hotplug-pull-qemuDomainUpdateDeviceList-out-of-qemuDomainDetachDeviceLive.patch
+Patch224: libvirt-test-replace-calls-to-individual-detach-functions-with-one-call-to-main-detach.patch
+Patch225: libvirt-qemu_hotplug-make-Detach-functions-called-only-from-qemu_hotplug.c-static.patch
+Patch226: libvirt-qemu_hotplug-rename-dev-to-match-in-qemuDomainDetachDeviceLive.patch
+Patch227: libvirt-qemu_hotplug-separate-Chr-Lease-from-other-devices-in-DetachDevice-switch.patch
+Patch228: libvirt-qemu_hotplug-standardize-the-names-args-calling-of-qemuDomainDetach.patch
+Patch229: libvirt-qemu_hotplug-rename-Chr-and-Lease-Detach-functions.patch
+Patch230: libvirt-qemu_hotplug-new-function-qemuDomainRemoveAuditDevice.patch
+Patch231: libvirt-qemu_hotplug-audit-all-auditable-device-types-in-qemuDomainRemoveAuditDevice.patch
+Patch232: libvirt-qemu_hotplug-consolidate-all-common-detach-code-in-qemuDomainDetachDeviceLive.patch
+Patch233: libvirt-qemu_hotplug-don-t-shutdown-net-device-until-the-guest-has-released-it.patch
+Patch234: libvirt-qemu_hotplug-delay-sending-DEVICE_REMOVED-event-until-after-all-teardown.patch
+Patch235: libvirt-conf-Expose-virDomainSCSIDriveAddressIsUsed.patch
+Patch236: libvirt-qemuhotplugtest-Don-t-plug-a-SCSI-disk-at-unit-7.patch
+Patch237: libvirt-qemu_hotplug-Check-for-duplicate-drive-addresses.patch
+Patch238: libvirt-qemu-Rework-setting-process-affinity.patch
+Patch239: libvirt-qemu-Set-up-EMULATOR-thread-and-cpuset.mems-before-exec-ing-qemu.patch
+Patch240: libvirt-cpu_map-Add-features-for-Icelake-CPUs.patch
+Patch241: libvirt-cpu_map-Add-Icelake-CPU-models.patch
+Patch242: libvirt-cpu_x86-Do-not-cache-microcode-version.patch
+Patch243: libvirt-qemu-Don-t-cache-microcode-version.patch
+Patch244: libvirt-util-Rename-some-functions-of-virresctrl.patch
+Patch245: libvirt-util-Refactor-virResctrlGetInfo-in-virresctrl.patch
+Patch246: libvirt-util-Refactor-virResctrlAllocFormat-of-virresctrl.patch
+Patch247: libvirt-util-Add-MBA-capability-information-query-to-resctrl.patch
+Patch248: libvirt-util-Add-MBA-check-to-virResctrlInfoGetCache.patch
+Patch249: libvirt-util-Add-MBA-allocation-to-virresctrl.patch
+Patch250: libvirt-util-Add-MBA-schemata-parse-and-format-methods.patch
+Patch251: libvirt-util-Add-support-to-calculate-MBA-utilization.patch
+Patch252: libvirt-util-Introduce-virResctrlAllocForeachMemory.patch
+Patch253: libvirt-util-Introduce-virResctrlAllocSetMemoryBandwidth.patch
+Patch254: libvirt-conf-Rename-cachetune-to-resctrl.patch
+Patch255: libvirt-conf-Factor-out-vcpus-parsing-part-from-virDomainCachetuneDefParse.patch
+Patch256: libvirt-conf-Factor-out-vcpus-overlapping-from-virDomainCachetuneDefParse.patch
+Patch257: libvirt-conf-Factor-out-virDomainResctrlDef-update-from-virDomainCachetuneDefParse.patch
+Patch258: libvirt-conf-Add-support-for-memorytune-XML-processing-for-resctrl-MBA.patch
+Patch259: libvirt-conf-Add-return-value-check-to-virResctrlAllocForeachCache.patch
+Patch260: libvirt-conf-Add-memory-bandwidth-allocation-capability-of-host.patch
+Patch261: libvirt-conf-Fix-bug-in-finding-alloc-through-matching-vcpus.patch
+Patch262: libvirt-resctrl-Do-not-calculate-free-bandwidth-for-MBA.patch
+Patch263: libvirt-resctrl-Set-MBA-defaults-properly.patch
+Patch264: libvirt-resctrl-Fix-testing-line.patch
+Patch265: libvirt-virresctrl-fix-MBA-memory-leak.patch
+Patch266: libvirt-test-caps-Add-capabilities-for-QEMU-3.1.0.patch
+Patch267: libvirt-util-Introduce-virHostGetDRMRenderNode-helper.patch
+Patch268: libvirt-conf-Introduce-virDomainGraphics-related-helpers.patch
+Patch269: libvirt-qemu-process-spice-Pick-the-first-available-DRM-render-node.patch
+Patch270: libvirt-qemu-command-Introduce-qemuBuildGraphicsEGLHeadlessCommandLine-helper.patch
+Patch271: libvirt-qemu-caps-Introduce-QEMU_EGL_HEADLESS_RENDERNODE-capability.patch
+Patch272: libvirt-conf-gfx-Add-egl-headless-as-a-member-to-virDomainGraphicsDef-struct.patch
+Patch273: libvirt-conf-gfx-egl-headless-Introduce-a-new-gl-subelement.patch
+Patch274: libvirt-qemu-domain-egl-headless-Add-the-DRI-device-into-the-namespace.patch
+Patch275: libvirt-qemu-cgroup-gfx-egl-headless-Add-the-DRI-device-into-the-cgroup-list.patch
+Patch276: libvirt-security-dac-gfx-egl-headless-Relabel-the-DRI-device.patch
+Patch277: libvirt-qemu-command-gfx-egl-headless-Add-rendernode-option-to-the-cmdline.patch
+Patch278: libvirt-domain-conf-graphics-Fix-picking-DRI-renderer-automatically-for-SPICE.patch
+Patch279: libvirt-qemu-domain-gfx-Fix-shadowing-of-a-function-argument-in-validation.patch
+Patch280: libvirt-qemu_hotplug-Initialize-charAlias-in-qemuDomainRemoveChrDevice.patch
+Patch281: libvirt-Handle-copying-bitmaps-to-larger-data-buffers.patch
+Patch282: libvirt-nwfilter-fix-adding-std-MAC-and-IP-values-to-filter-binding.patch
+Patch283: libvirt-util-suppress-unimportant-ovs-vsctl-errors-when-getting-interface-stats.patch
+Patch284: libvirt-cpu_map-Add-support-for-cldemote-CPU-feature.patch
+Patch285: libvirt-cputest-Add-data-for-Intel-R-Xeon-R-CPU-E3-1225-v5.patch
+Patch286: libvirt-cpu_map-Define-md-clear-CPUID-bit.patch
+Patch287: libvirt-admin-reject-clients-unless-their-UID-matches-the-current-UID.patch
+Patch288: libvirt-locking-restrict-sockets-to-mode-0600.patch
+Patch289: libvirt-logging-restrict-sockets-to-mode-0600.patch
+Patch290: libvirt-util-require-command-args-to-be-non-NULL.patch
+Patch291: libvirt-qemu-use-line-breaks-in-command-line-args-written-to-log.patch
+Patch292: libvirt-virfile-added-GPFS-as-shared-fs.patch
+Patch293: libvirt-util-file-introduce-VIR_AUTOCLOSE-macro-to-close-fd-of-the-file-automatically.patch
+Patch294: libvirt-vircpuhost-Add-support-for-reading-MSRs.patch
+Patch295: libvirt-virhostcpu-Make-virHostCPUGetMSR-work-only-on-x86.patch
+Patch296: libvirt-qemu-Make-virQEMUCapsProbeHostCPUForEmulator-more-generic.patch
+Patch297: libvirt-qemuargv2xmltest-Use-mocked-virQEMUCapsProbeHostCPU.patch
+Patch298: libvirt-util-Add-virHostCPUGetTscInfo.patch
+Patch299: libvirt-conf-Report-TSC-frequency-in-host-CPU-capabilities.patch
+Patch300: libvirt-cpu_x86-Fix-placement-of-CheckFeature-functions.patch
+Patch301: libvirt-cpu_x86-Probe-TSC-frequency-and-scaling-support.patch
+Patch302: libvirt-qemu-Check-TSC-frequency-before-starting-QEMU.patch
+Patch303: libvirt-util-Propagate-numad-failures-correctly.patch
+Patch304: libvirt-util-alloc-add-macros-for-implementing-automatic-cleanup-functionality.patch
+Patch305: libvirt-util-bitmap-define-cleanup-function-using-VIR_DEFINE_AUTOPTR_FUNC.patch
+Patch306: libvirt-util-Introduce-virBitmapUnion.patch
+Patch307: libvirt-util-Introduce-virNumaNodesetToCPUset.patch
+Patch308: libvirt-qemu-Fix-qemuProcessInitCpuAffinity.patch
+Patch309: libvirt-qemu-Fix-leak-in-qemuProcessInitCpuAffinity.patch
+Patch310: libvirt-cpu_conf-Fix-XPath-for-parsing-TSC-frequency.patch
+Patch311: libvirt-qemu-Drop-cleanup-label-from-qemuProcessInitCpuAffinity.patch
+Patch312: libvirt-qemu-Fix-NULL-pointer-access-in-qemuProcessInitCpuAffinity.patch
+Patch313: libvirt-api-disallow-virDomainSaveImageGetXMLDesc-on-read-only-connections.patch
+Patch314: libvirt-api-disallow-virDomainManagedSaveDefineXML-on-read-only-connections.patch
+Patch315: libvirt-api-disallow-virConnectGetDomainCapabilities-on-read-only-connections.patch
+Patch316: libvirt-api-disallow-virConnect-HypervisorCPU-on-read-only-connections.patch
 
 Requires: libvirt-daemon = %{version}-%{release}
 Requires: libvirt-daemon-config-network = %{version}-%{release}
@@ -2325,88 +2480,245 @@ exit 0
 
 
 %changelog
-* Tue Jun 18 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.12
+* Thu Jun 20 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-23
 - api: disallow virDomainSaveImageGetXMLDesc on read-only connections (CVE-2019-10161)
 - api: disallow virDomainManagedSaveDefineXML on read-only connections (CVE-2019-10166)
 - api: disallow virConnectGetDomainCapabilities on read-only connections (CVE-2019-10167)
 - api: disallow virConnect*HypervisorCPU on read-only connections (CVE-2019-10168)
 
-* Wed Jun  5 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.11
-- virfile: added GPFS as shared fs (rhbz#1715867)
-
-* Thu May 16 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.10
-- virnwfilterbindingobj: Introduce and use virNWFilterBindingObjStealDef (rhbz#1702173)
+* Wed Jun 12 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-22
+- qemu: Drop cleanup label from qemuProcessInitCpuAffinity() (rhbz#1718172)
+- qemu: Fix NULL pointer access in qemuProcessInitCpuAffinity() (rhbz#1718172)
+
+* Thu Jun  6 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-21
+- cpu_conf: Fix XPath for parsing TSC frequency (rhbz#1641702)
+
+* Tue Jun  4 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-20
+- util: alloc: add macros for implementing automatic cleanup functionality (rhbz#1703661)
+- util: bitmap: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC (rhbz#1703661)
+- util: Introduce virBitmapUnion() (rhbz#1703661)
+- util: Introduce virNumaNodesetToCPUset() (rhbz#1703661)
+- qemu: Fix qemuProcessInitCpuAffinity() (rhbz#1703661)
+- qemu: Fix leak in qemuProcessInitCpuAffinity() (rhbz#1703661)
+
+* Tue Jun  4 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-19
+- virfile: added GPFS as shared fs (rhbz#1710728)
+- util: file: introduce VIR_AUTOCLOSE macro to close fd of the file automatically (rhbz#1641702)
+- vircpuhost: Add support for reading MSRs (rhbz#1641702)
+- virhostcpu: Make virHostCPUGetMSR() work only on x86 (rhbz#1641702)
+- qemu: Make virQEMUCapsProbeHostCPUForEmulator more generic (rhbz#1641702)
+- qemuargv2xmltest: Use mocked virQEMUCapsProbeHostCPU (rhbz#1641702)
+- util: Add virHostCPUGetTscInfo (rhbz#1641702)
+- conf: Report TSC frequency in host CPU capabilities (rhbz#1641702)
+- cpu_x86: Fix placement of *CheckFeature functions (rhbz#1641702)
+- cpu_x86: Probe TSC frequency and scaling support (rhbz#1641702)
+- qemu: Check TSC frequency before starting QEMU (rhbz#1641702)
+- util: Propagate numad failures correctly (rhbz#1716387)
+
+* Tue May 21 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-18
 - admin: reject clients unless their UID matches the current UID (CVE-2019-10132)
 - locking: restrict sockets to mode 0600 (CVE-2019-10132)
 - logging: restrict sockets to mode 0600 (CVE-2019-10132)
-
-* Tue Apr 16 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.9
-- qemu: Don't cache microcode version (CVE-2018-12127, CVE-2018-12126, CVE-2018-12130)
-
-* Wed Apr 10 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.8
-- cpu_x86: Do not cache microcode version (CVE-2018-12126, CVE-2018-12127, CVE-2018-12130)
-- cputest: Add data for Intel(R) Xeon(R) CPU E3-1225 v5 (CVE-2018-12126, CVE-2018-12127, CVE-2018-12130)
-- cpu_map: Define md-clear CPUID bit (CVE-2018-12126, CVE-2018-12127, CVE-2018-12130)
-
-* Tue Mar 26 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.7
-- cputest: Add data for Intel(R) Xeon(R) CPU E5-2630 v4 (rhbz#1687515)
-- cputest: Add data for Intel(R) Core(TM) i7-7600U (rhbz#1687515)
-- cputest: Add data for Intel(R) Xeon(R) CPU E7540 (rhbz#1687515)
-- cputest: Add data for Intel(R) Xeon(R) CPU E5-2650 (rhbz#1687515)
-- cputest: Add data for Intel(R) Core(TM) i7-8700 (rhbz#1687515)
-- cpu_x86: Separate signature parsing from x86ModelParse (rhbz#1687515)
-- cpu_x86: Add x86ModelCopySignatures helper (rhbz#1687515)
-- cpu_x86: Store CPU signature in an array (rhbz#1687515)
-- cpu_x86: Allow multiple signatures for a CPU model (rhbz#1687515)
-- cpu_map: Add hex representation of signatures (rhbz#1687515)
-- cpu_map: Add more signatures for Conroe CPU model (rhbz#1687515)
-- cpu_map: Add more signatures for Penryn CPU model (rhbz#1687515)
-- cpu_map: Add more signatures for Nehalem CPU models (rhbz#1687515)
-- cpu_map: Add more signatures for Westmere CPU model (rhbz#1687515)
-- cpu_map: Add more signatures for SandyBridge CPU models (rhbz#1687515)
-- cpu_map: Add more signatures for IvyBridge CPU models (rhbz#1687515)
-- cpu_map: Add more signatures for Haswell CPU models (rhbz#1687515)
-- cpu_map: Add more signatures for Broadwell CPU models (rhbz#1687515)
-- cpu_map: Add more signatures for Skylake-Client CPU models (rhbz#1687515)
-- cpu: Don't access invalid memory in virCPUx86Translate (rhbz#1687515)
-- cpu_x86: Log decoded CPU model and signatures (rhbz#1687515)
-- util: Modify virStorageFileGetSCSIKey return (rhbz#1687715)
-- storage: Rework virStorageBackendSCSISerial (rhbz#1687715)
-- util: Introduce virStorageFileGetNPIVKey (rhbz#1687715)
-- storage: Fetch a unique key for vHBA/NPIV LUNs (rhbz#1687715)
-
-* Thu Feb 21 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.6
-- RHEL: spec: Require new enough librbd1 (rhbz#1679569)
-
-* Wed Feb 20 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.5
-- virfile: Detect ceph as shared FS (rhbz#1672178)
-- util: Don't overflow in virRandomBits (rhbz#1667329)
-- virrandom: Avoid undefined behaviour in virRandomBits (rhbz#1667329)
-
-* Thu Jan 10 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.4
-- qemu: Fix post-copy migration on the source (rhbz#1654732)
-- RHEL: cpu_map: Mark arch-facilities feature as non-migratable (rhbz#1664793)
-
-* Thu Nov  8 2018 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.3
-- virfile: Take symlink into account in virFileIsSharedFixFUSE (rhbz#1641798)
-- qemu: Properly report VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT (rhbz#1634759)
-- qemu: Report more appropriate running reasons (rhbz#1634759)
-- qemu: Pass running reason to RESUME event handler (rhbz#1634759)
-- qemu: Map running reason to resume event detail (rhbz#1634759)
-- qemu: Avoid duplicate resume events and state changes (rhbz#1634759)
-- qemu: Don't ignore resume events (rhbz#1634759)
-
-* Wed Oct 10 2018 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.2
-- virfile: fix cast-align error (rhbz#1635705)
-- virfiletest: Fix test name prefix for virFileInData test (rhbz#1635705)
-- virfiletst: Test virFileIsSharedFS (rhbz#1635705)
-- virFileIsSharedFSType: Detect direct mount points (rhbz#1635705)
-- virfile: Rework virFileIsSharedFixFUSE (rhbz#1635705)
-
-* Mon Oct  8 2018 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10.el7_6.1
-- security: dac: also label listen UNIX sockets (rhbz#1635228)
-- qemu: fix up permissions for pre-created UNIX sockets (rhbz#1635228)
-- virFileIsSharedFSType: Check for fuse.glusterfs too (rhbz#1635705)
+- util: require command args to be non-NULL (rhbz#1672957)
+- qemu: use line breaks in command line args written to log (rhbz#1672957)
+
+* Tue May 14 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-17
+- cpu_map: Add support for cldemote CPU feature (rhbz#1537777)
+- cputest: Add data for Intel(R) Xeon(R) CPU E3-1225 v5 (CVE-2018-12126, CVE-2018-12127, CVE-2019-11091, CVE-2018-12130)
+- cpu_map: Define md-clear CPUID bit (CVE-2018-12126, CVE-2018-12127, CVE-2019-11091, CVE-2018-12130)
+
+* Fri May  3 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-16
+- Handle copying bitmaps to larger data buffers (rhbz#1703159)
+- nwfilter: fix adding std MAC and IP values to filter binding (rhbz#1691358)
+- util: suppress unimportant ovs-vsctl errors when getting interface stats (rhbz#1683175)
+
+* Thu Apr 25 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-15
+- qemu_hotplug: Initialize @charAlias in qemuDomainRemoveChrDevice (rhbz#1658198)
+
+* Tue Apr 23 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-14
+- cpu_map: Add features for Icelake CPUs (rhbz#1527659, rhbz#1526624)
+- cpu_map: Add Icelake CPU models (rhbz#1526624)
+- cpu_x86: Do not cache microcode version (rhbz#1576369)
+- qemu: Don't cache microcode version (rhbz#1576369)
+- util: Rename some functions of virresctrl (rhbz#1468650)
+- util: Refactor virResctrlGetInfo in virresctrl (rhbz#1468650)
+- util: Refactor virResctrlAllocFormat of virresctrl (rhbz#1468650)
+- util: Add MBA capability information query to resctrl (rhbz#1468650)
+- util: Add MBA check to virResctrlInfoGetCache (rhbz#1468650)
+- util: Add MBA allocation to virresctrl (rhbz#1468650)
+- util: Add MBA schemata parse and format methods (rhbz#1468650)
+- util: Add support to calculate MBA utilization (rhbz#1468650)
+- util: Introduce virResctrlAllocForeachMemory (rhbz#1468650)
+- util: Introduce virResctrlAllocSetMemoryBandwidth (rhbz#1468650)
+- conf: Rename cachetune to resctrl (rhbz#1468650)
+- conf: Factor out vcpus parsing part from virDomainCachetuneDefParse (rhbz#1468650)
+- conf: Factor out vcpus overlapping from virDomainCachetuneDefParse (rhbz#1468650)
+- conf: Factor out virDomainResctrlDef update from virDomainCachetuneDefParse (rhbz#1468650)
+- conf: Add support for memorytune XML processing for resctrl MBA (rhbz#1468650)
+- conf: Add return value check to virResctrlAllocForeachCache (rhbz#1468650)
+- conf: Add memory bandwidth allocation capability of host (rhbz#1468650)
+- conf: Fix bug in finding alloc through matching vcpus (rhbz#1468650)
+- resctrl: Do not calculate free bandwidth for MBA (rhbz#1468650)
+- resctrl: Set MBA defaults properly (rhbz#1468650)
+- resctrl: Fix testing line (rhbz#1468650)
+- virresctrl: fix MBA memory leak (rhbz#1468650)
+- test: caps: Add capabilities for QEMU 3.1.0 (rhbz#1628892)
+- util: Introduce virHostGetDRMRenderNode helper (rhbz#1628892)
+- conf: Introduce virDomainGraphics-related helpers (rhbz#1628892)
+- qemu: process: spice: Pick the first available DRM render node (rhbz#1628892)
+- qemu: command: Introduce qemuBuildGraphicsEGLHeadlessCommandLine helper (rhbz#1628892)
+- qemu: caps: Introduce QEMU_EGL_HEADLESS_RENDERNODE capability (rhbz#1628892)
+- conf: gfx: Add egl-headless as a member to virDomainGraphicsDef struct (rhbz#1628892)
+- conf: gfx: egl-headless: Introduce a new <gl> subelement (rhbz#1628892)
+- qemu: domain: egl-headless: Add the DRI device into the namespace (rhbz#1628892)
+- qemu: cgroup: gfx: egl-headless: Add the DRI device into the cgroup list (rhbz#1628892)
+- security: dac: gfx: egl-headless: Relabel the DRI device (rhbz#1628892)
+- qemu: command: gfx: egl-headless: Add 'rendernode' option to the cmdline (rhbz#1628892)
+- domain: conf: graphics: Fix picking DRI renderer automatically for SPICE (rhbz#1628892)
+- qemu: domain: gfx: Fix shadowing of a function argument in validation (rhbz#1628892)
+
+* Tue Apr 23 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-13
+- storage: Extract out mount command creation for FS Backend (rhbz#1584663)
+- storage: Move FS backend mount creation command helper (rhbz#1584663)
+- storage: Move virStorageBackendFileSystemGetPoolSource (rhbz#1584663)
+- tests: Introduce tests for storage pool xml to argv checks (rhbz#1584663)
+- tests: Add storagepool xml test for netfs-auto (rhbz#1584663)
+- storage: Rework virStorageBackendFileSystemMountCmd (rhbz#1584663)
+- storage: Add default mount options for fs/netfs storage pools (rhbz#1584663)
+- conf: Add optional NFS Source Pool <protocol ver='n'/> option (rhbz#1584663)
+- storage: Add the nfsvers to the command line (rhbz#1584663)
+- virsh: Add source-protocol-ver for pool commands (rhbz#1584663)
+- RHEL: conf: storage: Fix a memory leak in virStoragePoolDefParseSource (rhbz#1584663)
+- tests: Reuse qemucapabilities data for qemucaps2xml (rhbz#1628469)
+- tests: Add more tests to qemucaps2xml (rhbz#1628469)
+- qemu: Drop QEMU_CAPS_ENABLE_KVM (rhbz#1628469)
+- qemu: Avoid probing non-native binaries all the time (rhbz#1628469)
+- qemu: Clarify QEMU_CAPS_KVM (rhbz#1628469)
+- qemu: Don't check for /dev/kvm presence (rhbz#1628469)
+- tests: Follow up on qemucaps2xmldata rename (rhbz#1628469)
+- qemu: hotplug: Don't generate alias when detaching disk (rhbz#1658198)
+- qemu: hotplug: Don't generate alias when detaching controllers (rhbz#1658198)
+- tests: add channel-unix-guestfwd (rhbz#1658198)
+- qemu: Use @tmpChr in qemuDomainDetachChrDevice to build device string (rhbz#1658198)
+- qemuL: Drop "user-" prefix for guestfwd netdev (rhbz#1658198)
+- qemu_hotplug: Attach guestfwd using netdev_add (rhbz#1658198)
+- qemu_hotplug: Detach guestfwd using netdev_del (rhbz#1658198)
+- qemuhotplugtest: Test guestfwd attach and detach (rhbz#1658198)
+- qemu_hotplug: Don't build device string in qemuDomainDetachChrDevice (rhbz#1658198)
+- qemu_hotplug: Assume chardev alias always exists in qemuDomainDetachChrDevice (rhbz#1658198)
+- qemu: fix device name passed to error report (rhbz#1658198)
+- qemu_hotplug: Properly check for qemuMonitorDelDevice retval (rhbz#1658198)
+- qemu_hotplug: Introduce and use qemuDomainDeleteDevice (rhbz#1658198)
+- qemu: hotplug: Remove 'ret' variable in qemuDomainDetachDeviceDiskLive (rhbz#1658198)
+- qemu: hotplug: Use typecasted enum in qemuDomainDetachDeviceDiskLive (rhbz#1658198)
+- qemu: hotplug: Use switch statement for selecting disk bus function (rhbz#1658198)
+- qemu: hotplug: Merge virtio and non-virtio disk unplug code (rhbz#1658198)
+- qemu_hotplug: remove unnecessary check for valid PCI address (rhbz#1658198)
+- qemu_hotplug: rename a virDomainDeviceInfoPtr to avoid confusion (rhbz#1658198)
+- qemu_hotplug: eliminate multiple identical qemuDomainDetachHost*Device() functions (rhbz#1658198)
+- qemu_hotplug: eliminate unnecessary call to qemuDomainDetachNetDevice() (rhbz#1658198)
+- qemu_hotplug: refactor qemuDomainDetachDiskLive and qemuDomainDetachDiskDevice (rhbz#1658198)
+- qemu_hotplug: don't call DetachThisHostDevice for hostdev network devices (rhbz#1658198)
+- qemu_hotplug: merge qemuDomainDetachThisHostDevice into qemuDomainDetachHostDevice (rhbz#1658198)
+- qemu_hotplug: move qemuDomainChangeGraphicsPasswords() (rhbz#1658198)
+- qemu_hotplug: move (almost) all qemuDomainDetach*() functions together (rhbz#1658198)
+- qemu_hotplug: move (Attach|Detach)Lease functions with others of same type (rhbz#1658198)
+- qemu_hotplug: move qemuDomainDetachDeviceLive() to qemu_hotplug.c (rhbz#1658198)
+- qemu_hotplug: remove extra function in middle of DetachController call chain (rhbz#1658198)
+- qemu_hotplug: pull qemuDomainUpdateDeviceList out of qemuDomainDetachDeviceLive (rhbz#1658198)
+- test: replace calls to individual detach functions with one call to main detach (rhbz#1658198)
+- qemu_hotplug: make Detach functions called only from qemu_hotplug.c static (rhbz#1658198)
+- qemu_hotplug: rename dev to match in qemuDomainDetachDeviceLive (rhbz#1658198)
+- qemu_hotplug: separate Chr|Lease from other devices in DetachDevice switch (rhbz#1658198)
+- qemu_hotplug: standardize the names/args/calling of qemuDomainDetach*() (rhbz#1658198)
+- qemu_hotplug: rename Chr and Lease Detach functions (rhbz#1658198)
+- qemu_hotplug: new function qemuDomainRemoveAuditDevice() (rhbz#1658198)
+- qemu_hotplug: audit *all* auditable device types in qemuDomainRemoveAuditDevice (rhbz#1658198)
+- qemu_hotplug: consolidate all common detach code in qemuDomainDetachDeviceLive (rhbz#1658198)
+- qemu_hotplug: don't shutdown net device until the guest has released it (rhbz#1658198)
+- qemu_hotplug: delay sending DEVICE_REMOVED event until after *all* teardown (rhbz#1658198)
+- conf: Expose virDomainSCSIDriveAddressIsUsed (rhbz#1692296)
+- qemuhotplugtest: Don't plug a SCSI disk at unit 7 (rhbz#1692296)
+- qemu_hotplug: Check for duplicate drive addresses (rhbz#1692296)
+- qemu: Rework setting process affinity (rhbz#1695434)
+- qemu: Set up EMULATOR thread and cpuset.mems before exec()-ing qemu (rhbz#1695434)
+
+* Thu Apr  4 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-12
+- src: Document autostart for session demon (rhbz#1501450)
+- nwfilter: Add extra verbiage for binding create/delete (rhbz#1609454)
+- qemu: Remove duplicated qemuAgentCheckError (rhbz#1663051, CVE-2019-3840)
+- qemu: require reply from guest agent in qemuAgentGetInterfaces (rhbz#1663051, CVE-2019-3840)
+- virsh: Add missed fields to pool-define-as item entry (rhbz#1615680)
+- qemu: Add entry for balloon stat stat-disk-caches (rhbz#1690122)
+- qemu: Set identity for the reconnect all thread (rhbz#1631622)
+- docs: schemas: Fix missing timestamp inside backingStore (rhbz#1594266)
+- storage: Remove secretPath from _virStorageBackendQemuImgInfo (rhbz#1613737)
+- storage: Allow for inputvol to have any format for encryption (rhbz#1613737)
+- storage: Allow inputvol to be encrypted (rhbz#1613737)
+- virsh: man: Document quirks of device-detach and friends (rhbz#1688961)
+- virsh: man: Document asynchronous behaviour of detach-device-alias (rhbz#1688961)
+- access: Modify the VIR_ERR_ACCESS_DENIED to include driverName (rhbz#1631606)
+- qemu: Put format=raw onto cmd line for SCSI passthrough (rhbz#1632833)
+- virnwfilterbindingobj: Introduce and use virNWFilterBindingObjStealDef (rhbz#1686927)
+- logging: ensure pending I/O is drained before reading position (rhbz#1660531)
+- conf: Fix check for chardev source path (rhbz#1609720)
+- util: skip RDMA detection for non-PCI network devices (rhbz#1639258)
+- qemu: Set job statsType for external memory snapshot (rhbz#1690703)
+- virsh: Strip XML declaration when extracting CPU XMLs (rhbz#1592737)
+- virsh: Require explicit --domain for domxml-to-native (rhbz#1633077)
+
+* Wed Mar 27 2019 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-11
+- security: dac: also label listen UNIX sockets (rhbz#1633389)
+- qemu: fix up permissions for pre-created UNIX sockets (rhbz#1633389)
+- virFileIsSharedFSType: Check for fuse.glusterfs too (rhbz#1632711)
+- virfile: fix cast-align error (rhbz#1632711)
+- virfiletest: Fix test name prefix for virFileInData test (rhbz#1632711)
+- virfiletst: Test virFileIsSharedFS (rhbz#1632711)
+- virFileIsSharedFSType: Detect direct mount points (rhbz#1632711)
+- virfile: Rework virFileIsSharedFixFUSE (rhbz#1632711)
+- virfile: Take symlink into account in virFileIsSharedFixFUSE (rhbz#1640465)
+- qemu: Properly report VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT (rhbz#1612943)
+- qemu: Report more appropriate running reasons (rhbz#1612943)
+- qemu: Pass running reason to RESUME event handler (rhbz#1612943)
+- qemu: Map running reason to resume event detail (rhbz#1612943)
+- qemu: Avoid duplicate resume events and state changes (rhbz#1612943)
+- qemu: Don't ignore resume events (rhbz#1612943)
+- qemu: Fix post-copy migration on the source (rhbz#1647365)
+- RHEL: cpu_map: Mark arch-facilities feature as non-migratable (rhbz#1658406)
+- virfile: Detect ceph as shared FS (rhbz#1665553)
+- util: Don't overflow in virRandomBits (rhbz#1652894)
+- virrandom: Avoid undefined behaviour in virRandomBits (rhbz#1652894)
+- RHEL: spec: Require new enough librbd1 (rhbz#1658652)
+- cputest: Add data for Intel(R) Xeon(R) CPU E5-2630 v4 (rhbz#1558558)
+- cputest: Add data for Intel(R) Core(TM) i7-7600U (rhbz#1558558)
+- cputest: Add data for Intel(R) Xeon(R) CPU E7540 (rhbz#1558558)
+- cputest: Add data for Intel(R) Xeon(R) CPU E5-2650 (rhbz#1558558)
+- cputest: Add data for Intel(R) Core(TM) i7-8700 (rhbz#1558558)
+- cpu_x86: Separate signature parsing from x86ModelParse (rhbz#1558558)
+- cpu_x86: Add x86ModelCopySignatures helper (rhbz#1558558)
+- cpu_x86: Store CPU signature in an array (rhbz#1558558)
+- cpu_x86: Allow multiple signatures for a CPU model (rhbz#1558558)
+- cpu_map: Add hex representation of signatures (rhbz#1558558)
+- cpu_map: Add more signatures for Conroe CPU model (rhbz#1558558)
+- cpu_map: Add more signatures for Penryn CPU model (rhbz#1558558)
+- cpu_map: Add more signatures for Nehalem CPU models (rhbz#1558558)
+- cpu_map: Add more signatures for Westmere CPU model (rhbz#1558558)
+- cpu_map: Add more signatures for SandyBridge CPU models (rhbz#1558558)
+- cpu_map: Add more signatures for IvyBridge CPU models (rhbz#1558558)
+- cpu_map: Add more signatures for Haswell CPU models (rhbz#1558558)
+- cpu_map: Add more signatures for Broadwell CPU models (rhbz#1558558)
+- cpu_map: Add more signatures for Skylake-Client CPU models (rhbz#1558558)
+- cpu: Don't access invalid memory in virCPUx86Translate (rhbz#1558558)
+- cpu_x86: Log decoded CPU model and signatures (rhbz#1558558)
+- util: Modify virStorageFileGetSCSIKey return (rhbz#1657468)
+- storage: Rework virStorageBackendSCSISerial (rhbz#1657468)
+- util: Introduce virStorageFileGetNPIVKey (rhbz#1657468)
+- storage: Fetch a unique key for vHBA/NPIV LUNs (rhbz#1657468)
+- RHEL: qemu: Alter @val usage in qemuSetUnprivSGIO (rhbz#1656360)
+- RHEL: qemu: Alter qemuSetUnprivSGIO hostdev shareable logic (rhbz#1656360)
+- qemu: Filter non SCSI hostdevs in qemuHostdevPrepareSCSIDevices (rhbz#1665474)
+- qemu: Fix logic error in qemuSetUnprivSGIO (rhbz#1669581)
+- qemu: Fix crash trying to use iSCSI hostdev (rhbz#1669586)
 
 * Tue Sep 18 2018 Jiri Denemark <jdenemar@redhat.com> - 4.5.0-10
 - conf: correct false boot order error during domain parse (rhbz#1601318)