From 7a340840837c631259c6a04f7f4b5e05bd0c28a1 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 19 2015 03:39:15 +0000 Subject: import libvirt-1.2.17-13.el7 --- diff --git a/.gitignore b/.gitignore index 2a500a7..22bdbc4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libvirt-1.2.8.tar.gz +SOURCES/libvirt-1.2.17.tar.gz diff --git a/.libvirt.metadata b/.libvirt.metadata index 144a570..7bf5703 100644 --- a/.libvirt.metadata +++ b/.libvirt.metadata @@ -1 +1 @@ -76dd3376abff73d297e183257eef4a71b9e5d5c8 SOURCES/libvirt-1.2.8.tar.gz +504d1393852aaf2acdd75cadf2edf5ecf9845c5a SOURCES/libvirt-1.2.17.tar.gz diff --git a/SOURCES/libvirt-Add-rhel-machine-types-to-qemuDomainMachineNeedsFDC.patch b/SOURCES/libvirt-Add-rhel-machine-types-to-qemuDomainMachineNeedsFDC.patch new file mode 100644 index 0000000..dad40a6 --- /dev/null +++ b/SOURCES/libvirt-Add-rhel-machine-types-to-qemuDomainMachineNeedsFDC.patch @@ -0,0 +1,32 @@ +From 6d44afeba685e5c38fb81d256b0625b758f8f19e Mon Sep 17 00:00:00 2001 +Message-Id: <6d44afeba685e5c38fb81d256b0625b758f8f19e@dist-git> +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Wed, 8 Jul 2015 15:56:48 +0200 +Subject: [PATCH] Add rhel machine types to qemuDomainMachineNeedsFDC + +RHEL-only. + +https://bugzilla.redhat.com/show_bug.cgi?id=1227880 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 6590cf0..e3793bd 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3257,6 +3257,9 @@ qemuDomainMachineNeedsFDC(const virDomainDef *def) + STRPREFIX(p, "2.2") || + STRPREFIX(p, "2.3")) + return false; ++ if (STRPREFIX(p, "rhel-7.0.0") || ++ STRPREFIX(p, "rhel-7.1.0")) ++ return false; + return true; + } + return false; +-- +2.4.5 + diff --git a/SOURCES/libvirt-Add-support-for-fetching-statistics-of-completed-jobs.patch b/SOURCES/libvirt-Add-support-for-fetching-statistics-of-completed-jobs.patch deleted file mode 100644 index 346bc09..0000000 --- a/SOURCES/libvirt-Add-support-for-fetching-statistics-of-completed-jobs.patch +++ /dev/null @@ -1,197 +0,0 @@ -From cad012440efa450ff92d4fdcccb99169f5b2deea Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Thu, 28 Aug 2014 13:52:58 +0200 -Subject: [PATCH] Add support for fetching statistics of completed jobs - -virDomainGetJobStats gains new VIR_DOMAIN_JOB_STATS_COMPLETED flag that -can be used to fetch statistics of a completed job rather than a -currently running job. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 3a8688162e82a4004011f6f49f6a6fb3c2530f5f) - -https://bugzilla.redhat.com/show_bug.cgi?id=1063724 -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 11 +++++++++++ - src/libvirt.c | 8 +++++++- - src/qemu/qemu_domain.c | 1 + - src/qemu/qemu_domain.h | 1 + - src/qemu/qemu_driver.c | 25 +++++++++++++++++++------ - src/qemu/qemu_migration.c | 6 ++++++ - src/qemu/qemu_monitor_json.c | 3 ++- - 7 files changed, 47 insertions(+), 8 deletions(-) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index a64f597..d895560 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -4306,6 +4306,17 @@ struct _virDomainJobInfo { - unsigned long long fileRemaining; - }; - -+/** -+ * virDomainGetJobStatsFlags: -+ * -+ * Flags OR'ed together to provide specific behavior when querying domain -+ * job statistics. -+ */ -+typedef enum { -+ VIR_DOMAIN_JOB_STATS_COMPLETED = 1 << 0, /* return stats of a recently -+ * completed job */ -+} virDomainGetJobStatsFlags; -+ - int virDomainGetJobInfo(virDomainPtr dom, - virDomainJobInfoPtr info); - int virDomainGetJobStats(virDomainPtr domain, -diff --git a/src/libvirt.c b/src/libvirt.c -index 5d8f01c..6fa0a6b 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -17567,7 +17567,7 @@ virDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info) - * @type: where to store the job type (one of virDomainJobType) - * @params: where to store job statistics - * @nparams: number of items in @params -- * @flags: extra flags; not used yet, so callers should always pass 0 -+ * @flags: bitwise-OR of virDomainGetJobStatsFlags - * - * Extract information about progress of a background job on a domain. - * Will return an error if the domain is not active. The function returns -@@ -17577,6 +17577,12 @@ virDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info) - * may receive fields that they do not understand in case they talk to a - * newer server. - * -+ * When @flags contains VIR_DOMAIN_JOB_STATS_COMPLETED, the function will -+ * return statistics about a recently completed job. Specifically, this -+ * flag may be used to query statistics of a completed incoming migration. -+ * Statistics of a completed job are automatically destroyed once read or -+ * when libvirtd is restarted. -+ * - * Returns 0 in case of success and -1 in case of failure. - */ - int -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 8c94e27..78d6e8c 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -199,6 +199,7 @@ static void - qemuDomainObjFreeJob(qemuDomainObjPrivatePtr priv) - { - VIR_FREE(priv->job.current); -+ VIR_FREE(priv->job.completed); - virCondDestroy(&priv->job.cond); - virCondDestroy(&priv->job.asyncCond); - } -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 99c7d6a..2e16cde 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -124,6 +124,7 @@ struct qemuDomainJobObj { - unsigned long long mask; /* Jobs allowed during async job */ - bool dump_memory_only; /* use dump-guest-memory to do dump */ - qemuDomainJobInfoPtr current; /* async job progress data */ -+ qemuDomainJobInfoPtr completed; /* statistics data of a recently completed job */ - bool asyncAbort; /* abort of async job requested */ - }; - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 6640a29..496fab5 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -11659,9 +11659,10 @@ qemuDomainGetJobStats(virDomainPtr dom, - { - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; -+ qemuDomainJobInfoPtr jobInfo; - int ret = -1; - -- virCheckFlags(0, -1); -+ virCheckFlags(VIR_DOMAIN_JOB_STATS_COMPLETED, -1); - - if (!(vm = qemuDomObjFromDomain(dom))) - goto cleanup; -@@ -11671,13 +11672,19 @@ qemuDomainGetJobStats(virDomainPtr dom, - if (virDomainGetJobStatsEnsureACL(dom->conn, vm->def) < 0) - goto cleanup; - -- if (!virDomainObjIsActive(vm)) { -+ if (!(flags & VIR_DOMAIN_JOB_STATS_COMPLETED) && -+ !virDomainObjIsActive(vm)) { - virReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); - goto cleanup; - } - -- if (!priv->job.current) { -+ if (flags & VIR_DOMAIN_JOB_STATS_COMPLETED) -+ jobInfo = priv->job.completed; -+ else -+ jobInfo = priv->job.current; -+ -+ if (!jobInfo) { - *type = VIR_DOMAIN_JOB_NONE; - *params = NULL; - *nparams = 0; -@@ -11690,11 +11697,17 @@ qemuDomainGetJobStats(virDomainPtr dom, - * of incoming migration which we don't currently - * monitor actively in the background thread - */ -- if (qemuDomainJobInfoUpdateTime(priv->job.current) < 0 || -- qemuDomainJobInfoToParams(priv->job.current, -- type, params, nparams) < 0) -+ if ((jobInfo->type == VIR_DOMAIN_JOB_BOUNDED || -+ jobInfo->type == VIR_DOMAIN_JOB_UNBOUNDED) && -+ qemuDomainJobInfoUpdateTime(jobInfo) < 0) - goto cleanup; - -+ if (qemuDomainJobInfoToParams(jobInfo, type, params, nparams) < 0) -+ goto cleanup; -+ -+ if (flags & VIR_DOMAIN_JOB_STATS_COMPLETED) -+ VIR_FREE(priv->job.completed); -+ - ret = 0; - - cleanup: -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 066cc97..ba3ca66 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -1839,6 +1839,9 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, - } - - if (jobInfo->type == VIR_DOMAIN_JOB_COMPLETED) { -+ VIR_FREE(priv->job.completed); -+ if (VIR_ALLOC(priv->job.completed) == 0) -+ *priv->job.completed = *jobInfo; - return 0; - } else if (jobInfo->type == VIR_DOMAIN_JOB_UNBOUNDED) { - /* The migration was aborted by us rather than QEMU itself so let's -@@ -3418,6 +3421,9 @@ qemuMigrationRun(virQEMUDriverPtr driver, - VIR_FORCE_CLOSE(fd); - } - -+ if (priv->job.completed) -+ qemuDomainJobInfoUpdateTime(priv->job.completed); -+ - cookieFlags |= QEMU_MIGRATION_COOKIE_NETWORK; - if (flags & VIR_MIGRATE_PERSIST_DEST) - cookieFlags |= QEMU_MIGRATION_COOKIE_PERSISTENT; -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index cf26069..2ae8ee0 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -2474,7 +2474,8 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply, - if (rc == 0) - status->downtime_set = true; - -- if (status->status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE) { -+ if (status->status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE || -+ status->status == QEMU_MONITOR_MIGRATION_STATUS_COMPLETED) { - virJSONValuePtr ram = virJSONValueObjectGet(ret, "ram"); - if (!ram) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", --- -2.1.0 - diff --git a/SOURCES/libvirt-Allow-vfio-hotplug-of-a-device-to-the-domain-which-owns-the-iommu.patch b/SOURCES/libvirt-Allow-vfio-hotplug-of-a-device-to-the-domain-which-owns-the-iommu.patch new file mode 100644 index 0000000..1b9fc7d --- /dev/null +++ b/SOURCES/libvirt-Allow-vfio-hotplug-of-a-device-to-the-domain-which-owns-the-iommu.patch @@ -0,0 +1,138 @@ +From ceeaf62ea52df6cfacac8c1653ff9f7585ef0392 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Shivaprasad G Bhat +Date: Wed, 2 Sep 2015 15:55:23 -0400 +Subject: [PATCH] Allow vfio hotplug of a device to the domain which owns the + iommu + +The commit 7e72de4 didn't consider the hotplug scenarios. The patch addresses +the hotplug case whereby if atleast one of the pci function is owned by a +guest, the hotplug of other functions/devices in the same iommu group to the +same guest goes through successfully. + +Prerequisite for the fix for: + + https://bugzilla.redhat.com/show_bug.cgi?id=1256486 + +Signed-off-by: Shivaprasad G Bhat +(cherry picked from commit e3810db34f1acb74dfcfd69219930e23a30284f6) +Signed-off-by: Jiri Denemark +--- + src/util/virhostdev.c | 34 +++++++++++++++++++++++++++------- + 1 file changed, 27 insertions(+), 7 deletions(-) + +diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c +index 809caed..529753c 100644 +--- a/src/util/virhostdev.c ++++ b/src/util/virhostdev.c +@@ -54,23 +54,35 @@ static virClassPtr virHostdevManagerClass; + static void virHostdevManagerDispose(void *obj); + static virHostdevManagerPtr virHostdevManagerNew(void); + ++struct virHostdevIsPCINodeDeviceUsedData { ++ virHostdevManagerPtr hostdev_mgr; ++ const char *domainName; ++ const bool usesVfio; ++}; ++ + static int virHostdevIsPCINodeDeviceUsed(virPCIDeviceAddressPtr devAddr, void *opaque) + { + virPCIDevicePtr other; + int ret = -1; + virPCIDevicePtr pci = NULL; +- virHostdevManagerPtr hostdev_mgr = opaque; ++ struct virHostdevIsPCINodeDeviceUsedData *helperData = opaque; + + if (!(pci = virPCIDeviceNew(devAddr->domain, devAddr->bus, + devAddr->slot, devAddr->function))) + goto cleanup; + +- other = virPCIDeviceListFind(hostdev_mgr->activePCIHostdevs, pci); ++ other = virPCIDeviceListFind(helperData->hostdev_mgr->activePCIHostdevs, ++ pci); + if (other) { + const char *other_drvname = NULL; + const char *other_domname = NULL; + virPCIDeviceGetUsedBy(other, &other_drvname, &other_domname); + ++ if (helperData->usesVfio && ++ (other_domname && helperData->domainName) && ++ (STREQ(other_domname, helperData->domainName))) ++ goto iommu_owner; ++ + if (other_drvname && other_domname) + virReportError(VIR_ERR_OPERATION_INVALID, + _("PCI device %s is in use by " +@@ -83,6 +95,7 @@ static int virHostdevIsPCINodeDeviceUsed(virPCIDeviceAddressPtr devAddr, void *o + virPCIDeviceGetName(pci)); + goto cleanup; + } ++ iommu_owner: + ret = 0; + cleanup: + virPCIDeviceFree(pci); +@@ -562,6 +575,9 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr, + for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) { + virPCIDevicePtr dev = virPCIDeviceListGet(pcidevs, i); + bool strict_acs_check = !!(flags & VIR_HOSTDEV_STRICT_ACS_CHECK); ++ bool usesVfio = STREQ(virPCIDeviceGetStubDriver(dev), "vfio-pci"); ++ struct virHostdevIsPCINodeDeviceUsedData data = {hostdev_mgr, dom_name, ++ usesVfio}; + + if (!virPCIDeviceIsAssignable(dev, strict_acs_check)) { + virReportError(VIR_ERR_OPERATION_INVALID, +@@ -579,12 +595,12 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr, + * belonging to same iommu group can't be shared + * across guests. + */ +- if (STREQ(virPCIDeviceGetStubDriver(dev), "vfio-pci")) { ++ if (usesVfio) { + if (virPCIDeviceAddressIOMMUGroupIterate(devAddr, + virHostdevIsPCINodeDeviceUsed, +- hostdev_mgr) < 0) ++ &data) < 0) + goto cleanup; +- } else if (virHostdevIsPCINodeDeviceUsed(devAddr, hostdev_mgr)) { ++ } else if (virHostdevIsPCINodeDeviceUsed(devAddr, &data)) { + goto cleanup; + } + } +@@ -1544,6 +1560,8 @@ virHostdevPCINodeDeviceDetach(virHostdevManagerPtr hostdev_mgr, + virPCIDevicePtr pci) + { + virPCIDeviceAddressPtr devAddr = NULL; ++ struct virHostdevIsPCINodeDeviceUsedData data = { hostdev_mgr, NULL, ++ false }; + int ret = -1; + + virObjectLock(hostdev_mgr->activePCIHostdevs); +@@ -1552,7 +1570,7 @@ virHostdevPCINodeDeviceDetach(virHostdevManagerPtr hostdev_mgr, + if (!(devAddr = virPCIDeviceGetAddress(pci))) + goto out; + +- if (virHostdevIsPCINodeDeviceUsed(devAddr, hostdev_mgr)) ++ if (virHostdevIsPCINodeDeviceUsed(devAddr, &data)) + goto out; + + if (virPCIDeviceDetach(pci, hostdev_mgr->activePCIHostdevs, +@@ -1573,6 +1591,8 @@ virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr, + virPCIDevicePtr pci) + { + virPCIDeviceAddressPtr devAddr = NULL; ++ struct virHostdevIsPCINodeDeviceUsedData data = {hostdev_mgr, NULL, ++ false}; + int ret = -1; + + virObjectLock(hostdev_mgr->activePCIHostdevs); +@@ -1581,7 +1601,7 @@ virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr, + if (!(devAddr = virPCIDeviceGetAddress(pci))) + goto out; + +- if (virHostdevIsPCINodeDeviceUsed(devAddr, hostdev_mgr)) ++ if (virHostdevIsPCINodeDeviceUsed(devAddr, &data)) + goto out; + + virPCIDeviceReattachInit(pci); +-- +2.5.1 + diff --git a/SOURCES/libvirt-Also-filter-out-non-migratable-features-out-of-host-passthrough.patch b/SOURCES/libvirt-Also-filter-out-non-migratable-features-out-of-host-passthrough.patch deleted file mode 100644 index a54fbf8..0000000 --- a/SOURCES/libvirt-Also-filter-out-non-migratable-features-out-of-host-passthrough.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 8340232d7fa0ec885f81de92dfd6e8d542141ce5 Mon Sep 17 00:00:00 2001 -Message-Id: <8340232d7fa0ec885f81de92dfd6e8d542141ce5@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 30 Sep 2014 11:04:27 +0200 -Subject: [PATCH] Also filter out non-migratable features out of - host-passthrough - -Commit de0aeaf filtered them out from the host-model features, -to allow host-model to be migratable by default. - -Even though they are not passed to QEMU for host-passthrough, -(and not enabled by default) filter them out too -so the user does not think the domain has them. - -https://bugzilla.redhat.com/show_bug.cgi?id=1147584 -(cherry picked from commit f53bb1af90737205fdbfd26dc99865c02457d8c9) - -Signed-off-by: Jiri Denemark ---- - src/cpu/cpu_x86.c | 14 ++++++-------- - 1 file changed, 6 insertions(+), 8 deletions(-) - -diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c -index 0df8653..e7a7702 100644 ---- a/src/cpu/cpu_x86.c -+++ b/src/cpu/cpu_x86.c -@@ -2068,7 +2068,8 @@ x86UpdateCustom(virCPUDefPtr guest, - - static int - x86UpdateHostModel(virCPUDefPtr guest, -- const virCPUDef *host) -+ const virCPUDef *host, -+ bool passthrough) - { - virCPUDefPtr oldguest = NULL; - const struct x86_map *map; -@@ -2076,8 +2077,6 @@ x86UpdateHostModel(virCPUDefPtr guest, - size_t i; - int ret = -1; - -- guest->match = VIR_CPU_MATCH_EXACT; -- - if (!(map = virCPUx86GetMap())) - goto cleanup; - -@@ -2100,8 +2099,7 @@ x86UpdateHostModel(virCPUDefPtr guest, - } - } - } -- -- for (i = 0; i < oldguest->nfeatures; i++) { -+ for (i = 0; !passthrough && i < oldguest->nfeatures; i++) { - if (virCPUDefUpdateFeature(guest, - oldguest->features[i].name, - oldguest->features[i].policy) < 0) -@@ -2125,12 +2123,12 @@ x86Update(virCPUDefPtr guest, - return x86UpdateCustom(guest, host); - - case VIR_CPU_MODE_HOST_MODEL: -- return x86UpdateHostModel(guest, host); -+ guest->match = VIR_CPU_MATCH_EXACT; -+ return x86UpdateHostModel(guest, host, false); - - case VIR_CPU_MODE_HOST_PASSTHROUGH: - guest->match = VIR_CPU_MATCH_MINIMUM; -- virCPUDefFreeModel(guest); -- return virCPUDefCopyModel(guest, host, true); -+ return x86UpdateHostModel(guest, host, true); - - case VIR_CPU_MODE_LAST: - break; --- -2.1.2 - diff --git a/SOURCES/libvirt-CVE-2014-3633-qemu-blkiotune-Use-correct-definition-when-looking-up-disk.patch b/SOURCES/libvirt-CVE-2014-3633-qemu-blkiotune-Use-correct-definition-when-looking-up-disk.patch deleted file mode 100644 index 8e0386d..0000000 --- a/SOURCES/libvirt-CVE-2014-3633-qemu-blkiotune-Use-correct-definition-when-looking-up-disk.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 225777a1435ad6cdbbee99270d2b120cdf736bcb Mon Sep 17 00:00:00 2001 -Message-Id: <225777a1435ad6cdbbee99270d2b120cdf736bcb@dist-git> -From: Peter Krempa -Date: Wed, 17 Sep 2014 23:17:23 +0200 -Subject: [PATCH] CVE-2014-3633: qemu: blkiotune: Use correct definition when - looking up disk - -Live definition was used to look up the disk index while persistent one -was indexed leading to a crash in qemuDomainGetBlockIoTune. Use the -correct def and report a nice error. - -Unfortunately it's accessible via read-only connection, though it can -only crash libvirtd in the cases where the guest is hot-plugging disks -without reflecting those changes to the persistent definition. So -avoiding hotplug, or doing hotplug where persistent is always modified -alongside live definition, will avoid the out-of-bounds access. - -Introduced in: eca96694a7f992be633d48d5ca03cedc9bbc3c9aa (v0.9.8) -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1140724 -Reported-by: Luyao Huang -Signed-off-by: Peter Krempa - -(cherry picked from commit 3e745e8f775dfe6f64f18b5c2fe4791b35d3546b) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 48bf612..63bb629 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -16069,9 +16069,13 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { -- int idx = virDomainDiskIndexByName(vm->def, disk, true); -- if (idx < 0) -+ int idx = virDomainDiskIndexByName(persistentDef, disk, true); -+ if (idx < 0) { -+ virReportError(VIR_ERR_INVALID_ARG, -+ _("disk '%s' was not found in the domain config"), -+ disk); - goto endjob; -+ } - reply = persistentDef->disks[idx]->blkdeviotune; - } - --- -2.1.0 - diff --git a/SOURCES/libvirt-CVE-2014-7823-dumpxml-security-hole-with-migratable-flag.patch b/SOURCES/libvirt-CVE-2014-7823-dumpxml-security-hole-with-migratable-flag.patch deleted file mode 100644 index 02a3005..0000000 --- a/SOURCES/libvirt-CVE-2014-7823-dumpxml-security-hole-with-migratable-flag.patch +++ /dev/null @@ -1,70 +0,0 @@ -From de0a027209822ec012e9a22eefdb5ada96a72b36 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Eric Blake -Date: Thu, 6 Nov 2014 09:42:24 +0100 -Subject: [PATCH] CVE-2014-7823: dumpxml: security hole with migratable flag - -Commit 28f8dfd (v1.0.0) introduced a security hole: in at least -the qemu implementation of virDomainGetXMLDesc, the use of the -flag VIR_DOMAIN_XML_MIGRATABLE (which is usable from a read-only -connection) triggers the implicit use of VIR_DOMAIN_XML_SECURE -prior to calling qemuDomainFormatXML. However, the use of -VIR_DOMAIN_XML_SECURE is supposed to be restricted to read-write -clients only. This patch treats the migratable flag as requiring -the same permissions, rather than analyzing what might break if -migratable xml no longer includes secret information. - -Fortunately, the information leak is low-risk: all that is gated -by the VIR_DOMAIN_XML_SECURE flag is the VNC connection password; -but VNC passwords are already weak (FIPS forbids their use, and -on a non-FIPS machine, anyone stupid enough to trust a max-8-byte -password sent in plaintext over the network deserves what they -get). SPICE offers better security than VNC, and all other -secrets are properly protected by use of virSecret associations -rather than direct output in domain XML. - -* src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_GET_XML_DESC): -Tighten rules on use of migratable flag. -* src/libvirt-domain.c (virDomainGetXMLDesc): Likewise. - -Signed-off-by: Eric Blake -(cherry picked from commit b1674ad5a97441b7e1bd5f5ebaff498ef2fbb11b) - -Conflicts: - src/libvirt-domain.c - file split from older src/libvirt.c -Signed-off-by: Eric Blake -Signed-off-by: Jiri Denemark ---- - src/libvirt.c | 3 ++- - src/remote/remote_protocol.x | 1 + - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/libvirt.c b/src/libvirt.c -index 5c086c8..b593c9b 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -4369,7 +4369,8 @@ virDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) - virCheckDomainReturn(domain, NULL); - conn = domain->conn; - -- if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) { -+ if ((conn->flags & VIR_CONNECT_RO) && -+ (flags & (VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_MIGRATABLE))) { - virReportError(VIR_ERR_OPERATION_DENIED, "%s", - _("virDomainGetXMLDesc with secure flag")); - goto error; -diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x -index da724d1..ee195c4 100644 ---- a/src/remote/remote_protocol.x -+++ b/src/remote/remote_protocol.x -@@ -3233,6 +3233,7 @@ enum remote_procedure { - * @generate: both - * @acl: domain:read - * @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE -+ * @acl: domain:read_secure:VIR_DOMAIN_XML_MIGRATABLE - */ - REMOTE_PROC_DOMAIN_GET_XML_DESC = 14, - --- -2.1.3 - diff --git a/SOURCES/libvirt-CVE-2014-8131-Fix-possible-deadlock-and-segfault-in-qemuConnectGetAllDomainStats.patch b/SOURCES/libvirt-CVE-2014-8131-Fix-possible-deadlock-and-segfault-in-qemuConnectGetAllDomainStats.patch deleted file mode 100644 index 87e4fa6..0000000 --- a/SOURCES/libvirt-CVE-2014-8131-Fix-possible-deadlock-and-segfault-in-qemuConnectGetAllDomainStats.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 410c5b18640b585a2cd6b56c40b8e8c75355725c Mon Sep 17 00:00:00 2001 -Message-Id: <410c5b18640b585a2cd6b56c40b8e8c75355725c@dist-git> -From: Martin Kletzander -Date: Sat, 13 Dec 2014 10:10:01 +0100 -Subject: [PATCH] CVE-2014-8131: Fix possible deadlock and segfault in - qemuConnectGetAllDomainStats() - -https://bugzilla.redhat.com/show_bug.cgi?id=1172570 - -When user doesn't have read access on one of the domains he requested, -the for loop could exit abruptly or continue and override pointer which -pointed to locked object. - -This patch fixed two issues at once. One is that domflags might have -had QEMU_DOMAIN_STATS_HAVE_JOB even when there was no job started (this -is fixed by doing domflags |= QEMU_DOMAIN_STATS_HAVE_JOB only when the -job was acquired and cleaning domflags on every start of the loop. -Second one is that the domain is kept locked when -virConnectGetAllDomainStatsCheckACL() fails and continues the loop when -it didn't end. Adding a simple virObjectUnlock() and clearing the -pointer ought to do. - -Signed-off-by: Martin Kletzander -(cherry picked from commit 57023c0a3af4af1c547189c1f6712ed5edeb0c0b) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 20 +++++++++++++------- - 1 file changed, 13 insertions(+), 7 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index adf158a..1625ddd 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -18250,20 +18250,23 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, - privflags |= QEMU_DOMAIN_STATS_HAVE_JOB; - - for (i = 0; i < ndoms; i++) { -- domflags = privflags; - virDomainStatsRecordPtr tmp = NULL; -+ domflags = 0; - - if (!(dom = qemuDomObjFromDomain(doms[i]))) - continue; - - if (doms != domlist && -- !virConnectGetAllDomainStatsCheckACL(conn, dom->def)) -+ !virConnectGetAllDomainStatsCheckACL(conn, dom->def)) { -+ virObjectUnlock(dom); -+ dom = NULL; - continue; -+ } - -- if (HAVE_JOB(domflags) && -+ if (HAVE_JOB(privflags) && - qemuDomainObjBeginJob(driver, dom, QEMU_JOB_QUERY) < 0) - /* As it was never requested. Gather as much as possible anyway. */ -- domflags &= ~QEMU_DOMAIN_STATS_HAVE_JOB; -+ domflags |= QEMU_DOMAIN_STATS_HAVE_JOB; - - if (qemuDomainGetStats(conn, dom, stats, &tmp, domflags) < 0) - goto endjob; -@@ -18271,9 +18274,12 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, - if (tmp) - tmpstats[nstats++] = tmp; - -- if (HAVE_JOB(domflags) && !qemuDomainObjEndJob(driver, dom)) { -- dom = NULL; -- continue; -+ if (HAVE_JOB(domflags)) { -+ domflags = 0; -+ if (!qemuDomainObjEndJob(driver, dom)) { -+ dom = NULL; -+ continue; -+ } - } - - virObjectUnlock(dom); --- -2.2.0 - diff --git a/SOURCES/libvirt-CVE-2015-0236-qemu-Check-ACLs-when-dumping-security-info-from-save-image.patch b/SOURCES/libvirt-CVE-2015-0236-qemu-Check-ACLs-when-dumping-security-info-from-save-image.patch deleted file mode 100644 index d1f4fe9..0000000 --- a/SOURCES/libvirt-CVE-2015-0236-qemu-Check-ACLs-when-dumping-security-info-from-save-image.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 9b1f9aae223e1633662858e6d2ceac2ed6d2d5c4 Mon Sep 17 00:00:00 2001 -Message-Id: <9b1f9aae223e1633662858e6d2ceac2ed6d2d5c4@dist-git> -From: Peter Krempa -Date: Wed, 21 Jan 2015 13:07:43 +0100 -Subject: [PATCH] CVE-2015-0236: qemu: Check ACLs when dumping security info - from save image - -The ACL check didn't check the VIR_DOMAIN_XML_SECURE flag and the -appropriate permission for it. - -(Upstream ID not available yet.) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 2 +- - src/remote/remote_protocol.x | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 1b08cc4..960bea6 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -6119,7 +6119,7 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path, - if (fd < 0) - goto cleanup; - -- if (virDomainSaveImageGetXMLDescEnsureACL(conn, def) < 0) -+ if (virDomainSaveImageGetXMLDescEnsureACL(conn, def, flags) < 0) - goto cleanup; - - ret = qemuDomainDefFormatXML(driver, def, flags); -diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x -index 82f3902..1265060 100644 ---- a/src/remote/remote_protocol.x -+++ b/src/remote/remote_protocol.x -@@ -4764,6 +4764,7 @@ enum remote_procedure { - * @generate: both - * @priority: high - * @acl: domain:read -+ * @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE - */ - REMOTE_PROC_DOMAIN_SAVE_IMAGE_GET_XML_DESC = 235, - --- -2.2.1 - diff --git a/SOURCES/libvirt-CVE-2015-0236-qemu-Check-ACLs-when-dumping-security-info-from-snapshots.patch b/SOURCES/libvirt-CVE-2015-0236-qemu-Check-ACLs-when-dumping-security-info-from-snapshots.patch deleted file mode 100644 index 2320895..0000000 --- a/SOURCES/libvirt-CVE-2015-0236-qemu-Check-ACLs-when-dumping-security-info-from-snapshots.patch +++ /dev/null @@ -1,47 +0,0 @@ -From c2a9261d3c438f74553062b4e5d5aa31d7ae5354 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Wed, 21 Jan 2015 13:07:44 +0100 -Subject: [PATCH] CVE-2015-0236: qemu: Check ACLs when dumping security info - from snapshots - -The ACL check didn't check the VIR_DOMAIN_XML_SECURE flag and the -appropriate permission for it. Found via code inspection while fixing -permissions for save images. - -(Upstream ID not available yet) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 2 +- - src/remote/remote_protocol.x | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 960bea6..a62e429 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -14344,7 +14344,7 @@ qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, - if (!(vm = qemuDomObjFromSnapshot(snapshot))) - return NULL; - -- if (virDomainSnapshotGetXMLDescEnsureACL(snapshot->domain->conn, vm->def) < 0) -+ if (virDomainSnapshotGetXMLDescEnsureACL(snapshot->domain->conn, vm->def, flags) < 0) - goto cleanup; - - if (!(snap = qemuSnapObjFromSnapshot(vm, snapshot))) -diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x -index 1265060..04d842e 100644 ---- a/src/remote/remote_protocol.x -+++ b/src/remote/remote_protocol.x -@@ -4434,6 +4434,7 @@ enum remote_procedure { - * @generate: both - * @priority: high - * @acl: domain:read -+ * @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE - */ - REMOTE_PROC_DOMAIN_SNAPSHOT_GET_XML_DESC = 186, - --- -2.2.1 - diff --git a/SOURCES/libvirt-Check-for-NULL-in-qemu-monitor-event-filter.patch b/SOURCES/libvirt-Check-for-NULL-in-qemu-monitor-event-filter.patch deleted file mode 100644 index 6f4c02a..0000000 --- a/SOURCES/libvirt-Check-for-NULL-in-qemu-monitor-event-filter.patch +++ /dev/null @@ -1,34 +0,0 @@ -From b868cc78d390d093e062ef5e9caa93954f15d193 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 26 Sep 2014 13:45:01 +0200 -Subject: [PATCH] Check for NULL in qemu monitor event filter - -When virConnectDomainQemuMonitorEventRegister is called with the -VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX flag, -ignore the flag instead of crashing. - -https://bugzilla.redhat.com/show_bug.cgi?id=1144920 -(cherry picked from commit b987c4c3f4829eb8a0134b687cb9748ff724f98a) - -Signed-off-by: Jiri Denemark ---- - src/conf/domain_event.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c -index bf187cd..3504b34 100644 ---- a/src/conf/domain_event.c -+++ b/src/conf/domain_event.c -@@ -1798,7 +1798,7 @@ virDomainQemuMonitorEventStateRegisterID(virConnectPtr conn, - if (VIR_ALLOC(data) < 0) - return -1; - data->flags = flags; -- if (flags != -1) { -+ if (event && flags != -1) { - int rflags = REG_NOSUB; - - if (flags & VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE) --- -2.1.1 - diff --git a/SOURCES/libvirt-Check-for-domain-liveness-in-qemuDomainObjExitMonitor.patch b/SOURCES/libvirt-Check-for-domain-liveness-in-qemuDomainObjExitMonitor.patch deleted file mode 100644 index 3abe19b..0000000 --- a/SOURCES/libvirt-Check-for-domain-liveness-in-qemuDomainObjExitMonitor.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 1b93c4b30e7b0b7df7a61cf6a759a4b0ccccca20 Mon Sep 17 00:00:00 2001 -Message-Id: <1b93c4b30e7b0b7df7a61cf6a759a4b0ccccca20@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Mon, 19 Jan 2015 10:48:27 +0100 -Subject: [PATCH] Check for domain liveness in qemuDomainObjExitMonitor -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1161024 - -The domain might disappear during the time in monitor when -the virDomainObjPtr is unlocked, so the caller needs to check -if it's still alive. - -Since most of the callers are going to need it, put the -check inside qemuDomainObjExitMonitor and return -1 if -the domain died in the meantime. - -(cherry picked from commit dc2fd51fd727bbb6de172e0ca4b7dd307bb99180) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/qemu/THREADS.txt | 5 +++++ - src/qemu/qemu_domain.c | 16 ++++++++++++++-- - src/qemu/qemu_domain.h | 4 ++-- - 3 files changed, 21 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/THREADS.txt b/src/qemu/THREADS.txt -index 50a0cf9..b081bdb 100644 ---- a/src/qemu/THREADS.txt -+++ b/src/qemu/THREADS.txt -@@ -156,6 +156,11 @@ To acquire the QEMU monitor lock - - Acquires the virDomainObjPtr lock - - These functions must not be used by an asynchronous job. -+ Note that the virDomainObj is unlocked during the time in -+ monitor and it can be changed, e.g. if QEMU dies, qemuProcessStop -+ may free the live domain definition and put the persistent -+ definition back in vm->def. The callers should check the return -+ value of ExitMonitor to see if the domain is still alive. - - - To acquire the QEMU monitor lock as part of an asynchronous job -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 03ca663..0c3d21f 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -1609,11 +1609,23 @@ void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver, - /* obj must NOT be locked before calling - * - * Should be paired with an earlier qemuDomainObjEnterMonitor() call -+ * -+ * Returns -1 if the domain is no longer alive after exiting the monitor. -+ * In that case, the caller should be careful when using obj's data, -+ * e.g. the live definition in vm->def has been freed by qemuProcessStop -+ * and replaced by the persistent definition, so pointers stolen -+ * from the live definition could no longer be valid. - */ --void qemuDomainObjExitMonitor(virQEMUDriverPtr driver, -- virDomainObjPtr obj) -+int qemuDomainObjExitMonitor(virQEMUDriverPtr driver, -+ virDomainObjPtr obj) - { - qemuDomainObjExitMonitorInternal(driver, obj); -+ if (!virDomainObjIsActive(obj)) { -+ virReportError(VIR_ERR_OPERATION_FAILED, "%s", -+ _("domain is no longer running")); -+ return -1; -+ } -+ return 0; - } - - /* -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 53501f9..bf37e26 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -248,8 +248,8 @@ void qemuDomainObjReleaseAsyncJob(virDomainObjPtr obj); - void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver, - virDomainObjPtr obj) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); --void qemuDomainObjExitMonitor(virQEMUDriverPtr driver, -- virDomainObjPtr obj) -+int qemuDomainObjExitMonitor(virQEMUDriverPtr driver, -+ virDomainObjPtr obj) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - int qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver, - virDomainObjPtr obj, --- -2.2.1 - diff --git a/SOURCES/libvirt-Do-not-crash-on-gluster-snapshots-with-no-host-name.patch b/SOURCES/libvirt-Do-not-crash-on-gluster-snapshots-with-no-host-name.patch deleted file mode 100644 index ecab430..0000000 --- a/SOURCES/libvirt-Do-not-crash-on-gluster-snapshots-with-no-host-name.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 169d41cce1b6d10bda18462a237d35a24c501c31 Mon Sep 17 00:00:00 2001 -Message-Id: <169d41cce1b6d10bda18462a237d35a24c501c31@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Wed, 12 Nov 2014 09:48:08 +0100 -Subject: [PATCH] Do not crash on gluster snapshots with no host name - -virStorageFileBackendGlusterInit did not check nhosts. - -https://bugzilla.redhat.com/show_bug.cgi?id=1162974 -(cherry picked from commit b66288faaba68e22a2876029872ddadf1794bda8) - -Signed-off-by: Jiri Denemark ---- - src/storage/storage_backend_gluster.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c -index 8a7d7e5..b79b634 100644 ---- a/src/storage/storage_backend_gluster.c -+++ b/src/storage/storage_backend_gluster.c -@@ -571,9 +571,17 @@ virStorageFileBackendGlusterInit(virStorageSourcePtr src) - { - virStorageFileBackendGlusterPrivPtr priv = NULL; - virStorageNetHostDefPtr host = &(src->hosts[0]); -- const char *hostname = host->name; -+ const char *hostname; - int port = 0; - -+ if (src->nhosts != 1) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Expected exactly 1 host for the gluster volume")); -+ return -1; -+ } -+ -+ hostname = host->name; -+ - VIR_DEBUG("initializing gluster storage file %p (gluster://%s:%s/%s%s)", - src, hostname, host->port ? host->port : "0", - NULLSTR(src->volume), src->path); --- -2.1.3 - diff --git a/SOURCES/libvirt-Do-not-format-CPU-features-without-a-model.patch b/SOURCES/libvirt-Do-not-format-CPU-features-without-a-model.patch deleted file mode 100644 index 48a6db7..0000000 --- a/SOURCES/libvirt-Do-not-format-CPU-features-without-a-model.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 4bba1d479ff2e68a3c69bcc6e8c482d07ec728d9 Mon Sep 17 00:00:00 2001 -Message-Id: <4bba1d479ff2e68a3c69bcc6e8c482d07ec728d9@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 11 Dec 2014 13:28:09 +0100 -Subject: [PATCH] Do not format CPU features without a model - -For host-passthrough CPU we don't honor the CPU -features specified in the XML, but we allow -outputting them via the UPDATE_CPU flag for dumpxml, -this gives user a rough idea of what features the CPU -might have. - -After restoring a managedsave'd domain, the features -might end up in the live status XML (in /var/run) without -the model. This XML cannot be parsed by the daemon after -restart and the domain might disappear. - -This fix skips formatting the features for HOST_PASSTHROUGH -when UPDATE_CPU is not specified, so the newly restored domains -and newly created snapshots won't be affected. - -Note: this doesn't fix existing snapshots or already restored -running domains. - -https://bugzilla.redhat.com/show_bug.cgi?id=1030793 -https://bugzilla.redhat.com/show_bug.cgi?id=1151885 -(cherry picked from commit dd324bb2703b9cf619c521b2a04f186cd9734f0a) - -Signed-off-by: Jiri Denemark ---- - src/conf/cpu_conf.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c -index e190641..72555a7 100644 ---- a/src/conf/cpu_conf.c -+++ b/src/conf/cpu_conf.c -@@ -664,7 +664,7 @@ virCPUDefFormatBuf(virBufferPtr buf, - virBufferAddLit(buf, "/>\n"); - } - -- for (i = 0; i < def->nfeatures; i++) { -+ for (i = 0; formatModel && i < def->nfeatures; i++) { - virCPUFeatureDefPtr feature = def->features + i; - - if (!feature->name) { --- -2.2.0 - diff --git a/SOURCES/libvirt-Do-not-probe-for-power-mgmt-capabilities-in-lxc-emulator.patch b/SOURCES/libvirt-Do-not-probe-for-power-mgmt-capabilities-in-lxc-emulator.patch deleted file mode 100644 index 5119c22..0000000 --- a/SOURCES/libvirt-Do-not-probe-for-power-mgmt-capabilities-in-lxc-emulator.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 977ca1a312cd9ade47cac3a9168894a4d796f637 Mon Sep 17 00:00:00 2001 -Message-Id: <977ca1a312cd9ade47cac3a9168894a4d796f637@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 4 Nov 2014 13:47:29 +0100 -Subject: [PATCH] Do not probe for power mgmt capabilities in lxc emulator -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It fails after 30 seconds with this error: -error : virDBusCall:1429 : error from service: CanSuspend: -Did not receive a reply. Possible causes include: the remote -application did not send a reply, the message bus security -policy blocked the reply, the reply timeout expired, or the -network connection was broken. - -Only probe for the power mgmt capabilities when driver is non-NULL. -This speeds up domain startup by 30 seconds. - -https://bugzilla.redhat.com/show_bug.cgi?id=1159227 -(cherry picked from commit 7ead1a5d91a93b5614deeef7b0227bffcea9740d) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/lxc/lxc_conf.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c -index 17df7a8..e713ff8 100644 ---- a/src/lxc/lxc_conf.c -+++ b/src/lxc/lxc_conf.c -@@ -82,7 +82,9 @@ virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver) - VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities"); - } - -- if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0) -+ /* Only probe for power management capabilities in the driver, -+ * not in the emulator */ -+ if (driver && virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0) - VIR_WARN("Failed to get host power management capabilities"); - - if (virGetHostUUID(caps->host.host_uuid)) { --- -2.1.3 - diff --git a/SOURCES/libvirt-Don-t-include-non-migratable-features-in-host-model.patch b/SOURCES/libvirt-Don-t-include-non-migratable-features-in-host-model.patch deleted file mode 100644 index a2737a1..0000000 --- a/SOURCES/libvirt-Don-t-include-non-migratable-features-in-host-model.patch +++ /dev/null @@ -1,266 +0,0 @@ -From 038e97c940dd3eba1faf114b3559f32129110f72 Mon Sep 17 00:00:00 2001 -Message-Id: <038e97c940dd3eba1faf114b3559f32129110f72@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 5 Sep 2014 14:41:25 +0200 -Subject: [PATCH] Don't include non-migratable features in host-model - -Commit fba6bc4 introduced support for the 'invtsc' feature, -which blocks migration. We should not include it in the -host-model CPU by default, because it's intended to be used -with migration. - -https://bugzilla.redhat.com/show_bug.cgi?id=1138221 -(cherry picked from commit de0aeafe9ce3eb414c8b5d3aa8995d776a2952de) - -Conflicts: - src/cpu/cpu_x86.c - braces cleanup - -Signed-off-by: Jiri Denemark ---- - src/cpu/cpu_map.xml | 2 +- - src/cpu/cpu_x86.c | 69 +++++++++++++++++++++--- - tests/cputest.c | 1 + - tests/cputestdata/x86-host-invtsc+host-model.xml | 22 ++++++++ - tests/cputestdata/x86-host-invtsc.xml | 27 ++++++++++ - 5 files changed, 113 insertions(+), 8 deletions(-) - create mode 100644 tests/cputestdata/x86-host-invtsc+host-model.xml - create mode 100644 tests/cputestdata/x86-host-invtsc.xml - -diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml -index 12987a0..18c7b0d 100644 ---- a/src/cpu/cpu_map.xml -+++ b/src/cpu/cpu_map.xml -@@ -328,7 +328,7 @@ - - - -- -+ - - - -diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c -index b460e8d..affc882 100644 ---- a/src/cpu/cpu_x86.c -+++ b/src/cpu/cpu_x86.c -@@ -89,6 +89,7 @@ struct x86_map { - struct x86_vendor *vendors; - struct x86_feature *features; - struct x86_model *models; -+ struct x86_feature *migrate_blockers; - }; - - static struct x86_map* virCPUx86Map = NULL; -@@ -592,6 +593,28 @@ x86FeatureFree(struct x86_feature *feature) - - - static struct x86_feature * -+x86FeatureCopy(const struct x86_feature *src) -+{ -+ struct x86_feature *feature; -+ -+ if (VIR_ALLOC(feature) < 0) -+ return NULL; -+ -+ if (VIR_STRDUP(feature->name, src->name) < 0) -+ goto error; -+ -+ if ((feature->data = x86DataCopy(src->data)) == NULL) -+ goto error; -+ -+ return feature; -+ -+ error: -+ x86FeatureFree(feature); -+ return NULL; -+} -+ -+ -+static struct x86_feature * - x86FeatureFind(const struct x86_map *map, - const char *name) - { -@@ -677,6 +700,9 @@ x86FeatureLoad(xmlXPathContextPtr ctxt, - int ret = 0; - size_t i; - int n; -+ char *str = NULL; -+ bool migratable = true; -+ struct x86_feature *migrate_blocker = NULL; - - if (!(feature = x86FeatureNew())) - goto error; -@@ -694,6 +720,10 @@ x86FeatureLoad(xmlXPathContextPtr ctxt, - goto ignore; - } - -+ str = virXPathString("string(@migratable)", ctxt); -+ if (STREQ_NULLABLE(str, "no")) -+ migratable = false; -+ - n = virXPathNodeSet("./cpuid", ctxt, &nodes); - if (n < 0) - goto ignore; -@@ -710,9 +740,17 @@ x86FeatureLoad(xmlXPathContextPtr ctxt, - goto error; - } - -- if (map->features == NULL) -+ if (!migratable) { -+ if ((migrate_blocker = x86FeatureCopy(feature)) == NULL) -+ goto error; -+ -+ migrate_blocker->next = map->migrate_blockers; -+ map->migrate_blockers = migrate_blocker; -+ } -+ -+ if (map->features == NULL) { - map->features = feature; -- else { -+ } else { - feature->next = map->features; - map->features = feature; - } -@@ -720,6 +758,7 @@ x86FeatureLoad(xmlXPathContextPtr ctxt, - out: - ctxt->node = ctxt_node; - VIR_FREE(nodes); -+ VIR_FREE(str); - - return ret; - -@@ -728,6 +767,7 @@ x86FeatureLoad(xmlXPathContextPtr ctxt, - - ignore: - x86FeatureFree(feature); -+ x86FeatureFree(migrate_blocker); - goto out; - } - -@@ -1093,6 +1133,12 @@ x86MapFree(struct x86_map *map) - x86VendorFree(vendor); - } - -+ while (map->migrate_blockers != NULL) { -+ struct x86_feature *migrate_blocker = map->migrate_blockers; -+ map->migrate_blockers = migrate_blocker->next; -+ x86FeatureFree(migrate_blocker); -+ } -+ - VIR_FREE(map); - } - -@@ -2025,16 +2071,15 @@ x86UpdateHostModel(virCPUDefPtr guest, - const virCPUDef *host) - { - virCPUDefPtr oldguest = NULL; -+ const struct x86_map *map; -+ const struct x86_feature *feat; - size_t i; - int ret = -1; - - guest->match = VIR_CPU_MATCH_EXACT; - -- /* no updates are required */ -- if (guest->nfeatures == 0) { -- virCPUDefFreeModel(guest); -- return virCPUDefCopyModel(guest, host, true); -- } -+ if (!(map = virCPUx86GetMap())) -+ goto cleanup; - - /* update the host model according to the desired configuration */ - if (!(oldguest = virCPUDefCopy(guest))) -@@ -2044,6 +2089,16 @@ x86UpdateHostModel(virCPUDefPtr guest, - if (virCPUDefCopyModel(guest, host, true) < 0) - goto cleanup; - -+ /* Remove non-migratable features by default -+ * Note: this only works as long as no CPU model contains non-migratable -+ * features directly */ -+ for (i = 0; i < guest->nfeatures; i++) { -+ for (feat = map->migrate_blockers; feat; feat = feat->next) { -+ if (STREQ(feat->name, guest->features[i].name)) -+ VIR_DELETE_ELEMENT_INPLACE(guest->features, i, guest->nfeatures); -+ } -+ } -+ - for (i = 0; i < oldguest->nfeatures; i++) { - if (virCPUDefUpdateFeature(guest, - oldguest->features[i].name, -diff --git a/tests/cputest.c b/tests/cputest.c -index 38cd71e..0ddf82a 100644 ---- a/tests/cputest.c -+++ b/tests/cputest.c -@@ -599,6 +599,7 @@ mymain(void) - DO_TEST_UPDATE("x86", "host", "host-model", VIR_CPU_COMPARE_IDENTICAL); - DO_TEST_UPDATE("x86", "host", "host-model-nofallback", VIR_CPU_COMPARE_IDENTICAL); - DO_TEST_UPDATE("x86", "host", "host-passthrough", VIR_CPU_COMPARE_IDENTICAL); -+ DO_TEST_UPDATE("x86", "host-invtsc", "host-model", VIR_CPU_COMPARE_SUPERSET); - - /* computing baseline CPUs */ - DO_TEST_BASELINE("x86", "incompatible-vendors", 0, -1); -diff --git a/tests/cputestdata/x86-host-invtsc+host-model.xml b/tests/cputestdata/x86-host-invtsc+host-model.xml -new file mode 100644 -index 0000000..ad1bbf8 ---- /dev/null -+++ b/tests/cputestdata/x86-host-invtsc+host-model.xml -@@ -0,0 +1,22 @@ -+ -+ SandyBridge -+ Intel -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/cputestdata/x86-host-invtsc.xml b/tests/cputestdata/x86-host-invtsc.xml -new file mode 100644 -index 0000000..f558399 ---- /dev/null -+++ b/tests/cputestdata/x86-host-invtsc.xml -@@ -0,0 +1,27 @@ -+ -+ x86_64 -+ SandyBridge -+ Intel -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ --- -2.1.0 - diff --git a/SOURCES/libvirt-Don-t-verify-CPU-features-with-host-passthrough.patch b/SOURCES/libvirt-Don-t-verify-CPU-features-with-host-passthrough.patch deleted file mode 100644 index f585ede..0000000 --- a/SOURCES/libvirt-Don-t-verify-CPU-features-with-host-passthrough.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 9f8e2e68bb6cebe92dbf7258553b46007a544e0a Mon Sep 17 00:00:00 2001 -Message-Id: <9f8e2e68bb6cebe92dbf7258553b46007a544e0a@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 30 Sep 2014 11:04:26 +0200 -Subject: [PATCH] Don't verify CPU features with host-passthrough - -Commit fba6bc4 introduced the non-migratable invtsc feature, -breaking save/migration with host-model and host-passthrough. - -On hosts with this feature present it was automatically included -in the CPU definition, regardless of QEMU support. - -Commit de0aeaf stopped including it by default for host-model, -but failed to fix host-passthrough. - -This commit ignores checking of CPU features with host-passthrough, -since we don't pass them to QEMU (only -cpu host is passed), -allowing domains using host-passthrough that were saved with -the broken version of libvirtd to be restored. - -https://bugzilla.redhat.com/show_bug.cgi?id=1147584 -(cherry picked from commit ec5f817f2e108ef2164bd4cefd9ad37319cc7518) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 22 ++++++++++++---------- - src/qemu/qemu_process.c | 5 +++++ - 2 files changed, 17 insertions(+), 10 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 1db9108..2b922fe 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -1714,18 +1714,20 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm, - return false; - } - -- for (i = 0; def->cpu && i < def->cpu->nfeatures; i++) { -- virCPUFeatureDefPtr feature = &def->cpu->features[i]; -+ if (def->cpu && def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) { -+ for (i = 0; i < def->cpu->nfeatures; i++) { -+ virCPUFeatureDefPtr feature = &def->cpu->features[i]; - -- if (feature->policy != VIR_CPU_FEATURE_REQUIRE) -- continue; -+ if (feature->policy != VIR_CPU_FEATURE_REQUIRE) -+ continue; - -- /* QEMU blocks migration and save with invariant TSC enabled */ -- if (STREQ(feature->name, "invtsc")) { -- virReportError(VIR_ERR_OPERATION_INVALID, -- _("domain has CPU feature: %s"), -- feature->name); -- return false; -+ /* QEMU blocks migration and save with invariant TSC enabled */ -+ if (STREQ(feature->name, "invtsc")) { -+ virReportError(VIR_ERR_OPERATION_INVALID, -+ _("domain has CPU feature: %s"), -+ feature->name); -+ return false; -+ } - } - } - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index d675add..6565956 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3785,6 +3785,11 @@ qemuProcessVerifyGuestCPU(virQEMUDriverPtr driver, - bool ret = false; - size_t i; - -+ /* no features are passed to QEMU with -cpu host -+ * so it makes no sense to verify them */ -+ if (def->cpu && def->cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) -+ return true; -+ - switch (arch) { - case VIR_ARCH_I686: - case VIR_ARCH_X86_64: --- -2.1.2 - diff --git a/SOURCES/libvirt-Explicitly-format-the-isa-fdc-controller-for-newer-q35-machines.patch b/SOURCES/libvirt-Explicitly-format-the-isa-fdc-controller-for-newer-q35-machines.patch new file mode 100644 index 0000000..0c0803f --- /dev/null +++ b/SOURCES/libvirt-Explicitly-format-the-isa-fdc-controller-for-newer-q35-machines.patch @@ -0,0 +1,304 @@ +From c8aeb07255eb984a89be33ca3a0bafcebe088682 Mon Sep 17 00:00:00 2001 +Message-Id: +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Wed, 8 Jul 2015 15:56:47 +0200 +Subject: [PATCH] Explicitly format the isa-fdc controller for newer q35 + machines +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Since QEMU commit ea96bc6 [1]: +i386: drop FDC in pc-q35-2.4+ if neither it nor floppy drives are wanted +the floppy controller is no longer implicit. + +Specify it explicitly on the command line if the machine type version +is 2.4 or later. + +Note that libvirt's floppy drives do not result in QEMU implying the +controller, because libvirt uses if=none instead of if=floppy. + +https://bugzilla.redhat.com/show_bug.cgi?id=1227880 + +[1] http://git.qemu.org/?p=qemu.git;a=commitdiff;h=ea96bc6 + +(cherry picked from commit 4edf01c92cf9004aac2a505a38d92d13050c24bc) +Signed-off-by: Ján Tomko +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 31 +++++++++++++---- + src/qemu/qemu_domain.c | 19 ++++++++++ + src/qemu/qemu_domain.h | 1 + + .../qemuxml2argv-boot-floppy-q35.args | 12 +++++++ + .../qemuxml2argv-boot-floppy-q35.xml | 40 ++++++++++++++++++++++ + .../qemuxml2argv-bootindex-floppy-q35.args | 11 ++++++ + .../qemuxml2argv-bootindex-floppy-q35.xml | 40 ++++++++++++++++++++++ + tests/qemuxml2argvtest.c | 9 +++++ + 8 files changed, 156 insertions(+), 7 deletions(-) + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.xml + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index d8ce22f..48d2ee0 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -8837,9 +8837,9 @@ qemuBuildCommandLine(virConnectPtr conn, + * List of controller types that we add commandline args for, + * *in the order we want to add them*. + * +- * We don't add an explicit FD controller because the +- * provided PIIX4 device already includes one. It isn't possible to +- * remove the PIIX4. ++ * The floppy controller is implicit on PIIX4 and older Q35 ++ * machines. For newer Q35 machines it is added out of the ++ * controllers loop, after the floppy drives. + * + * We don't add PCI/PCIe root controller either, because it's + * implicit, but we do add PCI bridges and other PCI +@@ -8860,6 +8860,8 @@ qemuBuildCommandLine(virConnectPtr conn, + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + virBuffer boot_buf = VIR_BUFFER_INITIALIZER; + char *boot_order_str = NULL, *boot_opts_str = NULL; ++ virBuffer fdc_opts = VIR_BUFFER_INITIALIZER; ++ char *fdc_opts_str = NULL; + + VIR_DEBUG("conn=%p driver=%p def=%p mon=%p json=%d " + "qemuCaps=%p migrateFrom=%s migrateFD=%d " +@@ -9810,8 +9812,12 @@ qemuBuildCommandLine(virConnectPtr conn, + disk->info.alias) < 0) + goto error; + +- virCommandAddArg(cmd, "-global"); +- virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr); ++ if (!qemuDomainMachineNeedsFDC(def)) { ++ virCommandAddArg(cmd, "-global"); ++ virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr); ++ } else { ++ virBufferAsprintf(&fdc_opts, "%s,", optstr); ++ } + VIR_FREE(optstr); + + if (bootindex) { +@@ -9821,8 +9827,12 @@ qemuBuildCommandLine(virConnectPtr conn, + bootindex) < 0) + goto error; + +- virCommandAddArg(cmd, "-global"); +- virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr); ++ if (!qemuDomainMachineNeedsFDC(def)) { ++ virCommandAddArg(cmd, "-global"); ++ virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr); ++ } else { ++ virBufferAsprintf(&fdc_opts, "%s,", optstr); ++ } + VIR_FREE(optstr); + } + } else { +@@ -9836,6 +9846,13 @@ qemuBuildCommandLine(virConnectPtr conn, + } + } + } ++ /* Newer Q35 machine types require an explicit FDC controller */ ++ virBufferTrim(&fdc_opts, ",", -1); ++ if ((fdc_opts_str = virBufferContentAndReset(&fdc_opts))) { ++ virCommandAddArg(cmd, "-device"); ++ virCommandAddArgFormat(cmd, "isa-fdc,%s", fdc_opts_str); ++ VIR_FREE(fdc_opts_str); ++ } + } else { + for (i = 0; i < def->ndisks; i++) { + char dev[NAME_MAX]; +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index f9bf32c..6590cf0 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3245,6 +3245,25 @@ qemuDomainMachineIsI440FX(const virDomainDef *def) + } + + ++bool ++qemuDomainMachineNeedsFDC(const virDomainDef *def) ++{ ++ char *p = STRSKIP(def->os.machine, "pc-q35-"); ++ ++ if (p) { ++ if (STRPREFIX(p, "1.") || ++ STRPREFIX(p, "2.0") || ++ STRPREFIX(p, "2.1") || ++ STRPREFIX(p, "2.2") || ++ STRPREFIX(p, "2.3")) ++ return false; ++ return true; ++ } ++ return false; ++} ++ ++ ++ + /** + * qemuDomainUpdateCurrentMemorySize: + * +diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h +index 54e1e7b..66dbcf5 100644 +--- a/src/qemu/qemu_domain.h ++++ b/src/qemu/qemu_domain.h +@@ -465,6 +465,7 @@ virDomainChrSourceDefPtr qemuFindAgentConfig(virDomainDefPtr def); + + bool qemuDomainMachineIsQ35(const virDomainDef *def); + bool qemuDomainMachineIsI440FX(const virDomainDef *def); ++bool qemuDomainMachineNeedsFDC(const virDomainDef *def); + + int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver, + virDomainObjPtr vm); +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.args +new file mode 100644 +index 0000000..464bfa9 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.args +@@ -0,0 +1,12 @@ ++LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu -S \ ++-M pc-q35-2.4 \ ++-m 214 -smp 1 \ ++-nographic -nodefaults \ ++-monitor unix:/tmp/test-monitor,server,nowait \ ++-no-acpi -boot a \ ++-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ ++-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \ ++-drive file=/tmp/firmware.img,if=none,id=drive-fdc0-0-0 \ ++-device isa-fdc,driveA=drive-fdc0-0-0 \ ++-device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x3 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.xml +new file mode 100644 +index 0000000..70d3262 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.xml +@@ -0,0 +1,40 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu ++ ++ ++ ++ ++
++ ++ ++
++ ++ ++ ++
++ ++ ++
++ ++ ++ ++ ++ ++
++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.args +new file mode 100644 +index 0000000..2f0627b +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.args +@@ -0,0 +1,11 @@ ++LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu -S -M pc-q35-2.4 \ ++-m 214 -smp 1 \ ++-nographic -nodefaults \ ++-monitor unix:/tmp/test-monitor,server,nowait \ ++-no-acpi \ ++-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ ++-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \ ++-drive file=/tmp/firmware.img,if=none,id=drive-fdc0-0-0 \ ++-device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1 \ ++-device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x3 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.xml +new file mode 100644 +index 0000000..70d3262 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.xml +@@ -0,0 +1,40 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu ++ ++ ++ ++ ++
++ ++ ++
++ ++ ++ ++
++ ++ ++
++ ++ ++ ++ ++ ++
++ ++ ++ +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index 574777b..bee6637 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -607,6 +607,15 @@ mymain(void) + DO_TEST("boot-cdrom", NONE); + DO_TEST("boot-network", NONE); + DO_TEST("boot-floppy", NONE); ++ DO_TEST("boot-floppy-q35", ++ QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE, ++ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, ++ QEMU_CAPS_DRIVE, QEMU_CAPS_ICH9_AHCI); ++ DO_TEST("bootindex-floppy-q35", ++ QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE, ++ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, ++ QEMU_CAPS_DRIVE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_BOOT_MENU, ++ QEMU_CAPS_BOOTINDEX); + DO_TEST("boot-multi", QEMU_CAPS_BOOT_MENU); + DO_TEST("boot-menu-enable", + QEMU_CAPS_BOOT_MENU, QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE); +-- +2.4.5 + diff --git a/SOURCES/libvirt-Fix-MinGW-build.patch b/SOURCES/libvirt-Fix-MinGW-build.patch deleted file mode 100644 index 74e3a0b..0000000 --- a/SOURCES/libvirt-Fix-MinGW-build.patch +++ /dev/null @@ -1,54 +0,0 @@ -From ce9423c4be3408f3d230320ad3326f4b3c40d3c9 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pavel Hrdina -Date: Fri, 26 Sep 2014 12:43:58 +0200 -Subject: [PATCH] Fix MinGW build - -When building on mingw the format string for long long/unsigned long -long have to be I64d/I64u instead of lld/llu. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit b8b3c56566712757eebd76ac199b69673766226a) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1115898 -Signed-off-by: Jiri Denemark ---- - examples/object-events/event-test.c | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/examples/object-events/event-test.c b/examples/object-events/event-test.c -index 9e09736..faf0cf2 100644 ---- a/examples/object-events/event-test.c -+++ b/examples/object-events/event-test.c -@@ -476,6 +476,15 @@ myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED, - printf("%s EVENT: Domain %s(%d) tunable updated:\n", - __func__, virDomainGetName(dom), virDomainGetID(dom)); - -+#ifdef WIN32 -+/* MinGW doesn't know the lld/llu so we have to use I64f/I64u instead. */ -+# define LLD_FORMAT "%I64d" -+# define LLU_FORMAT "%I64u" -+#else /* WIN32 */ -+# define LLD_FORMAT "%lld" -+# define LLU_FORMAT "%llu" -+#endif /* WIN32 */ -+ - for (i = 0; i < nparams; i++) { - switch (params[i].type) { - case VIR_TYPED_PARAM_INT: -@@ -485,10 +494,10 @@ myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED, - printf("\t%s: %u\n", params[i].field, params[i].value.ui); - break; - case VIR_TYPED_PARAM_LLONG: -- printf("\t%s: %lld\n", params[i].field, params[i].value.l); -+ printf("\t%s: " LLD_FORMAT "\n", params[i].field, params[i].value.l); - break; - case VIR_TYPED_PARAM_ULLONG: -- printf("\t%s: %llu\n", params[i].field, params[i].value.ul); -+ printf("\t%s: " LLU_FORMAT "\n", params[i].field, params[i].value.ul); - break; - case VIR_TYPED_PARAM_DOUBLE: - printf("\t%s: %g\n", params[i].field, params[i].value.d); --- -2.1.1 - diff --git a/SOURCES/libvirt-Fix-bug-with-loading-bridge-name-for-active-domain-during-libvirtd-start.patch b/SOURCES/libvirt-Fix-bug-with-loading-bridge-name-for-active-domain-during-libvirtd-start.patch deleted file mode 100644 index fa094db..0000000 --- a/SOURCES/libvirt-Fix-bug-with-loading-bridge-name-for-active-domain-during-libvirtd-start.patch +++ /dev/null @@ -1,42 +0,0 @@ -From cbf7eb87e62645090cdc28c878c3fe13d7f76c31 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pavel Hrdina -Date: Wed, 24 Sep 2014 11:59:36 +0200 -Subject: [PATCH] Fix bug with loading bridge name for active domain during - libvirtd start - -If you have a bridge network in running domain and libvirtd is restarted -the information about host bridge interface is lost from live xml. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1140085 - -Signed-off-by: Pavel Hrdina -(cherry picked from commit a71f741ec57634957adcac8a59b1ef27641580ad) -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index c03affe..a5f3c1d 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -6824,6 +6824,15 @@ virDomainActualNetDefParseXML(xmlNodePtr node, - goto error; - } - VIR_FREE(class_id); -+ } else if (actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE) { -+ char *brname = virXPathString("string(./source/@bridge)", ctxt); -+ if (!brname) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing element with bridge name in " -+ "interface's element")); -+ goto error; -+ } -+ actual->data.bridge.brname = brname; - } - - bandwidth_node = virXPathNode("./bandwidth", ctxt); --- -2.1.1 - diff --git a/SOURCES/libvirt-Fix-build-in-qemu_capabilities.patch b/SOURCES/libvirt-Fix-build-in-qemu_capabilities.patch deleted file mode 100644 index 7068cc8..0000000 --- a/SOURCES/libvirt-Fix-build-in-qemu_capabilities.patch +++ /dev/null @@ -1,186 +0,0 @@ -From 63a1376f7f4e6e2811d3eb15f6e969dc1576d4cb Mon Sep 17 00:00:00 2001 -Message-Id: <63a1376f7f4e6e2811d3eb15f6e969dc1576d4cb@dist-git> -From: Roman Bogorodskiy -Date: Wed, 19 Nov 2014 18:59:13 +0100 -Subject: [PATCH] Fix build in qemu_capabilities - -https://bugzilla.redhat.com/show_bug.cgi?id=1165782 - -Commit f05b6a91 added virQEMUDriverConfigPtr argument to the -virQEMUCapsFillDomainCaps function and it uses forward declaration -of virQEMUDriverConfig and virQEMUDriverConfigPtr that casues clang -build to fail: - -gmake[3]: Entering directory `/usr/home/novel/code/libvirt/src' - CC qemu/libvirt_driver_qemu_impl_la-qemu_capabilities.lo -In file included from qemu/qemu_capabilities.c:43: -In file included from qemu/qemu_hostdev.h:27: -qemu/qemu_conf.h:63:37: error: redefinition of typedef 'virQEMUDriverConfig' -is a C11 feature [-Werror,-Wtypedef-redefinition] -typedef struct _virQEMUDriverConfig virQEMUDriverConfig; - ^ -qemu/qemu_capabilities.h:328:37: note: previous definition is here -typedef struct _virQEMUDriverConfig virQEMUDriverConfig; - ^ - -Fix that by passing loader and nloader config attributes directly -instead of passing complete config. - -(cherry picked from commit 3b3947ea3740d0713f04dcf178a08945b544ce47) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 37 +++++++++++++++++++++---------------- - src/qemu/qemu_capabilities.h | 7 ++----- - src/qemu/qemu_driver.c | 3 ++- - tests/domaincapstest.c | 3 ++- - 4 files changed, 27 insertions(+), 23 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 683b882..a10bc8c 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -3615,43 +3615,44 @@ virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps) - - static int - virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps, -- virDomainCapsLoaderPtr loader, -+ virDomainCapsLoaderPtr capsLoader, - virArch arch, -- virQEMUDriverConfigPtr cfg) -+ char **loader, -+ size_t nloader) - { - size_t i; - -- loader->device.supported = true; -+ capsLoader->device.supported = true; - -- if (VIR_ALLOC_N(loader->values.values, cfg->nloader) < 0) -+ if (VIR_ALLOC_N(capsLoader->values.values, nloader) < 0) - return -1; - -- for (i = 0; i < cfg->nloader; i++) { -- const char *filename = cfg->loader[i]; -+ for (i = 0; i < nloader; i++) { -+ const char *filename = loader[i]; - - if (!virFileExists(filename)) { - VIR_DEBUG("loader filename=%s does not exist", filename); - continue; - } - -- if (VIR_STRDUP(loader->values.values[loader->values.nvalues], -+ if (VIR_STRDUP(capsLoader->values.values[capsLoader->values.nvalues], - filename) < 0) - return -1; -- loader->values.nvalues++; -+ capsLoader->values.nvalues++; - } - -- VIR_DOMAIN_CAPS_ENUM_SET(loader->type, -+ VIR_DOMAIN_CAPS_ENUM_SET(capsLoader->type, - VIR_DOMAIN_LOADER_TYPE_ROM); - - if (arch == VIR_ARCH_X86_64 && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_FORMAT)) -- VIR_DOMAIN_CAPS_ENUM_SET(loader->type, -+ VIR_DOMAIN_CAPS_ENUM_SET(capsLoader->type, - VIR_DOMAIN_LOADER_TYPE_PFLASH); - - - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_READONLY)) -- VIR_DOMAIN_CAPS_ENUM_SET(loader->readonly, -+ VIR_DOMAIN_CAPS_ENUM_SET(capsLoader->readonly, - VIR_TRISTATE_BOOL_YES, - VIR_TRISTATE_BOOL_NO); - return 0; -@@ -3662,12 +3663,14 @@ static int - virQEMUCapsFillDomainOSCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsOSPtr os, - virArch arch, -- virQEMUDriverConfigPtr cfg) -+ char **loader, -+ size_t nloader) - { -- virDomainCapsLoaderPtr loader = &os->loader; -+ virDomainCapsLoaderPtr capsLoader = &os->loader; - - os->device.supported = true; -- if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, loader, arch, cfg) < 0) -+ if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, capsLoader, arch, -+ loader, nloader) < 0) - return -1; - return 0; - } -@@ -3752,7 +3755,8 @@ virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps, - int - virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, - virQEMUCapsPtr qemuCaps, -- virQEMUDriverConfigPtr cfg) -+ char **loader, -+ size_t nloader) - { - virDomainCapsOSPtr os = &domCaps->os; - virDomainCapsDeviceDiskPtr disk = &domCaps->disk; -@@ -3761,7 +3765,8 @@ virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, - - domCaps->maxvcpus = maxvcpus; - -- if (virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch, cfg) < 0 || -+ if (virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch, -+ loader, nloader) < 0 || - virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, disk) < 0 || - virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0) - return -1; -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 08c531d..c0e2172 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -326,12 +326,9 @@ int virQEMUCapsInitGuestFromBinary(virCapsPtr caps, - virQEMUCapsPtr kvmbinCaps, - virArch guestarch); - --/* Forward declaration */ --typedef struct _virQEMUDriverConfig virQEMUDriverConfig; --typedef virQEMUDriverConfig *virQEMUDriverConfigPtr; -- - int virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, - virQEMUCapsPtr qemuCaps, -- virQEMUDriverConfigPtr cfg); -+ char **loader, -+ size_t nloader); - - #endif /* __QEMU_CAPABILITIES_H__*/ -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index ea45d89..8e6ef1e 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17668,7 +17668,8 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, - if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, virttype))) - goto cleanup; - -- if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps, cfg) < 0) -+ if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps, -+ cfg->loader, cfg->nloader) < 0) - goto cleanup; - - ret = virDomainCapsFormat(domCaps); -diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c -index 067ad4d..70d2ef3 100644 ---- a/tests/domaincapstest.c -+++ b/tests/domaincapstest.c -@@ -106,7 +106,8 @@ fillQemuCaps(virDomainCapsPtr domCaps, - virQEMUCapsPtr qemuCaps = data->qemuCaps; - virQEMUDriverConfigPtr cfg = data->cfg; - -- if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps, cfg) < 0) -+ if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps, -+ cfg->loader, cfg->nloader) < 0) - return -1; - - /* The function above tries to query host's KVM & VFIO capabilities by --- -2.1.3 - diff --git a/SOURCES/libvirt-Fix-crash-cpu_shares-change-event-crash-on-domain-startup.patch b/SOURCES/libvirt-Fix-crash-cpu_shares-change-event-crash-on-domain-startup.patch deleted file mode 100644 index c27acdd..0000000 --- a/SOURCES/libvirt-Fix-crash-cpu_shares-change-event-crash-on-domain-startup.patch +++ /dev/null @@ -1,54 +0,0 @@ -From f600e269cc7f2330dba96e5c89d68bde89063beb Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Mon, 29 Sep 2014 14:01:40 +0200 -Subject: [PATCH] Fix crash cpu_shares change event crash on domain startup - -Introduced by commit 0dce260. - -qemuDomainEventQueue was called with qemuDomainObjPrivatePtr instead -of virQEMUDriverPtr. - -https://bugzilla.redhat.com/show_bug.cgi?id=1147494 -(cherry picked from commit e26bbf49cc051b5d5c2a86c572f55953e617e872) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_cgroup.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index 8819943..bd22b7f 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -674,7 +674,8 @@ qemuSetupCpusetCgroup(virDomainObjPtr vm, - - - static int --qemuSetupCpuCgroup(virDomainObjPtr vm) -+qemuSetupCpuCgroup(virQEMUDriverPtr driver, -+ virDomainObjPtr vm) - { - qemuDomainObjPrivatePtr priv = vm->privateData; - virObjectEventPtr event = NULL; -@@ -711,7 +712,7 @@ qemuSetupCpuCgroup(virDomainObjPtr vm) - } - - if (event) -- qemuDomainEventQueue(vm->privateData, event); -+ qemuDomainEventQueue(driver, event); - } - - return 0; -@@ -845,7 +846,7 @@ qemuSetupCgroup(virQEMUDriverPtr driver, - if (qemuSetupMemoryCgroup(vm) < 0) - goto cleanup; - -- if (qemuSetupCpuCgroup(vm) < 0) -+ if (qemuSetupCpuCgroup(driver, vm) < 0) - goto cleanup; - - if (qemuSetupCpusetCgroup(vm, nodemask, caps) < 0) --- -2.1.2 - diff --git a/SOURCES/libvirt-Fix-hotplugging-of-block-device-backed-usb-disks.patch b/SOURCES/libvirt-Fix-hotplugging-of-block-device-backed-usb-disks.patch deleted file mode 100644 index df3f736..0000000 --- a/SOURCES/libvirt-Fix-hotplugging-of-block-device-backed-usb-disks.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 3d445c1a3b55a3b95d8f5c782bfe01335cd66145 Mon Sep 17 00:00:00 2001 -Message-Id: <3d445c1a3b55a3b95d8f5c782bfe01335cd66145@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 18 Dec 2014 13:20:53 +0100 -Subject: [PATCH] Fix hotplugging of block device-backed usb disks - -Commit ca91ba7 moved qemuSetupDiskCgroup into the qemuDomainPrepareDisk -helper, but failed to call it for usb disks. - -https://bugzilla.redhat.com/show_bug.cgi?id=1175668` -(cherry picked from commit 1cddf0001f5f1af10791181229148f36fd6d94c5) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 18 ++---------------- - 1 file changed, 2 insertions(+), 16 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 84d2218..819b4fd 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -679,17 +679,9 @@ qemuDomainAttachUSBMassstorageDevice(virConnectPtr conn, - } - } - -- if (virDomainLockDiskAttach(driver->lockManager, cfg->uri, -- vm, disk) < 0) -+ if (qemuDomainPrepareDisk(driver, vm, disk, NULL, false) < 0) - goto cleanup; - -- if (virSecurityManagerSetDiskLabel(driver->securityManager, -- vm->def, disk) < 0) { -- if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0) -- VIR_WARN("Unable to release lock on %s", src); -- goto cleanup; -- } -- - /* XXX not correct once we allow attaching a USB CDROM */ - if (!src) { - virReportError(VIR_ERR_INTERNAL_ERROR, -@@ -740,13 +732,7 @@ qemuDomainAttachUSBMassstorageDevice(virConnectPtr conn, - return ret; - - error: -- if (virSecurityManagerRestoreDiskLabel(driver->securityManager, -- vm->def, disk) < 0) -- VIR_WARN("Unable to restore security label on %s", src); -- -- if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0) -- VIR_WARN("Unable to release lock on %s", src); -- -+ ignore_value(qemuDomainPrepareDisk(driver, vm, disk, NULL, true)); - goto cleanup; - } - --- -2.2.1 - diff --git a/SOURCES/libvirt-Fix-leak-in-x86UpdateHostModel.patch b/SOURCES/libvirt-Fix-leak-in-x86UpdateHostModel.patch deleted file mode 100644 index 9bd0b9d..0000000 --- a/SOURCES/libvirt-Fix-leak-in-x86UpdateHostModel.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e3f6d01cc56a7b706d59f6ac62678622f26559b4 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 19 Sep 2014 10:13:50 +0200 -Subject: [PATCH] Fix leak in x86UpdateHostModel - -https://bugzilla.redhat.com/show_bug.cgi?id=1144303 - -Commit de0aeaf introduced a memory leak. - -(cherry picked from commit 5b5631dedf59e540661bfeac774e543d8d38531b) - -Signed-off-by: Jiri Denemark ---- - src/cpu/cpu_x86.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c -index affc882..0df8653 100644 ---- a/src/cpu/cpu_x86.c -+++ b/src/cpu/cpu_x86.c -@@ -2094,8 +2094,10 @@ x86UpdateHostModel(virCPUDefPtr guest, - * features directly */ - for (i = 0; i < guest->nfeatures; i++) { - for (feat = map->migrate_blockers; feat; feat = feat->next) { -- if (STREQ(feat->name, guest->features[i].name)) -+ if (STREQ(feat->name, guest->features[i].name)) { -+ VIR_FREE(guest->features[i].name); - VIR_DELETE_ELEMENT_INPLACE(guest->features, i, guest->nfeatures); -+ } - } - } - --- -2.1.1 - diff --git a/SOURCES/libvirt-Fix-libvirtd-crash-when-removing-metadata.patch b/SOURCES/libvirt-Fix-libvirtd-crash-when-removing-metadata.patch deleted file mode 100644 index f5dc36d..0000000 --- a/SOURCES/libvirt-Fix-libvirtd-crash-when-removing-metadata.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 9951acfdcb794b4ab2af9e6f494e09cdf74f6c68 Mon Sep 17 00:00:00 2001 -Message-Id: <9951acfdcb794b4ab2af9e6f494e09cdf74f6c68@dist-git> -From: Erik Skultety -Date: Thu, 18 Sep 2014 15:16:09 +0200 -Subject: [PATCH] Fix libvirtd crash when removing metadata - -When trying to remove nonexistent metadata from XML, libvirt daemon -crashes due to dereferencing NULL pointer. - -Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1143955 - -(cherry picked from commit 288c47406cffa7a6eb9e9c29764850b0cdeb5508) - -Signed-off-by: Jiri Denemark ---- - src/util/virxml.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/util/virxml.c b/src/util/virxml.c -index cc4a85c..9ce705a 100644 ---- a/src/util/virxml.c -+++ b/src/util/virxml.c -@@ -974,6 +974,9 @@ virXMLFindChildNodeByNs(xmlNodePtr root, - { - xmlNodePtr next; - -+ if (!root) -+ return NULL; -+ - for (next = root->children; next; next = next->next) { - if (next->ns && - STREQ_NULLABLE((const char *) next->ns->href, uri)) --- -2.1.1 - diff --git a/SOURCES/libvirt-Fix-typo-of-virNodeGetFreePages-comment.patch b/SOURCES/libvirt-Fix-typo-of-virNodeGetFreePages-comment.patch deleted file mode 100644 index 7a54999..0000000 --- a/SOURCES/libvirt-Fix-typo-of-virNodeGetFreePages-comment.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 708b4ab4a8c7d714c7816a20f03cedbaeda891da Mon Sep 17 00:00:00 2001 -Message-Id: <708b4ab4a8c7d714c7816a20f03cedbaeda891da@dist-git> -From: Jincheng Miao -Date: Tue, 23 Sep 2014 10:34:05 +0200 -Subject: [PATCH] Fix typo of virNodeGetFreePages comment - -https://bugzilla.redhat.com/show_bug.cgi?id=1145050 - -Signed-off-by: Jincheng Miao -(cherry picked from commit c46fa72e4090b7884b8c6edaf63f1638eb8e04f8) -Signed-off-by: Jiri Denemark ---- - src/libvirt.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libvirt.c b/src/libvirt.c -index 61d0543..d0fdf11 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21266,7 +21266,7 @@ virDomainSetTime(virDomainPtr dom, - * @flags: extra flags; not used yet, so callers should always pass 0 - * - * This calls queries the host system on free pages of -- * specified size. Ont the input, @pages is expected to be -+ * specified size. For the input, @pages is expected to be - * filled with pages that caller is interested in (the size - * unit is kibibytes, so e.g. pass 2048 for 2MB), then @startcell - * refers to the first NUMA node that info should be collected --- -2.1.1 - diff --git a/SOURCES/libvirt-Fix-typo-s-EMULATORIN-EMULATORPIN.patch b/SOURCES/libvirt-Fix-typo-s-EMULATORIN-EMULATORPIN.patch deleted file mode 100644 index bf8ff6f..0000000 --- a/SOURCES/libvirt-Fix-typo-s-EMULATORIN-EMULATORPIN.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 0135ca620a942030d4ea04787b5f75c983bc7795 Mon Sep 17 00:00:00 2001 -Message-Id: <0135ca620a942030d4ea04787b5f75c983bc7795@dist-git> -From: "Daniel P. Berrange" -Date: Fri, 26 Sep 2014 12:44:03 +0200 -Subject: [PATCH] Fix typo s/EMULATORIN/EMULATORPIN/ - -Fix the typo in VIR_DOMAIN_TUNABLE_CPU_EMULATORIN - -Signed-off-by: Daniel P. Berrange -(cherry picked from commit 42571dfa867acb89fea9a731f2e816005c9ab787) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1115898 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 4 ++-- - src/qemu/qemu_driver.c | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 9dbb222..972bdfa 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -5177,12 +5177,12 @@ typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn, - #define VIR_DOMAIN_TUNABLE_CPU_VCPUPIN "cputune.vcpupin%u" - - /** -- * VIR_DOMAIN_TUNABLE_CPU_EMULATORIN: -+ * VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN: - * - * Macro represents formatted pinning for emulator process, - * as VIR_TYPED_PARAM_STRING. - */ --#define VIR_DOMAIN_TUNABLE_CPU_EMULATORIN "cputune.emulatorpin" -+#define VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN "cputune.emulatorpin" - - /** - * VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES: -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 1b14a12..08f0142 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4876,7 +4876,7 @@ qemuDomainPinEmulator(virDomainPtr dom, - str = virBitmapFormat(pcpumap); - if (virTypedParamsAddString(&eventParams, &eventNparams, - &eventMaxparams, -- VIR_DOMAIN_TUNABLE_CPU_EMULATORIN, -+ VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN, - str) < 0) - goto cleanup; - --- -2.1.1 - diff --git a/SOURCES/libvirt-Fix-virDomainChrEquals-for-spicevmc.patch b/SOURCES/libvirt-Fix-virDomainChrEquals-for-spicevmc.patch deleted file mode 100644 index a8130f4..0000000 --- a/SOURCES/libvirt-Fix-virDomainChrEquals-for-spicevmc.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 96f29c80cd0632d69296e8282f2ca7f4d83c0d22 Mon Sep 17 00:00:00 2001 -Message-Id: <96f29c80cd0632d69296e8282f2ca7f4d83c0d22@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 11 Nov 2014 14:57:27 +0100 -Subject: [PATCH] Fix virDomainChrEquals for spicevmc - -virDomainChrSourceDefIsEqual should return 'true' for -identical SPICEVMC chardevs, and those that have no source -specification. - -After this change, a failed hotplug no longer leaves a stale -pointer in the domain definition. - -https://bugzilla.redhat.com/show_bug.cgi?id=1162097 -(cherry picked from commit b987684ff63a20ab1301c48ca4842930be044f6d) - -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 8f16d10..0e977fc 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1588,16 +1588,17 @@ virDomainChrSourceDefIsEqual(const virDomainChrSourceDef *src, - tgt->data.spiceport.channel); - break; - -+ case VIR_DOMAIN_CHR_TYPE_SPICEVMC: -+ return src->data.spicevmc == tgt->data.spicevmc; -+ - case VIR_DOMAIN_CHR_TYPE_NULL: - case VIR_DOMAIN_CHR_TYPE_VC: - case VIR_DOMAIN_CHR_TYPE_STDIO: -- case VIR_DOMAIN_CHR_TYPE_SPICEVMC: - case VIR_DOMAIN_CHR_TYPE_LAST: -- /* nada */ - break; - } - -- return false; -+ return true; - } - - void virDomainChrDefFree(virDomainChrDefPtr def) --- -2.1.3 - diff --git a/SOURCES/libvirt-Fix-vmdef-usage-after-domain-crash-in-monitor-on-device-attach.patch b/SOURCES/libvirt-Fix-vmdef-usage-after-domain-crash-in-monitor-on-device-attach.patch deleted file mode 100644 index 244d954..0000000 --- a/SOURCES/libvirt-Fix-vmdef-usage-after-domain-crash-in-monitor-on-device-attach.patch +++ /dev/null @@ -1,201 +0,0 @@ -From afcec1b837a1be463234ead731483a28f9d8a428 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Mon, 19 Jan 2015 10:48:33 +0100 -Subject: [PATCH] Fix vmdef usage after domain crash in monitor on device - attach -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1161024 - -If the domain crashed while we were in monitor, -we cannot rely on the REALLOC done on live definition, -since vm->def now points to the persistent definition. -Skip adding the attached devices to domain definition -if the domain crashed. - -In AttachChrDevice, the chardev was already added to the -live definition and freed by qemuProcessStop in the case -of a crash. Skip the device removal in that case. - -Also skip audit if the domain crashed in the meantime. - -(cherry picked from commit 3070bc8ee52efed073e5d351bfdb1072bbc6e303) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 69 +++++++++++++++++++++++++++++++++++++------------ - 1 file changed, 52 insertions(+), 17 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index c78cc4e..8a3eb27 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -390,7 +390,11 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, - memcpy(&disk->info.addr.pci, &guestAddr, sizeof(guestAddr)); - } - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) { -+ releaseaddr = false; -+ ret = -1; -+ goto error; -+ } - - virDomainAuditDisk(vm, NULL, disk->src, "attach", ret >= 0); - -@@ -485,7 +489,11 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver, - type, - &controller->info.addr.pci); - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) { -+ releaseaddr = false; -+ ret = -1; -+ goto cleanup; -+ } - - if (ret == 0) { - if (controller->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) -@@ -636,7 +644,10 @@ qemuDomainAttachSCSIDisk(virConnectPtr conn, - disk->info.addr.drive.unit = driveAddr.unit; - } - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) { -+ ret = -1; -+ goto error; -+ } - - virDomainAuditDisk(vm, NULL, disk->src, "attach", ret >= 0); - -@@ -716,7 +727,10 @@ qemuDomainAttachUSBMassstorageDevice(virConnectPtr conn, - } else { - ret = qemuMonitorAddUSBDisk(priv->mon, src); - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) { -+ ret = -1; -+ goto error; -+ } - - virDomainAuditDisk(vm, NULL, disk->src, "attach", ret >= 0); - -@@ -1277,7 +1291,8 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, - qemuDomainObjEnterMonitor(driver, vm); - ret = qemuMonitorAddDeviceWithFd(priv->mon, devstr, - configfd, configfd_name); -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto error; - } else { - virDevicePCIAddressPtr guestAddr = &hostdev->info->addr.pci; - virDevicePCIAddressPtr hostAddr = &hostdev->source.subsys.u.pci.addr; -@@ -1293,7 +1308,8 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, - - qemuDomainObjEnterMonitor(driver, vm); - ret = qemuMonitorAddPCIHostDevice(priv->mon, hostAddr, guestAddr); -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto error; - - hostdev->info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; - } -@@ -1353,12 +1369,11 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver, - goto error; - - qemuDomainObjEnterMonitor(driver, vm); -- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) -- ret = qemuMonitorAddDevice(priv->mon, devstr); -- else -+ ret = qemuMonitorAddDevice(priv->mon, devstr); -+ -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) - goto error; - -- qemuDomainObjExitMonitor(driver, vm); - virDomainAuditRedirdev(vm, redirdev, "attach", ret == 0); - if (ret < 0) - goto error; -@@ -1480,17 +1495,29 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver, - - qemuDomainObjEnterMonitor(driver, vm); - if (qemuMonitorAttachCharDev(priv->mon, charAlias, &chr->source) < 0) { -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) { -+ need_remove = false; -+ ret = -1; -+ goto cleanup; -+ } - goto audit; - } - - if (devstr && qemuMonitorAddDevice(priv->mon, devstr) < 0) { - /* detach associated chardev on error */ - qemuMonitorDetachCharDev(priv->mon, charAlias); -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) { -+ need_remove = false; -+ ret = -1; -+ goto cleanup; -+ } - goto audit; - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) { -+ need_remove = false; -+ ret = -1; -+ goto cleanup; -+ } - - ret = 0; - audit: -@@ -1546,7 +1573,10 @@ qemuDomainAttachHostUSBDevice(virQEMUDriverPtr driver, - ret = qemuMonitorAddUSBDeviceExact(priv->mon, - hostdev->source.subsys.u.usb.bus, - hostdev->source.subsys.u.usb.device); -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) { -+ ret = -1; -+ goto cleanup; -+ } - virDomainAuditHostdev(vm, hostdev, "attach", ret == 0); - if (ret < 0) - goto cleanup; -@@ -1649,7 +1679,10 @@ qemuDomainAttachHostSCSIDevice(virConnectPtr conn, - } - } - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) { -+ ret = -1; -+ goto cleanup; -+ } - - virDomainAuditHostdev(vm, hostdev, "attach", ret == 0); - if (ret < 0) -@@ -1895,7 +1928,8 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver, - dev->linkstate = linkstate; - - cleanup: -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ return -1; - - return ret; - } -@@ -3661,7 +3695,8 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver, - } - - end_job: -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ ret = -1; - cleanup: - virObjectUnref(cfg); - return ret; --- -2.2.1 - diff --git a/SOURCES/libvirt-Fix-vmdef-usage-after-domain-crash-in-monitor-on-device-detach.patch b/SOURCES/libvirt-Fix-vmdef-usage-after-domain-crash-in-monitor-on-device-detach.patch deleted file mode 100644 index facfbd5..0000000 --- a/SOURCES/libvirt-Fix-vmdef-usage-after-domain-crash-in-monitor-on-device-detach.patch +++ /dev/null @@ -1,344 +0,0 @@ -From e4eed0cb91484c3f8b415965120a9eebfc1ecb18 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Mon, 19 Jan 2015 10:48:32 +0100 -Subject: [PATCH] Fix vmdef usage after domain crash in monitor on device - detach -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1161024 - -In the device type-specific functions, exit early -if the domain has disappeared, because the cleanup -should have been done by qemuProcessStop. - -Check the return value in processDeviceDeletedEvent -and qemuProcessUpdateDevices. - -Skip audit and removing the device from live def because -it has already been cleaned up. - -(cherry picked from commit 6edb97f29af5c266617943ab36534f2f81aeb49a) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 3 +- - src/qemu/qemu_hotplug.c | 91 ++++++++++++++++++++++++++++++------------------- - src/qemu/qemu_hotplug.h | 6 ++-- - src/qemu/qemu_process.c | 6 ++-- - 4 files changed, 65 insertions(+), 41 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 9eb5f9c..f3b909f 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4130,7 +4130,8 @@ processDeviceDeletedEvent(virQEMUDriverPtr driver, - if (virDomainDefFindDevice(vm->def, devAlias, &dev, true) < 0) - goto endjob; - -- qemuDomainRemoveDevice(driver, vm, &dev); -+ if (qemuDomainRemoveDevice(driver, vm, &dev) < 0) -+ goto endjob; - - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) - VIR_WARN("unable to save domain status after removing device %s", -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 819b4fd..c78cc4e 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -2525,8 +2525,9 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver, - - qemuDomainObjEnterMonitor(driver, vm); - qemuMonitorDriveDel(priv->mon, drivestr); -- qemuDomainObjExitMonitor(driver, vm); - VIR_FREE(drivestr); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ return -1; - - virDomainAuditDisk(vm, disk->src, NULL, "detach", true); - -@@ -2641,7 +2642,8 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver, - - qemuDomainObjEnterMonitor(driver, vm); - qemuMonitorDriveDel(priv->mon, drivestr); -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - } - - event = virDomainEventDeviceRemovedNewFromObj(vm, hostdev->info->alias); -@@ -2735,7 +2737,8 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver, - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV) && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { - if (qemuMonitorRemoveNetdev(priv->mon, hostnet_name) < 0) { -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - virDomainAuditNet(vm, net, NULL, "detach", false); - goto cleanup; - } -@@ -2747,12 +2750,14 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver, - virReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("unable to determine original VLAN")); - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - virDomainAuditNet(vm, net, NULL, "detach", false); - goto cleanup; - } - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - - virDomainAuditNet(vm, net, NULL, "detach", true); - -@@ -2822,7 +2827,8 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver, - - qemuDomainObjEnterMonitor(driver, vm); - rc = qemuMonitorDetachCharDev(priv->mon, charAlias); -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - - virDomainAuditChardev(vm, chr, NULL, "detach", rc == 0); - -@@ -2843,27 +2849,28 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver, - } - - --void -+int - qemuDomainRemoveDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) - { -+ int ret = -1; - switch ((virDomainDeviceType) dev->type) { - case VIR_DOMAIN_DEVICE_DISK: -- qemuDomainRemoveDiskDevice(driver, vm, dev->data.disk); -+ ret = qemuDomainRemoveDiskDevice(driver, vm, dev->data.disk); - break; - case VIR_DOMAIN_DEVICE_CONTROLLER: -- qemuDomainRemoveControllerDevice(driver, vm, dev->data.controller); -+ ret = qemuDomainRemoveControllerDevice(driver, vm, dev->data.controller); - break; - case VIR_DOMAIN_DEVICE_NET: -- qemuDomainRemoveNetDevice(driver, vm, dev->data.net); -+ ret = qemuDomainRemoveNetDevice(driver, vm, dev->data.net); - break; - case VIR_DOMAIN_DEVICE_HOSTDEV: -- qemuDomainRemoveHostDevice(driver, vm, dev->data.hostdev); -+ ret = qemuDomainRemoveHostDevice(driver, vm, dev->data.hostdev); - break; - - case VIR_DOMAIN_DEVICE_CHR: -- qemuDomainRemoveChrDevice(driver, vm, dev->data.chr); -+ ret = qemuDomainRemoveChrDevice(driver, vm, dev->data.chr); - break; - - case VIR_DOMAIN_DEVICE_NONE: -@@ -2887,6 +2894,7 @@ qemuDomainRemoveDevice(virQEMUDriverPtr driver, - virDomainDeviceTypeToString(dev->type)); - break; - } -+ return ret; - } - - -@@ -3010,19 +3018,22 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver, - qemuDomainObjEnterMonitor(driver, vm); - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { - if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) { -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - virDomainAuditDisk(vm, detach->src, NULL, "detach", false); - goto cleanup; - } - } else { - if (qemuMonitorRemovePCIDevice(priv->mon, - &detach->info.addr.pci) < 0) { -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - virDomainAuditDisk(vm, detach->src, NULL, "detach", false); - goto cleanup; - } - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - - rc = qemuDomainWaitForDeviceRemoval(vm); - if (rc == 0 || rc == 1) -@@ -3062,11 +3073,13 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver, - - qemuDomainObjEnterMonitor(driver, vm); - if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) { -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - virDomainAuditDisk(vm, detach->src, NULL, "detach", false); - goto cleanup; - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - - rc = qemuDomainWaitForDeviceRemoval(vm); - if (rc == 0 || rc == 1) -@@ -3244,17 +3257,20 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver, - qemuDomainObjEnterMonitor(driver, vm); - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { - if (qemuMonitorDelDevice(priv->mon, detach->info.alias)) { -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - goto cleanup; - } - } else { - if (qemuMonitorRemovePCIDevice(priv->mon, - &detach->info.addr.pci) < 0) { -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - goto cleanup; - } - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - - rc = qemuDomainWaitForDeviceRemoval(vm); - if (rc == 0 || rc == 1) -@@ -3299,7 +3315,8 @@ qemuDomainDetachHostPCIDevice(virQEMUDriverPtr driver, - } else { - ret = qemuMonitorRemovePCIDevice(priv->mon, &detach->info->addr.pci); - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ ret = -1; - - return ret; - } -@@ -3328,7 +3345,8 @@ qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver, - - qemuDomainObjEnterMonitor(driver, vm); - ret = qemuMonitorDelDevice(priv->mon, detach->info->alias); -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ ret = -1; - - return ret; - } -@@ -3356,14 +3374,11 @@ qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver, - qemuDomainMarkDeviceForRemoval(vm, detach->info); - - qemuDomainObjEnterMonitor(driver, vm); -- if (qemuMonitorDelDevice(priv->mon, detach->info->alias) < 0) { -- qemuDomainObjExitMonitor(driver, vm); -- goto cleanup; -- } -- qemuDomainObjExitMonitor(driver, vm); -- ret = 0; -+ ret = qemuMonitorDelDevice(priv->mon, detach->info->alias); -+ -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ return -1; - -- cleanup: - return ret; - } - -@@ -3399,7 +3414,8 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver, - } - - if (ret < 0) { -- virDomainAuditHostdev(vm, detach, "detach", false); -+ if (virDomainObjIsActive(vm)) -+ virDomainAuditHostdev(vm, detach, "detach", false); - } else { - int rc = qemuDomainWaitForDeviceRemoval(vm); - if (rc == 0 || rc == 1) -@@ -3550,19 +3566,22 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver, - qemuDomainObjEnterMonitor(driver, vm); - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { - if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) { -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - virDomainAuditNet(vm, detach, NULL, "detach", false); - goto cleanup; - } - } else { - if (qemuMonitorRemovePCIDevice(priv->mon, - &detach->info.addr.pci) < 0) { -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - virDomainAuditNet(vm, detach, NULL, "detach", false); - goto cleanup; - } - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - - rc = qemuDomainWaitForDeviceRemoval(vm); - if (rc == 0 || rc == 1) -@@ -3729,10 +3748,12 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, - - qemuDomainObjEnterMonitor(driver, vm); - if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) { -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - goto cleanup; - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - - rc = qemuDomainWaitForDeviceRemoval(vm); - if (rc == 0 || rc == 1) -diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h -index 1c9ca8f..28700f7 100644 ---- a/src/qemu/qemu_hotplug.h -+++ b/src/qemu/qemu_hotplug.h -@@ -105,9 +105,9 @@ virDomainChrDefPtr - qemuDomainChrRemove(virDomainDefPtr vmdef, - virDomainChrDefPtr chr); - --void qemuDomainRemoveDevice(virQEMUDriverPtr driver, -- virDomainObjPtr vm, -- virDomainDeviceDefPtr dev); -+int qemuDomainRemoveDevice(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ virDomainDeviceDefPtr dev); - - bool qemuDomainSignalDeviceRemoval(virDomainObjPtr vm, - const char *devAlias); -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index ae1dbdf..45bcf76 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3587,8 +3587,10 @@ qemuProcessUpdateDevices(virQEMUDriverPtr driver, - if ((tmp = old)) { - while (*tmp) { - if (!virStringArrayHasString(priv->qemuDevices, *tmp) && -- virDomainDefFindDevice(vm->def, *tmp, &dev, false) == 0) -- qemuDomainRemoveDevice(driver, vm, &dev); -+ virDomainDefFindDevice(vm->def, *tmp, &dev, false) == 0 && -+ qemuDomainRemoveDevice(driver, vm, &dev) < 0) { -+ goto cleanup; -+ } - tmp++; - } - } --- -2.2.1 - diff --git a/SOURCES/libvirt-Fix-vmdef-usage-while-in-monitor-in-BlockStat-APIs.patch b/SOURCES/libvirt-Fix-vmdef-usage-while-in-monitor-in-BlockStat-APIs.patch deleted file mode 100644 index 34e52df..0000000 --- a/SOURCES/libvirt-Fix-vmdef-usage-while-in-monitor-in-BlockStat-APIs.patch +++ /dev/null @@ -1,150 +0,0 @@ -From 6cacbd1b9233e98576c01f5245c7d95b2501f15d Mon Sep 17 00:00:00 2001 -Message-Id: <6cacbd1b9233e98576c01f5245c7d95b2501f15d@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Mon, 19 Jan 2015 10:48:30 +0100 -Subject: [PATCH] Fix vmdef usage while in monitor in BlockStat* APIs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1161024 - -Make a local copy of the disk alias instead of pointing -to the domain definition, which might get freed if -the domain dies while we're in monitor. - -Also exit early if that happens. - -(cherry picked from commit 3f2139843760e6d5596b75db9df6af8c6e9c1ee6) -Signed-off-by: Ján Tomko - -Conflicts: - src/qemu/qemu_driver.c - missing qemuDomainEndAPI and maxOptions - for block IO throttle -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 26 +++++++++++++++++++------- - 1 file changed, 19 insertions(+), 7 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 97d850b..9eb5f9c 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -10120,6 +10120,7 @@ qemuDomainBlockStats(virDomainPtr dom, - virDomainObjPtr vm; - virDomainDiskDefPtr disk = NULL; - qemuDomainObjPrivatePtr priv; -+ char *diskAlias = NULL; - - if (!*path) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -@@ -10155,11 +10156,14 @@ qemuDomainBlockStats(virDomainPtr dom, - goto endjob; - } - -+ if (VIR_STRDUP(diskAlias, disk->info.alias) < 0) -+ goto endjob; -+ - priv = vm->privateData; - - qemuDomainObjEnterMonitor(driver, vm); - ret = qemuMonitorGetBlockStatsInfo(priv->mon, -- disk->info.alias, -+ diskAlias, - &stats->rd_req, - &stats->rd_bytes, - NULL, -@@ -10169,7 +10173,8 @@ qemuDomainBlockStats(virDomainPtr dom, - NULL, - NULL, - &stats->errs); -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ ret = -1; - - endjob: - if (!qemuDomainObjEndJob(driver, vm)) -@@ -10178,6 +10183,7 @@ qemuDomainBlockStats(virDomainPtr dom, - cleanup: - if (vm) - virObjectUnlock(vm); -+ VIR_FREE(diskAlias); - return ret; - } - -@@ -10193,11 +10199,11 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, - int idx; - int tmp, ret = -1; - virDomainObjPtr vm; -- virDomainDiskDefPtr disk = NULL; - qemuDomainObjPrivatePtr priv; - long long rd_req, rd_bytes, wr_req, wr_bytes, rd_total_times; - long long wr_total_times, flush_req, flush_total_times, errs; - virTypedParameterPtr param; -+ char *diskAlias = NULL; - - virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); - -@@ -10226,6 +10232,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, - } - - if (*nparams != 0) { -+ virDomainDiskDefPtr disk = NULL; - if ((idx = virDomainDiskIndexByName(vm->def, path, false)) < 0) { - virReportError(VIR_ERR_INVALID_ARG, - _("invalid path: %s"), path); -@@ -10239,6 +10246,8 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, - disk->dst); - goto endjob; - } -+ if (VIR_STRDUP(diskAlias, disk->info.alias) < 0) -+ goto endjob; - } - - priv = vm->privateData; -@@ -10249,12 +10258,12 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, - ret = qemuMonitorGetBlockStatsParamsNumber(priv->mon, nparams); - - if (tmp == 0 || ret < 0) { -- qemuDomainObjExitMonitor(driver, vm); -+ ignore_value(qemuDomainObjExitMonitor(driver, vm)); - goto endjob; - } - - ret = qemuMonitorGetBlockStatsInfo(priv->mon, -- disk->info.alias, -+ diskAlias, - &rd_req, - &rd_bytes, - &rd_total_times, -@@ -10265,7 +10274,8 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, - &flush_total_times, - &errs); - -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ ret = -1; - - if (ret < 0) - goto endjob; -@@ -10353,6 +10363,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, - cleanup: - if (vm) - virObjectUnlock(vm); -+ VIR_FREE(diskAlias); - return ret; - } - -@@ -16544,7 +16555,8 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - } - qemuDomainObjEnterMonitor(driver, vm); - ret = qemuMonitorSetBlockIoThrottle(priv->mon, device, &info); -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ ret = -1; - if (ret < 0) - goto endjob; - vm->def->disks[idx]->blkdeviotune = info; --- -2.2.1 - diff --git a/SOURCES/libvirt-Fix-vmdef-usage-while-in-monitor-in-qemu-process.patch b/SOURCES/libvirt-Fix-vmdef-usage-while-in-monitor-in-qemu-process.patch deleted file mode 100644 index 30deee6..0000000 --- a/SOURCES/libvirt-Fix-vmdef-usage-while-in-monitor-in-qemu-process.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 3a2b715e02c2e0205e7787d9aefd332743ef5599 Mon Sep 17 00:00:00 2001 -Message-Id: <3a2b715e02c2e0205e7787d9aefd332743ef5599@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Mon, 19 Jan 2015 10:48:31 +0100 -Subject: [PATCH] Fix vmdef usage while in monitor in qemu process -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1161024 - -Make local copy of the disk alias in qemuProcessInitPasswords, -instead of referencing the one in domain definition, which -might get freed if the domain crashes while we're in monitor. - -Also copy the memballoon period value. - -(cherry picked from commit c749eda4a2220cddb24467fbbcf22c9b7917b8a2) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 31 +++++++++++++++++++------------ - 1 file changed, 19 insertions(+), 12 deletions(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 90e45a8..ae1dbdf 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2550,6 +2550,8 @@ qemuProcessInitPasswords(virConnectPtr conn, - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - size_t i; -+ char *alias = NULL; -+ char *secret = NULL; - - for (i = 0; i < vm->def->ngraphics; ++i) { - virDomainGraphicsDefPtr graphics = vm->def->graphics[i]; -@@ -2573,33 +2575,34 @@ qemuProcessInitPasswords(virConnectPtr conn, - - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { - for (i = 0; i < vm->def->ndisks; i++) { -- char *secret; - size_t secretLen; -- const char *alias; - - if (!vm->def->disks[i]->src->encryption || - !virDomainDiskGetSource(vm->def->disks[i])) - continue; - -+ VIR_FREE(secret); - if (qemuProcessGetVolumeQcowPassphrase(conn, - vm->def->disks[i], - &secret, &secretLen) < 0) - goto cleanup; - -- alias = vm->def->disks[i]->info.alias; -- if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) { -- VIR_FREE(secret); -+ VIR_FREE(alias); -+ if (VIR_STRDUP(alias, vm->def->disks[i]->info.alias) < 0) -+ goto cleanup; -+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) - goto cleanup; -- } - ret = qemuMonitorSetDrivePassphrase(priv->mon, alias, secret); -- VIR_FREE(secret); -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ ret = -1; - if (ret < 0) - goto cleanup; - } - } - - cleanup: -+ VIR_FREE(alias); -+ VIR_FREE(secret); - virObjectUnref(cfg); - return ret; - } -@@ -4251,6 +4254,7 @@ int qemuProcessStart(virConnectPtr conn, - virCommandPtr cmd = NULL; - struct qemuProcessHookData hookData; - unsigned long cur_balloon; -+ unsigned int period = 0; - size_t i; - bool rawio_set = false; - char *nodeset = NULL; -@@ -4864,15 +4868,18 @@ int qemuProcessStart(virConnectPtr conn, - vm->def->mem.cur_balloon); - goto cleanup; - } -- if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) -- goto cleanup; - if (vm->def->memballoon && vm->def->memballoon->period) -- qemuMonitorSetMemoryStatsPeriod(priv->mon, vm->def->memballoon->period); -+ period = vm->def->memballoon->period; -+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) -+ goto cleanup; -+ if (period) -+ qemuMonitorSetMemoryStatsPeriod(priv->mon, period); - if (qemuMonitorSetBalloon(priv->mon, cur_balloon) < 0) { - qemuDomainObjExitMonitor(driver, vm); - goto cleanup; - } -- qemuDomainObjExitMonitor(driver, vm); -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto cleanup; - - VIR_DEBUG("Detecting actual memory size for video device"); - if (qemuProcessUpdateVideoRamSize(driver, vm, asyncJob) < 0) --- -2.2.1 - diff --git a/SOURCES/libvirt-Fix-vmdef-usage-while-in-monitor-in-qemuDomainHotplugVcpus.patch b/SOURCES/libvirt-Fix-vmdef-usage-while-in-monitor-in-qemuDomainHotplugVcpus.patch deleted file mode 100644 index 6ec9ea8..0000000 --- a/SOURCES/libvirt-Fix-vmdef-usage-while-in-monitor-in-qemuDomainHotplugVcpus.patch +++ /dev/null @@ -1,84 +0,0 @@ -From ab2daea383e32d94c6429bc59105cbff1986d6b3 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Wed, 21 Jan 2015 11:39:35 +0100 -Subject: [PATCH] Fix vmdef usage while in monitor in qemuDomainHotplugVcpus -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1161024 - -Exit the monitor right after we've done with it to get -the virDomainObjPtr lock back, otherwise we might be accessing -vm->def while it's being cleaned up by qemuProcessStop. - -If the domain crashed while we were in the monitor, exit -early instead of changing vm->def which is now the persistent -definition. - -(cherry picked from commit 051add2ff90f7b7f821e274fd318e1d845144157) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index a62e429..97d850b 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4462,7 +4462,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, - if (rc == 0) - goto unsupported; - if (rc < 0) -- goto cleanup; -+ goto exit_monitor; - - vcpus++; - } -@@ -4473,7 +4473,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, - if (rc == 0) - goto unsupported; - if (rc < 0) -- goto cleanup; -+ goto exit_monitor; - - vcpus--; - } -@@ -4490,6 +4490,10 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, - * fatal */ - if ((ncpupids = qemuMonitorGetCPUInfo(priv->mon, &cpupids)) <= 0) { - virResetLastError(); -+ goto exit_monitor; -+ } -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) { -+ ret = -1; - goto cleanup; - } - -@@ -4610,10 +4614,10 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, - cpupids = NULL; - - cleanup: -- qemuDomainObjExitMonitor(driver, vm); -- vm->def->vcpus = vcpus; - VIR_FREE(cpupids); - VIR_FREE(mem_mask); -+ if (virDomainObjIsActive(vm)) -+ vm->def->vcpus = vcpus; - virDomainAuditVcpu(vm, oldvcpus, nvcpus, "update", rc == 1); - if (cgroup_vcpu) - virCgroupFree(&cgroup_vcpu); -@@ -4622,6 +4626,8 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, - unsupported: - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot change vcpu count of this domain")); -+ exit_monitor: -+ ignore_value(qemuDomainObjExitMonitor(driver, vm)); - goto cleanup; - } - --- -2.2.1 - diff --git a/SOURCES/libvirt-Fixes-for-domains-with-no-iothreads.patch b/SOURCES/libvirt-Fixes-for-domains-with-no-iothreads.patch deleted file mode 100644 index 2ff62a2..0000000 --- a/SOURCES/libvirt-Fixes-for-domains-with-no-iothreads.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 33cfcaf372eba54ed1da4969a95281cf12b78a66 Mon Sep 17 00:00:00 2001 -Message-Id: <33cfcaf372eba54ed1da4969a95281cf12b78a66@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 18 Sep 2014 09:30:03 -0400 -Subject: [PATCH] Fixes for domains with no iothreads - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -Plug a memory leak and silence a warning. - -(cherry picked from commit c1480871bbf4de10a06efd39dc0a61ae3889db2d) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_cgroup.c | 2 +- - src/qemu/qemu_process.c | 6 ++++-- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index 9d39370..7c6b2c1 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -1131,7 +1131,7 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm) - if (priv->cgroup == NULL) - return 0; - -- if (priv->niothreadpids == 0) { -+ if (def->iothreads && priv->niothreadpids == 0) { - VIR_WARN("Unable to get iothreads' pids."); - return 0; - } -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 3b43912..776edee 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2116,8 +2116,10 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver, - goto cleanup; - - /* Nothing to do */ -- if (niothreads == 0) -- return 0; -+ if (niothreads == 0) { -+ ret = 0; -+ goto cleanup; -+ } - - if (niothreads != vm->def->iothreads) { - virReportError(VIR_ERR_INTERNAL_ERROR, --- -2.1.0 - diff --git a/SOURCES/libvirt-Format-CPU-features-even-for-host-model.patch b/SOURCES/libvirt-Format-CPU-features-even-for-host-model.patch deleted file mode 100644 index 6116826..0000000 --- a/SOURCES/libvirt-Format-CPU-features-even-for-host-model.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 613c26c910fb69cc7c69677f637b80e162250094 Mon Sep 17 00:00:00 2001 -Message-Id: <613c26c910fb69cc7c69677f637b80e162250094@dist-git> -From: Prerna Saxena -Date: Thu, 15 Jan 2015 12:57:16 +0100 -Subject: [PATCH] Format CPU features even for host-model -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1182448 - -Partial backport of the upstream commit: -PowerPC : Add support for launching VM in 'compat' mode. - -PowerISA allows processors to run VMs in binary compatibility ("compat") -mode supporting an older version of ISA. QEMU has recently added support to -explicitly denote a VM running in compatibility mode through commit 6d9412ea -& 8dfa3a5e85. Now, a "compat" mode VM can be run by invoking this qemu -commandline on a POWER8 host: -cpu host,compat=power7. - -This patch allows libvirt to exploit cpu mode 'host-model' to describe this -new mode for PowerKVM guests. For example, when a user wants to request a -power7 vm to run in compatibility mode on a Power8 host, this can be -described in XML as follows : - - - power7 - - -Signed-off-by: Prerna Saxena -Signed-off-by: Li Zhang -Signed-off-by: Pradipta Kr. Banerjee -Acked-by: Michal Privoznik -(cherry picked from commit addce06c9221f948072cd222b56ea9c3f70ec066) -Signed-off-by: Ján Tomko - -My upstream commit dd324bb2703b9cf619c521b2a04f186cd9734f0a - Do not format CPU features without a model -for bug https://bugzilla.redhat.com/show_bug.cgi?id=1151885 only formats -the features if 'formatModel' is set if we need to format features, but -without this patch, it's not done for host-model. - -Conflicts: - src/qemu/qemu_command.c (in the part omitted from this backport) -Signed-off-by: Jiri Denemark ---- - src/conf/cpu_conf.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c -index 95e04c7..8388f44 100644 ---- a/src/conf/cpu_conf.c -+++ b/src/conf/cpu_conf.c -@@ -622,6 +622,7 @@ virCPUDefFormatBuf(virBufferPtr buf, - return 0; - - formatModel = (def->mode == VIR_CPU_MODE_CUSTOM || -+ def->mode == VIR_CPU_MODE_HOST_MODEL || - (flags & VIR_DOMAIN_XML_UPDATE_CPU)); - formatFallback = (def->type == VIR_CPU_TYPE_GUEST && - (def->mode == VIR_CPU_MODE_HOST_MODEL || --- -2.2.1 - diff --git a/SOURCES/libvirt-Free-job-statistics-from-the-migration-cookie.patch b/SOURCES/libvirt-Free-job-statistics-from-the-migration-cookie.patch deleted file mode 100644 index 77aadfa..0000000 --- a/SOURCES/libvirt-Free-job-statistics-from-the-migration-cookie.patch +++ /dev/null @@ -1,43 +0,0 @@ -From f361614b6a8dd6a687f90c5a3a5cf51d8918dcfe Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 6 Nov 2014 13:56:03 +0100 -Subject: [PATCH] Free job statistics from the migration cookie -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1161124 - -==404== 232 bytes in 1 blocks are definitely lost in loss record 669 of 758 -==404== at 0x4C2B934: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) -==404== by 0x52A2BF3: virAlloc (viralloc.c:144) -==404== by 0x1D49AD70: qemuMigrationCookieAddStatistics (qemu_migration.c:554) -==404== by 0x1D49AD70: qemuMigrationBakeCookie (qemu_migration.c:1228) -==404== by 0x1D4A43B8: qemuMigrationFinish (qemu_migration.c:5002) -==404== by 0x1D4C9339: qemuDomainMigrateFinish3Params (qemu_driver.c:11526) - -Introduced by commit 5d6fb96 - -(cherry picked from commit 1d1c5ecd1360d74292a5db18fbd90fe27ec2551b) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index cc245f6..98fd376 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -219,6 +219,7 @@ static void qemuMigrationCookieFree(qemuMigrationCookiePtr mig) - VIR_FREE(mig->lockState); - VIR_FREE(mig->lockDriver); - VIR_FREE(mig->nbd); -+ VIR_FREE(mig->jobInfo); - VIR_FREE(mig); - } - --- -2.1.3 - diff --git a/SOURCES/libvirt-Generate-a-MAC-when-loading-a-config-instead-of-package-update.patch b/SOURCES/libvirt-Generate-a-MAC-when-loading-a-config-instead-of-package-update.patch deleted file mode 100644 index fd79d97..0000000 --- a/SOURCES/libvirt-Generate-a-MAC-when-loading-a-config-instead-of-package-update.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 4cf1de1c458fd21cc55546f4281ed03fc1532c7b Mon Sep 17 00:00:00 2001 -Message-Id: <4cf1de1c458fd21cc55546f4281ed03fc1532c7b@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 2 Dec 2014 16:12:35 +0100 -Subject: [PATCH] Generate a MAC when loading a config instead of package - update - -Partially reverts commit 5754dbd. - -The code in the specfile adds a MAC address to every , -even for for which we don't support -changing MAC addresses. - -Remove it completely. For new networks, we have been adding -MAC addresses on definition/creation since the commit mentioned above. -For existing networks (pre-0.9.0), the MAC is added by this commit. - -https://bugzilla.redhat.com/show_bug.cgi?id=1156367 -(cherry picked from commit a47ae7c004e92f959b45808ca82326e8559c2f61) - -Signed-off-by: Jiri Denemark ---- - libvirt.spec.in | 42 ------------------------------------------ - src/conf/network_conf.c | 4 ++++ - 2 files changed, 4 insertions(+), 42 deletions(-) - -diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c -index d348a20..7b17d59 100644 ---- a/src/conf/network_conf.c -+++ b/src/conf/network_conf.c -@@ -3147,6 +3147,10 @@ virNetworkObjPtr virNetworkLoadConfig(virNetworkObjListPtr nets, - def->forward.type == VIR_NETWORK_FORWARD_NAT || - def->forward.type == VIR_NETWORK_FORWARD_ROUTE) { - -+ if (!def->mac_specified) { -+ virNetworkSetBridgeMacAddr(def); -+ virNetworkSaveConfig(configDir, def); -+ } - /* Generate a bridge if none is specified, but don't check for collisions - * if a bridge is hardcoded, so the network is at least defined. - */ --- -2.2.0 - diff --git a/SOURCES/libvirt-Ignore-CPU-features-without-a-model-for-host-passthrough.patch b/SOURCES/libvirt-Ignore-CPU-features-without-a-model-for-host-passthrough.patch deleted file mode 100644 index 7601063..0000000 --- a/SOURCES/libvirt-Ignore-CPU-features-without-a-model-for-host-passthrough.patch +++ /dev/null @@ -1,145 +0,0 @@ -From 6b34e105829caf93a230b41f43200b036061638d Mon Sep 17 00:00:00 2001 -Message-Id: <6b34e105829caf93a230b41f43200b036061638d@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 11 Dec 2014 13:28:10 +0100 -Subject: [PATCH] Ignore CPU features without a model for host-passthrough - -This fixes reverting to snapshots created by older libvirt -and allows libvirt not to lose track of a domain that -has this in its live status XML (such as a domain -restored from managedsave) - -https://bugzilla.redhat.com/show_bug.cgi?id=1030793 -https://bugzilla.redhat.com/show_bug.cgi?id=1151885 -(cherry picked from commit 15abebdecb35308ddd4d2967efa6dffa4842fac9) - -Signed-off-by: Jiri Denemark ---- - src/conf/cpu_conf.c | 5 ++ - ...argv-cpu-host-passthrough-features-invalid.args | 22 +++++++++ - ...2argv-cpu-host-passthrough-features-invalid.xml | 55 ++++++++++++++++++++++ - tests/qemuxml2argvtest.c | 1 + - 4 files changed, 83 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.xml - -diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c -index 72555a7..95e04c7 100644 ---- a/src/conf/cpu_conf.c -+++ b/src/conf/cpu_conf.c -@@ -365,6 +365,11 @@ virCPUDefParseXML(xmlNodePtr node, - goto error; - - if (n > 0) { -+ if (!def->model && def->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) { -+ /* silently ignore incorrectly formatted features generated -+ * by older libvirt */ -+ goto cleanup; -+ } - if (!def->model && def->mode != VIR_CPU_MODE_HOST_MODEL) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("Non-empty feature list specified without " -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.args -new file mode 100644 -index 0000000..18c1dce ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.args -@@ -0,0 +1,22 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUD\ -+IO_DRV=none \ -+/usr/bin/qemu \ -+-S \ -+-M pc \ -+-cpu host \ -+-m 214 \ -+-smp 1 \ -+-nographic \ -+-monitor unix:/tmp/test-monitor,server,nowait \ -+-no-acpi \ -+-boot c \ -+-usb \ -+-hda /dev/HostVG/QEMUGuest1 \ -+-net none \ -+-serial none \ -+-parallel none -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.xml -new file mode 100644 -index 0000000..b5f5326 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.xml -@@ -0,0 +1,55 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ A description of the test machine. -+ -+ A test of qemu's minimal configuration. -+ This test also tests the description and title elements. -+ -+ 219100 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 967760a..595b658 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1490,6 +1490,7 @@ mymain(void) - DO_TEST_FAILURE("shmem-invalid-size", NONE); - DO_TEST_FAILURE("shmem-small-size", NONE); - DO_TEST_PARSE_ERROR("shmem-msi-only", NONE); -+ DO_TEST("cpu-host-passthrough-features-invalid", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST); - - virObjectUnref(driver.config); - virObjectUnref(driver.caps); --- -2.2.0 - diff --git a/SOURCES/libvirt-Introduce-virErrorCopyNew.patch b/SOURCES/libvirt-Introduce-virErrorCopyNew.patch new file mode 100644 index 0000000..a9f5617 --- /dev/null +++ b/SOURCES/libvirt-Introduce-virErrorCopyNew.patch @@ -0,0 +1,87 @@ +From 9de6f8ef5dbda65683717dd0001cb606792a9ca3 Mon Sep 17 00:00:00 2001 +Message-Id: <9de6f8ef5dbda65683717dd0001cb606792a9ca3@dist-git> +From: Jiri Denemark +Date: Fri, 10 Jul 2015 08:44:41 +0200 +Subject: [PATCH] Introduce virErrorCopyNew + +A helper function for copying error objects. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 9d0a2af6c230ce3007b3504907ccdba09cdc4cf2) + +https://bugzilla.redhat.com/show_bug.cgi?id=1090093 + +Signed-off-by: Jiri Denemark +--- + docs/apibuild.py | 1 + + src/libvirt_private.syms | 1 + + src/util/virerror.c | 16 ++++++++++++++++ + src/util/virerror.h | 1 + + 4 files changed, 19 insertions(+) + +diff --git a/docs/apibuild.py b/docs/apibuild.py +index 69f991d..f934fb2 100755 +--- a/docs/apibuild.py ++++ b/docs/apibuild.py +@@ -102,6 +102,7 @@ ignored_functions = { + "virDomainMigratePrepare3Params": "private function for migration", + "virDomainMigrateConfirm3Params": "private function for migration", + "virDomainMigratePrepareTunnel3Params": "private function for tunnelled migration", ++ "virErrorCopyNew": "private", + } + + ignored_macros = { +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 65168b1..1a03268 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -1365,6 +1365,7 @@ ebtablesRemoveForwardAllowIn; + + # util/virerror.h + virDispatchError; ++virErrorCopyNew; + virErrorInitialize; + virErrorSetErrnoFromLastError; + virLastErrorIsSystemErrno; +diff --git a/src/util/virerror.c b/src/util/virerror.c +index fae627b..60b2e79 100644 +--- a/src/util/virerror.c ++++ b/src/util/virerror.c +@@ -214,6 +214,22 @@ virCopyError(virErrorPtr from, + return ret; + } + ++ ++virErrorPtr ++virErrorCopyNew(virErrorPtr err) ++{ ++ virErrorPtr ret; ++ ++ if (VIR_ALLOC_QUIET(ret) < 0) ++ return NULL; ++ ++ if (virCopyError(err, ret) < 0) ++ VIR_FREE(ret); ++ ++ return ret; ++} ++ ++ + static virErrorPtr + virLastErrorObject(void) + { +diff --git a/src/util/virerror.h b/src/util/virerror.h +index baa2d08..2348648 100644 +--- a/src/util/virerror.h ++++ b/src/util/virerror.h +@@ -185,6 +185,7 @@ void virReportOOMErrorFull(int domcode, + virRaiseErrorObject(__FILE__, __FUNCTION__, __LINE__, obj) + + int virSetError(virErrorPtr newerr); ++virErrorPtr virErrorCopyNew(virErrorPtr err); + void virDispatchError(virConnectPtr conn); + const char *virStrerror(int theerrno, char *errBuf, size_t errBufLen); + +-- +2.4.5 + diff --git a/SOURCES/libvirt-Introduce-virHashAtomic.patch b/SOURCES/libvirt-Introduce-virHashAtomic.patch new file mode 100644 index 0000000..ad98343 --- /dev/null +++ b/SOURCES/libvirt-Introduce-virHashAtomic.patch @@ -0,0 +1,201 @@ +From c940f107b75694c3272ca98cb69b9d7df8cd2d0b Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Thu, 2 Jul 2015 14:21:27 +0200 +Subject: [PATCH] Introduce virHashAtomic + +This is a self-locking wrapper around virHashTable. Only a limited set +of APIs are implemented now (the ones which are used in the following +patch) as more can be added on demand. + +Signed-off-by: Jiri Denemark +(cherry picked from commit a7c22a1f2949e781aef4aa82afda407efd344f95) + +https://bugzilla.redhat.com/show_bug.cgi?id=1090093 + +Signed-off-by: Jiri Denemark +--- + src/libvirt_private.syms | 3 ++ + src/util/virhash.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ + src/util/virhash.h | 10 ++++++ + 3 files changed, 94 insertions(+) + +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 720afdf..65168b1 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -1476,6 +1476,9 @@ virFirewallStartTransaction; + + # util/virhash.h + virHashAddEntry; ++virHashAtomicNew; ++virHashAtomicSteal; ++virHashAtomicUpdate; + virHashCreate; + virHashEqual; + virHashForEach; +diff --git a/src/util/virhash.c b/src/util/virhash.c +index e3c1880..3cfcc69 100644 +--- a/src/util/virhash.c ++++ b/src/util/virhash.c +@@ -31,6 +31,7 @@ + #include "virhashcode.h" + #include "virrandom.h" + #include "virstring.h" ++#include "virobject.h" + + #define VIR_FROM_THIS VIR_FROM_NONE + +@@ -76,6 +77,28 @@ struct _virHashTable { + virHashKeyFree keyFree; + }; + ++struct _virHashAtomic { ++ virObjectLockable parent; ++ virHashTablePtr hash; ++}; ++ ++static virClassPtr virHashAtomicClass; ++static void virHashAtomicDispose(void *obj); ++ ++static int virHashAtomicOnceInit(void) ++{ ++ virHashAtomicClass = virClassNew(virClassForObjectLockable(), ++ "virHashAtomic", ++ sizeof(virHashAtomic), ++ virHashAtomicDispose); ++ if (!virHashAtomicClass) ++ return -1; ++ else ++ return 0; ++} ++VIR_ONCE_GLOBAL_INIT(virHashAtomic) ++ ++ + static uint32_t virHashStrCode(const void *name, uint32_t seed) + { + return virHashCodeGen(name, strlen(name), seed); +@@ -178,6 +201,36 @@ virHashTablePtr virHashCreate(ssize_t size, virHashDataFree dataFree) + virHashStrFree); + } + ++ ++virHashAtomicPtr ++virHashAtomicNew(ssize_t size, ++ virHashDataFree dataFree) ++{ ++ virHashAtomicPtr hash; ++ ++ if (virHashAtomicInitialize() < 0) ++ return NULL; ++ ++ if (!(hash = virObjectLockableNew(virHashAtomicClass))) ++ return NULL; ++ ++ if (!(hash->hash = virHashCreate(size, dataFree))) { ++ virObjectUnref(hash); ++ return NULL; ++ } ++ return hash; ++} ++ ++ ++static void ++virHashAtomicDispose(void *obj) ++{ ++ virHashAtomicPtr hash = obj; ++ ++ virHashFree(hash->hash); ++} ++ ++ + /** + * virHashGrow: + * @table: the hash table +@@ -360,6 +413,21 @@ virHashUpdateEntry(virHashTablePtr table, const void *name, + return virHashAddOrUpdateEntry(table, name, userdata, true); + } + ++int ++virHashAtomicUpdate(virHashAtomicPtr table, ++ const void *name, ++ void *userdata) ++{ ++ int ret; ++ ++ virObjectLock(table); ++ ret = virHashAddOrUpdateEntry(table->hash, name, userdata, true); ++ virObjectUnlock(table); ++ ++ return ret; ++} ++ ++ + /** + * virHashLookup: + * @table: the hash table +@@ -409,6 +477,19 @@ void *virHashSteal(virHashTablePtr table, const void *name) + return data; + } + ++void * ++virHashAtomicSteal(virHashAtomicPtr table, ++ const void *name) ++{ ++ void *data; ++ ++ virObjectLock(table); ++ data = virHashSteal(table->hash, name); ++ virObjectUnlock(table); ++ ++ return data; ++} ++ + + /** + * virHashSize: +diff --git a/src/util/virhash.h b/src/util/virhash.h +index a137137..50b9a04 100644 +--- a/src/util/virhash.h ++++ b/src/util/virhash.h +@@ -21,6 +21,9 @@ + typedef struct _virHashTable virHashTable; + typedef virHashTable *virHashTablePtr; + ++typedef struct _virHashAtomic virHashAtomic; ++typedef virHashAtomic *virHashAtomicPtr; ++ + /* + * function types: + */ +@@ -101,6 +104,8 @@ typedef void (*virHashKeyFree)(void *name); + */ + virHashTablePtr virHashCreate(ssize_t size, + virHashDataFree dataFree); ++virHashAtomicPtr virHashAtomicNew(ssize_t size, ++ virHashDataFree dataFree); + virHashTablePtr virHashCreateFull(ssize_t size, + virHashDataFree dataFree, + virHashKeyCode keyCode, +@@ -119,6 +124,9 @@ int virHashAddEntry(virHashTablePtr table, + int virHashUpdateEntry(virHashTablePtr table, + const void *name, + void *userdata); ++int virHashAtomicUpdate(virHashAtomicPtr table, ++ const void *name, ++ void *userdata); + + /* + * Remove an entry from the hash table. +@@ -140,6 +148,8 @@ void *virHashLookup(const virHashTable *table, const void *name); + * Retrieve & remove the userdata. + */ + void *virHashSteal(virHashTablePtr table, const void *name); ++void *virHashAtomicSteal(virHashAtomicPtr table, ++ const void *name); + + /* + * Get the hash table's key/value pairs and have them optionally sorted. +-- +2.4.5 + diff --git a/SOURCES/libvirt-Mark-the-domain-as-active-in-qemuhotplugtest.patch b/SOURCES/libvirt-Mark-the-domain-as-active-in-qemuhotplugtest.patch deleted file mode 100644 index 587ffa5..0000000 --- a/SOURCES/libvirt-Mark-the-domain-as-active-in-qemuhotplugtest.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 7f3f658cf0370f13c8197e2889113196415e32de Mon Sep 17 00:00:00 2001 -Message-Id: <7f3f658cf0370f13c8197e2889113196415e32de@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Mon, 19 Jan 2015 10:48:28 +0100 -Subject: [PATCH] Mark the domain as active in qemuhotplugtest -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1161024 - -This will allow us to call qemuDomainObjIsActive() in -the tested functions to check if the domain has crashed. - -(cherry picked from commit a5e5996b91129130863be8b5608d47d0ef01e326) -Signed-off-by: Ján Tomko - -Conflicts: - tests/qemuhotplugtest.c - 0ecd685 not backported -Signed-off-by: Jiri Denemark ---- - tests/qemuhotplugtest.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c -index 1077013..ae8a8a9 100644 ---- a/tests/qemuhotplugtest.c -+++ b/tests/qemuhotplugtest.c -@@ -40,6 +40,8 @@ enum { - UPDATE - }; - -+#define QEMU_HOTPLUG_TEST_DOMAIN_ID 7 -+ - struct qemuHotplugTestData { - const char *domain_filename; - const char *device_filename; -@@ -90,6 +92,8 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, - if (qemuAssignDeviceAliases((*vm)->def, priv->qemuCaps) < 0) - goto cleanup; - -+ (*vm)->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID; -+ - ret = 0; - cleanup: - return ret; -@@ -177,9 +181,11 @@ testQemuHotplugCheckResult(virDomainObjPtr vm, - char *actual; - int ret; - -+ vm->def->id = -1; - actual = virDomainDefFormat(vm->def, VIR_DOMAIN_XML_SECURE); - if (!actual) - return -1; -+ vm->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID; - - if (STREQ(expected, actual)) { - if (fail && virTestGetVerbose()) --- -2.2.1 - diff --git a/SOURCES/libvirt-Match-scsi_host-pools-by-parent-address-first.patch b/SOURCES/libvirt-Match-scsi_host-pools-by-parent-address-first.patch deleted file mode 100644 index de704b0..0000000 --- a/SOURCES/libvirt-Match-scsi_host-pools-by-parent-address-first.patch +++ /dev/null @@ -1,69 +0,0 @@ -From b8ef2c7dbcaedff7a5eb49ccd339ab15b0ffe407 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Sat, 1 Nov 2014 17:55:32 -0400 -Subject: [PATCH] Match scsi_host pools by parent address first - -https://bugzilla.redhat.com/show_bug.cgi?id=1146837 - -If both source adapters are specified by a parent address, -just comparing the address is faster and catches even addresses -that do not refer to valid adapters. - -(cherry picked from commit 77911d305dfe22f2c93e560ac71602efd73e8ffa) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/conf/storage_conf.c | 29 +++++++++++++++++++++++++++++ - 1 file changed, 29 insertions(+) - -diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c -index 7fa3dbf..d614b2d 100644 ---- a/src/conf/storage_conf.c -+++ b/src/conf/storage_conf.c -@@ -2093,6 +2093,28 @@ getSCSIHostNumber(virStoragePoolSourceAdapter adapter, - VIR_FREE(name); - return ret; - } -+static bool -+matchSCSIAdapterParent(virStoragePoolObjPtr pool, -+ virStoragePoolDefPtr def) -+{ -+ virDevicePCIAddressPtr pooladdr = -+ &pool->def->source.adapter.data.scsi_host.parentaddr; -+ virDevicePCIAddressPtr defaddr = -+ &def->source.adapter.data.scsi_host.parentaddr; -+ int pool_unique_id = -+ pool->def->source.adapter.data.scsi_host.unique_id; -+ int def_unique_id = -+ def->source.adapter.data.scsi_host.unique_id; -+ if (pooladdr->domain == defaddr->domain && -+ pooladdr->bus == defaddr->bus && -+ pooladdr->slot == defaddr->slot && -+ pooladdr->function == defaddr->function && -+ pool_unique_id == def_unique_id) { -+ return true; -+ } -+ return false; -+} -+ - - int - virStoragePoolSourceFindDuplicate(virStoragePoolObjListPtr pools, -@@ -2142,6 +2164,13 @@ virStoragePoolSourceFindDuplicate(virStoragePoolObjListPtr pools, - VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST) { - unsigned int pool_hostnum, def_hostnum; - -+ if (pool->def->source.adapter.data.scsi_host.has_parent && -+ def->source.adapter.data.scsi_host.has_parent && -+ matchSCSIAdapterParent(pool, def)) { -+ matchpool = pool; -+ break; -+ } -+ - if (getSCSIHostNumber(pool->def->source.adapter, - &pool_hostnum) < 0 || - getSCSIHostNumber(def->source.adapter, &def_hostnum) < 0) --- -2.1.3 - diff --git a/SOURCES/libvirt-Move-the-FIPS-detection-from-capabilities.patch b/SOURCES/libvirt-Move-the-FIPS-detection-from-capabilities.patch deleted file mode 100644 index c24ebbb..0000000 --- a/SOURCES/libvirt-Move-the-FIPS-detection-from-capabilities.patch +++ /dev/null @@ -1,356 +0,0 @@ -From 2720e38743321bdd20f94b6abf7440b7f57f5e00 Mon Sep 17 00:00:00 2001 -Message-Id: <2720e38743321bdd20f94b6abf7440b7f57f5e00@dist-git> -From: Pavel Hrdina -Date: Fri, 19 Sep 2014 09:20:15 +0200 -Subject: [PATCH] Move the FIPS detection from capabilities - -We are not detecting the presence of FIPS from QEMU, but from procfs and -that means it's not QEMU capability. It was decided that we will pass -this flag to QEMU even if it's not supported by old QEMU binaries. - -This patch also reverts changes done by commit a21cfb0f to -qemucapabilitestest and implements a new test case in qemuxml2argvtest. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1135431 - -Signed-off-by: Pavel Hrdina -(cherry picked from commit da7799d879fd037849f820667b9b610bf94b6262) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 24 --------------- - src/qemu/qemu_command.c | 34 ++++++++++++++++++++-- - src/qemu/qemu_command.h | 6 +++- - src/qemu/qemu_driver.c | 3 +- - src/qemu/qemu_process.c | 3 +- - tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 - - tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 - - tests/qemucapabilitiestest.c | 24 +++++---------- - .../qemuxml2argv-fips-enabled.args | 6 ++++ - .../qemuxml2argvdata/qemuxml2argv-fips-enabled.xml | 25 ++++++++++++++++ - tests/qemuxml2argvtest.c | 9 +++++- - tests/qemuxmlnstest.c | 2 +- - 12 files changed, 89 insertions(+), 49 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.xml - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 67bfc36..4145c22 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -3215,30 +3215,6 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps, - config.data.nix.path = monpath; - config.data.nix.listen = false; - -- /* Qemu 1.2 and later have a binary flag -enable-fips that must be -- * used for VNC auth to obey FIPS settings; but the flag only -- * exists on Linux, and with no way to probe for it via QMP. Our -- * solution: if FIPS mode is required, then unconditionally use -- * the flag, regardless of qemu version, for the following matrix: -- * -- * old QEMU new QEMU -- * FIPS enabled doesn't start VNC auth disabled -- * FIPS disabled/missing VNC auth enabled VNC auth enabled -- * -- * Setting the flag here instead of in virQEMUCapsInitQMPMonitor -- * or virQEMUCapsInitHelp also allows the testsuite to be -- * independent of FIPS setting. -- */ -- if (virFileExists("/proc/sys/crypto/fips_enabled")) { -- char *buf = NULL; -- -- if (virFileReadAll("/proc/sys/crypto/fips_enabled", 10, &buf) < 0) -- goto cleanup; -- if (STREQ(buf, "1\n")) -- virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_FIPS); -- VIR_FREE(buf); -- } -- - VIR_DEBUG("Try to get caps via QMP qemuCaps=%p", qemuCaps); - - /* -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index fb9c453..82ee58b 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -3292,6 +3292,35 @@ qemuCheckDiskConfig(virDomainDiskDefPtr disk) - } - - -+/* Qemu 1.2 and later have a binary flag -enable-fips that must be -+ * used for VNC auth to obey FIPS settings; but the flag only -+ * exists on Linux, and with no way to probe for it via QMP. Our -+ * solution: if FIPS mode is required, then unconditionally use -+ * the flag, regardless of qemu version, for the following matrix: -+ * -+ * old QEMU new QEMU -+ * FIPS enabled doesn't start VNC auth disabled -+ * FIPS disabled/missing VNC auth enabled VNC auth enabled -+ */ -+bool -+qemuCheckFips(void) -+{ -+ bool ret = false; -+ -+ if (virFileExists("/proc/sys/crypto/fips_enabled")) { -+ char *buf = NULL; -+ -+ if (virFileReadAll("/proc/sys/crypto/fips_enabled", 10, &buf) < 0) -+ return ret; -+ if (STREQ(buf, "1\n")) -+ ret = true; -+ VIR_FREE(buf); -+ } -+ -+ return ret; -+} -+ -+ - char * - qemuBuildDriveStr(virConnectPtr conn, - virDomainDiskDefPtr disk, -@@ -7542,7 +7571,8 @@ qemuBuildCommandLine(virConnectPtr conn, - virDomainSnapshotObjPtr snapshot, - virNetDevVPortProfileOp vmop, - qemuBuildCommandLineCallbacksPtr callbacks, -- bool standalone) -+ bool standalone, -+ bool enableFips) - { - virErrorPtr originalError = NULL; - size_t i, j; -@@ -7655,7 +7685,7 @@ qemuBuildCommandLine(virConnectPtr conn, - if (!standalone) - virCommandAddArg(cmd, "-S"); /* freeze CPU */ - -- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ENABLE_FIPS)) -+ if (enableFips) - virCommandAddArg(cmd, "-enable-fips"); - - if (qemuBuildMachineArgStr(cmd, def, qemuCaps) < 0) -diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h -index 633ff71..aa40c9e 100644 ---- a/src/qemu/qemu_command.h -+++ b/src/qemu/qemu_command.h -@@ -78,7 +78,8 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn, - virDomainSnapshotObjPtr current_snapshot, - virNetDevVPortProfileOp vmop, - qemuBuildCommandLineCallbacksPtr callbacks, -- bool forXMLToArgv) -+ bool forXMLToArgv, -+ bool enableFips) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(11); - - /* Generate '-device' string for chardev device */ -@@ -273,4 +274,7 @@ int qemuGetDriveSourceString(virStorageSourcePtr src, - char **source); - - int qemuCheckDiskConfig(virDomainDiskDefPtr disk); -+ -+bool -+qemuCheckFips(void); - #endif /* __QEMU_COMMAND_H__*/ -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index f914081..98b214a 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -6126,7 +6126,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, - NULL, -1, NULL, - VIR_NETDEV_VPORT_PROFILE_OP_NO_OP, - &buildCommandLineCallbacks, -- true))) -+ true, -+ qemuCheckFips()))) - goto cleanup; - - ret = virCommandToString(cmd); -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 776edee..a0eb845 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -4304,7 +4304,8 @@ int qemuProcessStart(virConnectPtr conn, - if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig, - priv->monJSON, priv->qemuCaps, - migrateFrom, stdin_fd, snapshot, vmop, -- &buildCommandLineCallbacks, false))) -+ &buildCommandLineCallbacks, false, -+ qemuCheckFips()))) - goto cleanup; - - /* now that we know it is about to start call the hook if present */ -diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps -index c8a379a..3b1b699 100644 ---- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps -@@ -112,7 +112,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps -index e10f030..21d4320 100644 ---- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps -@@ -138,7 +138,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c -index 4e5f9e5..2f2b73d 100644 ---- a/tests/qemucapabilitiestest.c -+++ b/tests/qemucapabilitiestest.c -@@ -31,7 +31,6 @@ typedef testQemuData *testQemuDataPtr; - struct _testQemuData { - virDomainXMLOptionPtr xmlopt; - const char *base; -- bool fips; - }; - - static qemuMonitorTestPtr -@@ -143,12 +142,6 @@ testQemuCaps(const void *opaque) - qemuMonitorTestGetMonitor(mon)) < 0) - goto cleanup; - -- /* So that our test does not depend on the contents of /proc, we -- * hoisted the setting of ENABLE_FIPS to virQEMUCapsInitQMP. But -- * we do want to test the effect of that flag. */ -- if (data->fips) -- virQEMUCapsSet(capsComputed, QEMU_CAPS_ENABLE_FIPS); -- - if (testQemuCapsCompare(capsProvided, capsComputed) < 0) - goto cleanup; - -@@ -183,19 +176,18 @@ mymain(void) - - data.xmlopt = xmlopt; - --#define DO_TEST_FULL(name, use_fips) \ -- data.base = name; \ -- data.fips = use_fips; \ -- if (virtTestRun(name, testQemuCaps, &data) < 0) \ -- ret = -1 -+#define DO_TEST(name) \ -+ do { \ -+ data.base = name; \ -+ if (virtTestRun(name, testQemuCaps, &data) < 0) \ -+ ret = -1; \ -+ } while (0) - --#define DO_TEST(name) DO_TEST_FULL(name, false) -- -- DO_TEST_FULL("caps_1.2.2-1", true); -+ DO_TEST("caps_1.2.2-1"); - DO_TEST("caps_1.3.1-1"); - DO_TEST("caps_1.4.2-1"); - DO_TEST("caps_1.5.3-1"); -- DO_TEST_FULL("caps_1.6.0-1", true); -+ DO_TEST("caps_1.6.0-1"); - DO_TEST("caps_1.6.50-1"); - - virObjectUnref(xmlopt); -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.args b/tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.args -new file mode 100644 -index 0000000..196f61f ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.args -@@ -0,0 +1,6 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu \ -+-S -enable-fips -M pc -m 214 -smp 1 -nographic -monitor \ -+unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /dev/HostVG/QEMUGuest1 -net none -serial \ -+none -parallel none -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.xml -new file mode 100644 -index 0000000..a6b041d ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.xml -@@ -0,0 +1,25 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 68fc01b..a9129dc 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -259,6 +259,7 @@ typedef enum { - FLAG_EXPECT_FAILURE = 1 << 1, - FLAG_EXPECT_PARSE_ERROR = 1 << 2, - FLAG_JSON = 1 << 3, -+ FLAG_FIPS = 1 << 4, - } virQemuXML2ArgvTestFlags; - - static int testCompareXMLToArgvFiles(const char *xml, -@@ -360,7 +361,8 @@ static int testCompareXMLToArgvFiles(const char *xml, - (flags & FLAG_JSON), extraFlags, - migrateFrom, migrateFd, NULL, - VIR_NETDEV_VPORT_PROFILE_OP_NO_OP, -- &testCallbacks, false))) { -+ &testCallbacks, false, -+ (flags & FLAG_FIPS)))) { - if (!virtTestOOMActive() && - (flags & FLAG_EXPECT_FAILURE)) { - ret = 0; -@@ -443,6 +445,9 @@ testCompareXMLToArgvHelper(const void *data) - if (virQEMUCapsGet(info->extraFlags, QEMU_CAPS_MONITOR_JSON)) - flags |= FLAG_JSON; - -+ if (virQEMUCapsGet(info->extraFlags, QEMU_CAPS_ENABLE_FIPS)) -+ flags |= FLAG_FIPS; -+ - result = testCompareXMLToArgvFiles(xml, args, info->extraFlags, - info->migrateFrom, info->migrateFd, - flags); -@@ -1454,6 +1459,8 @@ mymain(void) - DO_TEST("panic", QEMU_CAPS_DEVICE_PANIC, - QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); - -+ DO_TEST("fips-enabled", QEMU_CAPS_ENABLE_FIPS); -+ - virObjectUnref(driver.config); - virObjectUnref(driver.caps); - virObjectUnref(driver.xmlopt); -diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c -index e8f70d6..b3a608c 100644 ---- a/tests/qemuxmlnstest.c -+++ b/tests/qemuxmlnstest.c -@@ -119,7 +119,7 @@ static int testCompareXMLToArgvFiles(const char *xml, - vmdef, &monitor_chr, json, extraFlags, - migrateFrom, migrateFd, NULL, - VIR_NETDEV_VPORT_PROFILE_OP_NO_OP, -- &testCallbacks, false))) -+ &testCallbacks, false, false))) - goto fail; - - if (!virtTestOOMActive()) { --- -2.1.1 - diff --git a/SOURCES/libvirt-QXL-fix-setting-ram-and-vram-values-for-QEMU-QXL-device.patch b/SOURCES/libvirt-QXL-fix-setting-ram-and-vram-values-for-QEMU-QXL-device.patch deleted file mode 100644 index 9a19342..0000000 --- a/SOURCES/libvirt-QXL-fix-setting-ram-and-vram-values-for-QEMU-QXL-device.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 1442e803c97a4e528a6319f097d82968ed46f965 Mon Sep 17 00:00:00 2001 -Message-Id: <1442e803c97a4e528a6319f097d82968ed46f965@dist-git> -From: Pavel Hrdina -Date: Tue, 25 Nov 2014 10:53:00 +0100 -Subject: [PATCH] QXL: fix setting ram and vram values for QEMU QXL device - -QEMU has two different type of QXL display device. The first "qxl-vga" -is for primary video device and second "qxl" is for secondary video -device. - -There are also two different ways how to specify those devices on qemu -command line, the first one and obsolete is using "-vga" option and the -current new one is using "-device" option. The "-vga" could be used only -to setup primary video device, so the "-vga qxl" equal to -"-device qxl-vga". Unfortunately the "-vga qxl" doesn't support setting -additional parameters for the device and "-global" option must be used -for this purpose. It's mandatory to use "-global qxl-vga...." to set the -parameters of primary video device previously defined with "-vga qxl". - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 - -Signed-off-by: Pavel Hrdina -(cherry picked from commit c32cfc6d3ff53e6493928ac4bc14a19cd162bc4b) -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 15 +++++++++++++-- - .../qemuxml2argv-graphics-spice-compression.args | 2 +- - .../qemuxml2argv-graphics-spice-sasl.args | 4 ++-- - tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args | 4 ++-- - tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args | 2 +- - tests/qemuxml2argvdata/qemuxml2argv-q35.args | 2 +- - 6 files changed, 20 insertions(+), 9 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 8d73f89..c75d3b0 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -9107,11 +9107,22 @@ qemuBuildCommandLine(virConnectPtr conn, - - virCommandAddArgList(cmd, "-vga", vgastr, NULL); - -+ /* If we cannot use --device option to specify the video device -+ * in QEMU we will fallback to the old --vga option. To get the -+ * correct device name for the --vga option the 'qemuVideo' is -+ * used, but to set some device attributes we need to use the -+ * --global option and for that we need to specify the device -+ * name the same as for --device option and for that we need to -+ * use 'qemuDeviceVideo'. -+ * -+ * See 'Graphics Devices' section in docs/qdev-device-use.txt in -+ * QEMU repository. -+ */ -+ const char *dev = qemuDeviceVideoTypeToString(primaryVideoType); -+ - if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL && - (def->videos[0]->vram || def->videos[0]->ram) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { -- const char *dev = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA) -- ? "qxl-vga" : "qxl"); - unsigned int ram = def->videos[0]->ram; - unsigned int vram = def->videos[0]->vram; - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args -index cdc916c..e08ee20 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args -@@ -6,6 +6,6 @@ x509-dir=/etc/pki/libvirt-spice,\ - image-compression=auto_glz,jpeg-wan-compression=auto,\ - zlib-glz-wan-compression=auto,\ - playback-compression=on,streaming-video=filter -vga \ --qxl -global qxl.ram_size=67108864 -global qxl.vram_size=33554432 \ -+qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 \ - -device qxl,id=video1,ram_size=67108864,vram_size=33554432,bus=pci.0,addr=0x4 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args -index 0c9df16..4f7f09b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args -@@ -5,5 +5,5 @@ SASL_CONF_PATH=/root/.sasl2 QEMU_AUDIO_DRV=spice \ - /dev/HostVG/QEMUGuest1 \ - -spice port=5903,tls-port=5904,sasl,addr=127.0.0.1,\ - x509-dir=/etc/pki/libvirt-spice,tls-channel=default \ ---vga qxl -global qxl.ram_size=67108864 -global \ --qxl.vram_size=33554432 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -+-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args -index 704cec7..97755c3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args -@@ -7,7 +7,7 @@ plaintext-channel=inputs,\ - image-compression=auto_glz,jpeg-wan-compression=auto,\ - zlib-glz-wan-compression=auto,\ - playback-compression=on,streaming-video=filter,disable-copy-paste,\ --disable-agent-file-xfer -vga qxl -global qxl.ram_size=67108864 \ ---global qxl.vram_size=33554432 \ -+disable-agent-file-xfer -vga qxl -global qxl-vga.ram_size=67108864 \ -+-global qxl-vga.vram_size=33554432 \ - -device qxl,id=video1,ram_size=67108864,vram_size=33554432,bus=pci.0,addr=0x4 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args -index c8045a4..cd2ccca 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args -@@ -6,4 +6,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ - -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \ - -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-sata0-0-0 \ - -device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \ ---vga qxl -global qxl.ram_size=67108864 -global qxl.vram_size=33554432 -+-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args -index 08bd96e..888aa6b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args -@@ -5,4 +5,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ - -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \ - -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-sata0-0-0 \ - -device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \ ---vga qxl -global qxl.ram_size=67108864 -global qxl.vram_size=33554432 -+-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 --- -2.1.3 - diff --git a/SOURCES/libvirt-RHEL-Add-support-for-QMP-I-O-error-reason.patch b/SOURCES/libvirt-RHEL-Add-support-for-QMP-I-O-error-reason.patch index 5c85974..930adbc 100644 --- a/SOURCES/libvirt-RHEL-Add-support-for-QMP-I-O-error-reason.patch +++ b/SOURCES/libvirt-RHEL-Add-support-for-QMP-I-O-error-reason.patch @@ -1,11 +1,10 @@ -From 7d00aff7e3a78d5d03a9191e46975e699cf89e03 Mon Sep 17 00:00:00 2001 -Message-Id: <7d00aff7e3a78d5d03a9191e46975e699cf89e03@dist-git> +From 5c9c53f6c1a8223fdd65f2acb0f5db2cba0f6fd0 Mon Sep 17 00:00:00 2001 +Message-Id: <5c9c53f6c1a8223fdd65f2acb0f5db2cba0f6fd0@dist-git> From: Jiri Denemark Date: Thu, 9 Oct 2014 10:38:39 +0200 Subject: [PATCH] RHEL: Add support for QMP I/O error reason -RHEL-only, obsoletes older RHEL-only commit -8d2d15ec73393f360a1bf7b88ee2cb491efad037 +RHEL-only Adds support for __com.redhat_reason on I/O error events. The code will fallback to upstream nospace boolean if the reason is not present and @@ -19,10 +18,10 @@ Signed-off-by: Jiri Denemark 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 7dcea2e..cad6be8 100644 +index fd567e4..065c7fe 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c -@@ -722,7 +722,7 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) +@@ -584,7 +584,7 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) { const char *device; const char *action; @@ -31,9 +30,9 @@ index 7dcea2e..cad6be8 100644 bool nospc = false; int actionID; -@@ -739,8 +739,14 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) +@@ -600,8 +600,14 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) + if ((device = virJSONValueObjectGetString(data, "device")) == NULL) VIR_WARN("missing device in disk io error event"); - } - if (virJSONValueObjectGetBoolean(data, "nospace", &nospc) == 0 && nospc) - reason = "enospc"; @@ -49,5 +48,5 @@ index 7dcea2e..cad6be8 100644 if ((actionID = qemuMonitorIOErrorActionTypeFromString(action)) < 0) { VIR_WARN("unknown disk io error action '%s'", action); -- -2.1.3 +2.4.5 diff --git a/SOURCES/libvirt-RHEL-Fix-maxvcpus-output.patch b/SOURCES/libvirt-RHEL-Fix-maxvcpus-output.patch index 32e0d80..8d74501 100644 --- a/SOURCES/libvirt-RHEL-Fix-maxvcpus-output.patch +++ b/SOURCES/libvirt-RHEL-Fix-maxvcpus-output.patch @@ -1,5 +1,5 @@ -From aa8480d804ae24514b51d262ad0edb3d509ecbd6 Mon Sep 17 00:00:00 2001 -Message-Id: +From 83bce1af14104615dd2945099d9d6519801d6d0f Mon Sep 17 00:00:00 2001 +Message-Id: <83bce1af14104615dd2945099d9d6519801d6d0f@dist-git> From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 17 Sep 2014 19:00:58 +0200 Subject: [PATCH] RHEL: Fix maxvcpus output @@ -19,10 +19,10 @@ Signed-off-by: Jiri Denemark 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index d3ff143..0a5605a 100644 +index f3beebe..6dafbec 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c -@@ -1211,6 +1211,11 @@ kvmGetMaxVCPUs(void) +@@ -1264,6 +1264,11 @@ kvmGetMaxVCPUs(void) return -1; } @@ -35,5 +35,5 @@ index d3ff143..0a5605a 100644 /* at first try KVM_CAP_MAX_VCPUS to determine the maximum count */ if ((ret = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_MAX_VCPUS)) > 0) -- -2.1.0 +2.4.5 diff --git a/SOURCES/libvirt-RHEL-Hack-around-changed-Broadwell-Haswell-CPUs.patch b/SOURCES/libvirt-RHEL-Hack-around-changed-Broadwell-Haswell-CPUs.patch new file mode 100644 index 0000000..1d73e60 --- /dev/null +++ b/SOURCES/libvirt-RHEL-Hack-around-changed-Broadwell-Haswell-CPUs.patch @@ -0,0 +1,89 @@ +From c920fb815413e588dfa36da3221196762a77e6fd Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Fri, 27 Mar 2015 12:48:40 +0100 +Subject: [PATCH] RHEL: Hack around changed Broadwell/Haswell CPUs + +RHEL-only + +Upstream tried to solve the change of Broadwell and Haswell CPUs by +removing rtm and hle features from the corresponding CPU models for new +machine types. Then they reverted this and introduced new *-noTSX models +instead. However, the original fix was backported to RHEL. + +This patch makes sue Broadwell and Haswell will always contain rtm and +hle features regardless on RHEL version or machine type used. + +https://bugzilla.redhat.com/show_bug.cgi?id=1199446 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 21 +++++++++++++++++++++ + .../qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args | 2 +- + .../qemuxml2argvdata/qemuxml2argv-cpu-Haswell3.args | 2 +- + 3 files changed, 23 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 25a7bc6..ca14ffc 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -7011,6 +7011,8 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, + virCPUCompareResult cmp; + const char *preferred; + virCapsPtr caps = NULL; ++ bool hle = false; ++ bool rtm = false; + bool compareAgainstHost = ((def->virtType == VIR_DOMAIN_VIRT_KVM || + def->cpu->mode != VIR_CPU_MODE_CUSTOM) && + def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH); +@@ -7171,8 +7173,27 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, + else + sign = '+'; + ++ if (STREQ("rtm", featCpu->features[i].name)) ++ rtm = true; ++ if (STREQ("hle", featCpu->features[i].name)) ++ hle = true; ++ + virBufferAsprintf(buf, ",%c%s", sign, featCpu->features[i].name); + } ++ ++ /* Some versions of qemu-kvm in RHEL provide Broadwell and Haswell CPU ++ * models which lack rtm and hle features when used with some machine ++ * types. Let's make sure Broadwell and Haswell will always have these ++ * features. But only if the features were not explicitly mentioned in ++ * the guest CPU definition. ++ */ ++ if (STREQ_NULLABLE(featCpu->model, "Broadwell") || ++ STREQ_NULLABLE(featCpu->model, "Haswell")) { ++ if (!rtm) ++ virBufferAddLit(buf, ",+rtm"); ++ if (!hle) ++ virBufferAddLit(buf, ",+hle"); ++ } + } + + ret = 0; +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args +index f9bea62..6c11291 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args +@@ -1,4 +1,4 @@ + LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +-/usr/bin/qemu-kvm -S -M pc -cpu Haswell -m 214 -smp 6 \ ++/usr/bin/qemu-kvm -S -M pc -cpu Haswell,+rtm,+hle -m 214 -smp 6 \ + -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -usb -net \ + none -serial none -parallel none +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell3.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell3.args +index f9bea62..6c11291 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell3.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell3.args +@@ -1,4 +1,4 @@ + LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +-/usr/bin/qemu-kvm -S -M pc -cpu Haswell -m 214 -smp 6 \ ++/usr/bin/qemu-kvm -S -M pc -cpu Haswell,+rtm,+hle -m 214 -smp 6 \ + -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -usb -net \ + none -serial none -parallel none +-- +2.4.5 + diff --git a/SOURCES/libvirt-RHEL-Support-virtio-disk-hotplug-in-JSON-mode.patch b/SOURCES/libvirt-RHEL-Support-virtio-disk-hotplug-in-JSON-mode.patch index e843f37..9dba2fb 100644 --- a/SOURCES/libvirt-RHEL-Support-virtio-disk-hotplug-in-JSON-mode.patch +++ b/SOURCES/libvirt-RHEL-Support-virtio-disk-hotplug-in-JSON-mode.patch @@ -1,5 +1,5 @@ -From be7634c927bc9f7340898bcb19a7e4b2214839d7 Mon Sep 17 00:00:00 2001 -Message-Id: +From b32e593db092c9c4f7c85028fe318f6b401451cb Mon Sep 17 00:00:00 2001 +Message-Id: From: "Daniel P. Berrange" Date: Fri, 17 Dec 2010 14:55:38 +0100 Subject: [PATCH] RHEL: Support virtio disk hotplug in JSON mode @@ -55,10 +55,10 @@ Conflicts: 2 files changed, 154 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index e88068c..cf26069 100644 +index edfa67f..fd567e4 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c -@@ -3274,9 +3274,54 @@ int qemuMonitorJSONAddDevice(qemuMonitorPtr mon, +@@ -3474,9 +3474,54 @@ int qemuMonitorJSONDelObject(qemuMonitorPtr mon, int qemuMonitorJSONAddDrive(qemuMonitorPtr mon, const char *drivestr) { @@ -114,7 +114,7 @@ index e88068c..cf26069 100644 } -@@ -3284,7 +3329,37 @@ int qemuMonitorJSONDriveDel(qemuMonitorPtr mon, +@@ -3484,7 +3529,37 @@ int qemuMonitorJSONDriveDel(qemuMonitorPtr mon, const char *drivestr) { int ret; @@ -152,7 +152,7 @@ index e88068c..cf26069 100644 /* XXX Update to use QMP, if QMP ever adds support for drive_del */ VIR_DEBUG("drive_del command not found, trying HMP"); if ((ret = qemuMonitorTextDriveDel(mon, drivestr)) < 0) { -@@ -3297,6 +3372,10 @@ int qemuMonitorJSONDriveDel(qemuMonitorPtr mon, +@@ -3497,6 +3572,10 @@ int qemuMonitorJSONDriveDel(qemuMonitorPtr mon, virResetLastError(); } } @@ -164,10 +164,10 @@ index e88068c..cf26069 100644 } diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c -index 9d39968..1077013 100644 +index 368a5e7..3b547f2 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c -@@ -413,6 +413,14 @@ mymain(void) +@@ -416,6 +416,14 @@ mymain(void) " }" \ "}\r\n" @@ -182,7 +182,7 @@ index 9d39968..1077013 100644 DO_TEST_UPDATE("graphics-spice", "graphics-spice-nochange", false, false, NULL); DO_TEST_UPDATE("graphics-spice-timeout", "graphics-spice-timeout-nochange", false, false, "set_password", QMP_OK, "expire_password", QMP_OK); -@@ -433,56 +441,122 @@ mymain(void) +@@ -436,56 +444,122 @@ mymain(void) "chardev-remove", QMP_OK); DO_TEST_ATTACH("hotplug-base", "disk-virtio", false, true, @@ -306,5 +306,5 @@ index 9d39968..1077013 100644 virObjectUnref(driver.xmlopt); virObjectUnref(driver.config); -- -2.1.0 +2.4.5 diff --git a/SOURCES/libvirt-RHEL-Switch-to-private-redhat-namespace-for-QMP-I-O-error-reason.patch b/SOURCES/libvirt-RHEL-Switch-to-private-redhat-namespace-for-QMP-I-O-error-reason.patch deleted file mode 100644 index f640eef..0000000 --- a/SOURCES/libvirt-RHEL-Switch-to-private-redhat-namespace-for-QMP-I-O-error-reason.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 8d2d15ec73393f360a1bf7b88ee2cb491efad037 Mon Sep 17 00:00:00 2001 -Message-Id: <8d2d15ec73393f360a1bf7b88ee2cb491efad037@dist-git> -From: "Daniel P. Berrange" -Date: Fri, 17 Dec 2010 14:55:35 +0100 -Subject: [PATCH] RHEL: Switch to private redhat namespace for QMP I/O error - reason - -RHEL only, no upstream - -For - https://bugzilla.redhat.com/show_bug.cgi?id=1026966 - https://bugzilla.redhat.com/show_bug.cgi?id=586353 - -The I/O error reason support is not yet available in QEMU, so RHEL6 -is using the redhat private namespace for it - -* src/qemu/qemu_monitor_json.c: Replace 'reason' with '__com.redhat_reason' - -(cherry picked from commit 369186c3f1555fa66b084bdf1f1d3f21f041256d in -rhel-6.5 branch) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor_json.c | 8 ++------ - 1 file changed, 2 insertions(+), 6 deletions(-) - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 6e8834f..e88068c 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -737,14 +737,10 @@ static void qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr dat - VIR_WARN("missing device in disk io error event"); - } - --#if 0 -- if ((reason = virJSONValueObjectGetString(data, "reason")) == NULL) { -- VIR_WARN("missing reason in disk io error event"); -+ if ((reason = virJSONValueObjectGetString(data, "__com.redhat_reason")) == NULL) { -+ VIR_WARN("missing __com.redhat_reason in disk io error event"); - reason = ""; - } --#else -- reason = ""; --#endif - - if ((actionID = qemuMonitorIOErrorActionTypeFromString(action)) < 0) { - VIR_WARN("unknown disk io error action '%s'", action); --- -2.1.0 - diff --git a/SOURCES/libvirt-RHEL-qemu-Add-ability-to-set-sgio-values-for-hostdev.patch b/SOURCES/libvirt-RHEL-qemu-Add-ability-to-set-sgio-values-for-hostdev.patch new file mode 100644 index 0000000..be8a38d --- /dev/null +++ b/SOURCES/libvirt-RHEL-qemu-Add-ability-to-set-sgio-values-for-hostdev.patch @@ -0,0 +1,72 @@ +From e9b274bf20d24096921e09626eaec3e89b7b7767 Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Thu, 9 Jul 2015 08:28:57 -0400 +Subject: [PATCH] RHEL: qemu: Add ability to set sgio values for hostdev + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +RHEL-only + +Add necessary checks in order to allow setting sgio values for a scsi +host device + +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index 7d317d7..aa2d1de 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1432,6 +1432,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + virDomainDiskDefPtr disk = NULL; + virDomainHostdevDefPtr hostdev = NULL; + char *sysfs_path = NULL; ++ char *hostdev_path = NULL; + const char *path = NULL; + bool val; + int ret = -1; +@@ -1453,14 +1454,10 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + if (!qemuIsSharedHostdev(hostdev)) + return 0; + +- if (hostdev->source.subsys.u.scsi.sgio) { +- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", +- _("'sgio' is not supported for SCSI " +- "generic device yet ")); ++ if (!(hostdev_path = qemuGetHostdevPath(hostdev))) + goto cleanup; +- } + +- return 0; ++ path = hostdev_path; + } else { + return 0; + } +@@ -1469,7 +1466,11 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + goto cleanup; + + /* By default, filter the SG_IO commands, i.e. set unpriv_sgio to 0. */ +- val = (disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED); ++ 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); + + /* 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 +@@ -1486,6 +1487,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + ret = 0; + + cleanup: ++ VIR_FREE(hostdev_path); + VIR_FREE(sysfs_path); + return ret; + } +-- +2.5.1 + diff --git a/SOURCES/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch b/SOURCES/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch new file mode 100644 index 0000000..5b5ec58 --- /dev/null +++ b/SOURCES/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch @@ -0,0 +1,59 @@ +From 4b1391cc3a879f4a82510742d0f1dc668d23de94 Mon Sep 17 00:00:00 2001 +Message-Id: <4b1391cc3a879f4a82510742d0f1dc668d23de94@dist-git> +From: John Ferlan +Date: Thu, 9 Jul 2015 08:28:58 -0400 +Subject: [PATCH] RHEL: qemu: Add check for unpriv sgio for SCSI generic host + device + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +RHEL-only + +Check if the hostdev has set the sgio filtered/unfiltered and handle +appropriately. + +This restores functionality removed by upstream commit id 'ce346623' +to remove sgio support for the SCSI generic host device. + +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index aa2d1de..965d34d 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1274,6 +1274,8 @@ qemuAddSharedHostdev(virQEMUDriverPtr driver, + { + char *dev_path = NULL; + char *key = NULL; ++ virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; ++ virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + int ret = -1; + + if (!qemuIsSharedHostdev(hostdev)) +@@ -1282,6 +1284,19 @@ qemuAddSharedHostdev(virQEMUDriverPtr driver, + if (!(dev_path = qemuGetHostdevPath(hostdev))) + goto cleanup; + ++ if ((ret = qemuCheckUnprivSGIO(driver->sharedDevices, dev_path, ++ scsisrc->sgio)) < 0) { ++ if (ret == -2) { ++ virReportError(VIR_ERR_OPERATION_INVALID, ++ _("sgio of shared scsi host device '%s-%u-%u-%llu' " ++ "conflicts with other active domains"), ++ scsihostsrc->adapter, scsihostsrc->bus, ++ scsihostsrc->target, scsihostsrc->unit); ++ ret = -1; ++ } ++ goto cleanup; ++ } ++ + if (!(key = qemuGetSharedDeviceKey(dev_path))) + goto cleanup; + +-- +2.5.1 + diff --git a/SOURCES/libvirt-RHEL-qemu-support-relative-backing-for-RHEL-7.0.z-qemu.patch b/SOURCES/libvirt-RHEL-qemu-support-relative-backing-for-RHEL-7.0.z-qemu.patch new file mode 100644 index 0000000..6c233a6 --- /dev/null +++ b/SOURCES/libvirt-RHEL-qemu-support-relative-backing-for-RHEL-7.0.z-qemu.patch @@ -0,0 +1,41 @@ +From 10dc4fb241e70105d5b584f7070f34d156e5e4e2 Mon Sep 17 00:00:00 2001 +Message-Id: <10dc4fb241e70105d5b584f7070f34d156e5e4e2@dist-git> +From: Eric Blake +Date: Tue, 7 Oct 2014 17:06:17 -0600 +Subject: [PATCH] RHEL: qemu: support relative backing for RHEL 7.0.z qemu + +RHEL-only: https://bugzilla.redhat.com/show_bug.cgi?id=1150322 + +qemu-kvm-rhev for RHEL 7.0.z backported enough code to allow +relative backing file manipulations, but could not backport +everything from upstream. So, instead of providing the upstream +'change-backing-file' QMP command, it added a downstream-only +'__com.redhat_change-backing-file' as a witness that relative +backing is supported, but not as full-featured. Since libvirt +from RHEL 7.1 may be driving an older qemu, we need to be able +to recognize the alternate spelling. + +* src/qemu/qemu_capabilities.c (virQEMUCapsCommands): Also +recognize downstream spelling. + +Signed-off-by: Eric Blake +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 27686c3..89d63e5 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -1494,6 +1494,7 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { + { "add-fd", QEMU_CAPS_ADD_FD }, + { "nbd-server-start", QEMU_CAPS_NBD_SERVER }, + { "change-backing-file", QEMU_CAPS_CHANGE_BACKING_FILE }, ++ { "__com.redhat_change-backing-file", QEMU_CAPS_CHANGE_BACKING_FILE }, + { "rtc-reset-reinjection", QEMU_CAPS_RTC_RESET_REINJECTION }, + }; + +-- +2.4.5 + diff --git a/SOURCES/libvirt-RHEL-screenshot-Implement-multiple-screen-support.patch b/SOURCES/libvirt-RHEL-screenshot-Implement-multiple-screen-support.patch index 71d2a85..299af32 100644 --- a/SOURCES/libvirt-RHEL-screenshot-Implement-multiple-screen-support.patch +++ b/SOURCES/libvirt-RHEL-screenshot-Implement-multiple-screen-support.patch @@ -1,5 +1,5 @@ -From 57bf3fecbd49af584a25b45611038f19e6fd3c9c Mon Sep 17 00:00:00 2001 -Message-Id: <57bf3fecbd49af584a25b45611038f19e6fd3c9c@dist-git> +From df75234947b6c743e08277577056fe9837659108 Mon Sep 17 00:00:00 2001 +Message-Id: From: Michal Privoznik Date: Fri, 26 Aug 2011 16:41:17 +0800 Subject: [PATCH] RHEL: screenshot: Implement multiple screen support @@ -27,17 +27,17 @@ Conflicts: error --- src/qemu/qemu_driver.c | 22 +++++++++++++++------- - src/qemu/qemu_monitor.c | 23 +++++++++++++++++------ + src/qemu/qemu_monitor.c | 14 ++++++++++++-- src/qemu/qemu_monitor.h | 3 ++- src/qemu/qemu_monitor_json.c | 24 ++++++++++++++++++++++++ src/qemu/qemu_monitor_json.h | 4 ++++ - 5 files changed, 62 insertions(+), 14 deletions(-) + 5 files changed, 57 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 239a300..aceddb1 100644 +index 7a04e67..f3beebe 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c -@@ -3735,6 +3735,8 @@ qemuDomainScreenshot(virDomainPtr dom, +@@ -3808,6 +3808,8 @@ qemuDomainScreenshot(virDomainPtr dom, char *ret = NULL; bool unlink_tmp = false; virQEMUDriverConfigPtr cfg = NULL; @@ -46,7 +46,7 @@ index 239a300..aceddb1 100644 virCheckFlags(0, NULL); -@@ -3756,12 +3758,15 @@ qemuDomainScreenshot(virDomainPtr dom, +@@ -3829,12 +3831,15 @@ qemuDomainScreenshot(virDomainPtr dom, goto endjob; } @@ -68,7 +68,7 @@ index 239a300..aceddb1 100644 goto endjob; } -@@ -3776,8 +3781,11 @@ qemuDomainScreenshot(virDomainPtr dom, +@@ -3849,8 +3854,11 @@ qemuDomainScreenshot(virDomainPtr dom, virSecurityManagerSetSavedStateLabel(qemu_driver->securityManager, vm->def, tmp); @@ -78,58 +78,43 @@ index 239a300..aceddb1 100644 qemuDomainObjEnterMonitor(driver, vm); - if (qemuMonitorScreendump(priv->mon, tmp) < 0) { + if (qemuMonitorScreendump(priv->mon, tmp, video_id) < 0) { - qemuDomainObjExitMonitor(driver, vm); + ignore_value(qemuDomainObjExitMonitor(driver, vm)); goto endjob; } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 5b2952a..2edc19b 100644 +index 93fcc7f..9c70211 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c -@@ -3340,11 +3340,12 @@ int qemuMonitorSendKey(qemuMonitorPtr mon, - } +@@ -3141,12 +3141,22 @@ qemuMonitorSendKey(qemuMonitorPtr mon, - int qemuMonitorScreendump(qemuMonitorPtr mon, -- const char *file) -+ const char *file, -+ const char *id) + int + qemuMonitorScreendump(qemuMonitorPtr mon, +- const char *file) ++ const char *file, ++ const char *id) { - int ret; +- VIR_DEBUG("file=%s", file); ++ VIR_DEBUG("file=%s, id=%s", file, id); -- VIR_DEBUG("mon=%p, file=%s", mon, file); -+ VIR_DEBUG("mon=%p, file=%s, id=%s", mon, file, id); - - if (!mon) { - virReportError(VIR_ERR_INVALID_ARG, "%s", -@@ -3352,10 +3353,20 @@ int qemuMonitorScreendump(qemuMonitorPtr mon, - return -1; - } + QEMU_CHECK_MONITOR(mon); -- if (mon->json) -- ret = qemuMonitorJSONScreendump(mon, file); -- else -- ret = qemuMonitorTextScreendump(mon, file); + if (id) { -+ if (mon->json) { -+ ret = qemuMonitorJSONScreendumpRH(mon, file, id); -+ } else { ++ if (!mon->json) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -+ _("non-zero screen IDs require JSON monitor")); -+ ret = -1; ++ _("non-zero screen ID requires JSON monitor")); ++ return -1; + } -+ } else { -+ if (mon->json) -+ ret = qemuMonitorJSONScreendump(mon, file); -+ else -+ ret = qemuMonitorTextScreendump(mon, file); ++ return qemuMonitorJSONScreendumpRH(mon, file, id); + } - return ret; - } - ++ + if (mon->json) + return qemuMonitorJSONScreendump(mon, file); + else diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index 4fd6f01..ecba7e1 100644 +index ec1724f..87167e3 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h -@@ -676,7 +676,8 @@ int qemuMonitorArbitraryCommand(qemuMonitorPtr mon, +@@ -754,7 +754,8 @@ int qemuMonitorArbitraryCommand(qemuMonitorPtr mon, int qemuMonitorInjectNMI(qemuMonitorPtr mon); int qemuMonitorScreendump(qemuMonitorPtr mon, @@ -140,10 +125,10 @@ index 4fd6f01..ecba7e1 100644 int qemuMonitorSendKey(qemuMonitorPtr mon, unsigned int holdtime, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 62e7d5d..6e8834f 100644 +index f0cfc57..edfa67f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c -@@ -3661,6 +3661,30 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon, +@@ -3959,6 +3959,30 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon, return ret; } @@ -175,10 +160,10 @@ index 62e7d5d..6e8834f 100644 const char *file) { diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index d8c9308..efa2330 100644 +index b76d85b..399a38d 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h -@@ -277,6 +277,10 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon, +@@ -291,6 +291,10 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon, unsigned int *keycodes, unsigned int nkeycodes); @@ -190,5 +175,5 @@ index d8c9308..efa2330 100644 const char *file); -- -2.1.0 +2.4.5 diff --git a/SOURCES/libvirt-Really-fix-XML-formatting-flags-in-SaveImageUpdateDef.patch b/SOURCES/libvirt-Really-fix-XML-formatting-flags-in-SaveImageUpdateDef.patch deleted file mode 100644 index 7490665..0000000 --- a/SOURCES/libvirt-Really-fix-XML-formatting-flags-in-SaveImageUpdateDef.patch +++ /dev/null @@ -1,38 +0,0 @@ -From c6b02db1183324ffd5e5f458d7922fb2e082f4ae Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 21 Aug 2015 10:50:57 -0700 -Subject: [PATCH] Really fix XML formatting flags in SaveImageUpdateDef - -Commit cf2d4c6 used a logical or instead of bitwise or, -effectively passing 1, that is VIR_DOMAIN_XML_INACTIVE. - -This was caught by a warning when building with clang. - -https://bugzilla.redhat.com/show_bug.cgi?id=1183869 [7.2.0] -https://bugzilla.redhat.com/show_bug.cgi?id=1254164 [7.2.0] -https://bugzilla.redhat.com/show_bug.cgi?id=1255859 [7.1.z] - -(cherry picked from commit c75f42f3318463b0555edac333c8f20d54b4d5dc) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 299cf7b..b6ce10c 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -5856,7 +5856,7 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, - - if (!(newdef_migr = qemuDomainDefCopy(driver, - newdef, -- QEMU_DOMAIN_FORMAT_LIVE_FLAGS || -+ QEMU_DOMAIN_FORMAT_LIVE_FLAGS | - VIR_DOMAIN_XML_MIGRATABLE))) - goto cleanup; - --- -2.5.0 - diff --git a/SOURCES/libvirt-Refactor-job-statistics.patch b/SOURCES/libvirt-Refactor-job-statistics.patch deleted file mode 100644 index effc30e..0000000 --- a/SOURCES/libvirt-Refactor-job-statistics.patch +++ /dev/null @@ -1,620 +0,0 @@ -From f4a492f7751e066548cd63d2bc56fd0260c7b32b Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Thu, 21 Aug 2014 15:08:39 +0200 -Subject: [PATCH] Refactor job statistics - -Job statistics data were tracked in several structures and variables. -Let's make a new qemuDomainJobInfo structure which can be used as a -single source of statistics data as a preparation for storing data about -completed a job. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 6fcddfcd8f25bc23018a1fc2e37ebca375f7f1c3) - -https://bugzilla.redhat.com/show_bug.cgi?id=1063724 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 157 ++++++++++++++++++++++++++++++++++++++++++++-- - src/qemu/qemu_domain.h | 28 ++++++++- - src/qemu/qemu_driver.c | 119 ++++------------------------------- - src/qemu/qemu_migration.c | 72 ++++++++------------- - 4 files changed, 217 insertions(+), 159 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 306ff10..7b54306 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -163,11 +163,9 @@ qemuDomainObjResetAsyncJob(qemuDomainObjPrivatePtr priv) - job->asyncOwner = 0; - job->phase = 0; - job->mask = QEMU_JOB_DEFAULT_MASK; -- job->start = 0; - job->dump_memory_only = false; - job->asyncAbort = false; -- memset(&job->status, 0, sizeof(job->status)); -- memset(&job->info, 0, sizeof(job->info)); -+ VIR_FREE(job->current); - } - - void -@@ -200,6 +198,7 @@ qemuDomainObjTransferJob(virDomainObjPtr obj) - static void - qemuDomainObjFreeJob(qemuDomainObjPrivatePtr priv) - { -+ VIR_FREE(priv->job.current); - virCondDestroy(&priv->job.cond); - virCondDestroy(&priv->job.asyncCond); - } -@@ -211,6 +210,150 @@ qemuDomainTrackJob(qemuDomainJob job) - } - - -+int -+qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo) -+{ -+ unsigned long long now; -+ -+ if (!jobInfo->started) -+ return 0; -+ -+ if (virTimeMillisNow(&now) < 0) -+ return -1; -+ -+ jobInfo->timeElapsed = now - jobInfo->started; -+ return 0; -+} -+ -+int -+qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo, -+ virDomainJobInfoPtr info) -+{ -+ info->timeElapsed = jobInfo->timeElapsed; -+ info->timeRemaining = jobInfo->timeRemaining; -+ -+ info->memTotal = jobInfo->status.ram_total; -+ info->memRemaining = jobInfo->status.ram_remaining; -+ info->memProcessed = jobInfo->status.ram_transferred; -+ -+ info->fileTotal = jobInfo->status.disk_total; -+ info->fileRemaining = jobInfo->status.disk_remaining; -+ info->fileProcessed = jobInfo->status.disk_transferred; -+ -+ info->dataTotal = info->memTotal + info->fileTotal; -+ info->dataRemaining = info->memRemaining + info->fileRemaining; -+ info->dataProcessed = info->memProcessed + info->fileProcessed; -+ -+ return 0; -+} -+ -+int -+qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo, -+ int *type, -+ virTypedParameterPtr *params, -+ int *nparams) -+{ -+ qemuMonitorMigrationStatus *status = &jobInfo->status; -+ virTypedParameterPtr par = NULL; -+ int maxpar = 0; -+ int npar = 0; -+ -+ if (virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_TIME_ELAPSED, -+ jobInfo->timeElapsed) < 0) -+ goto error; -+ -+ if (jobInfo->type == VIR_DOMAIN_JOB_BOUNDED && -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_TIME_REMAINING, -+ jobInfo->timeRemaining) < 0) -+ goto error; -+ -+ if (status->downtime_set && -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_DOWNTIME, -+ status->downtime) < 0) -+ goto error; -+ -+ if (virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_DATA_TOTAL, -+ status->ram_total + -+ status->disk_total) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_DATA_PROCESSED, -+ status->ram_transferred + -+ status->disk_transferred) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_DATA_REMAINING, -+ status->ram_remaining + -+ status->disk_remaining) < 0) -+ goto error; -+ -+ if (virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_MEMORY_TOTAL, -+ status->ram_total) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_MEMORY_PROCESSED, -+ status->ram_transferred) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_MEMORY_REMAINING, -+ status->ram_remaining) < 0) -+ goto error; -+ -+ if (status->ram_duplicate_set) { -+ if (virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_MEMORY_CONSTANT, -+ status->ram_duplicate) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_MEMORY_NORMAL, -+ status->ram_normal) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES, -+ status->ram_normal_bytes) < 0) -+ goto error; -+ } -+ -+ if (virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_DISK_TOTAL, -+ status->disk_total) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_DISK_PROCESSED, -+ status->disk_transferred) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_DISK_REMAINING, -+ status->disk_remaining) < 0) -+ goto error; -+ -+ if (status->xbzrle_set) { -+ if (virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_COMPRESSION_CACHE, -+ status->xbzrle_cache_size) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_COMPRESSION_BYTES, -+ status->xbzrle_bytes) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_COMPRESSION_PAGES, -+ status->xbzrle_pages) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES, -+ status->xbzrle_cache_miss) < 0 || -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW, -+ status->xbzrle_overflow) < 0) -+ goto error; -+ } -+ -+ *type = jobInfo->type; -+ *params = par; -+ *nparams = npar; -+ return 0; -+ -+ error: -+ virTypedParamsFree(par, npar); -+ return -1; -+} -+ -+ - static void * - qemuDomainObjPrivateAlloc(void) - { -@@ -1071,7 +1214,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, - unsigned long long then; - bool nested = job == QEMU_JOB_ASYNC_NESTED; - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); -- int ret; -+ int ret = -1; - - VIR_DEBUG("Starting %s: %s (async=%s vm=%p name=%s)", - job == QEMU_JOB_ASYNC ? "async job" : "job", -@@ -1127,9 +1270,11 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, - qemuDomainAsyncJobTypeToString(asyncJob), - obj, obj->def->name); - qemuDomainObjResetAsyncJob(priv); -+ if (VIR_ALLOC(priv->job.current) < 0) -+ goto cleanup; - priv->job.asyncJob = asyncJob; - priv->job.asyncOwner = virThreadSelfID(); -- priv->job.start = now; -+ priv->job.current->started = now; - } - - if (qemuDomainTrackJob(job)) -@@ -1163,6 +1308,8 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, - virReportSystemError(errno, - "%s", _("cannot acquire job mutex")); - } -+ -+ cleanup: - priv->jobs_queued--; - virObjectUnref(obj); - virObjectUnref(cfg); -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index f353d90..99c7d6a 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -100,6 +100,18 @@ typedef enum { - } qemuDomainAsyncJob; - VIR_ENUM_DECL(qemuDomainAsyncJob) - -+typedef struct _qemuDomainJobInfo qemuDomainJobInfo; -+typedef qemuDomainJobInfo *qemuDomainJobInfoPtr; -+struct _qemuDomainJobInfo { -+ virDomainJobType type; -+ unsigned long long started; /* When the async job started */ -+ /* Computed values */ -+ unsigned long long timeElapsed; -+ unsigned long long timeRemaining; -+ /* Raw values from QEMU */ -+ qemuMonitorMigrationStatus status; -+}; -+ - struct qemuDomainJobObj { - virCond cond; /* Use to coordinate jobs */ - qemuDomainJob active; /* Currently running job */ -@@ -110,10 +122,8 @@ struct qemuDomainJobObj { - unsigned long long asyncOwner; /* Thread which set current async job */ - int phase; /* Job phase (mainly for migrations) */ - unsigned long long mask; /* Jobs allowed during async job */ -- unsigned long long start; /* When the async job started */ - bool dump_memory_only; /* use dump-guest-memory to do dump */ -- qemuMonitorMigrationStatus status; /* Raw async job progress data */ -- virDomainJobInfo info; /* Processed async job progress data */ -+ qemuDomainJobInfoPtr current; /* async job progress data */ - bool asyncAbort; /* abort of async job requested */ - }; - -@@ -378,4 +388,16 @@ bool qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, - bool qemuDomainAgentAvailable(qemuDomainObjPrivatePtr priv, - bool reportError); - -+int qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo) -+ ATTRIBUTE_NONNULL(1); -+int qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo, -+ virDomainJobInfoPtr info) -+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -+int qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo, -+ int *type, -+ virTypedParameterPtr *params, -+ int *nparams) -+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) -+ ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -+ - #endif /* __QEMU_DOMAIN_H__ */ -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 53baced..6640a29 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -2655,15 +2655,13 @@ qemuDomainGetControlInfo(virDomainPtr dom, - if (priv->monError) { - info->state = VIR_DOMAIN_CONTROL_ERROR; - } else if (priv->job.active) { -- if (!priv->monStart) { -+ if (virTimeMillisNow(&info->stateTime) < 0) -+ goto cleanup; -+ if (priv->job.current) { - info->state = VIR_DOMAIN_CONTROL_JOB; -- if (virTimeMillisNow(&info->stateTime) < 0) -- goto cleanup; -- info->stateTime -= priv->job.start; -+ info->stateTime -= priv->job.current->started; - } else { - info->state = VIR_DOMAIN_CONTROL_OCCUPIED; -- if (virTimeMillisNow(&info->stateTime) < 0) -- goto cleanup; - info->stateTime -= priv->monStart; - } - } else { -@@ -3110,8 +3108,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - goto endjob; - } - -- memset(&priv->job.info, 0, sizeof(priv->job.info)); -- priv->job.info.type = VIR_DOMAIN_JOB_UNBOUNDED; -+ priv->job.current->type = VIR_DOMAIN_JOB_UNBOUNDED; - - /* Pause */ - if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) { -@@ -3460,6 +3457,7 @@ static int qemuDumpToFd(virQEMUDriverPtr driver, virDomainObjPtr vm, - fd) < 0) - return -1; - -+ VIR_FREE(priv->job.current); - priv->job.dump_memory_only = true; - - if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) -@@ -11624,17 +11622,15 @@ static int qemuDomainGetJobInfo(virDomainPtr dom, - goto cleanup; - - if (virDomainObjIsActive(vm)) { -- if (priv->job.asyncJob && !priv->job.dump_memory_only) { -- memcpy(info, &priv->job.info, sizeof(*info)); -- -+ if (priv->job.current) { - /* Refresh elapsed time again just to ensure it - * is fully updated. This is primarily for benefit - * of incoming migration which we don't currently - * monitor actively in the background thread - */ -- if (virTimeMillisNow(&info->timeElapsed) < 0) -+ if (qemuDomainJobInfoUpdateTime(priv->job.current) < 0 || -+ qemuDomainJobInfoToInfo(priv->job.current, info) < 0) - goto cleanup; -- info->timeElapsed -= priv->job.start; - } else { - memset(info, 0, sizeof(*info)); - info->type = VIR_DOMAIN_JOB_NONE; -@@ -11663,9 +11659,6 @@ qemuDomainGetJobStats(virDomainPtr dom, - { - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; -- virTypedParameterPtr par = NULL; -- int maxpar = 0; -- int npar = 0; - int ret = -1; - - virCheckFlags(0, -1); -@@ -11684,7 +11677,7 @@ qemuDomainGetJobStats(virDomainPtr dom, - goto cleanup; - } - -- if (!priv->job.asyncJob || priv->job.dump_memory_only) { -+ if (!priv->job.current) { - *type = VIR_DOMAIN_JOB_NONE; - *params = NULL; - *nparams = 0; -@@ -11697,102 +11690,16 @@ qemuDomainGetJobStats(virDomainPtr dom, - * of incoming migration which we don't currently - * monitor actively in the background thread - */ -- if (virTimeMillisNow(&priv->job.info.timeElapsed) < 0) -+ if (qemuDomainJobInfoUpdateTime(priv->job.current) < 0 || -+ qemuDomainJobInfoToParams(priv->job.current, -+ type, params, nparams) < 0) - goto cleanup; -- priv->job.info.timeElapsed -= priv->job.start; - -- if (virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_TIME_ELAPSED, -- priv->job.info.timeElapsed) < 0) -- goto cleanup; -- -- if (priv->job.info.type == VIR_DOMAIN_JOB_BOUNDED && -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_TIME_REMAINING, -- priv->job.info.timeRemaining) < 0) -- goto cleanup; -- -- if (priv->job.status.downtime_set && -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_DOWNTIME, -- priv->job.status.downtime) < 0) -- goto cleanup; -- -- if (virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_DATA_TOTAL, -- priv->job.info.dataTotal) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_DATA_PROCESSED, -- priv->job.info.dataProcessed) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_DATA_REMAINING, -- priv->job.info.dataRemaining) < 0) -- goto cleanup; -- -- if (virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_MEMORY_TOTAL, -- priv->job.info.memTotal) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_MEMORY_PROCESSED, -- priv->job.info.memProcessed) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_MEMORY_REMAINING, -- priv->job.info.memRemaining) < 0) -- goto cleanup; -- -- if (priv->job.status.ram_duplicate_set) { -- if (virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_MEMORY_CONSTANT, -- priv->job.status.ram_duplicate) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_MEMORY_NORMAL, -- priv->job.status.ram_normal) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES, -- priv->job.status.ram_normal_bytes) < 0) -- goto cleanup; -- } -- -- if (virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_DISK_TOTAL, -- priv->job.info.fileTotal) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_DISK_PROCESSED, -- priv->job.info.fileProcessed) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_DISK_REMAINING, -- priv->job.info.fileRemaining) < 0) -- goto cleanup; -- -- if (priv->job.status.xbzrle_set) { -- if (virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_COMPRESSION_CACHE, -- priv->job.status.xbzrle_cache_size) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_COMPRESSION_BYTES, -- priv->job.status.xbzrle_bytes) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_COMPRESSION_PAGES, -- priv->job.status.xbzrle_pages) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES, -- priv->job.status.xbzrle_cache_miss) < 0 || -- virTypedParamsAddULLong(&par, &npar, &maxpar, -- VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW, -- priv->job.status.xbzrle_overflow) < 0) -- goto cleanup; -- } -- -- *type = priv->job.info.type; -- *params = par; -- *nparams = npar; - ret = 0; - - cleanup: - if (vm) - virObjectUnlock(vm); -- if (ret < 0) -- virTypedParamsFree(par, npar); - return ret; - } - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 2726512..066cc97 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -1723,8 +1723,9 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver, - qemuDomainAsyncJob asyncJob) - { - qemuDomainObjPrivatePtr priv = vm->privateData; -- int ret; - qemuMonitorMigrationStatus status; -+ qemuDomainJobInfoPtr jobInfo; -+ int ret; - - memset(&status, 0, sizeof(status)); - -@@ -1738,62 +1739,40 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver, - - qemuDomainObjExitMonitor(driver, vm); - -- priv->job.status = status; -- -- if (ret < 0 || virTimeMillisNow(&priv->job.info.timeElapsed) < 0) -+ if (ret < 0 || -+ qemuDomainJobInfoUpdateTime(priv->job.current) < 0) - return -1; - -- priv->job.info.timeElapsed -= priv->job.start; -- - ret = -1; -- switch (priv->job.status.status) { -- case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE: -- priv->job.info.type = VIR_DOMAIN_JOB_NONE; -- virReportError(VIR_ERR_OPERATION_FAILED, -- _("%s: %s"), job, _("is not active")); -- break; -- -+ jobInfo = priv->job.current; -+ switch (status.status) { -+ case QEMU_MONITOR_MIGRATION_STATUS_COMPLETED: -+ jobInfo->type = VIR_DOMAIN_JOB_COMPLETED; -+ /* fall through */ - case QEMU_MONITOR_MIGRATION_STATUS_SETUP: -- ret = 0; -- break; -- - case QEMU_MONITOR_MIGRATION_STATUS_ACTIVE: -- priv->job.info.fileTotal = priv->job.status.disk_total; -- priv->job.info.fileRemaining = priv->job.status.disk_remaining; -- priv->job.info.fileProcessed = priv->job.status.disk_transferred; -- -- priv->job.info.memTotal = priv->job.status.ram_total; -- priv->job.info.memRemaining = priv->job.status.ram_remaining; -- priv->job.info.memProcessed = priv->job.status.ram_transferred; -- -- priv->job.info.dataTotal = -- priv->job.status.ram_total + priv->job.status.disk_total; -- priv->job.info.dataRemaining = -- priv->job.status.ram_remaining + priv->job.status.disk_remaining; -- priv->job.info.dataProcessed = -- priv->job.status.ram_transferred + -- priv->job.status.disk_transferred; -- - ret = 0; - break; - -- case QEMU_MONITOR_MIGRATION_STATUS_COMPLETED: -- priv->job.info.type = VIR_DOMAIN_JOB_COMPLETED; -- ret = 0; -+ case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE: -+ jobInfo->type = VIR_DOMAIN_JOB_NONE; -+ virReportError(VIR_ERR_OPERATION_FAILED, -+ _("%s: %s"), job, _("is not active")); - break; - - case QEMU_MONITOR_MIGRATION_STATUS_ERROR: -- priv->job.info.type = VIR_DOMAIN_JOB_FAILED; -+ jobInfo->type = VIR_DOMAIN_JOB_FAILED; - virReportError(VIR_ERR_OPERATION_FAILED, - _("%s: %s"), job, _("unexpectedly failed")); - break; - - case QEMU_MONITOR_MIGRATION_STATUS_CANCELLED: -- priv->job.info.type = VIR_DOMAIN_JOB_CANCELLED; -+ jobInfo->type = VIR_DOMAIN_JOB_CANCELLED; - virReportError(VIR_ERR_OPERATION_ABORTED, - _("%s: %s"), job, _("canceled by client")); - break; - } -+ jobInfo->status = status; - - return ret; - } -@@ -1803,11 +1782,14 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver, - * QEMU reports failed migration. - */ - static int --qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, virDomainObjPtr vm, -+qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, - qemuDomainAsyncJob asyncJob, -- virConnectPtr dconn, bool abort_on_error) -+ virConnectPtr dconn, -+ bool abort_on_error) - { - qemuDomainObjPrivatePtr priv = vm->privateData; -+ qemuDomainJobInfoPtr jobInfo = priv->job.current; - const char *job; - int pauseReason; - -@@ -1825,9 +1807,9 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, virDomainObjPtr vm, - job = _("job"); - } - -- priv->job.info.type = VIR_DOMAIN_JOB_UNBOUNDED; -+ jobInfo->type = VIR_DOMAIN_JOB_UNBOUNDED; - -- while (priv->job.info.type == VIR_DOMAIN_JOB_UNBOUNDED) { -+ while (jobInfo->type == VIR_DOMAIN_JOB_UNBOUNDED) { - /* Poll every 50ms for progress & to allow cancellation */ - struct timespec ts = { .tv_sec = 0, .tv_nsec = 50 * 1000 * 1000ull }; - -@@ -1856,13 +1838,13 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, virDomainObjPtr vm, - virObjectLock(vm); - } - -- if (priv->job.info.type == VIR_DOMAIN_JOB_COMPLETED) { -+ if (jobInfo->type == VIR_DOMAIN_JOB_COMPLETED) { - return 0; -- } else if (priv->job.info.type == VIR_DOMAIN_JOB_UNBOUNDED) { -+ } else if (jobInfo->type == VIR_DOMAIN_JOB_UNBOUNDED) { - /* The migration was aborted by us rather than QEMU itself so let's - * update the job type and notify the caller to send migrate_cancel. - */ -- priv->job.info.type = VIR_DOMAIN_JOB_FAILED; -+ jobInfo->type = VIR_DOMAIN_JOB_FAILED; - return -2; - } else { - return -1; -@@ -4914,7 +4896,7 @@ qemuMigrationJobStart(virQEMUDriverPtr driver, - JOB_MASK(QEMU_JOB_MIGRATION_OP))); - } - -- priv->job.info.type = VIR_DOMAIN_JOB_UNBOUNDED; -+ priv->job.current->type = VIR_DOMAIN_JOB_UNBOUNDED; - - return 0; - } --- -2.1.0 - diff --git a/SOURCES/libvirt-Reject-live-update-of-offloading-options.patch b/SOURCES/libvirt-Reject-live-update-of-offloading-options.patch deleted file mode 100644 index 5ec67a6..0000000 --- a/SOURCES/libvirt-Reject-live-update-of-offloading-options.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 5cda3789ba0d61bc34fa44b50b5ce729966d1da7 Mon Sep 17 00:00:00 2001 -Message-Id: <5cda3789ba0d61bc34fa44b50b5ce729966d1da7@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 30 Oct 2014 17:30:48 +0100 -Subject: [PATCH] Reject live update of offloading options - -https://bugzilla.redhat.com/show_bug.cgi?id=1155441 -(cherry picked from commit 4abcf04e7c01ddc1b0a92a4a25d829c51ceadac9) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index bbfd3de..14acac0 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -1980,7 +1980,18 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, - olddev->driver.virtio.txmode != newdev->driver.virtio.txmode || - olddev->driver.virtio.ioeventfd != newdev->driver.virtio.ioeventfd || - olddev->driver.virtio.event_idx != newdev->driver.virtio.event_idx || -- olddev->driver.virtio.queues != newdev->driver.virtio.queues)) { -+ olddev->driver.virtio.queues != newdev->driver.virtio.queues || -+ olddev->driver.virtio.host.csum != newdev->driver.virtio.host.csum || -+ olddev->driver.virtio.host.gso != newdev->driver.virtio.host.gso || -+ olddev->driver.virtio.host.tso4 != newdev->driver.virtio.host.tso4 || -+ olddev->driver.virtio.host.tso6 != newdev->driver.virtio.host.tso6 || -+ olddev->driver.virtio.host.ecn != newdev->driver.virtio.host.ecn || -+ olddev->driver.virtio.host.ufo != newdev->driver.virtio.host.ufo || -+ olddev->driver.virtio.guest.csum != newdev->driver.virtio.guest.csum || -+ olddev->driver.virtio.guest.tso4 != newdev->driver.virtio.guest.tso4 || -+ olddev->driver.virtio.guest.tso6 != newdev->driver.virtio.guest.tso6 || -+ olddev->driver.virtio.guest.ecn != newdev->driver.virtio.guest.ecn || -+ olddev->driver.virtio.guest.ufo != newdev->driver.virtio.guest.ufo)) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot modify virtio network device driver attributes")); - goto cleanup; --- -2.1.3 - diff --git a/SOURCES/libvirt-Relax-duplicate-SCSI-host-pool-checking.patch b/SOURCES/libvirt-Relax-duplicate-SCSI-host-pool-checking.patch deleted file mode 100644 index 7ad69e0..0000000 --- a/SOURCES/libvirt-Relax-duplicate-SCSI-host-pool-checking.patch +++ /dev/null @@ -1,49 +0,0 @@ -From afd72a7855f7d9e8411d7b876d18d8dda5864d96 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Sat, 1 Nov 2014 17:57:22 -0400 -Subject: [PATCH] Relax duplicate SCSI host pool checking - -https://bugzilla.redhat.com/show_bug.cgi?id=1146837 - -Since commit 3f99d64 no new scsi_host pools can be defined -if one of the already defined scsi_host pools does not refer -to an accessible scsi_host adapter. - -Relax the check by skipping over these inaccessible pools -when checking for duplicates. - -(cherry picked from commit 593892314a194df22ea54e5b9606e2a188932439) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/conf/storage_conf.c | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c -index d614b2d..67b44b9 100644 ---- a/src/conf/storage_conf.c -+++ b/src/conf/storage_conf.c -@@ -2174,7 +2174,7 @@ virStoragePoolSourceFindDuplicate(virStoragePoolObjListPtr pools, - if (getSCSIHostNumber(pool->def->source.adapter, - &pool_hostnum) < 0 || - getSCSIHostNumber(def->source.adapter, &def_hostnum) < 0) -- goto error; -+ break; - if (pool_hostnum == def_hostnum) - matchpool = pool; - } -@@ -2216,10 +2216,6 @@ virStoragePoolSourceFindDuplicate(virStoragePoolObjListPtr pools, - ret = -1; - } - return ret; -- -- error: -- virStoragePoolObjUnlock(pool); -- return -1; - } - - void --- -2.1.3 - diff --git a/SOURCES/libvirt-Rename-tunable-event-constants.patch b/SOURCES/libvirt-Rename-tunable-event-constants.patch deleted file mode 100644 index 8f70558..0000000 --- a/SOURCES/libvirt-Rename-tunable-event-constants.patch +++ /dev/null @@ -1,341 +0,0 @@ -From 3d12791c7e8306aa0e58c34906b619856a9dd856 Mon Sep 17 00:00:00 2001 -Message-Id: <3d12791c7e8306aa0e58c34906b619856a9dd856@dist-git> -From: "Daniel P. Berrange" -Date: Fri, 26 Sep 2014 12:44:02 +0200 -Subject: [PATCH] Rename tunable event constants - -For the new VIR_DOMAIN_EVENT_ID_TUNABLE event we have a bunch of -constants added - - VIR_DOMAIN_EVENT_CPUTUNE_ - VIR_DOMAIN_EVENT_BLKDEVIOTUNE_ - -This naming convention is bad for two reasons - - - There is no common prefix unique for the events to both - relate them, and distinguish them from other event - constants - - - The values associated with the constants were chosen - to match the names used with virConnectGetAllDomainStats - so having EVENT in the constant name is not applicable in - that respect - -This patch proposes renaming the constants to - - VIR_DOMAIN_TUNABLE_CPU_ - VIR_DOMAIN_TUNABLE_BLKDEV_ - -ie, given them a common VIR_DOMAIN_TUNABLE prefix. - -Signed-off-by: Daniel P. Berrange -(cherry picked from commit 0778c0be8deec25c8f040d4bdeddee50cbb26234) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1115898 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 56 ++++++++++++++++++++++---------------------- - src/qemu/qemu_cgroup.c | 2 +- - src/qemu/qemu_driver.c | 28 +++++++++++----------- - 3 files changed, 43 insertions(+), 43 deletions(-) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 026df48..9dbb222 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -5168,119 +5168,119 @@ typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn, - void *opaque); - - /** -- * VIR_DOMAIN_EVENT_CPUTUNE_VCPUPIN: -+ * VIR_DOMAIN_TUNABLE_CPU_VCPUPIN: - * - * Macro represents formatted pinning for one vcpu specified by id which is - * appended to the parameter name, for example "cputune.vcpupin1", - * as VIR_TYPED_PARAM_STRING. - */ --#define VIR_DOMAIN_EVENT_CPUTUNE_VCPUPIN "cputune.vcpupin%u" -+#define VIR_DOMAIN_TUNABLE_CPU_VCPUPIN "cputune.vcpupin%u" - - /** -- * VIR_DOMAIN_EVENT_CPUTUNE_EMULATORIN: -+ * VIR_DOMAIN_TUNABLE_CPU_EMULATORIN: - * - * Macro represents formatted pinning for emulator process, - * as VIR_TYPED_PARAM_STRING. - */ --#define VIR_DOMAIN_EVENT_CPUTUNE_EMULATORIN "cputune.emulatorpin" -+#define VIR_DOMAIN_TUNABLE_CPU_EMULATORIN "cputune.emulatorpin" - - /** -- * VIR_DOMAIN_EVENT_CPUTUNE_CPU_SHARES: -+ * VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES: - * - * Macro represents proportional weight of the scheduler used on the - * host cpu, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG. - */ --#define VIR_DOMAIN_EVENT_CPUTUNE_CPU_SHARES "cputune.cpu_shares" -+#define VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES "cputune.cpu_shares" - - /** -- * VIR_DOMAIN_EVENT_CPUTUNE_VCPU_PERIOD: -+ * VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD: - * - * Macro represents the enforcement period for a quota, in microseconds, - * for vcpus only, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG. - */ --#define VIR_DOMAIN_EVENT_CPUTUNE_VCPU_PERIOD "cputune.vcpu_period" -+#define VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD "cputune.vcpu_period" - - /** -- * VIR_DOMAIN_EVENT_CPUTUNE_VCPU_QUOTA: -+ * VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA: - * - * Macro represents the maximum bandwidth to be used within a period for - * vcpus only, when using the posix scheduler, as VIR_TYPED_PARAM_LLONG. - */ --#define VIR_DOMAIN_EVENT_CPUTUNE_VCPU_QUOTA "cputune.vcpu_quota" -+#define VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA "cputune.vcpu_quota" - - /** -- * VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_PERIOD: -+ * VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD: - * - * Macro represents the enforcement period for a quota in microseconds, - * when using the posix scheduler, for all emulator activity not tied to - * vcpus, as VIR_TYPED_PARAM_ULLONG. - */ --#define VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_PERIOD "cputune.emulator_period" -+#define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD "cputune.emulator_period" - - /** -- * VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_QUOTA: -+ * VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA: - * - * Macro represents the maximum bandwidth to be used within a period for - * all emulator activity not tied to vcpus, when using the posix scheduler, - * as an VIR_TYPED_PARAM_LLONG. - */ --#define VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_QUOTA "cputune.emulator_quota" -+#define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA "cputune.emulator_quota" - - /** -- * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_DISK: -+ * VIR_DOMAIN_TUNABLE_BLKDEV_DISK: - * - * Macro represents the name of guest disk for which the values are updated, - * as VIR_TYPED_PARAM_STRING. - */ --#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_DISK "blkdeviotune.disk" -+#define VIR_DOMAIN_TUNABLE_BLKDEV_DISK "blkdeviotune.disk" - - /** -- * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_BYTES_SEC: -+ * VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC: - * - * Marco represents the total throughput limit in bytes per second, - * as VIR_TYPED_PARAM_ULLONG. - */ --#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_BYTES_SEC "blkdeviotune.total_bytes_sec" -+#define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC "blkdeviotune.total_bytes_sec" - - /** -- * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_BYTES_SEC: -+ * VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC: - * - * Marco represents the read throughput limit in bytes per second, - * as VIR_TYPED_PARAM_ULLONG. - */ --#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_BYTES_SEC "blkdeviotune.read_bytes_sec" -+#define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC "blkdeviotune.read_bytes_sec" - - /** -- * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_BYTES_SEC: -+ * VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC: - * - * Macro represents the write throughput limit in bytes per second, - * as VIR_TYPED_PARAM_ULLONG. - */ --#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_BYTES_SEC "blkdeviotune.write_bytes_sec" -+#define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC "blkdeviotune.write_bytes_sec" - - /** -- * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_IOPS_SEC: -+ * VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC: - * - * Macro represents the total I/O operations per second, - * as VIR_TYPED_PARAM_ULLONG. - */ --#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_IOPS_SEC "blkdeviotune.total_iops_sec" -+#define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC "blkdeviotune.total_iops_sec" - - /** -- * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_IOPS_SEC: -+ * VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC: - * - * Macro represents the read I/O operations per second, - * as VIR_TYPED_PARAM_ULLONG. - */ --#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_IOPS_SEC "blkdeviotune.read_iops_sec" -+#define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC "blkdeviotune.read_iops_sec" - - /** -- * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_IOPS_SEC: -+ * VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC: - * - * Macro represents the write I/O operations per second, - * as VIR_TYPED_PARAM_ULLONG. - */ --#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_IOPS_SEC "blkdeviotune.write_iops_sec" -+#define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC "blkdeviotune.write_iops_sec" - - /** - * virConnectDomainEventTunableCallback: -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index 300946a..8819943 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -703,7 +703,7 @@ qemuSetupCpuCgroup(virDomainObjPtr vm) - vm->def->cputune.shares = val; - if (virTypedParamsAddULLong(&eventParams, &eventNparams, - &eventMaxparams, -- VIR_DOMAIN_EVENT_CPUTUNE_CPU_SHARES, -+ VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES, - val) < 0) - return -1; - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 843101c..1b14a12 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4589,7 +4589,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom, - goto cleanup; - - if (snprintf(paramField, VIR_TYPED_PARAM_FIELD_LENGTH, -- VIR_DOMAIN_EVENT_CPUTUNE_VCPUPIN, vcpu) < 0) { -+ VIR_DOMAIN_TUNABLE_CPU_VCPUPIN, vcpu) < 0) { - goto cleanup; - } - -@@ -4876,7 +4876,7 @@ qemuDomainPinEmulator(virDomainPtr dom, - str = virBitmapFormat(pcpumap); - if (virTypedParamsAddString(&eventParams, &eventNparams, - &eventMaxparams, -- VIR_DOMAIN_EVENT_CPUTUNE_EMULATORIN, -+ VIR_DOMAIN_TUNABLE_CPU_EMULATORIN, - str) < 0) - goto cleanup; - -@@ -9317,7 +9317,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - - if (virTypedParamsAddULLong(&eventParams, &eventNparams, - &eventMaxNparams, -- VIR_DOMAIN_EVENT_CPUTUNE_CPU_SHARES, -+ VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES, - val) < 0) - goto cleanup; - } -@@ -9340,7 +9340,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - - if (virTypedParamsAddULLong(&eventParams, &eventNparams, - &eventMaxNparams, -- VIR_DOMAIN_EVENT_CPUTUNE_VCPU_PERIOD, -+ VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD, - value_ul) < 0) - goto cleanup; - } -@@ -9360,7 +9360,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - - if (virTypedParamsAddLLong(&eventParams, &eventNparams, - &eventMaxNparams, -- VIR_DOMAIN_EVENT_CPUTUNE_VCPU_QUOTA, -+ VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA, - value_l) < 0) - goto cleanup; - } -@@ -9381,7 +9381,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - - if (virTypedParamsAddULLong(&eventParams, &eventNparams, - &eventMaxNparams, -- VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_PERIOD, -+ VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD, - value_ul) < 0) - goto cleanup; - } -@@ -9402,7 +9402,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - - if (virTypedParamsAddLLong(&eventParams, &eventNparams, - &eventMaxNparams, -- VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_QUOTA, -+ VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA, - value_l) < 0) - goto cleanup; - } -@@ -16105,7 +16105,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - goto endjob; - - if (virTypedParamsAddString(&eventParams, &eventNparams, &eventMaxparams, -- VIR_DOMAIN_EVENT_BLKDEVIOTUNE_DISK, disk) < 0) -+ VIR_DOMAIN_TUNABLE_BLKDEV_DISK, disk) < 0) - goto endjob; - - for (i = 0; i < nparams; i++) { -@@ -16123,7 +16123,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - set_bytes = true; - if (virTypedParamsAddULLong(&eventParams, &eventNparams, - &eventMaxparams, -- VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_BYTES_SEC, -+ VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC, - param->value.ul) < 0) - goto endjob; - } else if (STREQ(param->field, -@@ -16132,7 +16132,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - set_bytes = true; - if (virTypedParamsAddULLong(&eventParams, &eventNparams, - &eventMaxparams, -- VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_BYTES_SEC, -+ VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC, - param->value.ul) < 0) - goto endjob; - } else if (STREQ(param->field, -@@ -16141,7 +16141,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - set_bytes = true; - if (virTypedParamsAddULLong(&eventParams, &eventNparams, - &eventMaxparams, -- VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_BYTES_SEC, -+ VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC, - param->value.ul) < 0) - goto endjob; - } else if (STREQ(param->field, -@@ -16150,7 +16150,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - set_iops = true; - if (virTypedParamsAddULLong(&eventParams, &eventNparams, - &eventMaxparams, -- VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_IOPS_SEC, -+ VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC, - param->value.ul) < 0) - goto endjob; - } else if (STREQ(param->field, -@@ -16159,7 +16159,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - set_iops = true; - if (virTypedParamsAddULLong(&eventParams, &eventNparams, - &eventMaxparams, -- VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_IOPS_SEC, -+ VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC, - param->value.ul) < 0) - goto endjob; - } else if (STREQ(param->field, -@@ -16168,7 +16168,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - set_iops = true; - if (virTypedParamsAddULLong(&eventParams, &eventNparams, - &eventMaxparams, -- VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_IOPS_SEC, -+ VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC, - param->value.ul) < 0) - goto endjob; - } --- -2.1.1 - diff --git a/SOURCES/libvirt-Renamed-deconfigured-cpus-to-allow-make-dist.patch b/SOURCES/libvirt-Renamed-deconfigured-cpus-to-allow-make-dist.patch new file mode 100644 index 0000000..f7f5813 --- /dev/null +++ b/SOURCES/libvirt-Renamed-deconfigured-cpus-to-allow-make-dist.patch @@ -0,0 +1,7617 @@ +From b6108536a1acd8b2c3a38d47d91f10b2d1dd3d3b Mon Sep 17 00:00:00 2001 +Message-Id: +From: Daniel Veillard +Date: Wed, 5 Aug 2015 18:18:33 +0200 +Subject: [PATCH] Renamed deconfigured-cpus to allow make dist + +Simplest was just to rename that extra long name and move files in git +accordingly + +(cherry picked from commit 2094d01e2f54e5774c0d0d380e83154b42ea65be) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + .../nodeinfodata/linux-deconf-cpus/cpu/cpu0/online | 1 + + .../nodeinfodata/linux-deconf-cpus/cpu/cpu1/online | 1 + + .../linux-deconf-cpus/cpu/cpu10/online | 1 + + .../linux-deconf-cpus/cpu/cpu100/online | 1 + + .../linux-deconf-cpus/cpu/cpu101/online | 1 + + .../linux-deconf-cpus/cpu/cpu102/online | 1 + + .../linux-deconf-cpus/cpu/cpu103/online | 1 + + .../linux-deconf-cpus/cpu/cpu104/online | 1 + + .../linux-deconf-cpus/cpu/cpu104/topology/core_id | 1 + + .../cpu/cpu104/topology/core_siblings | 1 + + .../cpu/cpu104/topology/core_siblings_list | 1 + + .../cpu/cpu104/topology/physical_package_id | 1 + + .../cpu/cpu104/topology/thread_siblings | 1 + + .../cpu/cpu104/topology/thread_siblings_list | 1 + + .../linux-deconf-cpus/cpu/cpu105/online | 1 + + .../linux-deconf-cpus/cpu/cpu106/online | 1 + + .../linux-deconf-cpus/cpu/cpu107/online | 1 + + .../linux-deconf-cpus/cpu/cpu108/online | 1 + + .../linux-deconf-cpus/cpu/cpu109/online | 1 + + .../linux-deconf-cpus/cpu/cpu11/online | 1 + + .../linux-deconf-cpus/cpu/cpu110/online | 1 + + .../linux-deconf-cpus/cpu/cpu111/online | 1 + + .../linux-deconf-cpus/cpu/cpu112/online | 1 + + .../linux-deconf-cpus/cpu/cpu112/topology/core_id | 1 + + .../cpu/cpu112/topology/core_siblings | 1 + + .../cpu/cpu112/topology/core_siblings_list | 1 + + .../cpu/cpu112/topology/physical_package_id | 1 + + .../cpu/cpu112/topology/thread_siblings | 1 + + .../cpu/cpu112/topology/thread_siblings_list | 1 + + .../linux-deconf-cpus/cpu/cpu113/online | 1 + + .../linux-deconf-cpus/cpu/cpu114/online | 1 + + .../linux-deconf-cpus/cpu/cpu115/online | 1 + + .../linux-deconf-cpus/cpu/cpu116/online | 1 + + .../linux-deconf-cpus/cpu/cpu117/online | 1 + + .../linux-deconf-cpus/cpu/cpu118/online | 1 + + .../linux-deconf-cpus/cpu/cpu119/online | 1 + + .../linux-deconf-cpus/cpu/cpu12/online | 1 + + .../linux-deconf-cpus/cpu/cpu120/online | 1 + + .../linux-deconf-cpus/cpu/cpu120/topology/core_id | 1 + + .../cpu/cpu120/topology/core_siblings | 1 + + .../cpu/cpu120/topology/core_siblings_list | 1 + + .../cpu/cpu120/topology/physical_package_id | 1 + + .../cpu/cpu120/topology/thread_siblings | 1 + + .../cpu/cpu120/topology/thread_siblings_list | 1 + + .../linux-deconf-cpus/cpu/cpu121/online | 1 + + .../linux-deconf-cpus/cpu/cpu122/online | 1 + + .../linux-deconf-cpus/cpu/cpu123/online | 1 + + .../linux-deconf-cpus/cpu/cpu124/online | 1 + + .../linux-deconf-cpus/cpu/cpu125/online | 1 + + .../linux-deconf-cpus/cpu/cpu126/online | 1 + + .../linux-deconf-cpus/cpu/cpu127/online | 1 + + .../linux-deconf-cpus/cpu/cpu128/online | 1 + + .../linux-deconf-cpus/cpu/cpu128/topology/core_id | 1 + + .../cpu/cpu128/topology/core_siblings | 1 + + .../cpu/cpu128/topology/core_siblings_list | 1 + + .../cpu/cpu128/topology/physical_package_id | 1 + + .../cpu/cpu128/topology/thread_siblings | 1 + + .../cpu/cpu128/topology/thread_siblings_list | 1 + + .../linux-deconf-cpus/cpu/cpu129/online | 1 + + .../linux-deconf-cpus/cpu/cpu13/online | 1 + + .../linux-deconf-cpus/cpu/cpu130/online | 1 + + .../linux-deconf-cpus/cpu/cpu131/online | 1 + + .../linux-deconf-cpus/cpu/cpu132/online | 1 + + .../linux-deconf-cpus/cpu/cpu133/online | 1 + + .../linux-deconf-cpus/cpu/cpu134/online | 1 + + .../linux-deconf-cpus/cpu/cpu135/online | 1 + + .../linux-deconf-cpus/cpu/cpu136/online | 1 + + .../linux-deconf-cpus/cpu/cpu136/topology/core_id | 1 + + .../cpu/cpu136/topology/core_siblings | 1 + + .../cpu/cpu136/topology/core_siblings_list | 1 + + .../cpu/cpu136/topology/physical_package_id | 1 + + .../cpu/cpu136/topology/thread_siblings | 1 + + .../cpu/cpu136/topology/thread_siblings_list | 1 + + .../linux-deconf-cpus/cpu/cpu137/online | 1 + + .../linux-deconf-cpus/cpu/cpu138/online | 1 + + .../linux-deconf-cpus/cpu/cpu139/online | 1 + + .../linux-deconf-cpus/cpu/cpu14/online | 1 + + .../linux-deconf-cpus/cpu/cpu140/online | 1 + + .../linux-deconf-cpus/cpu/cpu141/online | 1 + + .../linux-deconf-cpus/cpu/cpu142/online | 1 + + .../linux-deconf-cpus/cpu/cpu143/online | 1 + + .../linux-deconf-cpus/cpu/cpu144/online | 1 + + .../linux-deconf-cpus/cpu/cpu145/online | 1 + + .../linux-deconf-cpus/cpu/cpu146/online | 1 + + .../linux-deconf-cpus/cpu/cpu147/online | 1 + + .../linux-deconf-cpus/cpu/cpu148/online | 1 + + .../linux-deconf-cpus/cpu/cpu149/online | 1 + + .../linux-deconf-cpus/cpu/cpu15/online | 1 + + .../linux-deconf-cpus/cpu/cpu150/online | 1 + + .../linux-deconf-cpus/cpu/cpu151/online | 1 + + .../linux-deconf-cpus/cpu/cpu152/online | 1 + + .../linux-deconf-cpus/cpu/cpu153/online | 1 + + .../linux-deconf-cpus/cpu/cpu154/online | 1 + + .../linux-deconf-cpus/cpu/cpu155/online | 1 + + .../linux-deconf-cpus/cpu/cpu156/online | 1 + + .../linux-deconf-cpus/cpu/cpu157/online | 1 + + .../linux-deconf-cpus/cpu/cpu158/online | 1 + + .../linux-deconf-cpus/cpu/cpu159/online | 1 + + .../linux-deconf-cpus/cpu/cpu16/online | 1 + + .../linux-deconf-cpus/cpu/cpu16/topology/core_id | 1 + + .../cpu/cpu16/topology/core_siblings | 1 + + .../cpu/cpu16/topology/core_siblings_list | 1 + + .../cpu/cpu16/topology/physical_package_id | 1 + + .../cpu/cpu16/topology/thread_siblings | 1 + + .../cpu/cpu16/topology/thread_siblings_list | 1 + + .../linux-deconf-cpus/cpu/cpu17/online | 1 + + .../linux-deconf-cpus/cpu/cpu18/online | 1 + + .../linux-deconf-cpus/cpu/cpu19/online | 1 + + .../nodeinfodata/linux-deconf-cpus/cpu/cpu2/online | 1 + + .../linux-deconf-cpus/cpu/cpu20/online | 1 + + .../linux-deconf-cpus/cpu/cpu21/online | 1 + + .../linux-deconf-cpus/cpu/cpu22/online | 1 + + .../linux-deconf-cpus/cpu/cpu23/online | 1 + + .../linux-deconf-cpus/cpu/cpu24/online | 1 + + .../linux-deconf-cpus/cpu/cpu24/topology/core_id | 1 + + .../cpu/cpu24/topology/core_siblings | 1 + + .../cpu/cpu24/topology/core_siblings_list | 1 + + .../cpu/cpu24/topology/physical_package_id | 1 + + .../cpu/cpu24/topology/thread_siblings | 1 + + .../cpu/cpu24/topology/thread_siblings_list | 1 + + .../linux-deconf-cpus/cpu/cpu25/online | 1 + + .../linux-deconf-cpus/cpu/cpu26/online | 1 + + .../linux-deconf-cpus/cpu/cpu27/online | 1 + + .../linux-deconf-cpus/cpu/cpu28/online | 1 + + .../linux-deconf-cpus/cpu/cpu29/online | 1 + + .../nodeinfodata/linux-deconf-cpus/cpu/cpu3/online | 1 + + .../linux-deconf-cpus/cpu/cpu30/online | 1 + + .../linux-deconf-cpus/cpu/cpu31/online | 1 + + .../linux-deconf-cpus/cpu/cpu32/online | 1 + + .../linux-deconf-cpus/cpu/cpu33/online | 1 + + .../linux-deconf-cpus/cpu/cpu34/online | 1 + + .../linux-deconf-cpus/cpu/cpu35/online | 1 + + .../linux-deconf-cpus/cpu/cpu36/online | 1 + + .../linux-deconf-cpus/cpu/cpu37/online | 1 + + .../linux-deconf-cpus/cpu/cpu38/online | 1 + + .../linux-deconf-cpus/cpu/cpu39/online | 1 + + .../nodeinfodata/linux-deconf-cpus/cpu/cpu4/online | 1 + + .../linux-deconf-cpus/cpu/cpu40/online | 1 + + .../linux-deconf-cpus/cpu/cpu40/topology/core_id | 1 + + .../cpu/cpu40/topology/core_siblings | 1 + + .../cpu/cpu40/topology/core_siblings_list | 1 + + .../cpu/cpu40/topology/physical_package_id | 1 + + .../cpu/cpu40/topology/thread_siblings | 1 + + .../cpu/cpu40/topology/thread_siblings_list | 1 + + .../linux-deconf-cpus/cpu/cpu41/online | 1 + + .../linux-deconf-cpus/cpu/cpu42/online | 1 + + .../linux-deconf-cpus/cpu/cpu43/online | 1 + + .../linux-deconf-cpus/cpu/cpu44/online | 1 + + .../linux-deconf-cpus/cpu/cpu45/online | 1 + + .../linux-deconf-cpus/cpu/cpu46/online | 1 + + .../linux-deconf-cpus/cpu/cpu47/online | 1 + + .../linux-deconf-cpus/cpu/cpu48/online | 1 + + .../linux-deconf-cpus/cpu/cpu48/topology/core_id | 1 + + .../cpu/cpu48/topology/core_siblings | 1 + + .../cpu/cpu48/topology/core_siblings_list | 1 + + .../cpu/cpu48/topology/physical_package_id | 1 + + .../cpu/cpu48/topology/thread_siblings | 1 + + .../cpu/cpu48/topology/thread_siblings_list | 1 + + .../linux-deconf-cpus/cpu/cpu49/online | 1 + + .../nodeinfodata/linux-deconf-cpus/cpu/cpu5/online | 1 + + .../linux-deconf-cpus/cpu/cpu50/online | 1 + + .../linux-deconf-cpus/cpu/cpu51/online | 1 + + .../linux-deconf-cpus/cpu/cpu52/online | 1 + + .../linux-deconf-cpus/cpu/cpu53/online | 1 + + .../linux-deconf-cpus/cpu/cpu54/online | 1 + + .../linux-deconf-cpus/cpu/cpu55/online | 1 + + .../linux-deconf-cpus/cpu/cpu56/online | 1 + + .../linux-deconf-cpus/cpu/cpu57/online | 1 + + .../linux-deconf-cpus/cpu/cpu58/online | 1 + + .../linux-deconf-cpus/cpu/cpu59/online | 1 + + .../nodeinfodata/linux-deconf-cpus/cpu/cpu6/online | 1 + + .../linux-deconf-cpus/cpu/cpu60/online | 1 + + .../linux-deconf-cpus/cpu/cpu61/online | 1 + + .../linux-deconf-cpus/cpu/cpu62/online | 1 + + .../linux-deconf-cpus/cpu/cpu63/online | 1 + + .../linux-deconf-cpus/cpu/cpu64/online | 1 + + .../linux-deconf-cpus/cpu/cpu65/online | 1 + + .../linux-deconf-cpus/cpu/cpu66/online | 1 + + .../linux-deconf-cpus/cpu/cpu67/online | 1 + + .../linux-deconf-cpus/cpu/cpu68/online | 1 + + .../linux-deconf-cpus/cpu/cpu69/online | 1 + + .../nodeinfodata/linux-deconf-cpus/cpu/cpu7/online | 1 + + .../linux-deconf-cpus/cpu/cpu70/online | 1 + + .../linux-deconf-cpus/cpu/cpu71/online | 1 + + .../linux-deconf-cpus/cpu/cpu72/online | 1 + + .../linux-deconf-cpus/cpu/cpu72/topology/core_id | 1 + + .../cpu/cpu72/topology/core_siblings | 1 + + .../cpu/cpu72/topology/core_siblings_list | 1 + + .../cpu/cpu72/topology/physical_package_id | 1 + + .../cpu/cpu72/topology/thread_siblings | 1 + + .../cpu/cpu72/topology/thread_siblings_list | 1 + + .../linux-deconf-cpus/cpu/cpu73/online | 1 + + .../linux-deconf-cpus/cpu/cpu74/online | 1 + + .../linux-deconf-cpus/cpu/cpu75/online | 1 + + .../linux-deconf-cpus/cpu/cpu76/online | 1 + + .../linux-deconf-cpus/cpu/cpu77/online | 1 + + .../linux-deconf-cpus/cpu/cpu78/online | 1 + + .../linux-deconf-cpus/cpu/cpu79/online | 1 + + .../nodeinfodata/linux-deconf-cpus/cpu/cpu8/online | 1 + + .../linux-deconf-cpus/cpu/cpu80/online | 1 + + .../linux-deconf-cpus/cpu/cpu81/online | 1 + + .../linux-deconf-cpus/cpu/cpu82/online | 1 + + .../linux-deconf-cpus/cpu/cpu83/online | 1 + + .../linux-deconf-cpus/cpu/cpu84/online | 1 + + .../linux-deconf-cpus/cpu/cpu85/online | 1 + + .../linux-deconf-cpus/cpu/cpu86/online | 1 + + .../linux-deconf-cpus/cpu/cpu87/online | 1 + + .../linux-deconf-cpus/cpu/cpu88/online | 1 + + .../linux-deconf-cpus/cpu/cpu89/online | 1 + + .../nodeinfodata/linux-deconf-cpus/cpu/cpu9/online | 1 + + .../linux-deconf-cpus/cpu/cpu90/online | 1 + + .../linux-deconf-cpus/cpu/cpu91/online | 1 + + .../linux-deconf-cpus/cpu/cpu92/online | 1 + + .../linux-deconf-cpus/cpu/cpu93/online | 1 + + .../linux-deconf-cpus/cpu/cpu94/online | 1 + + .../linux-deconf-cpus/cpu/cpu95/online | 1 + + .../linux-deconf-cpus/cpu/cpu96/online | 1 + + .../linux-deconf-cpus/cpu/cpu97/online | 1 + + .../linux-deconf-cpus/cpu/cpu98/online | 1 + + .../linux-deconf-cpus/cpu/cpu99/online | 1 + + .../nodeinfodata/linux-deconf-cpus/cpu/kernel_max | 1 + + tests/nodeinfodata/linux-deconf-cpus/cpu/offline | 1 + + tests/nodeinfodata/linux-deconf-cpus/cpu/online | 1 + + tests/nodeinfodata/linux-deconf-cpus/cpu/possible | 1 + + tests/nodeinfodata/linux-deconf-cpus/cpu/present | 1 + + .../nodeinfodata/linux-deconf-cpus/node/node0/cpu0 | 1 + + .../nodeinfodata/linux-deconf-cpus/node/node0/cpu1 | 1 + + .../linux-deconf-cpus/node/node0/cpu10 | 1 + + .../linux-deconf-cpus/node/node0/cpu100 | 1 + + .../linux-deconf-cpus/node/node0/cpu101 | 1 + + .../linux-deconf-cpus/node/node0/cpu102 | 1 + + .../linux-deconf-cpus/node/node0/cpu103 | 1 + + .../linux-deconf-cpus/node/node0/cpu11 | 1 + + .../linux-deconf-cpus/node/node0/cpu12 | 1 + + .../linux-deconf-cpus/node/node0/cpu13 | 1 + + .../linux-deconf-cpus/node/node0/cpu14 | 1 + + .../linux-deconf-cpus/node/node0/cpu144 | 1 + + .../linux-deconf-cpus/node/node0/cpu145 | 1 + + .../linux-deconf-cpus/node/node0/cpu146 | 1 + + .../linux-deconf-cpus/node/node0/cpu147 | 1 + + .../linux-deconf-cpus/node/node0/cpu148 | 1 + + .../linux-deconf-cpus/node/node0/cpu149 | 1 + + .../linux-deconf-cpus/node/node0/cpu15 | 1 + + .../linux-deconf-cpus/node/node0/cpu150 | 1 + + .../linux-deconf-cpus/node/node0/cpu151 | 1 + + .../linux-deconf-cpus/node/node0/cpu152 | 1 + + .../linux-deconf-cpus/node/node0/cpu153 | 1 + + .../linux-deconf-cpus/node/node0/cpu154 | 1 + + .../linux-deconf-cpus/node/node0/cpu155 | 1 + + .../linux-deconf-cpus/node/node0/cpu156 | 1 + + .../linux-deconf-cpus/node/node0/cpu157 | 1 + + .../linux-deconf-cpus/node/node0/cpu158 | 1 + + .../linux-deconf-cpus/node/node0/cpu159 | 1 + + .../linux-deconf-cpus/node/node0/cpu16 | 1 + + .../linux-deconf-cpus/node/node0/cpu17 | 1 + + .../linux-deconf-cpus/node/node0/cpu18 | 1 + + .../linux-deconf-cpus/node/node0/cpu19 | 1 + + .../nodeinfodata/linux-deconf-cpus/node/node0/cpu2 | 1 + + .../linux-deconf-cpus/node/node0/cpu20 | 1 + + .../linux-deconf-cpus/node/node0/cpu21 | 1 + + .../linux-deconf-cpus/node/node0/cpu22 | 1 + + .../linux-deconf-cpus/node/node0/cpu23 | 1 + + .../linux-deconf-cpus/node/node0/cpu24 | 1 + + .../linux-deconf-cpus/node/node0/cpu25 | 1 + + .../linux-deconf-cpus/node/node0/cpu26 | 1 + + .../linux-deconf-cpus/node/node0/cpu27 | 1 + + .../linux-deconf-cpus/node/node0/cpu28 | 1 + + .../linux-deconf-cpus/node/node0/cpu29 | 1 + + .../nodeinfodata/linux-deconf-cpus/node/node0/cpu3 | 1 + + .../linux-deconf-cpus/node/node0/cpu30 | 1 + + .../linux-deconf-cpus/node/node0/cpu31 | 1 + + .../linux-deconf-cpus/node/node0/cpu32 | 1 + + .../linux-deconf-cpus/node/node0/cpu33 | 1 + + .../linux-deconf-cpus/node/node0/cpu34 | 1 + + .../linux-deconf-cpus/node/node0/cpu35 | 1 + + .../linux-deconf-cpus/node/node0/cpu36 | 1 + + .../linux-deconf-cpus/node/node0/cpu37 | 1 + + .../linux-deconf-cpus/node/node0/cpu38 | 1 + + .../linux-deconf-cpus/node/node0/cpu39 | 1 + + .../nodeinfodata/linux-deconf-cpus/node/node0/cpu4 | 1 + + .../nodeinfodata/linux-deconf-cpus/node/node0/cpu5 | 1 + + .../linux-deconf-cpus/node/node0/cpu56 | 1 + + .../linux-deconf-cpus/node/node0/cpu57 | 1 + + .../linux-deconf-cpus/node/node0/cpu58 | 1 + + .../linux-deconf-cpus/node/node0/cpu59 | 1 + + .../nodeinfodata/linux-deconf-cpus/node/node0/cpu6 | 1 + + .../linux-deconf-cpus/node/node0/cpu60 | 1 + + .../linux-deconf-cpus/node/node0/cpu61 | 1 + + .../linux-deconf-cpus/node/node0/cpu62 | 1 + + .../linux-deconf-cpus/node/node0/cpu63 | 1 + + .../linux-deconf-cpus/node/node0/cpu64 | 1 + + .../linux-deconf-cpus/node/node0/cpu65 | 1 + + .../linux-deconf-cpus/node/node0/cpu66 | 1 + + .../linux-deconf-cpus/node/node0/cpu67 | 1 + + .../linux-deconf-cpus/node/node0/cpu68 | 1 + + .../linux-deconf-cpus/node/node0/cpu69 | 1 + + .../nodeinfodata/linux-deconf-cpus/node/node0/cpu7 | 1 + + .../linux-deconf-cpus/node/node0/cpu70 | 1 + + .../linux-deconf-cpus/node/node0/cpu71 | 1 + + .../nodeinfodata/linux-deconf-cpus/node/node0/cpu8 | 1 + + .../linux-deconf-cpus/node/node0/cpu80 | 1 + + .../linux-deconf-cpus/node/node0/cpu81 | 1 + + .../linux-deconf-cpus/node/node0/cpu82 | 1 + + .../linux-deconf-cpus/node/node0/cpu83 | 1 + + .../linux-deconf-cpus/node/node0/cpu84 | 1 + + .../linux-deconf-cpus/node/node0/cpu85 | 1 + + .../linux-deconf-cpus/node/node0/cpu86 | 1 + + .../linux-deconf-cpus/node/node0/cpu87 | 1 + + .../linux-deconf-cpus/node/node0/cpu88 | 1 + + .../linux-deconf-cpus/node/node0/cpu89 | 1 + + .../nodeinfodata/linux-deconf-cpus/node/node0/cpu9 | 1 + + .../linux-deconf-cpus/node/node0/cpu90 | 1 + + .../linux-deconf-cpus/node/node0/cpu91 | 1 + + .../linux-deconf-cpus/node/node0/cpu92 | 1 + + .../linux-deconf-cpus/node/node0/cpu93 | 1 + + .../linux-deconf-cpus/node/node0/cpu94 | 1 + + .../linux-deconf-cpus/node/node0/cpu95 | 1 + + .../linux-deconf-cpus/node/node0/cpu96 | 1 + + .../linux-deconf-cpus/node/node0/cpu97 | 1 + + .../linux-deconf-cpus/node/node0/cpu98 | 1 + + .../linux-deconf-cpus/node/node0/cpu99 | 1 + + .../linux-deconf-cpus/node/node0/meminfo | 29 ++++++++++++++++++++++ + .../linux-deconf-cpus/node/node1/cpu40 | 1 + + .../linux-deconf-cpus/node/node1/cpu41 | 1 + + .../linux-deconf-cpus/node/node1/cpu42 | 1 + + .../linux-deconf-cpus/node/node1/cpu43 | 1 + + .../linux-deconf-cpus/node/node1/cpu44 | 1 + + .../linux-deconf-cpus/node/node1/cpu45 | 1 + + .../linux-deconf-cpus/node/node1/cpu46 | 1 + + .../linux-deconf-cpus/node/node1/cpu47 | 1 + + .../linux-deconf-cpus/node/node1/cpu48 | 1 + + .../linux-deconf-cpus/node/node1/cpu49 | 1 + + .../linux-deconf-cpus/node/node1/cpu50 | 1 + + .../linux-deconf-cpus/node/node1/cpu51 | 1 + + .../linux-deconf-cpus/node/node1/cpu52 | 1 + + .../linux-deconf-cpus/node/node1/cpu53 | 1 + + .../linux-deconf-cpus/node/node1/cpu54 | 1 + + .../linux-deconf-cpus/node/node1/cpu55 | 1 + + .../linux-deconf-cpus/node/node1/cpu72 | 1 + + .../linux-deconf-cpus/node/node1/cpu73 | 1 + + .../linux-deconf-cpus/node/node1/cpu74 | 1 + + .../linux-deconf-cpus/node/node1/cpu75 | 1 + + .../linux-deconf-cpus/node/node1/cpu76 | 1 + + .../linux-deconf-cpus/node/node1/cpu77 | 1 + + .../linux-deconf-cpus/node/node1/cpu78 | 1 + + .../linux-deconf-cpus/node/node1/cpu79 | 1 + + .../linux-deconf-cpus/node/node1/meminfo | 29 ++++++++++++++++++++++ + .../linux-deconf-cpus/node/node16/cpu104 | 1 + + .../linux-deconf-cpus/node/node16/cpu105 | 1 + + .../linux-deconf-cpus/node/node16/cpu106 | 1 + + .../linux-deconf-cpus/node/node16/cpu107 | 1 + + .../linux-deconf-cpus/node/node16/cpu108 | 1 + + .../linux-deconf-cpus/node/node16/cpu109 | 1 + + .../linux-deconf-cpus/node/node16/cpu110 | 1 + + .../linux-deconf-cpus/node/node16/cpu111 | 1 + + .../linux-deconf-cpus/node/node16/cpu112 | 1 + + .../linux-deconf-cpus/node/node16/cpu113 | 1 + + .../linux-deconf-cpus/node/node16/cpu114 | 1 + + .../linux-deconf-cpus/node/node16/cpu115 | 1 + + .../linux-deconf-cpus/node/node16/cpu116 | 1 + + .../linux-deconf-cpus/node/node16/cpu117 | 1 + + .../linux-deconf-cpus/node/node16/cpu118 | 1 + + .../linux-deconf-cpus/node/node16/cpu119 | 1 + + .../linux-deconf-cpus/node/node16/meminfo | 29 ++++++++++++++++++++++ + .../linux-deconf-cpus/node/node17/cpu120 | 1 + + .../linux-deconf-cpus/node/node17/cpu121 | 1 + + .../linux-deconf-cpus/node/node17/cpu122 | 1 + + .../linux-deconf-cpus/node/node17/cpu123 | 1 + + .../linux-deconf-cpus/node/node17/cpu124 | 1 + + .../linux-deconf-cpus/node/node17/cpu125 | 1 + + .../linux-deconf-cpus/node/node17/cpu126 | 1 + + .../linux-deconf-cpus/node/node17/cpu127 | 1 + + .../linux-deconf-cpus/node/node17/cpu128 | 1 + + .../linux-deconf-cpus/node/node17/cpu129 | 1 + + .../linux-deconf-cpus/node/node17/cpu130 | 1 + + .../linux-deconf-cpus/node/node17/cpu131 | 1 + + .../linux-deconf-cpus/node/node17/cpu132 | 1 + + .../linux-deconf-cpus/node/node17/cpu133 | 1 + + .../linux-deconf-cpus/node/node17/cpu134 | 1 + + .../linux-deconf-cpus/node/node17/cpu135 | 1 + + .../linux-deconf-cpus/node/node17/cpu136 | 1 + + .../linux-deconf-cpus/node/node17/cpu137 | 1 + + .../linux-deconf-cpus/node/node17/cpu138 | 1 + + .../linux-deconf-cpus/node/node17/cpu139 | 1 + + .../linux-deconf-cpus/node/node17/cpu140 | 1 + + .../linux-deconf-cpus/node/node17/cpu141 | 1 + + .../linux-deconf-cpus/node/node17/cpu142 | 1 + + .../linux-deconf-cpus/node/node17/cpu143 | 1 + + .../linux-deconf-cpus/node/node17/meminfo | 29 ++++++++++++++++++++++ + tests/nodeinfodata/linux-deconf-cpus/node/online | 1 + + tests/nodeinfodata/linux-deconf-cpus/node/possible | 1 + + .../linux-deconfigured-cpus/cpu/cpu0/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu1/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu10/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu100/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu101/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu102/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu103/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu104/online | 1 - + .../cpu/cpu104/topology/core_id | 1 - + .../cpu/cpu104/topology/core_siblings | 1 - + .../cpu/cpu104/topology/core_siblings_list | 1 - + .../cpu/cpu104/topology/physical_package_id | 1 - + .../cpu/cpu104/topology/thread_siblings | 1 - + .../cpu/cpu104/topology/thread_siblings_list | 1 - + .../linux-deconfigured-cpus/cpu/cpu105/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu106/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu107/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu108/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu109/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu11/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu110/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu111/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu112/online | 1 - + .../cpu/cpu112/topology/core_id | 1 - + .../cpu/cpu112/topology/core_siblings | 1 - + .../cpu/cpu112/topology/core_siblings_list | 1 - + .../cpu/cpu112/topology/physical_package_id | 1 - + .../cpu/cpu112/topology/thread_siblings | 1 - + .../cpu/cpu112/topology/thread_siblings_list | 1 - + .../linux-deconfigured-cpus/cpu/cpu113/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu114/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu115/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu116/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu117/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu118/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu119/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu12/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu120/online | 1 - + .../cpu/cpu120/topology/core_id | 1 - + .../cpu/cpu120/topology/core_siblings | 1 - + .../cpu/cpu120/topology/core_siblings_list | 1 - + .../cpu/cpu120/topology/physical_package_id | 1 - + .../cpu/cpu120/topology/thread_siblings | 1 - + .../cpu/cpu120/topology/thread_siblings_list | 1 - + .../linux-deconfigured-cpus/cpu/cpu121/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu122/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu123/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu124/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu125/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu126/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu127/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu128/online | 1 - + .../cpu/cpu128/topology/core_id | 1 - + .../cpu/cpu128/topology/core_siblings | 1 - + .../cpu/cpu128/topology/core_siblings_list | 1 - + .../cpu/cpu128/topology/physical_package_id | 1 - + .../cpu/cpu128/topology/thread_siblings | 1 - + .../cpu/cpu128/topology/thread_siblings_list | 1 - + .../linux-deconfigured-cpus/cpu/cpu129/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu13/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu130/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu131/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu132/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu133/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu134/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu135/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu136/online | 1 - + .../cpu/cpu136/topology/core_id | 1 - + .../cpu/cpu136/topology/core_siblings | 1 - + .../cpu/cpu136/topology/core_siblings_list | 1 - + .../cpu/cpu136/topology/physical_package_id | 1 - + .../cpu/cpu136/topology/thread_siblings | 1 - + .../cpu/cpu136/topology/thread_siblings_list | 1 - + .../linux-deconfigured-cpus/cpu/cpu137/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu138/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu139/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu14/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu140/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu141/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu142/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu143/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu144/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu145/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu146/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu147/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu148/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu149/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu15/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu150/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu151/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu152/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu153/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu154/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu155/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu156/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu157/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu158/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu159/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu16/online | 1 - + .../cpu/cpu16/topology/core_id | 1 - + .../cpu/cpu16/topology/core_siblings | 1 - + .../cpu/cpu16/topology/core_siblings_list | 1 - + .../cpu/cpu16/topology/physical_package_id | 1 - + .../cpu/cpu16/topology/thread_siblings | 1 - + .../cpu/cpu16/topology/thread_siblings_list | 1 - + .../linux-deconfigured-cpus/cpu/cpu17/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu18/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu19/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu2/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu20/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu21/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu22/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu23/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu24/online | 1 - + .../cpu/cpu24/topology/core_id | 1 - + .../cpu/cpu24/topology/core_siblings | 1 - + .../cpu/cpu24/topology/core_siblings_list | 1 - + .../cpu/cpu24/topology/physical_package_id | 1 - + .../cpu/cpu24/topology/thread_siblings | 1 - + .../cpu/cpu24/topology/thread_siblings_list | 1 - + .../linux-deconfigured-cpus/cpu/cpu25/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu26/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu27/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu28/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu29/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu3/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu30/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu31/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu32/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu33/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu34/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu35/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu36/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu37/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu38/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu39/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu4/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu40/online | 1 - + .../cpu/cpu40/topology/core_id | 1 - + .../cpu/cpu40/topology/core_siblings | 1 - + .../cpu/cpu40/topology/core_siblings_list | 1 - + .../cpu/cpu40/topology/physical_package_id | 1 - + .../cpu/cpu40/topology/thread_siblings | 1 - + .../cpu/cpu40/topology/thread_siblings_list | 1 - + .../linux-deconfigured-cpus/cpu/cpu41/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu42/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu43/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu44/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu45/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu46/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu47/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu48/online | 1 - + .../cpu/cpu48/topology/core_id | 1 - + .../cpu/cpu48/topology/core_siblings | 1 - + .../cpu/cpu48/topology/core_siblings_list | 1 - + .../cpu/cpu48/topology/physical_package_id | 1 - + .../cpu/cpu48/topology/thread_siblings | 1 - + .../cpu/cpu48/topology/thread_siblings_list | 1 - + .../linux-deconfigured-cpus/cpu/cpu49/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu5/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu50/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu51/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu52/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu53/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu54/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu55/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu56/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu57/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu58/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu59/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu6/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu60/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu61/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu62/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu63/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu64/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu65/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu66/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu67/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu68/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu69/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu7/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu70/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu71/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu72/online | 1 - + .../cpu/cpu72/topology/core_id | 1 - + .../cpu/cpu72/topology/core_siblings | 1 - + .../cpu/cpu72/topology/core_siblings_list | 1 - + .../cpu/cpu72/topology/physical_package_id | 1 - + .../cpu/cpu72/topology/thread_siblings | 1 - + .../cpu/cpu72/topology/thread_siblings_list | 1 - + .../linux-deconfigured-cpus/cpu/cpu73/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu74/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu75/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu76/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu77/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu78/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu79/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu8/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu80/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu81/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu82/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu83/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu84/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu85/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu86/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu87/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu88/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu89/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu9/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu90/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu91/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu92/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu93/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu94/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu95/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu96/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu97/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu98/online | 1 - + .../linux-deconfigured-cpus/cpu/cpu99/online | 1 - + .../linux-deconfigured-cpus/cpu/kernel_max | 1 - + .../linux-deconfigured-cpus/cpu/offline | 1 - + .../linux-deconfigured-cpus/cpu/online | 1 - + .../linux-deconfigured-cpus/cpu/possible | 1 - + .../linux-deconfigured-cpus/cpu/present | 1 - + .../linux-deconfigured-cpus/node/node0/cpu0 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu1 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu10 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu100 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu101 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu102 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu103 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu11 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu12 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu13 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu14 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu144 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu145 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu146 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu147 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu148 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu149 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu15 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu150 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu151 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu152 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu153 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu154 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu155 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu156 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu157 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu158 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu159 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu16 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu17 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu18 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu19 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu2 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu20 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu21 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu22 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu23 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu24 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu25 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu26 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu27 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu28 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu29 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu3 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu30 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu31 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu32 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu33 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu34 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu35 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu36 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu37 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu38 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu39 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu4 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu5 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu56 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu57 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu58 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu59 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu6 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu60 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu61 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu62 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu63 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu64 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu65 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu66 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu67 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu68 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu69 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu7 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu70 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu71 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu8 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu80 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu81 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu82 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu83 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu84 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu85 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu86 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu87 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu88 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu89 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu9 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu90 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu91 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu92 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu93 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu94 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu95 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu96 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu97 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu98 | 1 - + .../linux-deconfigured-cpus/node/node0/cpu99 | 1 - + .../linux-deconfigured-cpus/node/node0/meminfo | 29 ---------------------- + .../linux-deconfigured-cpus/node/node1/cpu40 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu41 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu42 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu43 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu44 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu45 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu46 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu47 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu48 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu49 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu50 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu51 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu52 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu53 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu54 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu55 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu72 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu73 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu74 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu75 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu76 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu77 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu78 | 1 - + .../linux-deconfigured-cpus/node/node1/cpu79 | 1 - + .../linux-deconfigured-cpus/node/node1/meminfo | 29 ---------------------- + .../linux-deconfigured-cpus/node/node16/cpu104 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu105 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu106 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu107 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu108 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu109 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu110 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu111 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu112 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu113 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu114 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu115 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu116 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu117 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu118 | 1 - + .../linux-deconfigured-cpus/node/node16/cpu119 | 1 - + .../linux-deconfigured-cpus/node/node16/meminfo | 29 ---------------------- + .../linux-deconfigured-cpus/node/node17/cpu120 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu121 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu122 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu123 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu124 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu125 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu126 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu127 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu128 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu129 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu130 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu131 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu132 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu133 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu134 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu135 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu136 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu137 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu138 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu139 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu140 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu141 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu142 | 1 - + .../linux-deconfigured-cpus/node/node17/cpu143 | 1 - + .../linux-deconfigured-cpus/node/node17/meminfo | 29 ---------------------- + .../linux-deconfigured-cpus/node/online | 1 - + .../linux-deconfigured-cpus/node/possible | 1 - + tests/nodeinfotest.c | 2 +- + 783 files changed, 504 insertions(+), 504 deletions(-) + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu0/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu1/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu10/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu100/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu101/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu102/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu103/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/physical_package_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/thread_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/thread_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu105/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu106/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu107/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu108/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu109/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu11/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu110/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu111/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/physical_package_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/thread_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/thread_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu113/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu114/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu115/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu116/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu117/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu118/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu119/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu12/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/physical_package_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/thread_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/thread_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu121/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu122/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu123/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu124/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu125/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu126/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu127/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/physical_package_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/thread_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/thread_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu129/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu13/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu130/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu131/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu132/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu133/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu134/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu135/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/physical_package_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/thread_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/thread_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu137/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu138/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu139/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu14/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu140/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu141/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu142/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu143/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu144/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu145/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu146/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu147/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu148/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu149/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu15/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu150/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu151/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu152/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu153/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu154/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu155/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu156/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu157/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu158/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu159/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/physical_package_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/thread_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/thread_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu17/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu18/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu19/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu2/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu20/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu21/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu22/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu23/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/physical_package_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/thread_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/thread_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu25/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu26/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu27/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu28/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu29/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu3/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu30/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu31/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu32/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu33/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu34/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu35/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu36/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu37/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu38/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu39/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu4/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/physical_package_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/thread_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/thread_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu41/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu42/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu43/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu44/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu45/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu46/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu47/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/physical_package_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/thread_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/thread_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu49/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu5/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu50/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu51/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu52/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu53/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu54/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu55/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu56/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu57/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu58/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu59/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu6/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu60/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu61/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu62/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu63/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu64/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu65/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu66/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu67/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu68/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu69/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu7/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu70/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu71/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/physical_package_id + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/thread_siblings + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/thread_siblings_list + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu73/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu74/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu75/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu76/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu77/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu78/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu79/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu8/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu80/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu81/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu82/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu83/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu84/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu85/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu86/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu87/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu88/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu89/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu9/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu90/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu91/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu92/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu93/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu94/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu95/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu96/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu97/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu98/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/cpu99/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/kernel_max + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/offline + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/possible + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/cpu/present + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu0 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu1 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu10 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu100 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu101 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu102 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu103 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu11 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu12 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu13 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu14 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu144 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu145 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu146 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu147 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu148 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu149 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu15 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu150 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu151 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu152 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu153 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu154 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu155 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu156 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu157 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu158 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu159 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu16 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu17 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu18 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu19 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu2 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu20 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu21 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu22 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu23 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu24 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu25 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu26 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu27 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu28 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu29 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu3 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu30 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu31 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu32 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu33 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu34 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu35 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu36 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu37 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu38 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu39 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu4 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu5 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu56 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu57 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu58 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu59 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu6 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu60 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu61 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu62 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu63 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu64 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu65 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu66 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu67 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu68 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu69 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu7 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu70 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu71 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu8 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu80 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu81 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu82 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu83 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu84 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu85 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu86 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu87 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu88 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu89 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu9 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu90 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu91 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu92 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu93 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu94 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu95 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu96 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu97 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu98 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu99 + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/node/node0/meminfo + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu40 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu41 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu42 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu43 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu44 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu45 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu46 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu47 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu48 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu49 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu50 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu51 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu52 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu53 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu54 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu55 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu72 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu73 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu74 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu75 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu76 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu77 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu78 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu79 + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/node/node1/meminfo + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu104 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu105 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu106 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu107 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu108 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu109 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu110 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu111 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu112 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu113 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu114 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu115 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu116 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu117 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu118 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu119 + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/node/node16/meminfo + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu120 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu121 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu122 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu123 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu124 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu125 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu126 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu127 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu128 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu129 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu130 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu131 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu132 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu133 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu134 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu135 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu136 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu137 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu138 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu139 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu140 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu141 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu142 + create mode 120000 tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu143 + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/node/node17/meminfo + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/node/online + create mode 100644 tests/nodeinfodata/linux-deconf-cpus/node/possible + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu0/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu1/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu10/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu100/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu101/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu102/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu103/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/physical_package_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/thread_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/thread_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu105/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu106/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu107/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu108/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu109/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu11/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu110/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu111/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/physical_package_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/thread_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/thread_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu113/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu114/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu115/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu116/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu117/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu118/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu119/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu12/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/physical_package_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/thread_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/thread_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu121/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu122/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu123/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu124/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu125/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu126/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu127/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/physical_package_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/thread_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/thread_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu129/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu13/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu130/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu131/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu132/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu133/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu134/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu135/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/physical_package_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/thread_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/thread_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu137/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu138/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu139/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu14/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu140/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu141/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu142/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu143/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu144/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu145/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu146/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu147/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu148/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu149/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu15/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu150/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu151/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu152/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu153/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu154/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu155/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu156/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu157/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu158/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu159/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/physical_package_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/thread_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/thread_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu17/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu18/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu19/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu2/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu20/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu21/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu22/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu23/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/physical_package_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/thread_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/thread_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu25/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu26/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu27/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu28/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu29/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu3/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu30/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu31/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu32/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu33/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu34/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu35/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu36/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu37/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu38/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu39/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu4/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/physical_package_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/thread_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/thread_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu41/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu42/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu43/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu44/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu45/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu46/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu47/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/physical_package_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/thread_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/thread_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu49/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu5/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu50/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu51/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu52/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu53/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu54/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu55/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu56/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu57/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu58/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu59/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu6/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu60/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu61/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu62/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu63/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu64/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu65/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu66/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu67/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu68/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu69/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu7/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu70/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu71/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/physical_package_id + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/thread_siblings + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/thread_siblings_list + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu73/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu74/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu75/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu76/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu77/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu78/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu79/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu8/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu80/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu81/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu82/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu83/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu84/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu85/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu86/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu87/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu88/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu89/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu9/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu90/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu91/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu92/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu93/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu94/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu95/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu96/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu97/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu98/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu99/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/kernel_max + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/offline + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/possible + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/cpu/present + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu0 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu1 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu10 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu100 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu101 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu102 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu103 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu11 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu12 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu13 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu14 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu144 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu145 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu146 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu147 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu148 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu149 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu15 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu150 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu151 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu152 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu153 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu154 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu155 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu156 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu157 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu158 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu159 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu16 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu17 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu18 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu19 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu2 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu20 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu21 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu22 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu23 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu24 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu25 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu26 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu27 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu28 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu29 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu3 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu30 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu31 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu32 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu33 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu34 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu35 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu36 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu37 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu38 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu39 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu4 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu5 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu56 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu57 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu58 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu59 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu6 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu60 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu61 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu62 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu63 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu64 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu65 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu66 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu67 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu68 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu69 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu7 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu70 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu71 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu8 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu80 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu81 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu82 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu83 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu84 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu85 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu86 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu87 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu88 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu89 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu9 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu90 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu91 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu92 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu93 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu94 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu95 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu96 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu97 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu98 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu99 + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/node/node0/meminfo + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu40 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu41 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu42 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu43 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu44 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu45 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu46 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu47 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu48 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu49 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu50 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu51 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu52 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu53 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu54 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu55 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu72 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu73 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu74 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu75 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu76 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu77 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu78 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu79 + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/node/node1/meminfo + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu104 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu105 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu106 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu107 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu108 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu109 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu110 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu111 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu112 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu113 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu114 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu115 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu116 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu117 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu118 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu119 + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/node/node16/meminfo + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu120 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu121 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu122 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu123 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu124 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu125 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu126 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu127 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu128 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu129 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu130 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu131 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu132 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu133 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu134 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu135 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu136 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu137 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu138 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu139 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu140 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu141 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu142 + delete mode 120000 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu143 + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/node/node17/meminfo + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/node/online + delete mode 100644 tests/nodeinfodata/linux-deconfigured-cpus/node/possible + +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu0/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu0/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu0/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu1/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu1/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu1/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu10/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu10/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu10/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu100/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu100/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu100/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu101/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu101/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu101/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu102/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu102/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu102/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu103/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu103/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu103/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/online +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/online +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_id +new file mode 100644 +index 0000000..9bb71ca +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_id +@@ -0,0 +1 @@ ++2152 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_siblings +new file mode 100644 +index 0000000..267b161 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010100,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_siblings_list +new file mode 100644 +index 0000000..d11f5b7 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/core_siblings_list +@@ -0,0 +1 @@ ++104,112 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/physical_package_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/physical_package_id +new file mode 100644 +index 0000000..b6a7d89 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/physical_package_id +@@ -0,0 +1 @@ ++16 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/thread_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/thread_siblings +new file mode 100644 +index 0000000..b4fa391 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/thread_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/thread_siblings_list +new file mode 100644 +index 0000000..b16e5f7 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu104/topology/thread_siblings_list +@@ -0,0 +1 @@ ++104 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu105/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu105/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu105/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu106/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu106/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu106/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu107/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu107/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu107/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu108/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu108/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu108/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu109/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu109/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu109/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu11/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu11/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu11/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu110/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu110/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu110/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu111/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu111/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu111/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/online +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/online +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_id +new file mode 100644 +index 0000000..317509b +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_id +@@ -0,0 +1 @@ ++2160 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_siblings +new file mode 100644 +index 0000000..267b161 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010100,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_siblings_list +new file mode 100644 +index 0000000..d11f5b7 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/core_siblings_list +@@ -0,0 +1 @@ ++104,112 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/physical_package_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/physical_package_id +new file mode 100644 +index 0000000..b6a7d89 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/physical_package_id +@@ -0,0 +1 @@ ++16 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/thread_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/thread_siblings +new file mode 100644 +index 0000000..968e322 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/thread_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/thread_siblings_list +new file mode 100644 +index 0000000..194b81c +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu112/topology/thread_siblings_list +@@ -0,0 +1 @@ ++112 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu113/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu113/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu113/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu114/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu114/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu114/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu115/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu115/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu115/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu116/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu116/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu116/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu117/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu117/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu117/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu118/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu118/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu118/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu119/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu119/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu119/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu12/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu12/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu12/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/online +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/online +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_id +new file mode 100644 +index 0000000..b17e4bd +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_id +@@ -0,0 +1 @@ ++2208 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_siblings +new file mode 100644 +index 0000000..99374e8 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000101,01000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_siblings_list +new file mode 100644 +index 0000000..9764eab +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/core_siblings_list +@@ -0,0 +1 @@ ++120,128,136 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/physical_package_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/physical_package_id +new file mode 100644 +index 0000000..98d9bcb +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/physical_package_id +@@ -0,0 +1 @@ ++17 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/thread_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/thread_siblings +new file mode 100644 +index 0000000..13eaaf3 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/thread_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,01000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/thread_siblings_list +new file mode 100644 +index 0000000..52bd8e4 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu120/topology/thread_siblings_list +@@ -0,0 +1 @@ ++120 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu121/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu121/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu121/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu122/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu122/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu122/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu123/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu123/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu123/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu124/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu124/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu124/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu125/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu125/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu125/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu126/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu126/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu126/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu127/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu127/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu127/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/online +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/online +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_id +new file mode 100644 +index 0000000..5c54d10 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_id +@@ -0,0 +1 @@ ++2216 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_siblings +new file mode 100644 +index 0000000..99374e8 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000101,01000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_siblings_list +new file mode 100644 +index 0000000..9764eab +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/core_siblings_list +@@ -0,0 +1 @@ ++120,128,136 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/physical_package_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/physical_package_id +new file mode 100644 +index 0000000..98d9bcb +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/physical_package_id +@@ -0,0 +1 @@ ++17 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/thread_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/thread_siblings +new file mode 100644 +index 0000000..7e18bfb +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/thread_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001,00000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/thread_siblings_list +new file mode 100644 +index 0000000..a949a93 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu128/topology/thread_siblings_list +@@ -0,0 +1 @@ ++128 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu129/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu129/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu129/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu13/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu13/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu13/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu130/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu130/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu130/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu131/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu131/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu131/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu132/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu132/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu132/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu133/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu133/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu133/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu134/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu134/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu134/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu135/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu135/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu135/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/online +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/online +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_id +new file mode 100644 +index 0000000..9813cea +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_id +@@ -0,0 +1 @@ ++2272 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_siblings +new file mode 100644 +index 0000000..99374e8 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000101,01000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_siblings_list +new file mode 100644 +index 0000000..9764eab +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/core_siblings_list +@@ -0,0 +1 @@ ++120,128,136 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/physical_package_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/physical_package_id +new file mode 100644 +index 0000000..98d9bcb +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/physical_package_id +@@ -0,0 +1 @@ ++17 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/thread_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/thread_siblings +new file mode 100644 +index 0000000..c05c51e +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/thread_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/thread_siblings_list +new file mode 100644 +index 0000000..7296f25 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu136/topology/thread_siblings_list +@@ -0,0 +1 @@ ++136 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu137/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu137/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu137/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu138/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu138/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu138/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu139/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu139/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu139/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu14/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu14/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu14/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu140/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu140/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu140/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu141/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu141/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu141/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu142/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu142/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu142/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu143/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu143/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu143/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu144/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu144/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu144/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu145/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu145/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu145/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu146/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu146/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu146/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu147/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu147/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu147/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu148/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu148/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu148/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu149/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu149/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu149/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu15/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu15/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu15/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu150/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu150/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu150/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu151/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu151/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu151/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu152/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu152/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu152/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu153/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu153/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu153/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu154/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu154/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu154/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu155/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu155/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu155/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu156/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu156/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu156/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu157/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu157/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu157/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu158/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu158/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu158/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu159/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu159/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu159/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/online +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/online +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_id +new file mode 100644 +index 0000000..21e72e8 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_id +@@ -0,0 +1 @@ ++48 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_siblings +new file mode 100644 +index 0000000..94bd366 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,01010000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_siblings_list +new file mode 100644 +index 0000000..2887d7b +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/core_siblings_list +@@ -0,0 +1 @@ ++16,24 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/physical_package_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/physical_package_id +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/physical_package_id +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/thread_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/thread_siblings +new file mode 100644 +index 0000000..f15bff6 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/thread_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/thread_siblings_list +new file mode 100644 +index 0000000..b6a7d89 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu16/topology/thread_siblings_list +@@ -0,0 +1 @@ ++16 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu17/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu17/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu17/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu18/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu18/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu18/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu19/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu19/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu19/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu2/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu2/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu2/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu20/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu20/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu20/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu21/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu21/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu21/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu22/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu22/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu22/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu23/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu23/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu23/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/online +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/online +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_id +new file mode 100644 +index 0000000..f906e18 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_id +@@ -0,0 +1 @@ ++96 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_siblings +new file mode 100644 +index 0000000..94bd366 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,01010000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_siblings_list +new file mode 100644 +index 0000000..2887d7b +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/core_siblings_list +@@ -0,0 +1 @@ ++16,24 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/physical_package_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/physical_package_id +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/physical_package_id +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/thread_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/thread_siblings +new file mode 100644 +index 0000000..c20308b +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/thread_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,01000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/thread_siblings_list +new file mode 100644 +index 0000000..a45fd52 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu24/topology/thread_siblings_list +@@ -0,0 +1 @@ ++24 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu25/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu25/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu25/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu26/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu26/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu26/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu27/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu27/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu27/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu28/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu28/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu28/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu29/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu29/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu29/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu3/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu3/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu3/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu30/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu30/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu30/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu31/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu31/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu31/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu32/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu32/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu32/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu33/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu33/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu33/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu34/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu34/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu34/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu35/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu35/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu35/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu36/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu36/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu36/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu37/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu37/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu37/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu38/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu38/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu38/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu39/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu39/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu39/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu4/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu4/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu4/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/online +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/online +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_id +new file mode 100644 +index 0000000..a762560 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_id +@@ -0,0 +1 @@ ++160 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_siblings +new file mode 100644 +index 0000000..24976fc +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00010100,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_siblings_list +new file mode 100644 +index 0000000..b7a5a65 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/core_siblings_list +@@ -0,0 +1 @@ ++40,48,72 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/physical_package_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/physical_package_id +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/physical_package_id +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/thread_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/thread_siblings +new file mode 100644 +index 0000000..d98f0b4 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/thread_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/thread_siblings_list +new file mode 100644 +index 0000000..425151f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu40/topology/thread_siblings_list +@@ -0,0 +1 @@ ++40 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu41/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu41/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu41/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu42/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu42/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu42/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu43/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu43/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu43/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu44/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu44/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu44/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu45/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu45/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu45/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu46/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu46/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu46/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu47/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu47/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu47/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/online +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/online +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_id +new file mode 100644 +index 0000000..de8febe +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_id +@@ -0,0 +1 @@ ++168 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_siblings +new file mode 100644 +index 0000000..24976fc +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00010100,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_siblings_list +new file mode 100644 +index 0000000..b7a5a65 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/core_siblings_list +@@ -0,0 +1 @@ ++40,48,72 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/physical_package_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/physical_package_id +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/physical_package_id +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/thread_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/thread_siblings +new file mode 100644 +index 0000000..943a83a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/thread_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/thread_siblings_list +new file mode 100644 +index 0000000..21e72e8 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu48/topology/thread_siblings_list +@@ -0,0 +1 @@ ++48 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu49/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu49/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu49/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu5/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu5/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu5/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu50/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu50/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu50/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu51/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu51/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu51/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu52/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu52/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu52/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu53/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu53/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu53/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu54/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu54/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu54/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu55/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu55/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu55/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu56/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu56/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu56/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu57/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu57/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu57/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu58/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu58/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu58/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu59/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu59/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu59/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu6/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu6/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu6/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu60/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu60/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu60/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu61/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu61/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu61/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu62/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu62/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu62/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu63/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu63/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu63/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu64/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu64/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu64/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu65/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu65/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu65/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu66/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu66/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu66/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu67/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu67/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu67/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu68/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu68/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu68/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu69/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu69/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu69/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu7/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu7/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu7/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu70/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu70/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu70/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu71/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu71/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu71/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/online +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/online +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_id +new file mode 100644 +index 0000000..7c022ae +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_id +@@ -0,0 +1 @@ ++232 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_siblings +new file mode 100644 +index 0000000..24976fc +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00010100,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_siblings_list +new file mode 100644 +index 0000000..b7a5a65 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/core_siblings_list +@@ -0,0 +1 @@ ++40,48,72 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/physical_package_id b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/physical_package_id +new file mode 100644 +index 0000000..d00491f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/physical_package_id +@@ -0,0 +1 @@ ++1 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/thread_siblings b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/thread_siblings +new file mode 100644 +index 0000000..b85a0fd +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/thread_siblings +@@ -0,0 +1 @@ ++00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/thread_siblings_list +new file mode 100644 +index 0000000..ea70ce0 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu72/topology/thread_siblings_list +@@ -0,0 +1 @@ ++72 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu73/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu73/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu73/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu74/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu74/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu74/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu75/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu75/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu75/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu76/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu76/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu76/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu77/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu77/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu77/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu78/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu78/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu78/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu79/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu79/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu79/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu8/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu8/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu8/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu80/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu80/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu80/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu81/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu81/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu81/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu82/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu82/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu82/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu83/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu83/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu83/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu84/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu84/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu84/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu85/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu85/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu85/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu86/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu86/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu86/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu87/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu87/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu87/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu88/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu88/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu88/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu89/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu89/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu89/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu9/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu9/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu9/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu90/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu90/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu90/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu91/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu91/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu91/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu92/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu92/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu92/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu93/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu93/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu93/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu94/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu94/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu94/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu95/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu95/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu95/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu96/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu96/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu96/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu97/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu97/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu97/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu98/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu98/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu98/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu99/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu99/online +new file mode 100644 +index 0000000..573541a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/cpu99/online +@@ -0,0 +1 @@ ++0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/kernel_max b/tests/nodeinfodata/linux-deconf-cpus/cpu/kernel_max +new file mode 100644 +index 0000000..b6ac305 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/kernel_max +@@ -0,0 +1 @@ ++2047 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/offline b/tests/nodeinfodata/linux-deconf-cpus/cpu/offline +new file mode 100644 +index 0000000..b74672a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/offline +@@ -0,0 +1 @@ ++0-15,17-23,25-39,41-47,49-71,73-103,105-111,113-119,121-127,129-135,137-159 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/online b/tests/nodeinfodata/linux-deconf-cpus/cpu/online +new file mode 100644 +index 0000000..dbb065f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/online +@@ -0,0 +1 @@ ++16,24,40,48,72,104,112,120,128,136 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/possible b/tests/nodeinfodata/linux-deconf-cpus/cpu/possible +new file mode 100644 +index 0000000..7a662d6 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/possible +@@ -0,0 +1 @@ ++0-159 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/cpu/present b/tests/nodeinfodata/linux-deconf-cpus/cpu/present +new file mode 100644 +index 0000000..4acfa9b +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/cpu/present +@@ -0,0 +1 @@ ++16-31,40-55,72-79,104-143 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu0 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu0 +new file mode 120000 +index 0000000..c841bea +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu0 +@@ -0,0 +1 @@ ++../../cpu/cpu0 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu1 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu1 +new file mode 120000 +index 0000000..5f45362 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu1 +@@ -0,0 +1 @@ ++../../cpu/cpu1 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu10 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu10 +new file mode 120000 +index 0000000..a6dc6bb +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu10 +@@ -0,0 +1 @@ ++../../cpu/cpu10 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu100 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu100 +new file mode 120000 +index 0000000..ffb1446 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu100 +@@ -0,0 +1 @@ ++../../cpu/cpu100 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu101 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu101 +new file mode 120000 +index 0000000..2b399e6 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu101 +@@ -0,0 +1 @@ ++../../cpu/cpu101 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu102 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu102 +new file mode 120000 +index 0000000..f06eb7d +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu102 +@@ -0,0 +1 @@ ++../../cpu/cpu102 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu103 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu103 +new file mode 120000 +index 0000000..722b506 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu103 +@@ -0,0 +1 @@ ++../../cpu/cpu103 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu11 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu11 +new file mode 120000 +index 0000000..e29d898 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu11 +@@ -0,0 +1 @@ ++../../cpu/cpu11 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu12 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu12 +new file mode 120000 +index 0000000..211519e +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu12 +@@ -0,0 +1 @@ ++../../cpu/cpu12 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu13 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu13 +new file mode 120000 +index 0000000..52d3b69 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu13 +@@ -0,0 +1 @@ ++../../cpu/cpu13 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu14 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu14 +new file mode 120000 +index 0000000..24cb3b4 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu14 +@@ -0,0 +1 @@ ++../../cpu/cpu14 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu144 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu144 +new file mode 120000 +index 0000000..ccecb10 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu144 +@@ -0,0 +1 @@ ++../../cpu/cpu144 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu145 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu145 +new file mode 120000 +index 0000000..00def86 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu145 +@@ -0,0 +1 @@ ++../../cpu/cpu145 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu146 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu146 +new file mode 120000 +index 0000000..6a13966 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu146 +@@ -0,0 +1 @@ ++../../cpu/cpu146 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu147 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu147 +new file mode 120000 +index 0000000..143c5a7 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu147 +@@ -0,0 +1 @@ ++../../cpu/cpu147 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu148 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu148 +new file mode 120000 +index 0000000..21bae94 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu148 +@@ -0,0 +1 @@ ++../../cpu/cpu148 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu149 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu149 +new file mode 120000 +index 0000000..fdb0f17 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu149 +@@ -0,0 +1 @@ ++../../cpu/cpu149 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu15 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu15 +new file mode 120000 +index 0000000..e905d85 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu15 +@@ -0,0 +1 @@ ++../../cpu/cpu15 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu150 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu150 +new file mode 120000 +index 0000000..da363e5 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu150 +@@ -0,0 +1 @@ ++../../cpu/cpu150 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu151 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu151 +new file mode 120000 +index 0000000..069de6b +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu151 +@@ -0,0 +1 @@ ++../../cpu/cpu151 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu152 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu152 +new file mode 120000 +index 0000000..0fb022e +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu152 +@@ -0,0 +1 @@ ++../../cpu/cpu152 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu153 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu153 +new file mode 120000 +index 0000000..d7e0f9e +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu153 +@@ -0,0 +1 @@ ++../../cpu/cpu153 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu154 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu154 +new file mode 120000 +index 0000000..0a6117a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu154 +@@ -0,0 +1 @@ ++../../cpu/cpu154 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu155 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu155 +new file mode 120000 +index 0000000..201f0f5 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu155 +@@ -0,0 +1 @@ ++../../cpu/cpu155 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu156 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu156 +new file mode 120000 +index 0000000..da7f12b +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu156 +@@ -0,0 +1 @@ ++../../cpu/cpu156 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu157 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu157 +new file mode 120000 +index 0000000..c2aa5c2 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu157 +@@ -0,0 +1 @@ ++../../cpu/cpu157 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu158 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu158 +new file mode 120000 +index 0000000..4376692 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu158 +@@ -0,0 +1 @@ ++../../cpu/cpu158 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu159 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu159 +new file mode 120000 +index 0000000..852a0c4 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu159 +@@ -0,0 +1 @@ ++../../cpu/cpu159 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu16 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu16 +new file mode 120000 +index 0000000..445de40 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu16 +@@ -0,0 +1 @@ ++../../cpu/cpu16 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu17 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu17 +new file mode 120000 +index 0000000..13929db +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu17 +@@ -0,0 +1 @@ ++../../cpu/cpu17 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu18 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu18 +new file mode 120000 +index 0000000..3809adc +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu18 +@@ -0,0 +1 @@ ++../../cpu/cpu18 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu19 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu19 +new file mode 120000 +index 0000000..c671083 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu19 +@@ -0,0 +1 @@ ++../../cpu/cpu19 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu2 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu2 +new file mode 120000 +index 0000000..2dcca33 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu2 +@@ -0,0 +1 @@ ++../../cpu/cpu2 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu20 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu20 +new file mode 120000 +index 0000000..a37c370 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu20 +@@ -0,0 +1 @@ ++../../cpu/cpu20 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu21 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu21 +new file mode 120000 +index 0000000..68a7cad +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu21 +@@ -0,0 +1 @@ ++../../cpu/cpu21 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu22 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu22 +new file mode 120000 +index 0000000..2c226ae +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu22 +@@ -0,0 +1 @@ ++../../cpu/cpu22 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu23 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu23 +new file mode 120000 +index 0000000..75c2f57 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu23 +@@ -0,0 +1 @@ ++../../cpu/cpu23 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu24 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu24 +new file mode 120000 +index 0000000..ad0a618 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu24 +@@ -0,0 +1 @@ ++../../cpu/cpu24 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu25 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu25 +new file mode 120000 +index 0000000..3145742 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu25 +@@ -0,0 +1 @@ ++../../cpu/cpu25 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu26 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu26 +new file mode 120000 +index 0000000..1dd180f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu26 +@@ -0,0 +1 @@ ++../../cpu/cpu26 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu27 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu27 +new file mode 120000 +index 0000000..74ced19 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu27 +@@ -0,0 +1 @@ ++../../cpu/cpu27 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu28 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu28 +new file mode 120000 +index 0000000..83269be +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu28 +@@ -0,0 +1 @@ ++../../cpu/cpu28 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu29 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu29 +new file mode 120000 +index 0000000..fa37dc6 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu29 +@@ -0,0 +1 @@ ++../../cpu/cpu29 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu3 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu3 +new file mode 120000 +index 0000000..c7690e5 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu3 +@@ -0,0 +1 @@ ++../../cpu/cpu3 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu30 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu30 +new file mode 120000 +index 0000000..80226fa +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu30 +@@ -0,0 +1 @@ ++../../cpu/cpu30 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu31 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu31 +new file mode 120000 +index 0000000..6a9a569 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu31 +@@ -0,0 +1 @@ ++../../cpu/cpu31 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu32 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu32 +new file mode 120000 +index 0000000..bbca866 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu32 +@@ -0,0 +1 @@ ++../../cpu/cpu32 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu33 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu33 +new file mode 120000 +index 0000000..b7a9f8d +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu33 +@@ -0,0 +1 @@ ++../../cpu/cpu33 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu34 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu34 +new file mode 120000 +index 0000000..0c0e738 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu34 +@@ -0,0 +1 @@ ++../../cpu/cpu34 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu35 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu35 +new file mode 120000 +index 0000000..47654d6 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu35 +@@ -0,0 +1 @@ ++../../cpu/cpu35 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu36 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu36 +new file mode 120000 +index 0000000..5e53f70 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu36 +@@ -0,0 +1 @@ ++../../cpu/cpu36 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu37 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu37 +new file mode 120000 +index 0000000..41b4ce7 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu37 +@@ -0,0 +1 @@ ++../../cpu/cpu37 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu38 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu38 +new file mode 120000 +index 0000000..7231eb4 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu38 +@@ -0,0 +1 @@ ++../../cpu/cpu38 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu39 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu39 +new file mode 120000 +index 0000000..d465480 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu39 +@@ -0,0 +1 @@ ++../../cpu/cpu39 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu4 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu4 +new file mode 120000 +index 0000000..9e77a64 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu4 +@@ -0,0 +1 @@ ++../../cpu/cpu4 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu5 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu5 +new file mode 120000 +index 0000000..cc07c3b +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu5 +@@ -0,0 +1 @@ ++../../cpu/cpu5 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu56 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu56 +new file mode 120000 +index 0000000..586050f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu56 +@@ -0,0 +1 @@ ++../../cpu/cpu56 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu57 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu57 +new file mode 120000 +index 0000000..4276ac5 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu57 +@@ -0,0 +1 @@ ++../../cpu/cpu57 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu58 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu58 +new file mode 120000 +index 0000000..3c10d2d +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu58 +@@ -0,0 +1 @@ ++../../cpu/cpu58 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu59 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu59 +new file mode 120000 +index 0000000..06ddb97 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu59 +@@ -0,0 +1 @@ ++../../cpu/cpu59 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu6 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu6 +new file mode 120000 +index 0000000..2e75763 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu6 +@@ -0,0 +1 @@ ++../../cpu/cpu6 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu60 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu60 +new file mode 120000 +index 0000000..c062761 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu60 +@@ -0,0 +1 @@ ++../../cpu/cpu60 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu61 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu61 +new file mode 120000 +index 0000000..5a2c12f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu61 +@@ -0,0 +1 @@ ++../../cpu/cpu61 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu62 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu62 +new file mode 120000 +index 0000000..9056072 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu62 +@@ -0,0 +1 @@ ++../../cpu/cpu62 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu63 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu63 +new file mode 120000 +index 0000000..1511953 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu63 +@@ -0,0 +1 @@ ++../../cpu/cpu63 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu64 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu64 +new file mode 120000 +index 0000000..1664a2b +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu64 +@@ -0,0 +1 @@ ++../../cpu/cpu64 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu65 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu65 +new file mode 120000 +index 0000000..52712cf +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu65 +@@ -0,0 +1 @@ ++../../cpu/cpu65 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu66 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu66 +new file mode 120000 +index 0000000..93a4f32 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu66 +@@ -0,0 +1 @@ ++../../cpu/cpu66 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu67 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu67 +new file mode 120000 +index 0000000..db73e74 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu67 +@@ -0,0 +1 @@ ++../../cpu/cpu67 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu68 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu68 +new file mode 120000 +index 0000000..4f40eb8 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu68 +@@ -0,0 +1 @@ ++../../cpu/cpu68 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu69 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu69 +new file mode 120000 +index 0000000..9f32d96 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu69 +@@ -0,0 +1 @@ ++../../cpu/cpu69 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu7 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu7 +new file mode 120000 +index 0000000..09e3f79 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu7 +@@ -0,0 +1 @@ ++../../cpu/cpu7 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu70 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu70 +new file mode 120000 +index 0000000..a0e8fd2 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu70 +@@ -0,0 +1 @@ ++../../cpu/cpu70 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu71 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu71 +new file mode 120000 +index 0000000..898c9f2 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu71 +@@ -0,0 +1 @@ ++../../cpu/cpu71 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu8 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu8 +new file mode 120000 +index 0000000..bda10cc +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu8 +@@ -0,0 +1 @@ ++../../cpu/cpu8 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu80 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu80 +new file mode 120000 +index 0000000..ce5ed81 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu80 +@@ -0,0 +1 @@ ++../../cpu/cpu80 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu81 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu81 +new file mode 120000 +index 0000000..dcd9a05 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu81 +@@ -0,0 +1 @@ ++../../cpu/cpu81 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu82 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu82 +new file mode 120000 +index 0000000..c91ce01 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu82 +@@ -0,0 +1 @@ ++../../cpu/cpu82 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu83 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu83 +new file mode 120000 +index 0000000..22ba3c4 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu83 +@@ -0,0 +1 @@ ++../../cpu/cpu83 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu84 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu84 +new file mode 120000 +index 0000000..c7e4d26 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu84 +@@ -0,0 +1 @@ ++../../cpu/cpu84 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu85 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu85 +new file mode 120000 +index 0000000..6779d27 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu85 +@@ -0,0 +1 @@ ++../../cpu/cpu85 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu86 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu86 +new file mode 120000 +index 0000000..9e777be +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu86 +@@ -0,0 +1 @@ ++../../cpu/cpu86 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu87 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu87 +new file mode 120000 +index 0000000..0359c58 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu87 +@@ -0,0 +1 @@ ++../../cpu/cpu87 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu88 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu88 +new file mode 120000 +index 0000000..3825c50 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu88 +@@ -0,0 +1 @@ ++../../cpu/cpu88 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu89 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu89 +new file mode 120000 +index 0000000..9a72211 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu89 +@@ -0,0 +1 @@ ++../../cpu/cpu89 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu9 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu9 +new file mode 120000 +index 0000000..1ec1db2 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu9 +@@ -0,0 +1 @@ ++../../cpu/cpu9 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu90 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu90 +new file mode 120000 +index 0000000..75d10b3 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu90 +@@ -0,0 +1 @@ ++../../cpu/cpu90 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu91 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu91 +new file mode 120000 +index 0000000..8e9e4a4 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu91 +@@ -0,0 +1 @@ ++../../cpu/cpu91 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu92 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu92 +new file mode 120000 +index 0000000..f8d5f05 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu92 +@@ -0,0 +1 @@ ++../../cpu/cpu92 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu93 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu93 +new file mode 120000 +index 0000000..5a302ad +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu93 +@@ -0,0 +1 @@ ++../../cpu/cpu93 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu94 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu94 +new file mode 120000 +index 0000000..9e6239f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu94 +@@ -0,0 +1 @@ ++../../cpu/cpu94 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu95 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu95 +new file mode 120000 +index 0000000..d87b5e3 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu95 +@@ -0,0 +1 @@ ++../../cpu/cpu95 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu96 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu96 +new file mode 120000 +index 0000000..50d1edc +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu96 +@@ -0,0 +1 @@ ++../../cpu/cpu96 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu97 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu97 +new file mode 120000 +index 0000000..38b5a90 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu97 +@@ -0,0 +1 @@ ++../../cpu/cpu97 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu98 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu98 +new file mode 120000 +index 0000000..df97c6c +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu98 +@@ -0,0 +1 @@ ++../../cpu/cpu98 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu99 b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu99 +new file mode 120000 +index 0000000..a3a6164 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/cpu99 +@@ -0,0 +1 @@ ++../../cpu/cpu99 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node0/meminfo b/tests/nodeinfodata/linux-deconf-cpus/node/node0/meminfo +new file mode 100644 +index 0000000..0ecf45a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node0/meminfo +@@ -0,0 +1,29 @@ ++Node 0 MemTotal: 67108864 kB ++Node 0 MemFree: 61960640 kB ++Node 0 MemUsed: 5148224 kB ++Node 0 Active: 124864 kB ++Node 0 Inactive: 107584 kB ++Node 0 Active(anon): 83648 kB ++Node 0 Inactive(anon): 8768 kB ++Node 0 Active(file): 41216 kB ++Node 0 Inactive(file): 98816 kB ++Node 0 Unevictable: 0 kB ++Node 0 Mlocked: 0 kB ++Node 0 Dirty: 128 kB ++Node 0 Writeback: 0 kB ++Node 0 FilePages: 155008 kB ++Node 0 Mapped: 31552 kB ++Node 0 AnonPages: 77312 kB ++Node 0 Shmem: 15104 kB ++Node 0 KernelStack: 8992 kB ++Node 0 PageTables: 1728 kB ++Node 0 NFS_Unstable: 0 kB ++Node 0 Bounce: 0 kB ++Node 0 WritebackTmp: 0 kB ++Node 0 Slab: 151872 kB ++Node 0 SReclaimable: 27776 kB ++Node 0 SUnreclaim: 124096 kB ++Node 0 AnonHugePages: 0 kB ++Node 0 HugePages_Total: 0 ++Node 0 HugePages_Free: 0 ++Node 0 HugePages_Surp: 0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu40 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu40 +new file mode 120000 +index 0000000..c727d46 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu40 +@@ -0,0 +1 @@ ++../../cpu/cpu40 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu41 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu41 +new file mode 120000 +index 0000000..cc0b78c +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu41 +@@ -0,0 +1 @@ ++../../cpu/cpu41 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu42 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu42 +new file mode 120000 +index 0000000..8ebd18e +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu42 +@@ -0,0 +1 @@ ++../../cpu/cpu42 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu43 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu43 +new file mode 120000 +index 0000000..03b2d2d +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu43 +@@ -0,0 +1 @@ ++../../cpu/cpu43 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu44 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu44 +new file mode 120000 +index 0000000..859e4fc +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu44 +@@ -0,0 +1 @@ ++../../cpu/cpu44 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu45 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu45 +new file mode 120000 +index 0000000..58c3ca3 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu45 +@@ -0,0 +1 @@ ++../../cpu/cpu45 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu46 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu46 +new file mode 120000 +index 0000000..55223e0 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu46 +@@ -0,0 +1 @@ ++../../cpu/cpu46 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu47 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu47 +new file mode 120000 +index 0000000..19407d4 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu47 +@@ -0,0 +1 @@ ++../../cpu/cpu47 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu48 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu48 +new file mode 120000 +index 0000000..60a190c +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu48 +@@ -0,0 +1 @@ ++../../cpu/cpu48 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu49 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu49 +new file mode 120000 +index 0000000..0ff1796 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu49 +@@ -0,0 +1 @@ ++../../cpu/cpu49 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu50 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu50 +new file mode 120000 +index 0000000..ddc5361 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu50 +@@ -0,0 +1 @@ ++../../cpu/cpu50 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu51 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu51 +new file mode 120000 +index 0000000..41163a9 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu51 +@@ -0,0 +1 @@ ++../../cpu/cpu51 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu52 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu52 +new file mode 120000 +index 0000000..be09dc8 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu52 +@@ -0,0 +1 @@ ++../../cpu/cpu52 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu53 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu53 +new file mode 120000 +index 0000000..470ab22 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu53 +@@ -0,0 +1 @@ ++../../cpu/cpu53 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu54 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu54 +new file mode 120000 +index 0000000..5c11dfd +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu54 +@@ -0,0 +1 @@ ++../../cpu/cpu54 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu55 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu55 +new file mode 120000 +index 0000000..e858949 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu55 +@@ -0,0 +1 @@ ++../../cpu/cpu55 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu72 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu72 +new file mode 120000 +index 0000000..d731cf5 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu72 +@@ -0,0 +1 @@ ++../../cpu/cpu72 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu73 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu73 +new file mode 120000 +index 0000000..99f1a90 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu73 +@@ -0,0 +1 @@ ++../../cpu/cpu73 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu74 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu74 +new file mode 120000 +index 0000000..84a3139 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu74 +@@ -0,0 +1 @@ ++../../cpu/cpu74 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu75 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu75 +new file mode 120000 +index 0000000..0693a99 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu75 +@@ -0,0 +1 @@ ++../../cpu/cpu75 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu76 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu76 +new file mode 120000 +index 0000000..5ff7021 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu76 +@@ -0,0 +1 @@ ++../../cpu/cpu76 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu77 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu77 +new file mode 120000 +index 0000000..05099c6 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu77 +@@ -0,0 +1 @@ ++../../cpu/cpu77 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu78 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu78 +new file mode 120000 +index 0000000..20eb9cc +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu78 +@@ -0,0 +1 @@ ++../../cpu/cpu78 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu79 b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu79 +new file mode 120000 +index 0000000..4813a63 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/cpu79 +@@ -0,0 +1 @@ ++../../cpu/cpu79 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node1/meminfo b/tests/nodeinfodata/linux-deconf-cpus/node/node1/meminfo +new file mode 100644 +index 0000000..ef085b2 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node1/meminfo +@@ -0,0 +1,29 @@ ++Node 1 MemTotal: 67108864 kB ++Node 1 MemFree: 66143552 kB ++Node 1 MemUsed: 965312 kB ++Node 1 Active: 125952 kB ++Node 1 Inactive: 255808 kB ++Node 1 Active(anon): 79808 kB ++Node 1 Inactive(anon): 448 kB ++Node 1 Active(file): 46144 kB ++Node 1 Inactive(file): 255360 kB ++Node 1 Unevictable: 0 kB ++Node 1 Mlocked: 0 kB ++Node 1 Dirty: 213760 kB ++Node 1 Writeback: 0 kB ++Node 1 FilePages: 310656 kB ++Node 1 Mapped: 27328 kB ++Node 1 AnonPages: 73856 kB ++Node 1 Shmem: 6336 kB ++Node 1 KernelStack: 4624 kB ++Node 1 PageTables: 512 kB ++Node 1 NFS_Unstable: 0 kB ++Node 1 Bounce: 0 kB ++Node 1 WritebackTmp: 0 kB ++Node 1 Slab: 130688 kB ++Node 1 SReclaimable: 21120 kB ++Node 1 SUnreclaim: 109568 kB ++Node 1 AnonHugePages: 0 kB ++Node 1 HugePages_Total: 0 ++Node 1 HugePages_Free: 0 ++Node 1 HugePages_Surp: 0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu104 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu104 +new file mode 120000 +index 0000000..7692606 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu104 +@@ -0,0 +1 @@ ++../../cpu/cpu104 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu105 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu105 +new file mode 120000 +index 0000000..77d25d5 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu105 +@@ -0,0 +1 @@ ++../../cpu/cpu105 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu106 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu106 +new file mode 120000 +index 0000000..f8bff26 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu106 +@@ -0,0 +1 @@ ++../../cpu/cpu106 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu107 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu107 +new file mode 120000 +index 0000000..d475c15 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu107 +@@ -0,0 +1 @@ ++../../cpu/cpu107 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu108 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu108 +new file mode 120000 +index 0000000..4352ab8 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu108 +@@ -0,0 +1 @@ ++../../cpu/cpu108 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu109 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu109 +new file mode 120000 +index 0000000..c74e8ec +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu109 +@@ -0,0 +1 @@ ++../../cpu/cpu109 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu110 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu110 +new file mode 120000 +index 0000000..fb66aa1 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu110 +@@ -0,0 +1 @@ ++../../cpu/cpu110 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu111 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu111 +new file mode 120000 +index 0000000..b2da00c +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu111 +@@ -0,0 +1 @@ ++../../cpu/cpu111 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu112 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu112 +new file mode 120000 +index 0000000..e65062a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu112 +@@ -0,0 +1 @@ ++../../cpu/cpu112 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu113 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu113 +new file mode 120000 +index 0000000..f8380bf +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu113 +@@ -0,0 +1 @@ ++../../cpu/cpu113 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu114 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu114 +new file mode 120000 +index 0000000..4c33e35 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu114 +@@ -0,0 +1 @@ ++../../cpu/cpu114 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu115 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu115 +new file mode 120000 +index 0000000..2b4fbce +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu115 +@@ -0,0 +1 @@ ++../../cpu/cpu115 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu116 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu116 +new file mode 120000 +index 0000000..7e07a2d +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu116 +@@ -0,0 +1 @@ ++../../cpu/cpu116 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu117 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu117 +new file mode 120000 +index 0000000..2d65930 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu117 +@@ -0,0 +1 @@ ++../../cpu/cpu117 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu118 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu118 +new file mode 120000 +index 0000000..b09093c +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu118 +@@ -0,0 +1 @@ ++../../cpu/cpu118 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu119 b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu119 +new file mode 120000 +index 0000000..59a5bf1 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/cpu119 +@@ -0,0 +1 @@ ++../../cpu/cpu119 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node16/meminfo b/tests/nodeinfodata/linux-deconf-cpus/node/node16/meminfo +new file mode 100644 +index 0000000..09e3954 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node16/meminfo +@@ -0,0 +1,29 @@ ++Node 16 MemTotal: 67108864 kB ++Node 16 MemFree: 66573952 kB ++Node 16 MemUsed: 534912 kB ++Node 16 Active: 14272 kB ++Node 16 Inactive: 16832 kB ++Node 16 Active(anon): 6272 kB ++Node 16 Inactive(anon): 64 kB ++Node 16 Active(file): 8000 kB ++Node 16 Inactive(file): 16768 kB ++Node 16 Unevictable: 0 kB ++Node 16 Mlocked: 0 kB ++Node 16 Dirty: 0 kB ++Node 16 Writeback: 0 kB ++Node 16 FilePages: 26176 kB ++Node 16 Mapped: 384 kB ++Node 16 AnonPages: 4928 kB ++Node 16 Shmem: 1408 kB ++Node 16 KernelStack: 1968 kB ++Node 16 PageTables: 192 kB ++Node 16 NFS_Unstable: 0 kB ++Node 16 Bounce: 0 kB ++Node 16 WritebackTmp: 0 kB ++Node 16 Slab: 46336 kB ++Node 16 SReclaimable: 2688 kB ++Node 16 SUnreclaim: 43648 kB ++Node 16 AnonHugePages: 0 kB ++Node 16 HugePages_Total: 0 ++Node 16 HugePages_Free: 0 ++Node 16 HugePages_Surp: 0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu120 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu120 +new file mode 120000 +index 0000000..17a18b1 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu120 +@@ -0,0 +1 @@ ++../../cpu/cpu120 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu121 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu121 +new file mode 120000 +index 0000000..321bbc2 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu121 +@@ -0,0 +1 @@ ++../../cpu/cpu121 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu122 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu122 +new file mode 120000 +index 0000000..e03f5a3 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu122 +@@ -0,0 +1 @@ ++../../cpu/cpu122 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu123 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu123 +new file mode 120000 +index 0000000..3021e4f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu123 +@@ -0,0 +1 @@ ++../../cpu/cpu123 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu124 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu124 +new file mode 120000 +index 0000000..10b32dc +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu124 +@@ -0,0 +1 @@ ++../../cpu/cpu124 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu125 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu125 +new file mode 120000 +index 0000000..9e06e6e +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu125 +@@ -0,0 +1 @@ ++../../cpu/cpu125 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu126 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu126 +new file mode 120000 +index 0000000..2a4708a +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu126 +@@ -0,0 +1 @@ ++../../cpu/cpu126 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu127 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu127 +new file mode 120000 +index 0000000..96b5143 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu127 +@@ -0,0 +1 @@ ++../../cpu/cpu127 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu128 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu128 +new file mode 120000 +index 0000000..3142217 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu128 +@@ -0,0 +1 @@ ++../../cpu/cpu128 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu129 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu129 +new file mode 120000 +index 0000000..dc84401 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu129 +@@ -0,0 +1 @@ ++../../cpu/cpu129 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu130 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu130 +new file mode 120000 +index 0000000..59a50b8 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu130 +@@ -0,0 +1 @@ ++../../cpu/cpu130 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu131 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu131 +new file mode 120000 +index 0000000..ca1f958 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu131 +@@ -0,0 +1 @@ ++../../cpu/cpu131 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu132 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu132 +new file mode 120000 +index 0000000..a1f7ea1 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu132 +@@ -0,0 +1 @@ ++../../cpu/cpu132 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu133 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu133 +new file mode 120000 +index 0000000..89e453b +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu133 +@@ -0,0 +1 @@ ++../../cpu/cpu133 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu134 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu134 +new file mode 120000 +index 0000000..a46c33e +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu134 +@@ -0,0 +1 @@ ++../../cpu/cpu134 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu135 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu135 +new file mode 120000 +index 0000000..4efd76f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu135 +@@ -0,0 +1 @@ ++../../cpu/cpu135 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu136 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu136 +new file mode 120000 +index 0000000..cfd61b4 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu136 +@@ -0,0 +1 @@ ++../../cpu/cpu136 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu137 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu137 +new file mode 120000 +index 0000000..6a1ec92 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu137 +@@ -0,0 +1 @@ ++../../cpu/cpu137 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu138 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu138 +new file mode 120000 +index 0000000..890aad3 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu138 +@@ -0,0 +1 @@ ++../../cpu/cpu138 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu139 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu139 +new file mode 120000 +index 0000000..afb925f +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu139 +@@ -0,0 +1 @@ ++../../cpu/cpu139 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu140 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu140 +new file mode 120000 +index 0000000..2faf4c0 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu140 +@@ -0,0 +1 @@ ++../../cpu/cpu140 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu141 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu141 +new file mode 120000 +index 0000000..6cf8cf1 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu141 +@@ -0,0 +1 @@ ++../../cpu/cpu141 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu142 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu142 +new file mode 120000 +index 0000000..fa73d61 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu142 +@@ -0,0 +1 @@ ++../../cpu/cpu142 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu143 b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu143 +new file mode 120000 +index 0000000..04dcaa4 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/cpu143 +@@ -0,0 +1 @@ ++../../cpu/cpu143 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/node17/meminfo b/tests/nodeinfodata/linux-deconf-cpus/node/node17/meminfo +new file mode 100644 +index 0000000..1bddfb5 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/node17/meminfo +@@ -0,0 +1,29 @@ ++Node 17 MemTotal: 67108864 kB ++Node 17 MemFree: 66334656 kB ++Node 17 MemUsed: 774208 kB ++Node 17 Active: 15936 kB ++Node 17 Inactive: 12416 kB ++Node 17 Active(anon): 10944 kB ++Node 17 Inactive(anon): 64 kB ++Node 17 Active(file): 4992 kB ++Node 17 Inactive(file): 12352 kB ++Node 17 Unevictable: 0 kB ++Node 17 Mlocked: 0 kB ++Node 17 Dirty: 0 kB ++Node 17 Writeback: 0 kB ++Node 17 FilePages: 17600 kB ++Node 17 Mapped: 768 kB ++Node 17 AnonPages: 10752 kB ++Node 17 Shmem: 256 kB ++Node 17 KernelStack: 3808 kB ++Node 17 PageTables: 128 kB ++Node 17 NFS_Unstable: 0 kB ++Node 17 Bounce: 0 kB ++Node 17 WritebackTmp: 0 kB ++Node 17 Slab: 25792 kB ++Node 17 SReclaimable: 3840 kB ++Node 17 SUnreclaim: 21952 kB ++Node 17 AnonHugePages: 0 kB ++Node 17 HugePages_Total: 0 ++Node 17 HugePages_Free: 0 ++Node 17 HugePages_Surp: 0 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/online b/tests/nodeinfodata/linux-deconf-cpus/node/online +new file mode 100644 +index 0000000..a41eb32 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/online +@@ -0,0 +1 @@ ++0-1,16-17 +diff --git a/tests/nodeinfodata/linux-deconf-cpus/node/possible b/tests/nodeinfodata/linux-deconf-cpus/node/possible +new file mode 100644 +index 0000000..8d232c7 +--- /dev/null ++++ b/tests/nodeinfodata/linux-deconf-cpus/node/possible +@@ -0,0 +1 @@ ++0-255 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu0/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu0/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu0/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu1/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu1/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu1/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu10/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu10/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu10/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu100/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu100/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu100/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu101/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu101/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu101/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu102/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu102/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu102/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu103/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu103/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu103/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/online +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/online ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_id +deleted file mode 100644 +index 9bb71ca..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_id ++++ /dev/null +@@ -1 +0,0 @@ +-2152 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_siblings +deleted file mode 100644 +index 267b161..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010100,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_siblings_list +deleted file mode 100644 +index d11f5b7..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/core_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-104,112 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/physical_package_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/physical_package_id +deleted file mode 100644 +index b6a7d89..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/physical_package_id ++++ /dev/null +@@ -1 +0,0 @@ +-16 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/thread_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/thread_siblings +deleted file mode 100644 +index b4fa391..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/thread_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/thread_siblings_list +deleted file mode 100644 +index b16e5f7..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu104/topology/thread_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-104 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu105/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu105/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu105/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu106/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu106/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu106/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu107/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu107/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu107/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu108/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu108/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu108/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu109/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu109/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu109/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu11/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu11/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu11/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu110/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu110/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu110/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu111/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu111/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu111/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/online +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/online ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_id +deleted file mode 100644 +index 317509b..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_id ++++ /dev/null +@@ -1 +0,0 @@ +-2160 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_siblings +deleted file mode 100644 +index 267b161..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010100,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_siblings_list +deleted file mode 100644 +index d11f5b7..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/core_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-104,112 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/physical_package_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/physical_package_id +deleted file mode 100644 +index b6a7d89..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/physical_package_id ++++ /dev/null +@@ -1 +0,0 @@ +-16 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/thread_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/thread_siblings +deleted file mode 100644 +index 968e322..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/thread_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/thread_siblings_list +deleted file mode 100644 +index 194b81c..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu112/topology/thread_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-112 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu113/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu113/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu113/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu114/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu114/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu114/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu115/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu115/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu115/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu116/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu116/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu116/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu117/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu117/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu117/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu118/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu118/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu118/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu119/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu119/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu119/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu12/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu12/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu12/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/online +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/online ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_id +deleted file mode 100644 +index b17e4bd..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_id ++++ /dev/null +@@ -1 +0,0 @@ +-2208 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_siblings +deleted file mode 100644 +index 99374e8..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000101,01000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_siblings_list +deleted file mode 100644 +index 9764eab..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/core_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-120,128,136 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/physical_package_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/physical_package_id +deleted file mode 100644 +index 98d9bcb..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/physical_package_id ++++ /dev/null +@@ -1 +0,0 @@ +-17 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/thread_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/thread_siblings +deleted file mode 100644 +index 13eaaf3..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/thread_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,01000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/thread_siblings_list +deleted file mode 100644 +index 52bd8e4..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu120/topology/thread_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-120 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu121/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu121/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu121/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu122/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu122/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu122/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu123/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu123/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu123/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu124/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu124/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu124/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu125/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu125/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu125/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu126/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu126/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu126/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu127/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu127/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu127/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/online +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/online ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_id +deleted file mode 100644 +index 5c54d10..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_id ++++ /dev/null +@@ -1 +0,0 @@ +-2216 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_siblings +deleted file mode 100644 +index 99374e8..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000101,01000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_siblings_list +deleted file mode 100644 +index 9764eab..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/core_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-120,128,136 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/physical_package_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/physical_package_id +deleted file mode 100644 +index 98d9bcb..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/physical_package_id ++++ /dev/null +@@ -1 +0,0 @@ +-17 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/thread_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/thread_siblings +deleted file mode 100644 +index 7e18bfb..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/thread_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001,00000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/thread_siblings_list +deleted file mode 100644 +index a949a93..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu128/topology/thread_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-128 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu129/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu129/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu129/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu13/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu13/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu13/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu130/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu130/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu130/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu131/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu131/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu131/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu132/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu132/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu132/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu133/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu133/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu133/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu134/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu134/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu134/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu135/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu135/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu135/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/online +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/online ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_id +deleted file mode 100644 +index 9813cea..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_id ++++ /dev/null +@@ -1 +0,0 @@ +-2272 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_siblings +deleted file mode 100644 +index 99374e8..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000101,01000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_siblings_list +deleted file mode 100644 +index 9764eab..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/core_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-120,128,136 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/physical_package_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/physical_package_id +deleted file mode 100644 +index 98d9bcb..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/physical_package_id ++++ /dev/null +@@ -1 +0,0 @@ +-17 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/thread_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/thread_siblings +deleted file mode 100644 +index c05c51e..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/thread_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00000000,00000000,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/thread_siblings_list +deleted file mode 100644 +index 7296f25..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu136/topology/thread_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-136 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu137/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu137/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu137/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu138/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu138/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu138/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu139/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu139/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu139/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu14/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu14/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu14/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu140/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu140/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu140/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu141/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu141/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu141/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu142/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu142/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu142/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu143/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu143/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu143/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu144/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu144/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu144/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu145/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu145/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu145/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu146/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu146/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu146/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu147/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu147/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu147/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu148/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu148/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu148/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu149/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu149/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu149/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu15/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu15/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu15/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu150/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu150/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu150/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu151/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu151/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu151/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu152/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu152/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu152/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu153/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu153/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu153/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu154/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu154/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu154/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu155/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu155/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu155/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu156/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu156/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu156/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu157/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu157/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu157/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu158/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu158/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu158/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu159/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu159/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu159/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/online +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/online ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_id +deleted file mode 100644 +index 21e72e8..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_id ++++ /dev/null +@@ -1 +0,0 @@ +-48 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_siblings +deleted file mode 100644 +index 94bd366..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,01010000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_siblings_list +deleted file mode 100644 +index 2887d7b..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/core_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-16,24 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/physical_package_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/physical_package_id +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/physical_package_id ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/thread_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/thread_siblings +deleted file mode 100644 +index f15bff6..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/thread_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/thread_siblings_list +deleted file mode 100644 +index b6a7d89..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu16/topology/thread_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-16 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu17/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu17/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu17/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu18/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu18/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu18/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu19/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu19/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu19/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu2/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu2/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu2/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu20/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu20/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu20/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu21/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu21/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu21/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu22/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu22/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu22/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu23/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu23/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu23/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/online +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/online ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_id +deleted file mode 100644 +index f906e18..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_id ++++ /dev/null +@@ -1 +0,0 @@ +-96 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_siblings +deleted file mode 100644 +index 94bd366..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,01010000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_siblings_list +deleted file mode 100644 +index 2887d7b..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/core_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-16,24 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/physical_package_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/physical_package_id +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/physical_package_id ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/thread_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/thread_siblings +deleted file mode 100644 +index c20308b..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/thread_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,01000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/thread_siblings_list +deleted file mode 100644 +index a45fd52..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu24/topology/thread_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-24 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu25/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu25/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu25/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu26/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu26/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu26/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu27/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu27/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu27/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu28/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu28/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu28/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu29/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu29/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu29/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu3/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu3/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu3/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu30/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu30/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu30/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu31/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu31/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu31/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu32/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu32/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu32/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu33/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu33/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu33/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu34/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu34/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu34/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu35/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu35/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu35/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu36/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu36/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu36/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu37/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu37/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu37/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu38/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu38/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu38/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu39/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu39/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu39/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu4/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu4/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu4/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/online +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/online ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_id +deleted file mode 100644 +index a762560..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_id ++++ /dev/null +@@ -1 +0,0 @@ +-160 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_siblings +deleted file mode 100644 +index 24976fc..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00010100,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_siblings_list +deleted file mode 100644 +index b7a5a65..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/core_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-40,48,72 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/physical_package_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/physical_package_id +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/physical_package_id ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/thread_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/thread_siblings +deleted file mode 100644 +index d98f0b4..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/thread_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/thread_siblings_list +deleted file mode 100644 +index 425151f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu40/topology/thread_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-40 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu41/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu41/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu41/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu42/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu42/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu42/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu43/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu43/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu43/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu44/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu44/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu44/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu45/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu45/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu45/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu46/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu46/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu46/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu47/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu47/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu47/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/online +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/online ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_id +deleted file mode 100644 +index de8febe..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_id ++++ /dev/null +@@ -1 +0,0 @@ +-168 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_siblings +deleted file mode 100644 +index 24976fc..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00010100,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_siblings_list +deleted file mode 100644 +index b7a5a65..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/core_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-40,48,72 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/physical_package_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/physical_package_id +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/physical_package_id ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/thread_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/thread_siblings +deleted file mode 100644 +index 943a83a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/thread_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/thread_siblings_list +deleted file mode 100644 +index 21e72e8..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu48/topology/thread_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-48 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu49/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu49/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu49/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu5/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu5/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu5/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu50/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu50/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu50/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu51/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu51/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu51/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu52/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu52/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu52/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu53/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu53/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu53/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu54/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu54/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu54/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu55/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu55/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu55/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu56/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu56/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu56/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu57/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu57/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu57/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu58/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu58/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu58/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu59/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu59/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu59/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu6/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu6/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu6/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu60/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu60/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu60/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu61/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu61/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu61/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu62/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu62/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu62/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu63/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu63/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu63/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu64/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu64/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu64/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu65/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu65/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu65/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu66/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu66/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu66/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu67/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu67/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu67/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu68/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu68/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu68/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu69/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu69/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu69/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu7/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu7/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu7/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu70/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu70/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu70/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu71/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu71/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu71/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/online +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/online ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_id +deleted file mode 100644 +index 7c022ae..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_id ++++ /dev/null +@@ -1 +0,0 @@ +-232 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_siblings +deleted file mode 100644 +index 24976fc..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00010100,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_siblings_list +deleted file mode 100644 +index b7a5a65..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/core_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-40,48,72 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/physical_package_id b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/physical_package_id +deleted file mode 100644 +index d00491f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/physical_package_id ++++ /dev/null +@@ -1 +0,0 @@ +-1 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/thread_siblings b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/thread_siblings +deleted file mode 100644 +index b85a0fd..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/thread_siblings ++++ /dev/null +@@ -1 +0,0 @@ +-00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100,00000000,00000000 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/thread_siblings_list b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/thread_siblings_list +deleted file mode 100644 +index ea70ce0..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu72/topology/thread_siblings_list ++++ /dev/null +@@ -1 +0,0 @@ +-72 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu73/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu73/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu73/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu74/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu74/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu74/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu75/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu75/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu75/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu76/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu76/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu76/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu77/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu77/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu77/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu78/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu78/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu78/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu79/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu79/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu79/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu8/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu8/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu8/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu80/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu80/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu80/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu81/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu81/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu81/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu82/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu82/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu82/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu83/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu83/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu83/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu84/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu84/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu84/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu85/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu85/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu85/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu86/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu86/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu86/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu87/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu87/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu87/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu88/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu88/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu88/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu89/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu89/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu89/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu9/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu9/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu9/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu90/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu90/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu90/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu91/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu91/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu91/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu92/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu92/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu92/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu93/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu93/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu93/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu94/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu94/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu94/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu95/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu95/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu95/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu96/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu96/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu96/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu97/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu97/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu97/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu98/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu98/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu98/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu99/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu99/online +deleted file mode 100644 +index 573541a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/cpu99/online ++++ /dev/null +@@ -1 +0,0 @@ +-0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/kernel_max b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/kernel_max +deleted file mode 100644 +index b6ac305..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/kernel_max ++++ /dev/null +@@ -1 +0,0 @@ +-2047 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/offline b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/offline +deleted file mode 100644 +index b74672a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/offline ++++ /dev/null +@@ -1 +0,0 @@ +-0-15,17-23,25-39,41-47,49-71,73-103,105-111,113-119,121-127,129-135,137-159 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/online b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/online +deleted file mode 100644 +index dbb065f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/online ++++ /dev/null +@@ -1 +0,0 @@ +-16,24,40,48,72,104,112,120,128,136 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/possible b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/possible +deleted file mode 100644 +index 7a662d6..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/possible ++++ /dev/null +@@ -1 +0,0 @@ +-0-159 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/present b/tests/nodeinfodata/linux-deconfigured-cpus/cpu/present +deleted file mode 100644 +index 4acfa9b..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/cpu/present ++++ /dev/null +@@ -1 +0,0 @@ +-16-31,40-55,72-79,104-143 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu0 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu0 +deleted file mode 120000 +index c841bea..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu0 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu0 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu1 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu1 +deleted file mode 120000 +index 5f45362..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu1 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu1 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu10 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu10 +deleted file mode 120000 +index a6dc6bb..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu10 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu10 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu100 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu100 +deleted file mode 120000 +index ffb1446..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu100 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu100 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu101 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu101 +deleted file mode 120000 +index 2b399e6..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu101 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu101 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu102 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu102 +deleted file mode 120000 +index f06eb7d..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu102 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu102 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu103 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu103 +deleted file mode 120000 +index 722b506..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu103 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu103 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu11 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu11 +deleted file mode 120000 +index e29d898..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu11 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu11 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu12 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu12 +deleted file mode 120000 +index 211519e..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu12 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu12 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu13 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu13 +deleted file mode 120000 +index 52d3b69..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu13 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu13 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu14 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu14 +deleted file mode 120000 +index 24cb3b4..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu14 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu14 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu144 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu144 +deleted file mode 120000 +index ccecb10..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu144 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu144 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu145 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu145 +deleted file mode 120000 +index 00def86..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu145 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu145 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu146 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu146 +deleted file mode 120000 +index 6a13966..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu146 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu146 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu147 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu147 +deleted file mode 120000 +index 143c5a7..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu147 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu147 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu148 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu148 +deleted file mode 120000 +index 21bae94..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu148 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu148 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu149 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu149 +deleted file mode 120000 +index fdb0f17..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu149 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu149 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu15 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu15 +deleted file mode 120000 +index e905d85..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu15 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu15 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu150 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu150 +deleted file mode 120000 +index da363e5..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu150 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu150 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu151 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu151 +deleted file mode 120000 +index 069de6b..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu151 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu151 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu152 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu152 +deleted file mode 120000 +index 0fb022e..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu152 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu152 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu153 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu153 +deleted file mode 120000 +index d7e0f9e..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu153 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu153 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu154 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu154 +deleted file mode 120000 +index 0a6117a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu154 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu154 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu155 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu155 +deleted file mode 120000 +index 201f0f5..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu155 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu155 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu156 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu156 +deleted file mode 120000 +index da7f12b..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu156 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu156 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu157 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu157 +deleted file mode 120000 +index c2aa5c2..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu157 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu157 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu158 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu158 +deleted file mode 120000 +index 4376692..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu158 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu158 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu159 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu159 +deleted file mode 120000 +index 852a0c4..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu159 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu159 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu16 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu16 +deleted file mode 120000 +index 445de40..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu16 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu16 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu17 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu17 +deleted file mode 120000 +index 13929db..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu17 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu17 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu18 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu18 +deleted file mode 120000 +index 3809adc..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu18 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu18 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu19 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu19 +deleted file mode 120000 +index c671083..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu19 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu19 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu2 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu2 +deleted file mode 120000 +index 2dcca33..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu2 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu2 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu20 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu20 +deleted file mode 120000 +index a37c370..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu20 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu20 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu21 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu21 +deleted file mode 120000 +index 68a7cad..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu21 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu21 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu22 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu22 +deleted file mode 120000 +index 2c226ae..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu22 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu22 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu23 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu23 +deleted file mode 120000 +index 75c2f57..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu23 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu23 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu24 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu24 +deleted file mode 120000 +index ad0a618..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu24 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu24 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu25 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu25 +deleted file mode 120000 +index 3145742..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu25 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu25 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu26 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu26 +deleted file mode 120000 +index 1dd180f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu26 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu26 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu27 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu27 +deleted file mode 120000 +index 74ced19..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu27 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu27 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu28 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu28 +deleted file mode 120000 +index 83269be..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu28 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu28 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu29 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu29 +deleted file mode 120000 +index fa37dc6..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu29 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu29 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu3 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu3 +deleted file mode 120000 +index c7690e5..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu3 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu3 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu30 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu30 +deleted file mode 120000 +index 80226fa..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu30 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu30 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu31 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu31 +deleted file mode 120000 +index 6a9a569..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu31 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu31 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu32 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu32 +deleted file mode 120000 +index bbca866..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu32 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu32 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu33 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu33 +deleted file mode 120000 +index b7a9f8d..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu33 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu33 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu34 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu34 +deleted file mode 120000 +index 0c0e738..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu34 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu34 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu35 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu35 +deleted file mode 120000 +index 47654d6..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu35 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu35 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu36 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu36 +deleted file mode 120000 +index 5e53f70..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu36 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu36 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu37 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu37 +deleted file mode 120000 +index 41b4ce7..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu37 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu37 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu38 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu38 +deleted file mode 120000 +index 7231eb4..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu38 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu38 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu39 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu39 +deleted file mode 120000 +index d465480..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu39 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu39 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu4 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu4 +deleted file mode 120000 +index 9e77a64..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu4 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu4 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu5 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu5 +deleted file mode 120000 +index cc07c3b..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu5 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu5 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu56 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu56 +deleted file mode 120000 +index 586050f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu56 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu56 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu57 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu57 +deleted file mode 120000 +index 4276ac5..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu57 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu57 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu58 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu58 +deleted file mode 120000 +index 3c10d2d..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu58 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu58 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu59 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu59 +deleted file mode 120000 +index 06ddb97..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu59 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu59 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu6 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu6 +deleted file mode 120000 +index 2e75763..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu6 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu6 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu60 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu60 +deleted file mode 120000 +index c062761..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu60 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu60 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu61 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu61 +deleted file mode 120000 +index 5a2c12f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu61 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu61 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu62 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu62 +deleted file mode 120000 +index 9056072..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu62 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu62 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu63 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu63 +deleted file mode 120000 +index 1511953..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu63 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu63 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu64 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu64 +deleted file mode 120000 +index 1664a2b..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu64 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu64 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu65 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu65 +deleted file mode 120000 +index 52712cf..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu65 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu65 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu66 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu66 +deleted file mode 120000 +index 93a4f32..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu66 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu66 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu67 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu67 +deleted file mode 120000 +index db73e74..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu67 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu67 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu68 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu68 +deleted file mode 120000 +index 4f40eb8..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu68 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu68 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu69 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu69 +deleted file mode 120000 +index 9f32d96..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu69 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu69 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu7 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu7 +deleted file mode 120000 +index 09e3f79..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu7 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu7 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu70 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu70 +deleted file mode 120000 +index a0e8fd2..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu70 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu70 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu71 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu71 +deleted file mode 120000 +index 898c9f2..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu71 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu71 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu8 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu8 +deleted file mode 120000 +index bda10cc..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu8 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu8 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu80 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu80 +deleted file mode 120000 +index ce5ed81..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu80 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu80 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu81 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu81 +deleted file mode 120000 +index dcd9a05..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu81 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu81 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu82 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu82 +deleted file mode 120000 +index c91ce01..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu82 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu82 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu83 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu83 +deleted file mode 120000 +index 22ba3c4..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu83 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu83 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu84 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu84 +deleted file mode 120000 +index c7e4d26..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu84 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu84 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu85 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu85 +deleted file mode 120000 +index 6779d27..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu85 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu85 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu86 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu86 +deleted file mode 120000 +index 9e777be..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu86 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu86 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu87 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu87 +deleted file mode 120000 +index 0359c58..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu87 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu87 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu88 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu88 +deleted file mode 120000 +index 3825c50..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu88 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu88 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu89 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu89 +deleted file mode 120000 +index 9a72211..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu89 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu89 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu9 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu9 +deleted file mode 120000 +index 1ec1db2..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu9 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu9 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu90 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu90 +deleted file mode 120000 +index 75d10b3..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu90 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu90 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu91 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu91 +deleted file mode 120000 +index 8e9e4a4..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu91 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu91 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu92 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu92 +deleted file mode 120000 +index f8d5f05..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu92 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu92 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu93 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu93 +deleted file mode 120000 +index 5a302ad..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu93 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu93 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu94 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu94 +deleted file mode 120000 +index 9e6239f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu94 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu94 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu95 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu95 +deleted file mode 120000 +index d87b5e3..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu95 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu95 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu96 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu96 +deleted file mode 120000 +index 50d1edc..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu96 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu96 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu97 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu97 +deleted file mode 120000 +index 38b5a90..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu97 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu97 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu98 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu98 +deleted file mode 120000 +index df97c6c..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu98 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu98 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu99 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu99 +deleted file mode 120000 +index a3a6164..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/cpu99 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu99 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/meminfo b/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/meminfo +deleted file mode 100644 +index 0ecf45a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node0/meminfo ++++ /dev/null +@@ -1,29 +0,0 @@ +-Node 0 MemTotal: 67108864 kB +-Node 0 MemFree: 61960640 kB +-Node 0 MemUsed: 5148224 kB +-Node 0 Active: 124864 kB +-Node 0 Inactive: 107584 kB +-Node 0 Active(anon): 83648 kB +-Node 0 Inactive(anon): 8768 kB +-Node 0 Active(file): 41216 kB +-Node 0 Inactive(file): 98816 kB +-Node 0 Unevictable: 0 kB +-Node 0 Mlocked: 0 kB +-Node 0 Dirty: 128 kB +-Node 0 Writeback: 0 kB +-Node 0 FilePages: 155008 kB +-Node 0 Mapped: 31552 kB +-Node 0 AnonPages: 77312 kB +-Node 0 Shmem: 15104 kB +-Node 0 KernelStack: 8992 kB +-Node 0 PageTables: 1728 kB +-Node 0 NFS_Unstable: 0 kB +-Node 0 Bounce: 0 kB +-Node 0 WritebackTmp: 0 kB +-Node 0 Slab: 151872 kB +-Node 0 SReclaimable: 27776 kB +-Node 0 SUnreclaim: 124096 kB +-Node 0 AnonHugePages: 0 kB +-Node 0 HugePages_Total: 0 +-Node 0 HugePages_Free: 0 +-Node 0 HugePages_Surp: 0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu40 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu40 +deleted file mode 120000 +index c727d46..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu40 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu40 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu41 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu41 +deleted file mode 120000 +index cc0b78c..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu41 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu41 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu42 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu42 +deleted file mode 120000 +index 8ebd18e..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu42 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu42 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu43 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu43 +deleted file mode 120000 +index 03b2d2d..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu43 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu43 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu44 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu44 +deleted file mode 120000 +index 859e4fc..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu44 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu44 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu45 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu45 +deleted file mode 120000 +index 58c3ca3..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu45 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu45 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu46 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu46 +deleted file mode 120000 +index 55223e0..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu46 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu46 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu47 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu47 +deleted file mode 120000 +index 19407d4..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu47 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu47 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu48 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu48 +deleted file mode 120000 +index 60a190c..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu48 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu48 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu49 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu49 +deleted file mode 120000 +index 0ff1796..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu49 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu49 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu50 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu50 +deleted file mode 120000 +index ddc5361..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu50 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu50 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu51 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu51 +deleted file mode 120000 +index 41163a9..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu51 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu51 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu52 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu52 +deleted file mode 120000 +index be09dc8..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu52 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu52 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu53 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu53 +deleted file mode 120000 +index 470ab22..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu53 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu53 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu54 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu54 +deleted file mode 120000 +index 5c11dfd..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu54 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu54 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu55 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu55 +deleted file mode 120000 +index e858949..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu55 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu55 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu72 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu72 +deleted file mode 120000 +index d731cf5..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu72 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu72 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu73 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu73 +deleted file mode 120000 +index 99f1a90..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu73 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu73 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu74 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu74 +deleted file mode 120000 +index 84a3139..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu74 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu74 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu75 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu75 +deleted file mode 120000 +index 0693a99..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu75 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu75 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu76 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu76 +deleted file mode 120000 +index 5ff7021..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu76 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu76 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu77 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu77 +deleted file mode 120000 +index 05099c6..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu77 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu77 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu78 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu78 +deleted file mode 120000 +index 20eb9cc..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu78 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu78 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu79 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu79 +deleted file mode 120000 +index 4813a63..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/cpu79 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu79 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/meminfo b/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/meminfo +deleted file mode 100644 +index ef085b2..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node1/meminfo ++++ /dev/null +@@ -1,29 +0,0 @@ +-Node 1 MemTotal: 67108864 kB +-Node 1 MemFree: 66143552 kB +-Node 1 MemUsed: 965312 kB +-Node 1 Active: 125952 kB +-Node 1 Inactive: 255808 kB +-Node 1 Active(anon): 79808 kB +-Node 1 Inactive(anon): 448 kB +-Node 1 Active(file): 46144 kB +-Node 1 Inactive(file): 255360 kB +-Node 1 Unevictable: 0 kB +-Node 1 Mlocked: 0 kB +-Node 1 Dirty: 213760 kB +-Node 1 Writeback: 0 kB +-Node 1 FilePages: 310656 kB +-Node 1 Mapped: 27328 kB +-Node 1 AnonPages: 73856 kB +-Node 1 Shmem: 6336 kB +-Node 1 KernelStack: 4624 kB +-Node 1 PageTables: 512 kB +-Node 1 NFS_Unstable: 0 kB +-Node 1 Bounce: 0 kB +-Node 1 WritebackTmp: 0 kB +-Node 1 Slab: 130688 kB +-Node 1 SReclaimable: 21120 kB +-Node 1 SUnreclaim: 109568 kB +-Node 1 AnonHugePages: 0 kB +-Node 1 HugePages_Total: 0 +-Node 1 HugePages_Free: 0 +-Node 1 HugePages_Surp: 0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu104 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu104 +deleted file mode 120000 +index 7692606..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu104 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu104 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu105 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu105 +deleted file mode 120000 +index 77d25d5..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu105 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu105 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu106 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu106 +deleted file mode 120000 +index f8bff26..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu106 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu106 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu107 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu107 +deleted file mode 120000 +index d475c15..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu107 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu107 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu108 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu108 +deleted file mode 120000 +index 4352ab8..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu108 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu108 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu109 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu109 +deleted file mode 120000 +index c74e8ec..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu109 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu109 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu110 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu110 +deleted file mode 120000 +index fb66aa1..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu110 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu110 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu111 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu111 +deleted file mode 120000 +index b2da00c..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu111 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu111 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu112 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu112 +deleted file mode 120000 +index e65062a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu112 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu112 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu113 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu113 +deleted file mode 120000 +index f8380bf..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu113 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu113 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu114 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu114 +deleted file mode 120000 +index 4c33e35..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu114 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu114 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu115 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu115 +deleted file mode 120000 +index 2b4fbce..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu115 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu115 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu116 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu116 +deleted file mode 120000 +index 7e07a2d..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu116 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu116 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu117 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu117 +deleted file mode 120000 +index 2d65930..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu117 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu117 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu118 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu118 +deleted file mode 120000 +index b09093c..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu118 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu118 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu119 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu119 +deleted file mode 120000 +index 59a5bf1..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/cpu119 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu119 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/meminfo b/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/meminfo +deleted file mode 100644 +index 09e3954..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node16/meminfo ++++ /dev/null +@@ -1,29 +0,0 @@ +-Node 16 MemTotal: 67108864 kB +-Node 16 MemFree: 66573952 kB +-Node 16 MemUsed: 534912 kB +-Node 16 Active: 14272 kB +-Node 16 Inactive: 16832 kB +-Node 16 Active(anon): 6272 kB +-Node 16 Inactive(anon): 64 kB +-Node 16 Active(file): 8000 kB +-Node 16 Inactive(file): 16768 kB +-Node 16 Unevictable: 0 kB +-Node 16 Mlocked: 0 kB +-Node 16 Dirty: 0 kB +-Node 16 Writeback: 0 kB +-Node 16 FilePages: 26176 kB +-Node 16 Mapped: 384 kB +-Node 16 AnonPages: 4928 kB +-Node 16 Shmem: 1408 kB +-Node 16 KernelStack: 1968 kB +-Node 16 PageTables: 192 kB +-Node 16 NFS_Unstable: 0 kB +-Node 16 Bounce: 0 kB +-Node 16 WritebackTmp: 0 kB +-Node 16 Slab: 46336 kB +-Node 16 SReclaimable: 2688 kB +-Node 16 SUnreclaim: 43648 kB +-Node 16 AnonHugePages: 0 kB +-Node 16 HugePages_Total: 0 +-Node 16 HugePages_Free: 0 +-Node 16 HugePages_Surp: 0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu120 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu120 +deleted file mode 120000 +index 17a18b1..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu120 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu120 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu121 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu121 +deleted file mode 120000 +index 321bbc2..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu121 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu121 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu122 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu122 +deleted file mode 120000 +index e03f5a3..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu122 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu122 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu123 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu123 +deleted file mode 120000 +index 3021e4f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu123 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu123 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu124 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu124 +deleted file mode 120000 +index 10b32dc..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu124 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu124 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu125 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu125 +deleted file mode 120000 +index 9e06e6e..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu125 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu125 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu126 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu126 +deleted file mode 120000 +index 2a4708a..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu126 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu126 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu127 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu127 +deleted file mode 120000 +index 96b5143..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu127 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu127 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu128 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu128 +deleted file mode 120000 +index 3142217..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu128 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu128 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu129 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu129 +deleted file mode 120000 +index dc84401..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu129 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu129 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu130 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu130 +deleted file mode 120000 +index 59a50b8..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu130 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu130 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu131 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu131 +deleted file mode 120000 +index ca1f958..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu131 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu131 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu132 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu132 +deleted file mode 120000 +index a1f7ea1..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu132 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu132 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu133 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu133 +deleted file mode 120000 +index 89e453b..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu133 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu133 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu134 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu134 +deleted file mode 120000 +index a46c33e..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu134 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu134 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu135 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu135 +deleted file mode 120000 +index 4efd76f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu135 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu135 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu136 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu136 +deleted file mode 120000 +index cfd61b4..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu136 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu136 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu137 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu137 +deleted file mode 120000 +index 6a1ec92..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu137 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu137 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu138 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu138 +deleted file mode 120000 +index 890aad3..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu138 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu138 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu139 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu139 +deleted file mode 120000 +index afb925f..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu139 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu139 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu140 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu140 +deleted file mode 120000 +index 2faf4c0..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu140 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu140 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu141 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu141 +deleted file mode 120000 +index 6cf8cf1..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu141 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu141 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu142 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu142 +deleted file mode 120000 +index fa73d61..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu142 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu142 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu143 b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu143 +deleted file mode 120000 +index 04dcaa4..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/cpu143 ++++ /dev/null +@@ -1 +0,0 @@ +-../../cpu/cpu143 +\ No newline at end of file +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/meminfo b/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/meminfo +deleted file mode 100644 +index 1bddfb5..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/node17/meminfo ++++ /dev/null +@@ -1,29 +0,0 @@ +-Node 17 MemTotal: 67108864 kB +-Node 17 MemFree: 66334656 kB +-Node 17 MemUsed: 774208 kB +-Node 17 Active: 15936 kB +-Node 17 Inactive: 12416 kB +-Node 17 Active(anon): 10944 kB +-Node 17 Inactive(anon): 64 kB +-Node 17 Active(file): 4992 kB +-Node 17 Inactive(file): 12352 kB +-Node 17 Unevictable: 0 kB +-Node 17 Mlocked: 0 kB +-Node 17 Dirty: 0 kB +-Node 17 Writeback: 0 kB +-Node 17 FilePages: 17600 kB +-Node 17 Mapped: 768 kB +-Node 17 AnonPages: 10752 kB +-Node 17 Shmem: 256 kB +-Node 17 KernelStack: 3808 kB +-Node 17 PageTables: 128 kB +-Node 17 NFS_Unstable: 0 kB +-Node 17 Bounce: 0 kB +-Node 17 WritebackTmp: 0 kB +-Node 17 Slab: 25792 kB +-Node 17 SReclaimable: 3840 kB +-Node 17 SUnreclaim: 21952 kB +-Node 17 AnonHugePages: 0 kB +-Node 17 HugePages_Total: 0 +-Node 17 HugePages_Free: 0 +-Node 17 HugePages_Surp: 0 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/online b/tests/nodeinfodata/linux-deconfigured-cpus/node/online +deleted file mode 100644 +index a41eb32..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/online ++++ /dev/null +@@ -1 +0,0 @@ +-0-1,16-17 +diff --git a/tests/nodeinfodata/linux-deconfigured-cpus/node/possible b/tests/nodeinfodata/linux-deconfigured-cpus/node/possible +deleted file mode 100644 +index 8d232c7..0000000 +--- a/tests/nodeinfodata/linux-deconfigured-cpus/node/possible ++++ /dev/null +@@ -1 +0,0 @@ +-0-255 +diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c +index 60467bc..3fffdb2 100644 +--- a/tests/nodeinfotest.c ++++ b/tests/nodeinfotest.c +@@ -234,7 +234,7 @@ mymain(void) + {"raspberrypi", VIR_ARCH_ARMV6L}, + {"f21-mustang", VIR_ARCH_AARCH64}, + {"rhelsa-3.19.0-mustang", VIR_ARCH_AARCH64}, +- {"deconfigured-cpus", VIR_ARCH_PPC64}, ++ {"deconf-cpus", VIR_ARCH_PPC64}, + }; + + if (virInitialize() < 0) +-- +2.5.0 + diff --git a/SOURCES/libvirt-Require-at-least-one-console-for-LXC-domain.patch b/SOURCES/libvirt-Require-at-least-one-console-for-LXC-domain.patch deleted file mode 100644 index ad221cb..0000000 --- a/SOURCES/libvirt-Require-at-least-one-console-for-LXC-domain.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 25c7be693aac6ed11d3a0f16ed19e0244619df74 Mon Sep 17 00:00:00 2001 -Message-Id: <25c7be693aac6ed11d3a0f16ed19e0244619df74@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Wed, 5 Nov 2014 13:21:02 +0100 -Subject: [PATCH] Require at least one console for LXC domain -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -A domain without a console quietly dies soon after start, -because we try to set /dev/null as a controlling TTY -2014-10-30 15:10:59.705+0000: 1: error : lxcContainerSetupFDs:283 : -ioctl(TIOCSCTTY) failed: Inappropriate ioctl for device - -Report an error early instead of trying to start it. - -https://bugzilla.redhat.com/show_bug.cgi?id=1155410 -(cherry picked from commit 44686f6523cb30a174c052a242fa15f6a2b364e5) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/lxc/lxc_container.c | 6 ++++-- - src/lxc/lxc_process.c | 6 ++++++ - 2 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c -index 1cf2c8f..f3230fa 100644 ---- a/src/lxc/lxc_container.c -+++ b/src/lxc/lxc_container.c -@@ -2088,8 +2088,10 @@ static int lxcContainerChild(void *data) - if (virAsprintf(&ttyPath, "%s/%s.devpts/%s", - LXC_STATE_DIR, vmDef->name, tty) < 0) - goto cleanup; -- } else if (VIR_STRDUP(ttyPath, "/dev/null") < 0) { -- goto cleanup; -+ } else { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("At least one tty is required")); -+ goto cleanup; - } - - VIR_DEBUG("Container TTY path: %s", ttyPath); -diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c -index 3353dc1..6420c0d 100644 ---- a/src/lxc/lxc_process.c -+++ b/src/lxc/lxc_process.c -@@ -1144,6 +1144,12 @@ int virLXCProcessStart(virConnectPtr conn, - vm->def, NULL) < 0) - goto cleanup; - -+ if (vm->def->nconsoles == 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("At least one PTY console is required")); -+ goto cleanup; -+ } -+ - for (i = 0; i < vm->def->nconsoles; i++) { - char *ttyPath; - if (vm->def->consoles[i]->source.type != VIR_DOMAIN_CHR_TYPE_PTY) { --- -2.1.3 - diff --git a/SOURCES/libvirt-Revert-qemu-Fix-integer-boolean-logic-in-qemuSetUnprivSGIO.patch b/SOURCES/libvirt-Revert-qemu-Fix-integer-boolean-logic-in-qemuSetUnprivSGIO.patch new file mode 100644 index 0000000..fa789ef --- /dev/null +++ b/SOURCES/libvirt-Revert-qemu-Fix-integer-boolean-logic-in-qemuSetUnprivSGIO.patch @@ -0,0 +1,52 @@ +From e70e020cf8c946d4f5df161d469d6e2b626cccd2 Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Tue, 22 Sep 2015 11:02:05 -0400 +Subject: [PATCH] Revert "qemu: Fix integer/boolean logic in qemuSetUnprivSGIO" + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +This reverts commit 69b850fe2a19d0c32ae2f209e8d8463df6ead665. (upstream) +This reverts commit 8c46231056f7c633a9f8576018d764e3a0b7251f. (downstream) + +This change broke the ability to "clear" or reset unfiltered back +to filtered. + +(cherry picked from commit ec6754db57510173be372e3981ddb6a5cefbcce0) +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index 030261e..8abbb02 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1449,7 +1449,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + char *sysfs_path = NULL; + char *hostdev_path = NULL; + const char *path = NULL; +- bool val; ++ int val = -1; + int ret = -1; + + /* "sgio" is only valid for block disk; cdrom +@@ -1491,12 +1491,8 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + * whitelist is enabled. But if requesting unfiltered access, always call + * virSetDeviceUnprivSGIO, to report an error for unsupported unpriv_sgio. + */ +- if (!val || !virFileExists(sysfs_path)) { +- ret = 0; +- goto cleanup; +- } +- +- if (virSetDeviceUnprivSGIO(path, NULL, 1) < 0) ++ if ((virFileExists(sysfs_path) || val == 1) && ++ virSetDeviceUnprivSGIO(path, NULL, val) < 0) + goto cleanup; + + ret = 0; +-- +2.5.3 + diff --git a/SOURCES/libvirt-Separate-isa-fdc-options-generation.patch b/SOURCES/libvirt-Separate-isa-fdc-options-generation.patch new file mode 100644 index 0000000..650a518 --- /dev/null +++ b/SOURCES/libvirt-Separate-isa-fdc-options-generation.patch @@ -0,0 +1,64 @@ +From 699ce9cb3514bc0458ab61e4e82b725922011dbd Mon Sep 17 00:00:00 2001 +Message-Id: <699ce9cb3514bc0458ab61e4e82b725922011dbd@dist-git> +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Wed, 8 Jul 2015 15:56:46 +0200 +Subject: [PATCH] Separate isa-fdc options generation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +https://bugzilla.redhat.com/show_bug.cgi?id=1227880 + +For the implicit controller, we set them via -global. +Separating them will allow reuse for explicit fdc controller as well. + +No functional impact apart from one extra allocation. + +(cherry picked from commit 4ef21ec192f0de6e638d22b6a406cd87744f6b99) +Signed-off-by: Ján Tomko +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index ca14ffc..d8ce22f 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9805,18 +9805,25 @@ qemuBuildCommandLine(virConnectPtr conn, + + if (withDeviceArg) { + if (disk->bus == VIR_DOMAIN_DISK_BUS_FDC) { ++ if (virAsprintf(&optstr, "drive%c=drive-%s", ++ disk->info.addr.drive.unit ? 'B' : 'A', ++ disk->info.alias) < 0) ++ goto error; ++ + virCommandAddArg(cmd, "-global"); +- virCommandAddArgFormat(cmd, "isa-fdc.drive%c=drive-%s", +- disk->info.addr.drive.unit +- ? 'B' : 'A', +- disk->info.alias); ++ virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr); ++ VIR_FREE(optstr); + + if (bootindex) { ++ if (virAsprintf(&optstr, "bootindex%c=%d", ++ disk->info.addr.drive.unit ++ ? 'B' : 'A', ++ bootindex) < 0) ++ goto error; ++ + virCommandAddArg(cmd, "-global"); +- virCommandAddArgFormat(cmd, "isa-fdc.bootindex%c=%d", +- disk->info.addr.drive.unit +- ? 'B' : 'A', +- bootindex); ++ virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr); ++ VIR_FREE(optstr); + } + } else { + virCommandAddArg(cmd, "-device"); +-- +2.4.5 + diff --git a/SOURCES/libvirt-Silently-ignore-MAC-in-NetworkLoadConfig.patch b/SOURCES/libvirt-Silently-ignore-MAC-in-NetworkLoadConfig.patch deleted file mode 100644 index 76d912a..0000000 --- a/SOURCES/libvirt-Silently-ignore-MAC-in-NetworkLoadConfig.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 4dda2d06f4a4c9a526ccdac389ab3c51475fb6b0 Mon Sep 17 00:00:00 2001 -Message-Id: <4dda2d06f4a4c9a526ccdac389ab3c51475fb6b0@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 2 Dec 2014 16:12:34 +0100 -Subject: [PATCH] Silently ignore MAC in NetworkLoadConfig - -Libvirt's RPMs have been adding it to networks which don't support it. - -https://bugzilla.redhat.com/show_bug.cgi?id=1156367 -(cherry picked from commit c9c7a2bd964d02f1c1ffc542cb18bf851852dd37) - -Signed-off-by: Jiri Denemark ---- - src/conf/network_conf.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c -index 863d0e2..d348a20 100644 ---- a/src/conf/network_conf.c -+++ b/src/conf/network_conf.c -@@ -3152,6 +3152,10 @@ virNetworkObjPtr virNetworkLoadConfig(virNetworkObjListPtr nets, - */ - if (virNetworkSetBridgeName(nets, def, 0)) - goto error; -+ } else { -+ /* Throw away MAC address for other forward types, -+ * which could have been generated by older libvirt RPMs */ -+ def->mac_specified = false; - } - - if (!(net = virNetworkAssignDef(nets, def, false))) --- -2.2.0 - diff --git a/SOURCES/libvirt-Split-qemuDomainChrInsert-into-two-parts.patch b/SOURCES/libvirt-Split-qemuDomainChrInsert-into-two-parts.patch deleted file mode 100644 index 275ae32..0000000 --- a/SOURCES/libvirt-Split-qemuDomainChrInsert-into-two-parts.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 8518fbb314727cbb3f747c20ef194df7cd1bdac3 Mon Sep 17 00:00:00 2001 -Message-Id: <8518fbb314727cbb3f747c20ef194df7cd1bdac3@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Wed, 28 Jan 2015 12:25:11 +0100 -Subject: [PATCH] Split qemuDomainChrInsert into two parts -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1195155 - -Do the allocation first, then add the actual device. -The second part should never fail. This is good -for live hotplug where we don't want to remove the device -on OOM after the monitor command succeeded. - -The only change in behavior is that on failure, the -vmdef->consoles array is freed, not just the first console. - -(cherry picked from commit daf51be5f1b0f7b41c0813d43d6b66edfbe4f6d9) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 18 +++++++++++++--- - src/conf/domain_conf.h | 7 +++++-- - src/libvirt_private.syms | 3 ++- - src/qemu/qemu_hotplug.c | 54 +++++++++++++++++++++++++++++++++++++++++------- - 4 files changed, 68 insertions(+), 14 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index fed87f0..9bfffd0 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -11529,15 +11529,27 @@ virDomainChrGetDomainPtrs(const virDomainDef *vmdef, - - - int --virDomainChrInsert(virDomainDefPtr vmdef, -- virDomainChrDefPtr chr) -+virDomainChrPreAlloc(virDomainDefPtr vmdef, -+ virDomainChrDefPtr chr) - { - virDomainChrDefPtr **arrPtr = NULL; - size_t *cntPtr = NULL; - - virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType, &arrPtr, &cntPtr); - -- return VIR_APPEND_ELEMENT(*arrPtr, *cntPtr, chr); -+ return VIR_REALLOC_N(*arrPtr, *cntPtr + 1); -+} -+ -+void -+virDomainChrInsertPreAlloced(virDomainDefPtr vmdef, -+ virDomainChrDefPtr chr) -+{ -+ virDomainChrDefPtr **arrPtr = NULL; -+ size_t *cntPtr = NULL; -+ -+ virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType, &arrPtr, &cntPtr); -+ -+ ignore_value(VIR_APPEND_ELEMENT_INPLACE(*arrPtr, *cntPtr, chr)); - } - - virDomainChrDefPtr -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index b912845..1436eb8 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2543,8 +2543,11 @@ bool - virDomainChrEquals(virDomainChrDefPtr src, - virDomainChrDefPtr tgt); - int --virDomainChrInsert(virDomainDefPtr vmdef, -- virDomainChrDefPtr chr); -+virDomainChrPreAlloc(virDomainDefPtr vmdef, -+ virDomainChrDefPtr chr); -+void -+virDomainChrInsertPreAlloced(virDomainDefPtr vmdef, -+ virDomainChrDefPtr chr); - virDomainChrDefPtr - virDomainChrRemove(virDomainDefPtr vmdef, - virDomainChrDefPtr chr); -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index 325a912..18c715a 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -153,7 +153,8 @@ virDomainChrDefNew; - virDomainChrEquals; - virDomainChrFind; - virDomainChrGetDomainPtrs; --virDomainChrInsert; -+virDomainChrInsertPreAlloced; -+virDomainChrPreAlloc; - virDomainChrRemove; - virDomainChrSerialTargetTypeFromString; - virDomainChrSerialTargetTypeToString; -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 8a3eb27..00ce77f 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -1390,9 +1390,9 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver, - - } - --int --qemuDomainChrInsert(virDomainDefPtr vmdef, -- virDomainChrDefPtr chr) -+static int -+qemuDomainChrPreInsert(virDomainDefPtr vmdef, -+ virDomainChrDefPtr chr) - { - if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && - chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL) { -@@ -1407,25 +1407,63 @@ qemuDomainChrInsert(virDomainDefPtr vmdef, - return -1; - } - -- if (virDomainChrInsert(vmdef, chr) < 0) -+ if (virDomainChrPreAlloc(vmdef, chr) < 0) - return -1; - - /* Due to some crazy backcompat stuff, the first serial device is an alias - * to the first console too. If this is the case, the definition must be - * duplicated as first console device. */ -- if (vmdef->nserials == 1 && vmdef->nconsoles == 0) { -- if ((!vmdef->consoles && VIR_ALLOC(vmdef->consoles) < 0) || -- VIR_ALLOC(vmdef->consoles[0]) < 0) { -- virDomainChrRemove(vmdef, chr); -+ if (vmdef->nserials == 0 && vmdef->nconsoles == 0 && -+ chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { -+ if (!vmdef->consoles && VIR_ALLOC(vmdef->consoles) < 0) -+ return -1; -+ -+ if (VIR_ALLOC(vmdef->consoles[0]) < 0) { -+ VIR_FREE(vmdef->consoles); - return -1; - } -+ vmdef->nconsoles++; -+ } -+ return 0; -+} -+ -+static void -+qemuDomainChrInsertPreAlloced(virDomainDefPtr vmdef, -+ virDomainChrDefPtr chr) -+{ -+ virDomainChrInsertPreAlloced(vmdef, chr); -+ if (vmdef->nserials == 1 && vmdef->nconsoles == 0 && -+ chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { - vmdef->nconsoles = 1; - - /* Create an console alias for the serial port */ - vmdef->consoles[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE; - vmdef->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; - } -+} - -+static void -+qemuDomainChrInsertPreAllocCleanup(virDomainDefPtr vmdef, -+ virDomainChrDefPtr chr) -+{ -+ /* Remove the stub console added by qemuDomainChrPreInsert */ -+ if (vmdef->nserials == 0 && vmdef->nconsoles == 1 && -+ chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { -+ VIR_FREE(vmdef->consoles[0]); -+ VIR_FREE(vmdef->consoles); -+ vmdef->nconsoles = 0; -+ } -+} -+ -+int -+qemuDomainChrInsert(virDomainDefPtr vmdef, -+ virDomainChrDefPtr chr) -+{ -+ if (qemuDomainChrPreInsert(vmdef, chr) < 0) { -+ qemuDomainChrInsertPreAllocCleanup(vmdef, chr); -+ return -1; -+ } -+ qemuDomainChrInsertPreAlloced(vmdef, chr); - return 0; - } - --- -2.3.0 - diff --git a/SOURCES/libvirt-Start-daemon-only-after-filesystems-are-mounted.patch b/SOURCES/libvirt-Start-daemon-only-after-filesystems-are-mounted.patch new file mode 100644 index 0000000..a2a58c7 --- /dev/null +++ b/SOURCES/libvirt-Start-daemon-only-after-filesystems-are-mounted.patch @@ -0,0 +1,37 @@ +From 7020e2cb9168abfef903e7c9447430a2abe02981 Mon Sep 17 00:00:00 2001 +Message-Id: <7020e2cb9168abfef903e7c9447430a2abe02981@dist-git> +From: Martin Kletzander +Date: Wed, 26 Aug 2015 16:32:52 +0200 +Subject: [PATCH] Start daemon only after filesystems are mounted + +https://bugzilla.redhat.com/show_bug.cgi?id=1255228 + +When images are on mounted filesystems, there is no guarantee libvirtd +will start before they are mounted. Since we want to start after both +local and remote filesystems are mounted, we need to add both local-fs +and remote-fs as targets that should precede starting libvirtd service. + +Signed-off-by: Martin Kletzander +(cherry picked from commit 3418e7815a9fc9245aa6476415a353790ed3cb8b) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + daemon/libvirtd.service.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in +index 1759ac8..9e67e43 100644 +--- a/daemon/libvirtd.service.in ++++ b/daemon/libvirtd.service.in +@@ -5,6 +5,8 @@ After=network.target + After=dbus.service + After=iscsid.service + After=apparmor.service ++After=local-fs.target ++After=remote-fs.target + Documentation=man:libvirtd(8) + Documentation=http://libvirt.org + +-- +2.5.1 + diff --git a/SOURCES/libvirt-Wire-up-the-interface-backend-options.patch b/SOURCES/libvirt-Wire-up-the-interface-backend-options.patch deleted file mode 100644 index f276572..0000000 --- a/SOURCES/libvirt-Wire-up-the-interface-backend-options.patch +++ /dev/null @@ -1,363 +0,0 @@ -From 0d1763b206f9ff068c26f3b75dfc494117fdd51b Mon Sep 17 00:00:00 2001 -Message-Id: <0d1763b206f9ff068c26f3b75dfc494117fdd51b@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Wed, 17 Sep 2014 19:15:59 +0200 -Subject: [PATCH] Wire up the interface backend options - -https://bugzilla.redhat.com/show_bug.cgi?id=1139362 - -Pass the user-specified tun path down when creating tap device -when called from the qemu driver. - -Also honor the vhost device path specified by user. - -(cherry picked from commit b20d39a56f36ee41f585864587c97137363acc3e) - -Signed-off-by: Jiri Denemark ---- - src/bhyve/bhyve_command.c | 2 +- - src/bhyve/bhyve_process.c | 2 +- - src/network/bridge_driver.c | 6 +++--- - src/qemu/qemu_command.c | 22 +++++++++++++++------- - src/qemu/qemu_process.c | 2 +- - src/uml/uml_conf.c | 2 +- - src/uml/uml_driver.c | 3 ++- - src/util/virnetdevtap.c | 37 +++++++++++++++++++++++++++---------- - src/util/virnetdevtap.h | 5 ++++- - 9 files changed, 55 insertions(+), 26 deletions(-) - -diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c -index 94829e7..bea4a59 100644 ---- a/src/bhyve/bhyve_command.c -+++ b/src/bhyve/bhyve_command.c -@@ -72,7 +72,7 @@ bhyveBuildNetArgStr(const virDomainDef *def, - - if (!dryRun) { - if (virNetDevTapCreateInBridgePort(brname, &net->ifname, &net->mac, -- def->uuid, NULL, 0, -+ def->uuid, NULL, NULL, 0, - virDomainNetGetActualVirtPortProfile(net), - virDomainNetGetActualVlan(net), - VIR_NETDEV_TAP_CREATE_IFUP | VIR_NETDEV_TAP_CREATE_PERSIST) < 0) { -diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c -index 6b5403d..0bbe388 100644 ---- a/src/bhyve/bhyve_process.c -+++ b/src/bhyve/bhyve_process.c -@@ -82,7 +82,7 @@ bhyveNetCleanup(virDomainObjPtr vm) - ignore_value(virNetDevBridgeRemovePort( - virDomainNetGetActualBridgeName(net), - net->ifname)); -- ignore_value(virNetDevTapDelete(net->ifname)); -+ ignore_value(virNetDevTapDelete(net->ifname, NULL)); - } - } - } -diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c -index 4b3f07f..b77dc76 100644 ---- a/src/network/bridge_driver.c -+++ b/src/network/bridge_driver.c -@@ -1991,7 +1991,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver, - /* Keep tun fd open and interface up to allow for IPv6 DAD to happen */ - if (virNetDevTapCreateInBridgePort(network->def->bridge, - &macTapIfName, &network->def->mac, -- NULL, &tapfd, 1, NULL, NULL, -+ NULL, NULL, &tapfd, 1, NULL, NULL, - VIR_NETDEV_TAP_CREATE_USE_MAC_FOR_BRIDGE | - VIR_NETDEV_TAP_CREATE_IFUP | - VIR_NETDEV_TAP_CREATE_PERSIST) < 0) { -@@ -2117,7 +2117,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver, - - if (macTapIfName) { - VIR_FORCE_CLOSE(tapfd); -- ignore_value(virNetDevTapDelete(macTapIfName)); -+ ignore_value(virNetDevTapDelete(macTapIfName, NULL)); - VIR_FREE(macTapIfName); - } - -@@ -2156,7 +2156,7 @@ static int networkShutdownNetworkVirtual(virNetworkDriverStatePtr driver ATTRIBU - if (network->def->mac_specified) { - char *macTapIfName = networkBridgeDummyNicName(network->def->bridge); - if (macTapIfName) { -- ignore_value(virNetDevTapDelete(macTapIfName)); -+ ignore_value(virNetDevTapDelete(macTapIfName, NULL)); - VIR_FREE(macTapIfName); - } - } -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index ce5daae..81395a8 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -288,6 +288,10 @@ qemuNetworkIfaceConnect(virDomainDefPtr def, - bool template_ifname = false; - int actualType = virDomainNetGetActualType(net); - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); -+ const char *tunpath = "/dev/net/tun"; -+ -+ if (net->backend.tap) -+ tunpath = net->backend.tap; - - if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK) { - bool fail = false; -@@ -336,18 +340,18 @@ qemuNetworkIfaceConnect(virDomainDefPtr def, - - if (cfg->privileged) { - if (virNetDevTapCreateInBridgePort(brname, &net->ifname, &net->mac, -- def->uuid, tapfd, *tapfdSize, -+ def->uuid, tunpath, tapfd, *tapfdSize, - virDomainNetGetActualVirtPortProfile(net), - virDomainNetGetActualVlan(net), - tap_create_flags) < 0) { -- virDomainAuditNetDevice(def, net, "/dev/net/tun", false); -+ virDomainAuditNetDevice(def, net, tunpath, false); - goto cleanup; - } - } else { - if (qemuCreateInBridgePortWithHelper(cfg, brname, - &net->ifname, - tapfd, tap_create_flags) < 0) { -- virDomainAuditNetDevice(def, net, "/dev/net/tun", false); -+ virDomainAuditNetDevice(def, net, tunpath, false); - goto cleanup; - } - /* qemuCreateInBridgePortWithHelper can only create a single FD */ -@@ -357,7 +361,7 @@ qemuNetworkIfaceConnect(virDomainDefPtr def, - } - } - -- virDomainAuditNetDevice(def, net, "/dev/net/tun", true); -+ virDomainAuditNetDevice(def, net, tunpath, true); - - if (cfg->macFilter && - ebtablesAddForwardAllowIn(driver->ebtables, -@@ -441,6 +445,10 @@ qemuOpenVhostNet(virDomainDefPtr def, - int *vhostfdSize) - { - size_t i; -+ const char *vhostnet_path = net->backend.vhost; -+ -+ if (!vhostnet_path) -+ vhostnet_path = "/dev/vhost-net"; - - /* If running a plain QEMU guest, or - * if the config says explicitly to not use vhost, return now*/ -@@ -478,13 +486,13 @@ qemuOpenVhostNet(virDomainDefPtr def, - } - - for (i = 0; i < *vhostfdSize; i++) { -- vhostfd[i] = open("/dev/vhost-net", O_RDWR); -+ vhostfd[i] = open(vhostnet_path, O_RDWR); - - /* If the config says explicitly to use vhost and we couldn't open it, - * report an error. - */ - if (vhostfd[i] < 0) { -- virDomainAuditNetDevice(def, net, "/dev/vhost-net", false); -+ virDomainAuditNetDevice(def, net, vhostnet_path, false); - if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("vhost-net was requested for an interface, " -@@ -497,7 +505,7 @@ qemuOpenVhostNet(virDomainDefPtr def, - break; - } - } -- virDomainAuditNetDevice(def, net, "/dev/vhost-net", *vhostfdSize); -+ virDomainAuditNetDevice(def, net, vhostnet_path, *vhostfdSize); - return 0; - - error: -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index d7f6bdf..bf1f0de 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -4764,7 +4764,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, - case VIR_DOMAIN_NET_TYPE_NETWORK: - #ifdef VIR_NETDEV_TAP_REQUIRE_MANUAL_CLEANUP - if (!(vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)) -- ignore_value(virNetDevTapDelete(net->ifname)); -+ ignore_value(virNetDevTapDelete(net->ifname, net->backend.tap)); - #endif - break; - } -diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c -index 41ce03c..a99e8e9 100644 ---- a/src/uml/uml_conf.c -+++ b/src/uml/uml_conf.c -@@ -124,7 +124,7 @@ umlConnectTapDevice(virConnectPtr conn, - } - - if (virNetDevTapCreateInBridgePort(bridge, &net->ifname, &net->mac, -- vm->uuid, &tapfd, 1, -+ vm->uuid, net->backend.tap, &tapfd, 1, - virDomainNetGetActualVirtPortProfile(net), - virDomainNetGetActualVlan(net), - VIR_NETDEV_TAP_CREATE_IFUP | -diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c -index 7039afc..f9712e8 100644 ---- a/src/uml/uml_driver.c -+++ b/src/uml/uml_driver.c -@@ -1032,7 +1032,8 @@ static void umlCleanupTapDevices(virDomainObjPtr vm) - def->type != VIR_DOMAIN_NET_TYPE_NETWORK) - continue; - -- ignore_value(virNetDevTapDelete(def->ifname)); -+ ignore_value(virNetDevTapDelete(def->ifname, -+ def->backend.tap)); - } - } - -diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c -index d64e64f..3674f9b 100644 ---- a/src/util/virnetdevtap.c -+++ b/src/util/virnetdevtap.c -@@ -216,6 +216,7 @@ virNetDevProbeVnetHdr(int tapfd) - /** - * virNetDevTapCreate: - * @ifname: the interface name -+ * @tunpath: path to the tun device (if NULL, /dev/net/tun is used) - * @tapfds: array of file descriptors return value for the new tap device - * @tapfdSize: number of file descriptors in @tapfd - * @flags: OR of virNetDevTapCreateFlags. Only one flag is recognized: -@@ -233,6 +234,7 @@ virNetDevProbeVnetHdr(int tapfd) - * Returns 0 in case of success or -1 on failure. - */ - int virNetDevTapCreate(char **ifname, -+ const char *tunpath, - int *tapfd, - int tapfdSize, - unsigned int flags) -@@ -242,11 +244,15 @@ int virNetDevTapCreate(char **ifname, - int ret = -1; - int fd; - -+ if (!tunpath) -+ tunpath = "/dev/net/tun"; -+ - memset(&ifr, 0, sizeof(ifr)); - for (i = 0; i < tapfdSize; i++) { -- if ((fd = open("/dev/net/tun", O_RDWR)) < 0) { -- virReportSystemError(errno, "%s", -- _("Unable to open /dev/net/tun, is tun module loaded?")); -+ if ((fd = open(tunpath, O_RDWR)) < 0) { -+ virReportSystemError(errno, -+ _("Unable to open %s, is tun module loaded?"), -+ tunpath); - goto cleanup; - } - -@@ -316,15 +322,20 @@ int virNetDevTapCreate(char **ifname, - } - - --int virNetDevTapDelete(const char *ifname) -+int virNetDevTapDelete(const char *ifname, -+ const char *tunpath) - { - struct ifreq try; - int fd; - int ret = -1; - -- if ((fd = open("/dev/net/tun", O_RDWR)) < 0) { -- virReportSystemError(errno, "%s", -- _("Unable to open /dev/net/tun, is tun module loaded?")); -+ if (!tunpath) -+ tunpath = "/dev/net/tun"; -+ -+ if ((fd = open(tunpath, O_RDWR)) < 0) { -+ virReportSystemError(errno, -+ _("Unable to open %s, is tun module loaded?"), -+ tunpath); - return -1; - } - -@@ -358,6 +369,7 @@ int virNetDevTapDelete(const char *ifname) - } - #elif defined(SIOCIFCREATE2) && defined(SIOCIFDESTROY) && defined(IF_MAXUNIT) - int virNetDevTapCreate(char **ifname, -+ const char *tunpath ATTRIBUTE_UNUSED, - int *tapfd, - int tapfdSize, - unsigned int flags ATTRIBUTE_UNUSED) -@@ -444,7 +456,8 @@ int virNetDevTapCreate(char **ifname, - return ret; - } - --int virNetDevTapDelete(const char *ifname) -+int virNetDevTapDelete(const char *ifname, -+ const char *tunpath ATTRIBUTE_UNUSED) - { - int s; - struct ifreq ifr; -@@ -468,6 +481,7 @@ int virNetDevTapDelete(const char *ifname) - - #else - int virNetDevTapCreate(char **ifname ATTRIBUTE_UNUSED, -+ const char *tunpath ATTRIBUTE_UNUSED, - int *tapfd ATTRIBUTE_UNUSED, - int tapfdSize ATTRIBUTE_UNUSED, - unsigned int flags ATTRIBUTE_UNUSED) -@@ -476,7 +490,8 @@ int virNetDevTapCreate(char **ifname ATTRIBUTE_UNUSED, - _("Unable to create TAP devices on this platform")); - return -1; - } --int virNetDevTapDelete(const char *ifname ATTRIBUTE_UNUSED) -+int virNetDevTapDelete(const char *ifname ATTRIBUTE_UNUSED, -+ const char *tunpath ATTRIBUTE_UNUSED) - { - virReportSystemError(ENOSYS, "%s", - _("Unable to delete TAP devices on this platform")); -@@ -490,6 +505,7 @@ int virNetDevTapDelete(const char *ifname ATTRIBUTE_UNUSED) - * @brname: the bridge name - * @ifname: the interface name (or name template) - * @macaddr: desired MAC address -+ * @tunpath: path to the tun device (if NULL, /dev/net/tun is used) - * @tapfd: array of file descriptor return value for the new tap device - * @tapfdSize: number of file descriptors in @tapfd - * @virtPortProfile: bridge/port specific configuration -@@ -518,6 +534,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, - char **ifname, - const virMacAddr *macaddr, - const unsigned char *vmuuid, -+ const char *tunpath, - int *tapfd, - int tapfdSize, - virNetDevVPortProfilePtr virtPortProfile, -@@ -528,7 +545,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, - char macaddrstr[VIR_MAC_STRING_BUFLEN]; - size_t i; - -- if (virNetDevTapCreate(ifname, tapfd, tapfdSize, flags) < 0) -+ if (virNetDevTapCreate(ifname, tunpath, tapfd, tapfdSize, flags) < 0) - return -1; - - /* We need to set the interface MAC before adding it -diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h -index 03fb5f8..c0a4e15 100644 ---- a/src/util/virnetdevtap.h -+++ b/src/util/virnetdevtap.h -@@ -34,12 +34,14 @@ - # endif - - int virNetDevTapCreate(char **ifname, -+ const char *tunpath, - int *tapfd, - int tapfdSize, - unsigned int flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; - --int virNetDevTapDelete(const char *ifname) -+int virNetDevTapDelete(const char *ifname, -+ const char *tunpath) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; - - int virNetDevTapGetName(int tapfd, char **ifname) -@@ -64,6 +66,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, - char **ifname, - const virMacAddr *macaddr, - const unsigned char *vmuuid, -+ const char *tunpath, - int *tapfd, - int tapfdSize, - virNetDevVPortProfilePtr virtPortProfile, --- -2.1.0 - diff --git a/SOURCES/libvirt-add-an-example-how-to-use-tunable-event.patch b/SOURCES/libvirt-add-an-example-how-to-use-tunable-event.patch deleted file mode 100644 index 205ce8d..0000000 --- a/SOURCES/libvirt-add-an-example-how-to-use-tunable-event.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 3a14c3e36af4f3dcf271e8261cf68cc71a0483f8 Mon Sep 17 00:00:00 2001 -Message-Id: <3a14c3e36af4f3dcf271e8261cf68cc71a0483f8@dist-git> -From: Pavel Hrdina -Date: Fri, 26 Sep 2014 12:43:57 +0200 -Subject: [PATCH] add an example how to use tunable event - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 9e734ab73eb171bd09bb71c8fd6d21e266c06875) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1115898 -Signed-off-by: Jiri Denemark ---- - examples/object-events/event-test.c | 52 ++++++++++++++++++++++++++++++++++++- - 1 file changed, 51 insertions(+), 1 deletion(-) - -diff --git a/examples/object-events/event-test.c b/examples/object-events/event-test.c -index d6cfe46..9e09736 100644 ---- a/examples/object-events/event-test.c -+++ b/examples/object-events/event-test.c -@@ -464,6 +464,48 @@ static int myNetworkEventCallback(virConnectPtr conn ATTRIBUTE_UNUSED, - return 0; - } - -+static int -+myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED, -+ virDomainPtr dom, -+ virTypedParameterPtr params, -+ int nparams, -+ void *opaque ATTRIBUTE_UNUSED) -+{ -+ size_t i; -+ -+ printf("%s EVENT: Domain %s(%d) tunable updated:\n", -+ __func__, virDomainGetName(dom), virDomainGetID(dom)); -+ -+ for (i = 0; i < nparams; i++) { -+ switch (params[i].type) { -+ case VIR_TYPED_PARAM_INT: -+ printf("\t%s: %d\n", params[i].field, params[i].value.i); -+ break; -+ case VIR_TYPED_PARAM_UINT: -+ printf("\t%s: %u\n", params[i].field, params[i].value.ui); -+ break; -+ case VIR_TYPED_PARAM_LLONG: -+ printf("\t%s: %lld\n", params[i].field, params[i].value.l); -+ break; -+ case VIR_TYPED_PARAM_ULLONG: -+ printf("\t%s: %llu\n", params[i].field, params[i].value.ul); -+ break; -+ case VIR_TYPED_PARAM_DOUBLE: -+ printf("\t%s: %g\n", params[i].field, params[i].value.d); -+ break; -+ case VIR_TYPED_PARAM_BOOLEAN: -+ printf("\t%s: %d\n", params[i].field, params[i].value.b); -+ break; -+ case VIR_TYPED_PARAM_STRING: -+ printf("\t%s: %s\n", params[i].field, params[i].value.s); -+ break; -+ default: -+ printf("\t%s: unknown type\n", params[i].field); -+ } -+ } -+ -+ return 0; -+} - - static void myFreeFunc(void *opaque) - { -@@ -506,6 +548,7 @@ int main(int argc, char **argv) - int callback14ret = -1; - int callback15ret = -1; - int callback16ret = -1; -+ int callback17ret = -1; - struct sigaction action_stop; - - memset(&action_stop, 0, sizeof(action_stop)); -@@ -624,6 +667,11 @@ int main(int argc, char **argv) - VIR_NETWORK_EVENT_ID_LIFECYCLE, - VIR_NETWORK_EVENT_CALLBACK(myNetworkEventCallback), - strdup("net callback"), myFreeFunc); -+ callback17ret = virConnectDomainEventRegisterAny(dconn, -+ NULL, -+ VIR_DOMAIN_EVENT_ID_TUNABLE, -+ VIR_DOMAIN_EVENT_CALLBACK(myDomainEventTunableCallback), -+ strdup("tunable"), myFreeFunc); - - if ((callback1ret != -1) && - (callback2ret != -1) && -@@ -639,7 +687,8 @@ int main(int argc, char **argv) - (callback13ret != -1) && - (callback14ret != -1) && - (callback15ret != -1) && -- (callback16ret != -1)) { -+ (callback16ret != -1) && -+ (callback17ret != -1)) { - if (virConnectSetKeepAlive(dconn, 5, 3) < 0) { - virErrorPtr err = virGetLastError(); - fprintf(stderr, "Failed to start keepalive protocol: %s\n", -@@ -671,6 +720,7 @@ int main(int argc, char **argv) - virConnectDomainEventDeregisterAny(dconn, callback14ret); - virConnectDomainEventDeregisterAny(dconn, callback15ret); - virConnectNetworkEventDeregisterAny(dconn, callback16ret); -+ virConnectDomainEventDeregisterAny(dconn, callback17ret); - if (callback8ret != -1) - virConnectDomainEventDeregisterAny(dconn, callback8ret); - } --- -2.1.1 - diff --git a/SOURCES/libvirt-api-Adjust-comment-for-virDomainAddIOThread.patch b/SOURCES/libvirt-api-Adjust-comment-for-virDomainAddIOThread.patch new file mode 100644 index 0000000..3ed598b --- /dev/null +++ b/SOURCES/libvirt-api-Adjust-comment-for-virDomainAddIOThread.patch @@ -0,0 +1,43 @@ +From eb4814f8a769829820cf97f959fded8dc6e03cef Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Tue, 18 Aug 2015 14:47:14 -0400 +Subject: [PATCH] api: Adjust comment for virDomainAddIOThread + +https://bugzilla.redhat.com/show_bug.cgi?id=1251886 + +The comment for the function indicated that iothread_id had to be +a positive non-zero value; however, that wasn't checked - that is +a value of 0 is/was allowed by the API and was left up to the +hypervisor to reject the value. + +More than likely this nuance was missed during the many "adjustments" +to the API in the review phase. + +(cherry picked from commit 53058e11aa1d5ba9e86153ed47e97c4988b5eef6) +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + src/libvirt-domain.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c +index c4377bf..55ee28d 100644 +--- a/src/libvirt-domain.c ++++ b/src/libvirt-domain.c +@@ -7952,9 +7952,9 @@ virDomainPinIOThread(virDomainPtr domain, + * @iothread_id: the specific IOThread ID value to add + * @flags: bitwise-OR of virDomainModificationImpact + * +- * Dynamically add an IOThread to the domain. If @iothread_id is a positive +- * non-zero value, then attempt to add the specific IOThread ID and error +- * out if the iothread id already exists. ++ * Dynamically add an IOThread to the domain. It is left up to the ++ * underlying virtual hypervisor to determine the valid range for an ++ * @iothread_id and determining whether the @iothread_id already exists. + * + * Note that this call can fail if the underlying virtualization hypervisor + * does not support it or if growing the number is arbitrarily limited. +-- +2.5.0 + diff --git a/SOURCES/libvirt-api-Remove-check-on-iothread_id-arg-in-virDomainPinIOThread.patch b/SOURCES/libvirt-api-Remove-check-on-iothread_id-arg-in-virDomainPinIOThread.patch new file mode 100644 index 0000000..7f346e1 --- /dev/null +++ b/SOURCES/libvirt-api-Remove-check-on-iothread_id-arg-in-virDomainPinIOThread.patch @@ -0,0 +1,34 @@ +From f5966b72599ddc1335403cff13159e872dd95007 Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Tue, 18 Aug 2015 14:47:13 -0400 +Subject: [PATCH] api: Remove check on iothread_id arg in virDomainPinIOThread + +https://bugzilla.redhat.com/show_bug.cgi?id=1251886 + +Allow 0 as an iothread_id and force the hypervisor to handle. +The qemuDomainPinIOThread API will look up the iothread_id of +0 and not find it and message that anyway. + +(cherry picked from commit d64b81a8f0b0a4660691565cde65b13df2647391) +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + src/libvirt-domain.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c +index 837933f..c4377bf 100644 +--- a/src/libvirt-domain.c ++++ b/src/libvirt-domain.c +@@ -7926,7 +7926,6 @@ virDomainPinIOThread(virDomainPtr domain, + conn = domain->conn; + + virCheckReadOnlyGoto(conn->flags, error); +- virCheckPositiveArgGoto(iothread_id, error); + virCheckNonNullArgGoto(cpumap, error); + virCheckPositiveArgGoto(maplen, error); + +-- +2.5.0 + diff --git a/SOURCES/libvirt-blkdeviotune-fix-bug-with-saving-values-into-live-XML.patch b/SOURCES/libvirt-blkdeviotune-fix-bug-with-saving-values-into-live-XML.patch deleted file mode 100644 index 12e7ce4..0000000 --- a/SOURCES/libvirt-blkdeviotune-fix-bug-with-saving-values-into-live-XML.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 94419872a0976a5afff35fd9bce4117294a3c8c2 Mon Sep 17 00:00:00 2001 -Message-Id: <94419872a0976a5afff35fd9bce4117294a3c8c2@dist-git> -From: Pavel Hrdina -Date: Thu, 25 Sep 2014 13:25:37 +0200 -Subject: [PATCH] blkdeviotune: fix bug with saving values into live XML - -When you updated some blkdeviotune values for running domain the values -were stored only internally, but not saved into the live XML so they -won't survive restarting the libvirtd. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 783fe9ca8c5d1a831d5626c4835a8d3284456d9c) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146511 -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 8f655e5..808d35f 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -16107,6 +16107,13 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - if (ret < 0) - goto endjob; - vm->def->disks[idx]->blkdeviotune = info; -+ -+ ret = virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm); -+ if (ret < 0) { -+ virReportError(VIR_ERR_OPERATION_FAILED, "%s", -+ _("Saving live XML config failed")); -+ goto endjob; -+ } - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { --- -2.1.1 - diff --git a/SOURCES/libvirt-blkdeviotune-trigger-tunable-event-for-blkdeviotune-updates.patch b/SOURCES/libvirt-blkdeviotune-trigger-tunable-event-for-blkdeviotune-updates.patch deleted file mode 100644 index a8945df..0000000 --- a/SOURCES/libvirt-blkdeviotune-trigger-tunable-event-for-blkdeviotune-updates.patch +++ /dev/null @@ -1,202 +0,0 @@ -From 1285973505b7c917737cc9bf4eaca08a0617395b Mon Sep 17 00:00:00 2001 -Message-Id: <1285973505b7c917737cc9bf4eaca08a0617395b@dist-git> -From: Pavel Hrdina -Date: Fri, 26 Sep 2014 12:44:01 +0200 -Subject: [PATCH] blkdeviotune: trigger tunable event for blkdeviotune updates - -Use the universal tunable event to report changes to user. All -blkdeviotune values are prefixed with "blkdeviotune". - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 18fc3199c2d45256ae1dd80d855cef9f1ec65118) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1115898 -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 56 ++++++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_driver.c | 47 +++++++++++++++++++++++++++++++++++++ - 2 files changed, 103 insertions(+) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index b78f110..026df48 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -5226,6 +5226,61 @@ typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn, - */ - #define VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_QUOTA "cputune.emulator_quota" - -+/** -+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_DISK: -+ * -+ * Macro represents the name of guest disk for which the values are updated, -+ * as VIR_TYPED_PARAM_STRING. -+ */ -+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_DISK "blkdeviotune.disk" -+ -+/** -+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_BYTES_SEC: -+ * -+ * Marco represents the total throughput limit in bytes per second, -+ * as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_BYTES_SEC "blkdeviotune.total_bytes_sec" -+ -+/** -+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_BYTES_SEC: -+ * -+ * Marco represents the read throughput limit in bytes per second, -+ * as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_BYTES_SEC "blkdeviotune.read_bytes_sec" -+ -+/** -+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_BYTES_SEC: -+ * -+ * Macro represents the write throughput limit in bytes per second, -+ * as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_BYTES_SEC "blkdeviotune.write_bytes_sec" -+ -+/** -+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_IOPS_SEC: -+ * -+ * Macro represents the total I/O operations per second, -+ * as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_IOPS_SEC "blkdeviotune.total_iops_sec" -+ -+/** -+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_IOPS_SEC: -+ * -+ * Macro represents the read I/O operations per second, -+ * as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_IOPS_SEC "blkdeviotune.read_iops_sec" -+ -+/** -+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_IOPS_SEC: -+ * -+ * Macro represents the write I/O operations per second, -+ * as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_IOPS_SEC "blkdeviotune.write_iops_sec" - - /** - * virConnectDomainEventTunableCallback: -@@ -5241,6 +5296,7 @@ typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn, - * - * Currently supported name spaces: - * "cputune.*" -+ * "blkdeviotune.*" - * - * The callback signature to use when registering for an event of type - * VIR_DOMAIN_EVENT_ID_TUNABLE with virConnectDomainEventRegisterAny() -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 663c98d..843101c 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -16059,6 +16059,10 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - bool set_iops = false; - virQEMUDriverConfigPtr cfg = NULL; - virCapsPtr caps = NULL; -+ virObjectEventPtr event = NULL; -+ virTypedParameterPtr eventParams = NULL; -+ int eventNparams = 0; -+ int eventMaxparams = 0; - - virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | - VIR_DOMAIN_AFFECT_CONFIG, -1); -@@ -16100,6 +16104,10 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - &persistentDef) < 0) - goto endjob; - -+ if (virTypedParamsAddString(&eventParams, &eventNparams, &eventMaxparams, -+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_DISK, disk) < 0) -+ goto endjob; -+ - for (i = 0; i < nparams; i++) { - virTypedParameterPtr param = ¶ms[i]; - -@@ -16113,26 +16121,56 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - if (STREQ(param->field, VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC)) { - info.total_bytes_sec = param->value.ul; - set_bytes = true; -+ if (virTypedParamsAddULLong(&eventParams, &eventNparams, -+ &eventMaxparams, -+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_BYTES_SEC, -+ param->value.ul) < 0) -+ goto endjob; - } else if (STREQ(param->field, - VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC)) { - info.read_bytes_sec = param->value.ul; - set_bytes = true; -+ if (virTypedParamsAddULLong(&eventParams, &eventNparams, -+ &eventMaxparams, -+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_BYTES_SEC, -+ param->value.ul) < 0) -+ goto endjob; - } else if (STREQ(param->field, - VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC)) { - info.write_bytes_sec = param->value.ul; - set_bytes = true; -+ if (virTypedParamsAddULLong(&eventParams, &eventNparams, -+ &eventMaxparams, -+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_BYTES_SEC, -+ param->value.ul) < 0) -+ goto endjob; - } else if (STREQ(param->field, - VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC)) { - info.total_iops_sec = param->value.ul; - set_iops = true; -+ if (virTypedParamsAddULLong(&eventParams, &eventNparams, -+ &eventMaxparams, -+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_IOPS_SEC, -+ param->value.ul) < 0) -+ goto endjob; - } else if (STREQ(param->field, - VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC)) { - info.read_iops_sec = param->value.ul; - set_iops = true; -+ if (virTypedParamsAddULLong(&eventParams, &eventNparams, -+ &eventMaxparams, -+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_IOPS_SEC, -+ param->value.ul) < 0) -+ goto endjob; - } else if (STREQ(param->field, - VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC)) { - info.write_iops_sec = param->value.ul; - set_iops = true; -+ if (virTypedParamsAddULLong(&eventParams, &eventNparams, -+ &eventMaxparams, -+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_IOPS_SEC, -+ param->value.ul) < 0) -+ goto endjob; - } - } - -@@ -16197,6 +16235,13 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - _("Saving live XML config failed")); - goto endjob; - } -+ -+ if (eventNparams) { -+ event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams); -+ eventNparams = 0; -+ if (event) -+ qemuDomainEventQueue(driver, event); -+ } - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { -@@ -16229,6 +16274,8 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - VIR_FREE(device); - if (vm) - virObjectUnlock(vm); -+ if (eventNparams) -+ virTypedParamsFree(eventParams, eventNparams); - virObjectUnref(caps); - virObjectUnref(cfg); - return ret; --- -2.1.1 - diff --git a/SOURCES/libvirt-blockcopy-allow-block-device-destination.patch b/SOURCES/libvirt-blockcopy-allow-block-device-destination.patch deleted file mode 100644 index a6a25b7..0000000 --- a/SOURCES/libvirt-blockcopy-allow-block-device-destination.patch +++ /dev/null @@ -1,234 +0,0 @@ -From babfc1d48c3a0f83592fa501b609fd839ff1a51b Mon Sep 17 00:00:00 2001 -Message-Id: -From: Eric Blake -Date: Tue, 24 Feb 2015 11:59:52 +0100 -Subject: [PATCH] blockcopy: allow block device destination - -https://bugzilla.redhat.com/show_bug.cgi?id=1196066 - -To date, anyone performing a block copy and pivot ends up with -the destination being treated as . While this -works for data access for a block device, it has at least one -noticeable shortcoming: virDomainGetBlockInfo() reports allocation -differently for block devices visited as files (the size of the -device) than for block devices visited as -(the maximum sector used, as reported by qemu); and this difference -is significant when trying to manage qcow2 format on block devices -that can be grown as needed. - -Of course, the more powerful virDomainBlockCopy() API can already -express the ability to set the type. But a new API can't -be backported, while a new flag to an existing API can; and it is -also rather inconvenient to have to resort to the full power of -generating XML when just adding a flag to the older call will do -the trick. So this patch enhances blockcopy to let the user flag -when the resulting XML after the copy must list the device as -type='block'. - -* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_REBASE_COPY_DEV): -New flag. -* src/libvirt.c (virDomainBlockRebase): Document it. -* tools/virsh-domain.c (opts_block_copy, blockJobImpl): Add ---blockdev option. -* tools/virsh.pod (blockcopy): Document it. -* src/qemu/qemu_driver.c (qemuDomainBlockRebase): Allow new flag. -(qemuDomainBlockCopy): Remember the flag, and make sure it is only -used on actual block devices. -* tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Test it. - -Signed-off-by: Eric Blake -(cherry picked from commit b7e73585a8d96677695a52bafb156f26cbd48fb5) -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 2 ++ - src/libvirt.c | 8 +++-- - src/qemu/qemu_driver.c | 36 ++++++++++++++-------- - .../qemuxml2argvdata/qemuxml2argv-disk-mirror.xml | 4 +-- - tools/virsh-domain.c | 6 ++++ - tools/virsh.pod | 7 +++-- - 6 files changed, 45 insertions(+), 18 deletions(-) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 94de8a6..e086c8f 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -2638,6 +2638,8 @@ typedef enum { - VIR_DOMAIN_BLOCK_REBASE_RELATIVE = 1 << 4, /* Keep backing chain - referenced using relative - names */ -+ VIR_DOMAIN_BLOCK_REBASE_COPY_DEV = 1 << 5, /* Treat destination as block -+ device instead of file */ - } virDomainBlockRebaseFlags; - - int virDomainBlockRebase(virDomainPtr dom, const char *disk, -diff --git a/src/libvirt.c b/src/libvirt.c -index 5315881..e1c02dc 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -19891,7 +19891,10 @@ virDomainBlockPull(virDomainPtr dom, const char *disk, - * pre-create files with relative backing file names, rather than the default - * of absolute backing file names; as a security precaution, you should - * generally only use reuse_ext with the shallow flag and a non-raw -- * destination file. -+ * destination file. By default, the copy destination will be treated as -+ * type='file', but using VIR_DOMAIN_BLOCK_REBASE_COPY_DEV treats the -+ * destination as type='block' (affecting how virDomainGetBlockInfo() will -+ * report allocation after pivoting). - * - * A copy job has two parts; in the first phase, the @bandwidth parameter - * affects how fast the source is pulled into the destination, and the job -@@ -19966,7 +19969,8 @@ virDomainBlockRebase(virDomainPtr dom, const char *disk, - virCheckNonNullArgGoto(base, error); - } else if (flags & (VIR_DOMAIN_BLOCK_REBASE_SHALLOW | - VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT | -- VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)) { -+ VIR_DOMAIN_BLOCK_REBASE_COPY_RAW | -+ VIR_DOMAIN_BLOCK_REBASE_COPY_DEV)) { - virReportInvalidArg(flags, - _("use of flags in %s requires a copy job"), - __FUNCTION__); -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 162e039..c25c5ac 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -15781,7 +15781,8 @@ qemuDomainBlockCopy(virDomainObjPtr vm, - - /* Preliminaries: find the disk we are editing, sanity checks */ - virCheckFlags(VIR_DOMAIN_BLOCK_REBASE_SHALLOW | -- VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT, -1); -+ VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT | -+ VIR_DOMAIN_BLOCK_REBASE_COPY_DEV, -1); - - priv = vm->privateData; - cfg = virQEMUDriverGetConfig(driver); -@@ -15842,25 +15843,34 @@ qemuDomainBlockCopy(virDomainObjPtr vm, - virReportSystemError(errno, _("unable to stat for disk %s: %s"), - disk->dst, dest); - goto endjob; -- } else if (flags & VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT) { -+ } else if (flags & (VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT | -+ VIR_DOMAIN_BLOCK_REBASE_COPY_DEV)) { - virReportSystemError(errno, - _("missing destination file for disk %s: %s"), - disk->dst, dest); - goto endjob; - } -- } else if (!S_ISBLK(st.st_mode) && st.st_size && -- !(flags & VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT)) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("external destination file for disk %s already " -- "exists and is not a block device: %s"), -- disk->dst, dest); -- goto endjob; -+ } else if (!S_ISBLK(st.st_mode)) { -+ if (st.st_size && !(flags & VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("external destination file for disk %s already " -+ "exists and is not a block device: %s"), -+ disk->dst, dest); -+ goto endjob; -+ } -+ if (flags & VIR_DOMAIN_BLOCK_REBASE_COPY_DEV) { -+ virReportError(VIR_ERR_INVALID_ARG, -+ _("blockdev flag requested for disk %s, but file " -+ "'%s' is not a block device"), disk->dst, dest); -+ goto endjob; -+ } - } - - if (VIR_ALLOC(mirror) < 0) - goto endjob; - /* XXX Allow non-file mirror destinations */ -- mirror->type = VIR_STORAGE_TYPE_FILE; -+ mirror->type = flags & VIR_DOMAIN_BLOCK_REBASE_COPY_DEV ? -+ VIR_STORAGE_TYPE_BLOCK : VIR_STORAGE_TYPE_FILE; - - if (format) { - if ((mirror->format = virStorageFileFormatTypeFromString(format)) <= 0) { -@@ -15954,7 +15964,8 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base, - VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT | - VIR_DOMAIN_BLOCK_REBASE_COPY | - VIR_DOMAIN_BLOCK_REBASE_COPY_RAW | -- VIR_DOMAIN_BLOCK_REBASE_RELATIVE, -1); -+ VIR_DOMAIN_BLOCK_REBASE_RELATIVE | -+ VIR_DOMAIN_BLOCK_REBASE_COPY_DEV, -1); - - if (!(vm = qemuDomObjFromDomain(dom))) - return -1; -@@ -15982,7 +15993,8 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base, - } - - flags &= (VIR_DOMAIN_BLOCK_REBASE_SHALLOW | -- VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT); -+ VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT | -+ VIR_DOMAIN_BLOCK_REBASE_COPY_DEV); - ret = qemuDomainBlockCopy(vm, dom->conn, path, base, format, - bandwidth, flags); - vm = NULL; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml -index 46f2a3e..7495a45 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml -@@ -17,8 +17,8 @@ - - - -- -- -+ -+ - - -
-diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c -index 28f5319..8f79b55 100644 ---- a/tools/virsh-domain.c -+++ b/tools/virsh-domain.c -@@ -1550,6 +1550,8 @@ blockJobImpl(vshControl *ctl, const vshCmd *cmd, - flags |= VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT; - if (vshCommandOptBool(cmd, "raw")) - flags |= VIR_DOMAIN_BLOCK_REBASE_COPY_RAW; -+ if (vshCommandOptBool(cmd, "blockdev")) -+ flags |= VIR_DOMAIN_BLOCK_REBASE_COPY_DEV; - if (vshCommandOptStringReq(ctl, cmd, "dest", &base) < 0) - goto cleanup; - ret = virDomainBlockRebase(dom, path, base, bandwidth, flags); -@@ -1857,6 +1859,10 @@ static const vshCmdOptDef opts_block_copy[] = { - .type = VSH_OT_BOOL, - .help = N_("use raw destination file") - }, -+ {.name = "blockdev", -+ .type = VSH_OT_BOOL, -+ .help = N_("copy destination is block device instead of regular file") -+ }, - {.name = "wait", - .type = VSH_OT_BOOL, - .help = N_("wait for job to reach mirroring phase") -diff --git a/tools/virsh.pod b/tools/virsh.pod -index c5b176a..46ef01d 100644 ---- a/tools/virsh.pod -+++ b/tools/virsh.pod -@@ -959,7 +959,8 @@ unlimited. The hypervisor can choose whether to reject the value or - convert it to the maximum value allowed. - - =item B I I I [I] [I<--shallow>] --[I<--reuse-external>] [I<--raw>] [I<--wait> [I<--async>] [I<--verbose>]] -+[I<--reuse-external>] [I<--raw>] [I<--blockdev>] -+[I<--wait> [I<--async>] [I<--verbose>]] - [{I<--pivot> | I<--finish>}] [I<--timeout> B] - - Copy a disk backing image chain to I. By default, this command -@@ -977,7 +978,9 @@ The format of the destination is determined by the first match in the - following list: if I<--raw> is specified, it will be raw; if - I<--reuse-external> is specified, the existing destination is probed - for a format; and in all other cases, the destination format will --match the source format. -+match the source format. The destination is treated as a regular -+file unless I<--blockdev> is used to signal that it is a block -+device. - - By default, the copy job runs in the background, and consists of two - phases. Initially, the job must copy all data from the source, and --- -2.3.0 - diff --git a/SOURCES/libvirt-blockjob-shuffle-block-rebase-code.patch b/SOURCES/libvirt-blockjob-shuffle-block-rebase-code.patch deleted file mode 100644 index 0071039..0000000 --- a/SOURCES/libvirt-blockjob-shuffle-block-rebase-code.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 61fbb57d74cc44594b5bcb184c350ab18b963291 Mon Sep 17 00:00:00 2001 -Message-Id: <61fbb57d74cc44594b5bcb184c350ab18b963291@dist-git> -From: Eric Blake -Date: Tue, 24 Feb 2015 11:59:51 +0100 -Subject: [PATCH] blockjob: shuffle block rebase code - -https://bugzilla.redhat.com/show_bug.cgi?id=1196066 - -The existing virDomainBlockRebase code rejected the combination of -_RELATIVE and _COPY flags, but only by accident. It makes sense -to add support for the combination someday, at least for the case -of _SHALLOW and not _REUSE_EXT; but to implement it, libvirt would -have to pre-create the file with a relative backing name, and I'm -not ready to code that in yet. - -Meanwhile, the code to forward on to the block copy code is getting -longer, and reorganizing the function to have the block pull done -early makes it easier to add even more block copy prep code. - -This patch should have no semantic difference other than the quality -of the error message on the unsupported flag combination. Pre-patch: - -error: unsupported flags (0x10) in function qemuDomainBlockCopy - -Post-patch: - -error: argument unsupported: Relative backing during copy not supported yet - -* src/qemu/qemu_driver.c (qemuDomainBlockRebase): Reorder code, -and improve error message of relative copy. - -Signed-off-by: Eric Blake -(cherry picked from commit 02d2bd7d91c200d1ea1a5b3f78c8b41720cea832) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 47 ++++++++++++++++++++++++++++++++--------------- - 1 file changed, 32 insertions(+), 15 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index f3b909f..162e039 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -15947,6 +15947,8 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base, - unsigned long bandwidth, unsigned int flags) - { - virDomainObjPtr vm; -+ const char *format = NULL; -+ int ret = -1; - - virCheckFlags(VIR_DOMAIN_BLOCK_REBASE_SHALLOW | - VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT | -@@ -15957,22 +15959,37 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base, - if (!(vm = qemuDomObjFromDomain(dom))) - return -1; - -- if (virDomainBlockRebaseEnsureACL(dom->conn, vm->def) < 0) { -+ if (virDomainBlockRebaseEnsureACL(dom->conn, vm->def) < 0) -+ goto cleanup; -+ -+ /* For normal rebase (enhanced blockpull), the common code handles -+ * everything, including vm cleanup. */ -+ if (!(flags & VIR_DOMAIN_BLOCK_REBASE_COPY)) -+ return qemuDomainBlockJobImpl(vm, dom->conn, path, base, bandwidth, -+ NULL, BLOCK_JOB_PULL, flags); -+ -+ /* If we got here, we are doing a block copy rebase. */ -+ if (flags & VIR_DOMAIN_BLOCK_REBASE_COPY_RAW) -+ format = "raw"; -+ -+ /* XXX: If we are doing a shallow copy but not reusing an external -+ * file, we should attempt to pre-create the destination with a -+ * relative backing chain instead of qemu's default of absolute */ -+ if (flags & VIR_DOMAIN_BLOCK_REBASE_RELATIVE) { -+ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", -+ _("Relative backing during copy not supported yet")); -+ goto cleanup; -+ } -+ -+ flags &= (VIR_DOMAIN_BLOCK_REBASE_SHALLOW | -+ VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT); -+ ret = qemuDomainBlockCopy(vm, dom->conn, path, base, format, -+ bandwidth, flags); -+ vm = NULL; -+ cleanup: -+ if (vm) - virObjectUnlock(vm); -- return -1; -- } -- -- if (flags & VIR_DOMAIN_BLOCK_REBASE_COPY) { -- const char *format = NULL; -- if (flags & VIR_DOMAIN_BLOCK_REBASE_COPY_RAW) -- format = "raw"; -- flags &= ~(VIR_DOMAIN_BLOCK_REBASE_COPY | -- VIR_DOMAIN_BLOCK_REBASE_COPY_RAW); -- return qemuDomainBlockCopy(vm, dom->conn, path, base, format, bandwidth, flags); -- } -- -- return qemuDomainBlockJobImpl(vm, dom->conn, path, base, bandwidth, NULL, -- BLOCK_JOB_PULL, flags); -+ return ret; - } - - static int --- -2.3.0 - diff --git a/SOURCES/libvirt-bridge_driver-Introduce-networkBandwidthChangeAllowed.patch b/SOURCES/libvirt-bridge_driver-Introduce-networkBandwidthChangeAllowed.patch new file mode 100644 index 0000000..259ec78 --- /dev/null +++ b/SOURCES/libvirt-bridge_driver-Introduce-networkBandwidthChangeAllowed.patch @@ -0,0 +1,191 @@ +From 3e1dd6eacd48107e7646c8346bca73e280692542 Mon Sep 17 00:00:00 2001 +Message-Id: <3e1dd6eacd48107e7646c8346bca73e280692542@dist-git> +From: Michal Privoznik +Date: Fri, 14 Aug 2015 16:06:31 +0200 +Subject: [PATCH] bridge_driver: Introduce networkBandwidthChangeAllowed + +https://bugzilla.redhat.com/show_bug.cgi?id=1252473 + +When a domain vNIC's bandwidth is to be changed (at runtime) it is +possible that guaranteed minimal bandwidth (@floor) will change too. +Well, so far it is, because we still don't have an implementation that +allows setting it dynamically, so it's effectively erased on: + + #virsh domiftune $dom vnet0 --inbound 0 + +However, that's slightly unfortunate. We do some checks on domain +startup to see if @floor can be guaranteed. We ought do the same if +QoS is changed at runtime. + +Signed-off-by: Michal Privoznik +(cherry picked from commit 41a1531de54476310572f694c0b9cb9c63d4191d) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/network/bridge_driver.c | 78 ++++++++++++++++++++++++++++++++++++++++++--- + src/network/bridge_driver.h | 12 +++++++ + 2 files changed, 86 insertions(+), 4 deletions(-) + +diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c +index 17fc430..04602ed 100644 +--- a/src/network/bridge_driver.c ++++ b/src/network/bridge_driver.c +@@ -4686,9 +4686,18 @@ networkGetNetworkAddress(const char *netname, char **netaddr) + * networkCheckBandwidth: + * @net: network QoS + * @ifaceBand: interface QoS (may be NULL if no QoS) ++ * @oldBandwidth: new interface QoS (may be NULL if no QoS) + * @ifaceMac: interface MAC (used in error messages for identification) + * @new_rate: new rate for non guaranteed class + * ++ * Function checks if @ifaceBand can be satisfied on @net. However, sometimes it ++ * may happen that the interface that @ifaceBand corresponds to is already ++ * plugged into the @net and the bandwidth is to be updated. In that case we ++ * need to check if new bandwidth can be satisfied. If that's the case ++ * @ifaceBand should point to new bandwidth settings and @oldBandwidth to ++ * current ones. If you want to suppress this functionality just pass ++ * @oldBandwidth == NULL. ++ * + * Returns: -1 if plugging would overcommit network QoS + * 0 if plugging is safe (@new_rate updated) + * 1 if no QoS is set (@new_rate untouched) +@@ -4696,6 +4705,7 @@ networkGetNetworkAddress(const char *netname, char **netaddr) + static int + networkCheckBandwidth(virNetworkObjPtr net, + virNetDevBandwidthPtr ifaceBand, ++ virNetDevBandwidthPtr oldBandwidth, + virMacAddr ifaceMac, + unsigned long long *new_rate) + { +@@ -4716,14 +4726,18 @@ networkCheckBandwidth(virNetworkObjPtr net, + return -1; + } + +- if (!ifaceBand || !ifaceBand->in || !ifaceBand->in->floor || ++ if (((!ifaceBand || !ifaceBand->in || !ifaceBand->in->floor) && ++ (!oldBandwidth || !oldBandwidth->in || !oldBandwidth->in->floor)) || + !netBand || !netBand->in) { + /* no QoS required, claim success */ + return 1; + } + + tmp_new_rate = netBand->in->average; +- tmp_floor_sum += ifaceBand->in->floor; ++ if (oldBandwidth && oldBandwidth->in) ++ tmp_floor_sum -= oldBandwidth->in->floor; ++ if (ifaceBand && ifaceBand->in) ++ tmp_floor_sum += ifaceBand->in->floor; + + /* check against peak */ + if (netBand->in->peak) { +@@ -4749,7 +4763,8 @@ networkCheckBandwidth(virNetworkObjPtr net, + goto cleanup; + } + +- *new_rate = tmp_new_rate; ++ if (new_rate) ++ *new_rate = tmp_new_rate; + ret = 0; + + cleanup: +@@ -4791,7 +4806,7 @@ networkPlugBandwidth(virNetworkObjPtr net, + char ifmac[VIR_MAC_STRING_BUFLEN]; + virNetDevBandwidthPtr ifaceBand = virDomainNetGetActualBandwidth(iface); + +- if ((plug_ret = networkCheckBandwidth(net, ifaceBand, ++ if ((plug_ret = networkCheckBandwidth(net, ifaceBand, NULL, + iface->mac, &new_rate)) < 0) { + /* helper reported error */ + goto cleanup; +@@ -4917,3 +4932,58 @@ networkNetworkObjTaint(virNetworkObjPtr net, + virNetworkTaintTypeToString(taint)); + } + } ++ ++ ++static bool ++networkBandwidthGenericChecks(virDomainNetDefPtr iface, ++ virNetDevBandwidthPtr newBandwidth) ++{ ++ virNetDevBandwidthPtr ifaceBand = virDomainNetGetActualBandwidth(iface); ++ unsigned long long old_floor, new_floor; ++ ++ if (virDomainNetGetActualType(iface) != VIR_DOMAIN_NET_TYPE_NETWORK) { ++ /* This is not an interface that's plugged into a network. ++ * We don't care. Thus from our POV bandwidth change is allowed. */ ++ return false; ++ } ++ ++ old_floor = new_floor = 0; ++ ++ if (ifaceBand && ifaceBand->in) ++ old_floor = ifaceBand->in->floor; ++ if (newBandwidth && newBandwidth->in) ++ new_floor = newBandwidth->in->floor; ++ ++ return new_floor != old_floor; ++} ++ ++ ++bool ++networkBandwidthChangeAllowed(virDomainNetDefPtr iface, ++ virNetDevBandwidthPtr newBandwidth) ++{ ++ virNetworkDriverStatePtr driver = networkGetDriver(); ++ virNetworkObjPtr network = NULL; ++ virNetDevBandwidthPtr ifaceBand = virDomainNetGetActualBandwidth(iface); ++ bool ret = false; ++ ++ if (!networkBandwidthGenericChecks(iface, newBandwidth)) ++ return true; ++ ++ network = virNetworkObjFindByName(driver->networks, iface->data.network.name); ++ if (!network) { ++ virReportError(VIR_ERR_NO_NETWORK, ++ _("no network with matching name '%s'"), ++ iface->data.network.name); ++ return false; ++ } ++ ++ if (networkCheckBandwidth(network, newBandwidth, ifaceBand, iface->mac, NULL) < 0) ++ goto cleanup; ++ ++ ret = true; ++ ++ cleanup: ++ virNetworkObjEndAPI(&network); ++ return ret; ++} +diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h +index 513ccf7..cce9237 100644 +--- a/src/network/bridge_driver.h ++++ b/src/network/bridge_driver.h +@@ -52,6 +52,11 @@ int networkDnsmasqConfContents(virNetworkObjPtr network, + char **configstr, + dnsmasqContext *dctx, + dnsmasqCapsPtr caps); ++ ++bool networkBandwidthChangeAllowed(virDomainNetDefPtr iface, ++ virNetDevBandwidthPtr newBandwidth) ++ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ++ + # else + /* Define no-op replacements that don't drag in any link dependencies. */ + # define networkAllocateActualDevice(dom, iface) 0 +@@ -73,6 +78,13 @@ networkReleaseActualDevice(virDomainDefPtr dom ATTRIBUTE_UNUSED, + return 0; + } + ++static inline bool ++networkBandwidthChangeAllowed(virDomainNetDefPtr iface ATTRIBUTE_UNUSED, ++ virNetDevBandwidthPtr newBandwidth ATTRIBUTE_UNUSED) ++{ ++ return true; ++} ++ + # endif + + typedef char *(*networkDnsmasqLeaseFileNameFunc)(const char *netname); +-- +2.5.0 + diff --git a/SOURCES/libvirt-bridge_driver-Introduce-networkBandwidthUpdate.patch b/SOURCES/libvirt-bridge_driver-Introduce-networkBandwidthUpdate.patch new file mode 100644 index 0000000..765e46e --- /dev/null +++ b/SOURCES/libvirt-bridge_driver-Introduce-networkBandwidthUpdate.patch @@ -0,0 +1,276 @@ +From b80365f3a798bfc245d3db7d7586d2e82b38f68e Mon Sep 17 00:00:00 2001 +Message-Id: +From: Michal Privoznik +Date: Fri, 14 Aug 2015 16:06:32 +0200 +Subject: [PATCH] bridge_driver: Introduce networkBandwidthUpdate + +https://bugzilla.redhat.com/show_bug.cgi?id=1252473 + +So, if a domain vNIC's bandwidth has been successfully set, it's +possible that because @floor is set on network's bridge, this +part may need updating too. And that's exactly what this function +does. While the previous commit introduced a function to check if +@floor can be satisfied, this does all the hard work. In general, +there may be three, well four possibilities: + + 1) No change in @floor value (either it remain unset, or its + value hasn't changed) + + 2) The @floor value has changed from a non-zero to a non-zero + value + + 3) New @floor is to be set + + 4) Old @floor must be cleared out + +The difference between 2), 3) and 4) is, that while in 2) the QoS +tree on the network's bridge already has a special class for the +vNIC, in 3) the class must be created from scratch. In 4) it must +be removed. Fortunately, we have helpers for all three +interesting cases. + +Signed-off-by: Michal Privoznik +(cherry picked from commit 812932bea2c703d4031f947096f8efaf21b662bf) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/network/bridge_driver.c | 163 ++++++++++++++++++++++++++++++++++++-------- + src/network/bridge_driver.h | 11 +++ + 2 files changed, 145 insertions(+), 29 deletions(-) + +diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c +index 04602ed..666078c 100644 +--- a/src/network/bridge_driver.c ++++ b/src/network/bridge_driver.c +@@ -4794,38 +4794,17 @@ networkNextClassID(virNetworkObjPtr net) + return ret; + } + ++ + static int +-networkPlugBandwidth(virNetworkObjPtr net, +- virDomainNetDefPtr iface) ++networkPlugBandwidthImpl(virNetworkObjPtr net, ++ virDomainNetDefPtr iface, ++ virNetDevBandwidthPtr ifaceBand, ++ unsigned long long new_rate) + { + virNetworkDriverStatePtr driver = networkGetDriver(); +- int ret = -1; +- int plug_ret; +- unsigned long long new_rate = 0; + ssize_t class_id = 0; +- char ifmac[VIR_MAC_STRING_BUFLEN]; +- virNetDevBandwidthPtr ifaceBand = virDomainNetGetActualBandwidth(iface); +- +- if ((plug_ret = networkCheckBandwidth(net, ifaceBand, NULL, +- iface->mac, &new_rate)) < 0) { +- /* helper reported error */ +- goto cleanup; +- } +- +- if (plug_ret > 0) { +- /* no QoS needs to be set; claim success */ +- ret = 0; +- goto cleanup; +- } +- +- virMacAddrFormat(&iface->mac, ifmac); +- if (iface->type != VIR_DOMAIN_NET_TYPE_NETWORK || +- !iface->data.network.actual) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Cannot set bandwidth on interface '%s' of type %d"), +- ifmac, iface->type); +- goto cleanup; +- } ++ int plug_ret; ++ int ret = -1; + + /* generate new class_id */ + if ((class_id = networkNextClassID(net)) < 0) { +@@ -4861,6 +4840,46 @@ networkPlugBandwidth(virNetworkObjPtr net, + net->def->bridge); + + ret = 0; ++ cleanup: ++ return ret; ++} ++ ++ ++static int ++networkPlugBandwidth(virNetworkObjPtr net, ++ virDomainNetDefPtr iface) ++{ ++ int ret = -1; ++ int plug_ret; ++ unsigned long long new_rate = 0; ++ char ifmac[VIR_MAC_STRING_BUFLEN]; ++ virNetDevBandwidthPtr ifaceBand = virDomainNetGetActualBandwidth(iface); ++ ++ if ((plug_ret = networkCheckBandwidth(net, ifaceBand, NULL, ++ iface->mac, &new_rate)) < 0) { ++ /* helper reported error */ ++ goto cleanup; ++ } ++ ++ if (plug_ret > 0) { ++ /* no QoS needs to be set; claim success */ ++ ret = 0; ++ goto cleanup; ++ } ++ ++ virMacAddrFormat(&iface->mac, ifmac); ++ if (iface->type != VIR_DOMAIN_NET_TYPE_NETWORK || ++ !iface->data.network.actual) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Cannot set bandwidth on interface '%s' of type %d"), ++ ifmac, iface->type); ++ goto cleanup; ++ } ++ ++ if (networkPlugBandwidthImpl(net, iface, ifaceBand, new_rate) < 0) ++ goto cleanup; ++ ++ ret = 0; + + cleanup: + return ret; +@@ -4938,15 +4957,19 @@ static bool + networkBandwidthGenericChecks(virDomainNetDefPtr iface, + virNetDevBandwidthPtr newBandwidth) + { +- virNetDevBandwidthPtr ifaceBand = virDomainNetGetActualBandwidth(iface); ++ virNetDevBandwidthPtr ifaceBand; + unsigned long long old_floor, new_floor; + ++ if (!iface && !newBandwidth) ++ return false; ++ + if (virDomainNetGetActualType(iface) != VIR_DOMAIN_NET_TYPE_NETWORK) { + /* This is not an interface that's plugged into a network. + * We don't care. Thus from our POV bandwidth change is allowed. */ + return false; + } + ++ ifaceBand = virDomainNetGetActualBandwidth(iface); + old_floor = new_floor = 0; + + if (ifaceBand && ifaceBand->in) +@@ -4987,3 +5010,85 @@ networkBandwidthChangeAllowed(virDomainNetDefPtr iface, + virNetworkObjEndAPI(&network); + return ret; + } ++ ++ ++int ++networkBandwidthUpdate(virDomainNetDefPtr iface, ++ virNetDevBandwidthPtr newBandwidth) ++{ ++ virNetworkDriverStatePtr driver = networkGetDriver(); ++ virNetworkObjPtr network = NULL; ++ virNetDevBandwidthPtr ifaceBand = virDomainNetGetActualBandwidth(iface); ++ unsigned long long new_rate = 0; ++ int plug_ret; ++ int ret = -1; ++ ++ if (!networkBandwidthGenericChecks(iface, newBandwidth)) ++ return 0; ++ ++ network = virNetworkObjFindByName(driver->networks, iface->data.network.name); ++ if (!network) { ++ virReportError(VIR_ERR_NO_NETWORK, ++ _("no network with matching name '%s'"), ++ iface->data.network.name); ++ return ret; ++ } ++ ++ if ((plug_ret = networkCheckBandwidth(network, newBandwidth, ifaceBand, ++ iface->mac, &new_rate)) < 0) { ++ /* helper reported error */ ++ goto cleanup; ++ } ++ ++ if (plug_ret > 0) { ++ /* no QoS needs to be set; claim success */ ++ ret = 0; ++ goto cleanup; ++ } ++ ++ /* Okay, there are three possible scenarios: */ ++ ++ if (ifaceBand->in && ifaceBand->in->floor && ++ newBandwidth->in && newBandwidth->in->floor) { ++ /* Either we just need to update @floor .. */ ++ ++ if (virNetDevBandwidthUpdateRate(network->def->bridge, ++ iface->data.network.actual->class_id, ++ network->def->bandwidth, ++ newBandwidth->in->floor) < 0) ++ goto cleanup; ++ ++ network->floor_sum -= ifaceBand->in->floor; ++ network->floor_sum += newBandwidth->in->floor; ++ new_rate -= network->floor_sum; ++ ++ if (virNetDevBandwidthUpdateRate(network->def->bridge, 2, ++ network->def->bandwidth, new_rate) < 0 || ++ virNetworkSaveStatus(driver->stateDir, network) < 0) { ++ /* Ouch, rollback */ ++ network->floor_sum -= newBandwidth->in->floor; ++ network->floor_sum += ifaceBand->in->floor; ++ ++ ignore_value(virNetDevBandwidthUpdateRate(network->def->bridge, ++ iface->data.network.actual->class_id, ++ network->def->bandwidth, ++ ifaceBand->in->floor)); ++ goto cleanup; ++ } ++ } else if (newBandwidth->in && newBandwidth->in->floor) { ++ /* .. or we need to plug in new .. */ ++ ++ if (networkPlugBandwidthImpl(network, iface, newBandwidth, new_rate) < 0) ++ goto cleanup; ++ } else { ++ /* .. or unplug old. */ ++ ++ if (networkUnplugBandwidth(network, iface) < 0) ++ goto cleanup; ++ } ++ ++ ret = 0; ++ cleanup: ++ virNetworkObjEndAPI(&network); ++ return ret; ++} +diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h +index cce9237..7db2c90 100644 +--- a/src/network/bridge_driver.h ++++ b/src/network/bridge_driver.h +@@ -57,6 +57,10 @@ bool networkBandwidthChangeAllowed(virDomainNetDefPtr iface, + virNetDevBandwidthPtr newBandwidth) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + ++int networkBandwidthUpdate(virDomainNetDefPtr iface, ++ virNetDevBandwidthPtr newBandwidth) ++ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ++ + # else + /* Define no-op replacements that don't drag in any link dependencies. */ + # define networkAllocateActualDevice(dom, iface) 0 +@@ -85,6 +89,13 @@ networkBandwidthChangeAllowed(virDomainNetDefPtr iface ATTRIBUTE_UNUSED, + return true; + } + ++static inline int ++networkBandwidthUpdate(virDomainNetDefPtr iface ATTRIBUTE_UNUSED, ++ virNetDevBandwidthPtr newBandwidth ATTRIBUTE_UNUSED) ++{ ++ return 0; ++} ++ + # endif + + typedef char *(*networkDnsmasqLeaseFileNameFunc)(const char *netname); +-- +2.5.0 + diff --git a/SOURCES/libvirt-caps-introduce-new-QEMU-capability-for-vgamem_mb-device-property.patch b/SOURCES/libvirt-caps-introduce-new-QEMU-capability-for-vgamem_mb-device-property.patch deleted file mode 100644 index bc2b81d..0000000 --- a/SOURCES/libvirt-caps-introduce-new-QEMU-capability-for-vgamem_mb-device-property.patch +++ /dev/null @@ -1,2108 +0,0 @@ -From b412d7a412522e81e32e92ab9b672bd0a987006d Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pavel Hrdina -Date: Tue, 25 Nov 2014 10:53:01 +0100 -Subject: [PATCH] caps: introduce new QEMU capability for vgamem_mb device - property - -Allow setting vgamem size for video devices. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 - -Signed-off-by: Pavel Hrdina -(cherry picked from commit f480a87aa6ebaef0f478f2c67bfbeeee872e63e0) - -Conflicts: - src/qemu/qemu_capabilities.c - missing context c5b71619 - src/qemu/qemu_capabilities.h - missing context c5b71619 - tests/qemucapabilitiesdata/caps_2.1.1-1.caps - missing context - c5b71619 -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 33 ++++ - src/qemu/qemu_capabilities.h | 4 + - tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 4 + - tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 206 ++++++++++++++++++++- - tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 4 + - tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 218 ++++++++++++++++++++++- - tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 4 + - tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 218 ++++++++++++++++++++++- - tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 4 + - tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 218 ++++++++++++++++++++++- - tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 4 + - tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 218 ++++++++++++++++++++++- - tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 4 + - tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 218 ++++++++++++++++++++++- - tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 4 + - tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 218 ++++++++++++++++++++++- - 16 files changed, 1530 insertions(+), 49 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index e0c1b31..f827d3f 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -271,6 +271,11 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "iothread", - "migrate-rdma", - "ivshmem", -+ "VGA.vgamem_mb", -+ -+ "vmware-svga.vgamem_mb", /* 180 */ -+ "qxl.vgamem_mb", -+ "qxl-vga.vgamem_mb", - ); - - -@@ -1572,6 +1577,22 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsKVMPit[] = { - { "lost_tick_policy", QEMU_CAPS_KVM_PIT_TICK_POLICY }, - }; - -+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVGA[] = { -+ { "vgamem_mb", QEMU_CAPS_VGA_VGAMEM }, -+}; -+ -+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVmwareSvga[] = { -+ { "vgamem_mb", QEMU_CAPS_VMWARE_SVGA_VGAMEM }, -+}; -+ -+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = { -+ { "vgamem_mb", QEMU_CAPS_QXL_VGAMEM }, -+}; -+ -+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxlVga[] = { -+ { "vgamem_mb", QEMU_CAPS_QXL_VGA_VGAMEM }, -+}; -+ - struct virQEMUCapsObjectTypeProps { - const char *type; - struct virQEMUCapsStringFlags *props; -@@ -1617,6 +1638,14 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage) }, - { "kvm-pit", virQEMUCapsObjectPropsKVMPit, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsKVMPit) }, -+ { "VGA", virQEMUCapsObjectPropsVGA, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVGA) }, -+ { "vmware-svga", virQEMUCapsObjectPropsVmwareSvga, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVmwareSvga) }, -+ { "qxl", virQEMUCapsObjectPropsQxl, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl) }, -+ { "qxl-vga", virQEMUCapsObjectPropsQxlVga, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxlVga) }, - }; - - -@@ -1808,6 +1837,10 @@ virQEMUCapsExtractDeviceStr(const char *qemu, - "-device", "usb-host,?", - "-device", "scsi-generic,?", - "-device", "usb-storage,?", -+ "-device", "VGA,?", -+ "-device", "vmware-svga,?", -+ "-device", "qxl,?", -+ "-device", "qxl-vga,?", - NULL); - /* qemu -help goes to stdout, but qemu -device ? goes to stderr. */ - virCommandSetErrorBuffer(cmd, &output); -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index c0e2172..14cb20b 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -218,6 +218,10 @@ typedef enum { - QEMU_CAPS_OBJECT_IOTHREAD = 176, /* -object iothread */ - QEMU_CAPS_MIGRATE_RDMA = 177, /* have rdma migration */ - QEMU_CAPS_DEVICE_IVSHMEM = 178, /* -device ivshmem */ -+ QEMU_CAPS_VGA_VGAMEM = 179, /* -device VGA.vgamem_mb */ -+ QEMU_CAPS_VMWARE_SVGA_VGAMEM = 180, /* -device vmware-svga.vgamem_mb */ -+ QEMU_CAPS_QXL_VGAMEM = 181, /* -device qxl.vgamem_mb */ -+ QEMU_CAPS_QXL_VGA_VGAMEM = 182, /* -device qxl-vga.vgamem_mb */ - - QEMU_CAPS_LAST, /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps -index fc8dfc1..30239df 100644 ---- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps -@@ -116,4 +116,8 @@ - - - -+ -+ -+ -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies -index 4fce9d7..f501218 100644 ---- a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies -+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies -@@ -1408,6 +1408,198 @@ - { - "return": [ - { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-27" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-28" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-29" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-30" -+} -+ -+{ -+ "return": [ -+ { - "name": "xenpv" - }, - { -@@ -1449,7 +1641,7 @@ - "name": "none" - } - ], -- "id": "libvirt-26" -+ "id": "libvirt-31" - } - - { -@@ -1521,7 +1713,7 @@ - "name": "Opteron_G4" - } - ], -- "id": "libvirt-27" -+ "id": "libvirt-32" - } - - { -@@ -1529,11 +1721,11 @@ - "enabled": false, - "present": true - }, -- "id": "libvirt-28" -+ "id": "libvirt-33" - } - - { -- "id": "libvirt-29", -+ "id": "libvirt-34", - "error": { - "class": "CommandNotFound", - "desc": "The command query-tpm-models has not been found" -@@ -1541,7 +1733,7 @@ - } - - { -- "id": "libvirt-30", -+ "id": "libvirt-35", - "error": { - "class": "CommandNotFound", - "desc": "The command query-tpm-types has not been found" -@@ -1549,7 +1741,7 @@ - } - - { -- "id": "libvirt-31", -+ "id": "libvirt-36", - "error": { - "class": "CommandNotFound", - "desc": "The command query-command-line-options has not been found" -@@ -1563,5 +1755,5 @@ - "state": false - } - ], -- "id": "libvirt-32" -+ "id": "libvirt-37" - } -diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps -index f4f0397..68bed9f 100644 ---- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps -@@ -130,4 +130,8 @@ - - - -+ -+ -+ -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies -index 43713b2..e1f9704 100644 ---- a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies -+++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies -@@ -1575,6 +1575,210 @@ - { - "return": [ - { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "mmio", -+ "type": "on/off" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-28" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-29" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-30" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-31" -+} -+ -+{ -+ "return": [ -+ { - "name": "xenpv" - }, - { -@@ -1623,7 +1827,7 @@ - "name": "none" - } - ], -- "id": "libvirt-28" -+ "id": "libvirt-32" - } - - { -@@ -1701,7 +1905,7 @@ - "name": "Opteron_G5" - } - ], -- "id": "libvirt-29" -+ "id": "libvirt-33" - } - - { -@@ -1709,11 +1913,11 @@ - "enabled": false, - "present": true - }, -- "id": "libvirt-30" -+ "id": "libvirt-34" - } - - { -- "id": "libvirt-31", -+ "id": "libvirt-35", - "error": { - "class": "CommandNotFound", - "desc": "The command query-tpm-models has not been found" -@@ -1721,7 +1925,7 @@ - } - - { -- "id": "libvirt-32", -+ "id": "libvirt-36", - "error": { - "class": "CommandNotFound", - "desc": "The command query-tpm-types has not been found" -@@ -1729,7 +1933,7 @@ - } - - { -- "id": "libvirt-33", -+ "id": "libvirt-37", - "error": { - "class": "CommandNotFound", - "desc": "The command query-command-line-options has not been found" -@@ -1743,5 +1947,5 @@ - "state": false - } - ], -- "id": "libvirt-34" -+ "id": "libvirt-38" - } -diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps -index e6659e4..baf2e77 100644 ---- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps -@@ -131,4 +131,8 @@ - - - -+ -+ -+ -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies -index 34384f8..3d797b2 100644 ---- a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies -+++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies -@@ -1622,6 +1622,210 @@ - { - "return": [ - { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "mmio", -+ "type": "on/off" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-28" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-29" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-30" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-31" -+} -+ -+{ -+ "return": [ -+ { - "name": "xenpv" - }, - { -@@ -1673,7 +1877,7 @@ - "name": "none" - } - ], -- "id": "libvirt-28" -+ "id": "libvirt-32" - } - - { -@@ -1751,7 +1955,7 @@ - "name": "qemu64" - } - ], -- "id": "libvirt-29" -+ "id": "libvirt-33" - } - - { -@@ -1759,11 +1963,11 @@ - "enabled": false, - "present": true - }, -- "id": "libvirt-30" -+ "id": "libvirt-34" - } - - { -- "id": "libvirt-31", -+ "id": "libvirt-35", - "error": { - "class": "CommandNotFound", - "desc": "The command query-tpm-models has not been found" -@@ -1771,7 +1975,7 @@ - } - - { -- "id": "libvirt-32", -+ "id": "libvirt-36", - "error": { - "class": "CommandNotFound", - "desc": "The command query-tpm-types has not been found" -@@ -1779,7 +1983,7 @@ - } - - { -- "id": "libvirt-33", -+ "id": "libvirt-37", - "error": { - "class": "CommandNotFound", - "desc": "The command query-command-line-options has not been found" -@@ -1793,5 +1997,5 @@ - "state": false - } - ], -- "id": "libvirt-34" -+ "id": "libvirt-38" - } -diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps -index 9716cf5..496f305 100644 ---- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps -@@ -140,4 +140,8 @@ - - - -+ -+ -+ -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies -index 4613472..45571a3 100644 ---- a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies -+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies -@@ -1696,6 +1696,210 @@ - { - "return": [ - { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "mmio", -+ "type": "on/off" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-28" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-29" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-30" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-31" -+} -+ -+{ -+ "return": [ -+ { - "name": "pc-q35-1.4", - "cpu-max": 255 - }, -@@ -1763,7 +1967,7 @@ - "cpu-max": 1 - } - ], -- "id": "libvirt-28" -+ "id": "libvirt-32" - } - - { -@@ -1841,7 +2045,7 @@ - "name": "qemu64" - } - ], -- "id": "libvirt-29" -+ "id": "libvirt-33" - } - - { -@@ -1849,19 +2053,19 @@ - "enabled": false, - "present": true - }, -- "id": "libvirt-30" -+ "id": "libvirt-34" - } - - { - "return": [ - ], -- "id": "libvirt-31" -+ "id": "libvirt-35" - } - - { - "return": [ - ], -- "id": "libvirt-32" -+ "id": "libvirt-36" - } - - { -@@ -2537,7 +2741,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-33" -+ "id": "libvirt-37" - } - - { -@@ -2547,5 +2751,5 @@ - "state": false - } - ], -- "id": "libvirt-34" -+ "id": "libvirt-38" - } -diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps -index a820cd4..38333a6 100644 ---- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps -@@ -146,4 +146,8 @@ - - - -+ -+ -+ -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies -index 4205c89..ae4b3f4 100644 ---- a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies -+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies -@@ -1758,6 +1758,210 @@ - { - "return": [ - { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "mmio", -+ "type": "on/off" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-28" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-29" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-30" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-31" -+} -+ -+{ -+ "return": [ -+ { - "name": "xenpv", - "cpu-max": 1 - }, -@@ -1841,7 +2045,7 @@ - "cpu-max": 1 - } - ], -- "id": "libvirt-28" -+ "id": "libvirt-32" - } - - { -@@ -1919,7 +2123,7 @@ - "name": "qemu64" - } - ], -- "id": "libvirt-29" -+ "id": "libvirt-33" - } - - { -@@ -1927,19 +2131,19 @@ - "enabled": false, - "present": true - }, -- "id": "libvirt-30" -+ "id": "libvirt-34" - } - - { - "return": [ - ], -- "id": "libvirt-31" -+ "id": "libvirt-35" - } - - { - "return": [ - ], -- "id": "libvirt-32" -+ "id": "libvirt-36" - } - - { -@@ -2517,7 +2721,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-33" -+ "id": "libvirt-37" - } - - { -@@ -2539,5 +2743,5 @@ - "state": false - } - ], -- "id": "libvirt-34" -+ "id": "libvirt-38" - } -diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps -index f65b3f4..b093e08 100644 ---- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps -@@ -146,4 +146,8 @@ - - - -+ -+ -+ -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies -index 7582385..90d31f0 100644 ---- a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies -+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies -@@ -1722,6 +1722,210 @@ - { - "return": [ - { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "mmio", -+ "type": "on/off" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-28" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-29" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-30" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-31" -+} -+ -+{ -+ "return": [ -+ { - "name": "xenpv", - "cpu-max": 1 - }, -@@ -1813,7 +2017,7 @@ - "cpu-max": 1 - } - ], -- "id": "libvirt-28" -+ "id": "libvirt-32" - } - - { -@@ -1891,7 +2095,7 @@ - "name": "qemu64" - } - ], -- "id": "libvirt-29" -+ "id": "libvirt-33" - } - - { -@@ -1899,19 +2103,19 @@ - "enabled": false, - "present": true - }, -- "id": "libvirt-30" -+ "id": "libvirt-34" - } - - { - "return": [ - ], -- "id": "libvirt-31" -+ "id": "libvirt-35" - } - - { - "return": [ - ], -- "id": "libvirt-32" -+ "id": "libvirt-36" - } - - { -@@ -2499,7 +2703,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-33" -+ "id": "libvirt-37" - } - - { -@@ -2521,5 +2725,5 @@ - "state": false - } - ], -- "id": "libvirt-34" -+ "id": "libvirt-38" - } -diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps -index 7fc654d..57e6e14 100644 ---- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps -+++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps -@@ -160,4 +160,8 @@ - - - -+ -+ -+ -+ - -diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.replies b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies -index 74d09dc..511461a 100644 ---- a/tests/qemucapabilitiesdata/caps_2.1.1-1.replies -+++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies -@@ -2166,6 +2166,210 @@ - } - - { -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "mmio", -+ "type": "on/off" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-28" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-29" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-30" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "command_serr_enable", -+ "type": "on/off" -+ }, -+ { -+ "name": "multifunction", -+ "type": "on/off" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "type": "pci-devfn" -+ }, -+ { -+ "name": "surfaces", -+ "type": "int32" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram64_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "cmdlog", -+ "type": "uint32" -+ }, -+ { -+ "name": "guestdebug", -+ "type": "uint32" -+ }, -+ { -+ "name": "debug", -+ "type": "uint32" -+ }, -+ { -+ "name": "revision", -+ "type": "uint32" -+ }, -+ { -+ "name": "vram_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ram_size", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-31" -+} -+ -+{ - "return": [ - { - "name": "pc-1.3", -@@ -2275,7 +2479,7 @@ - "cpu-max": 255 - } - ], -- "id": "libvirt-28" -+ "id": "libvirt-32" - } - - { -@@ -2356,7 +2560,7 @@ - "name": "qemu64" - } - ], -- "id": "libvirt-29" -+ "id": "libvirt-33" - } - - { -@@ -2364,21 +2568,21 @@ - "enabled": false, - "present": true - }, -- "id": "libvirt-30" -+ "id": "libvirt-34" - } - - { - "return": [ - "tpm-tis" - ], -- "id": "libvirt-31" -+ "id": "libvirt-35" - } - - { - "return": [ - "passthrough" - ], -- "id": "libvirt-32" -+ "id": "libvirt-36" - } - - { -@@ -3238,7 +3442,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-33" -+ "id": "libvirt-37" - } - - { -@@ -3260,5 +3464,5 @@ - "capability": "zero-blocks" - } - ], -- "id": "libvirt-34" -+ "id": "libvirt-38" - } --- -2.1.3 - diff --git a/SOURCES/libvirt-cgroup-Drop-resource-partition-from-virSystemdMakeScopeName.patch b/SOURCES/libvirt-cgroup-Drop-resource-partition-from-virSystemdMakeScopeName.patch new file mode 100644 index 0000000..cb05f96 --- /dev/null +++ b/SOURCES/libvirt-cgroup-Drop-resource-partition-from-virSystemdMakeScopeName.patch @@ -0,0 +1,227 @@ +From 1934effeed51b631703bc7880c46a75afa065058 Mon Sep 17 00:00:00 2001 +Message-Id: <1934effeed51b631703bc7880c46a75afa065058@dist-git> +From: Peter Krempa +Date: Wed, 22 Jul 2015 07:24:17 +0200 +Subject: [PATCH] cgroup: Drop resource partition from virSystemdMakeScopeName + +The scope name, even according to our docs is +"machine-$DRIVER\x2d$VMNAME.scope" virSystemdMakeScopeName would use the +resource partition name instead of "machine-" if it was specified thus +creating invalid scope paths. + +This makes libvirt drop cgroups for a VM that uses custom resource +partition upon reconnecting since the detected scope name would not +match the expected name generated by virSystemdMakeScopeName. + +The error is exposed by the following log entry: + +debug : virCgroupValidateMachineGroup:302 : Name 'machine-qemu\x2dtestvm.scope' for controller 'cpu' does not match 'testvm', 'testvm.libvirt-qemu' or 'machine-test-qemu\x2dtestvm.scope' + +for a "/machine/test" resource and "testvm" vm. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238570 +(cherry picked from commit 88f6c007c3fb4324396ec397de57c8a80ba7b31d) + +Signed-off-by: Jiri Denemark +--- + src/lxc/lxc_process.c | 6 ------ + src/qemu/qemu_cgroup.c | 3 --- + src/util/vircgroup.c | 11 ++--------- + src/util/vircgroup.h | 1 - + src/util/virsystemd.c | 9 ++------- + src/util/virsystemd.h | 3 +-- + tests/virsystemdtest.c | 20 +++++++------------- + 7 files changed, 12 insertions(+), 41 deletions(-) + +diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c +index 2bdce3b..87ee484 100644 +--- a/src/lxc/lxc_process.c ++++ b/src/lxc/lxc_process.c +@@ -1319,9 +1319,6 @@ int virLXCProcessStart(virConnectPtr conn, + * more reliable way to kill everything off if something + * goes wrong from here onwards ... */ + if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid, +- vm->def->resource ? +- vm->def->resource->partition : +- NULL, + -1, &priv->cgroup) < 0) + goto cleanup; + +@@ -1505,9 +1502,6 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm, + goto error; + + if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid, +- vm->def->resource ? +- vm->def->resource->partition : +- NULL, + -1, &priv->cgroup) < 0) + goto error; + +diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c +index 8ed74ee..ab21e12 100644 +--- a/src/qemu/qemu_cgroup.c ++++ b/src/qemu/qemu_cgroup.c +@@ -855,9 +855,6 @@ qemuConnectCgroup(virQEMUDriverPtr driver, + if (virCgroupNewDetectMachine(vm->def->name, + "qemu", + vm->pid, +- vm->def->resource ? +- vm->def->resource->partition : +- NULL, + cfg->cgroupControllers, + &priv->cgroup) < 0) + goto cleanup; +diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c +index cbe0234..29b2ab9 100644 +--- a/src/util/vircgroup.c ++++ b/src/util/vircgroup.c +@@ -243,7 +243,6 @@ static bool + virCgroupValidateMachineGroup(virCgroupPtr group, + const char *name, + const char *drivername, +- const char *partition, + bool stripEmulatorSuffix) + { + size_t i; +@@ -258,10 +257,7 @@ virCgroupValidateMachineGroup(virCgroupPtr group, + if (virCgroupPartitionEscape(&partname) < 0) + goto cleanup; + +- if (!partition) +- partition = "/machine"; +- +- if (!(scopename = virSystemdMakeScopeName(name, drivername, partition))) ++ if (!(scopename = virSystemdMakeScopeName(name, drivername))) + goto cleanup; + + if (virCgroupPartitionEscape(&scopename) < 0) +@@ -1498,7 +1494,6 @@ int + virCgroupNewDetectMachine(const char *name, + const char *drivername, + pid_t pid, +- const char *partition, + int controllers, + virCgroupPtr *group) + { +@@ -1508,8 +1503,7 @@ virCgroupNewDetectMachine(const char *name, + return -1; + } + +- if (!virCgroupValidateMachineGroup(*group, name, drivername, partition, +- true)) { ++ if (!virCgroupValidateMachineGroup(*group, name, drivername, true)) { + VIR_DEBUG("Failed to validate machine name for '%s' driver '%s'", + name, drivername); + virCgroupFree(group); +@@ -4047,7 +4041,6 @@ int + virCgroupNewDetectMachine(const char *name ATTRIBUTE_UNUSED, + const char *drivername ATTRIBUTE_UNUSED, + pid_t pid ATTRIBUTE_UNUSED, +- const char *partition ATTRIBUTE_UNUSED, + int controllers ATTRIBUTE_UNUSED, + virCgroupPtr *group ATTRIBUTE_UNUSED) + { +diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h +index e75c522..675a185 100644 +--- a/src/util/vircgroup.h ++++ b/src/util/vircgroup.h +@@ -92,7 +92,6 @@ int virCgroupNewDetect(pid_t pid, + int virCgroupNewDetectMachine(const char *name, + const char *drivername, + pid_t pid, +- const char *partition, + int controllers, + virCgroupPtr *group); + +diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c +index 8cedf8d..54c409d 100644 +--- a/src/util/virsystemd.c ++++ b/src/util/virsystemd.c +@@ -80,16 +80,11 @@ static void virSystemdEscapeName(virBufferPtr buf, + + + char *virSystemdMakeScopeName(const char *name, +- const char *drivername, +- const char *partition) ++ const char *drivername) + { + virBuffer buf = VIR_BUFFER_INITIALIZER; + +- if (*partition == '/') +- partition++; +- +- virSystemdEscapeName(&buf, partition); +- virBufferAddChar(&buf, '-'); ++ virBufferAddLit(&buf, "machine-"); + virSystemdEscapeName(&buf, drivername); + virBufferAddLit(&buf, "\\x2d"); + virSystemdEscapeName(&buf, name); +diff --git a/src/util/virsystemd.h b/src/util/virsystemd.h +index 7a29dba..8af2169 100644 +--- a/src/util/virsystemd.h ++++ b/src/util/virsystemd.h +@@ -25,8 +25,7 @@ + # include "internal.h" + + char *virSystemdMakeScopeName(const char *name, +- const char *drivername, +- const char *slicename); ++ const char *drivername); + char *virSystemdMakeSliceName(const char *partition); + + char *virSystemdMakeMachineName(const char *name, +diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c +index 261c4cc..d0b9335 100644 +--- a/tests/virsystemdtest.c ++++ b/tests/virsystemdtest.c +@@ -340,7 +340,6 @@ static int testCreateNetwork(const void *opaque ATTRIBUTE_UNUSED) + + struct testScopeData { + const char *name; +- const char *partition; + const char *expected; + }; + +@@ -351,9 +350,7 @@ testScopeName(const void *opaque) + int ret = -1; + char *actual = NULL; + +- if (!(actual = virSystemdMakeScopeName(data->name, +- "lxc", +- data->partition))) ++ if (!(actual = virSystemdMakeScopeName(data->name, "lxc"))) + goto cleanup; + + if (STRNEQ(actual, data->expected)) { +@@ -472,22 +469,19 @@ mymain(void) + if (virtTestRun("Test create with network ", testCreateNetwork, NULL) < 0) + ret = -1; + +-# define TEST_SCOPE(name, partition, unitname) \ ++# define TEST_SCOPE(name, unitname) \ + do { \ + struct testScopeData data = { \ +- name, partition, unitname \ ++ name, unitname \ + }; \ + if (virtTestRun("Test scopename", testScopeName, &data) < 0) \ + ret = -1; \ + } while (0) + +- TEST_SCOPE("demo", "/machine", "machine-lxc\\x2ddemo.scope"); +- TEST_SCOPE("demo-name", "/machine", "machine-lxc\\x2ddemo\\x2dname.scope"); +- TEST_SCOPE("demo!name", "/machine", "machine-lxc\\x2ddemo\\x21name.scope"); +- TEST_SCOPE(".demo", "/machine", "machine-lxc\\x2d\\x2edemo.scope"); +- TEST_SCOPE("demo", "/machine/eng-dept", "machine-eng\\x2ddept-lxc\\x2ddemo.scope"); +- TEST_SCOPE("demo", "/machine/eng-dept/testing!stuff", +- "machine-eng\\x2ddept-testing\\x21stuff-lxc\\x2ddemo.scope"); ++ TEST_SCOPE("demo", "machine-lxc\\x2ddemo.scope"); ++ TEST_SCOPE("demo-name", "machine-lxc\\x2ddemo\\x2dname.scope"); ++ TEST_SCOPE("demo!name", "machine-lxc\\x2ddemo\\x21name.scope"); ++ TEST_SCOPE(".demo", "machine-lxc\\x2d\\x2edemo.scope"); + + # define TESTS_PM_SUPPORT_HELPER(name, function) \ + do { \ +-- +2.5.0 + diff --git a/SOURCES/libvirt-cmdVcpuPin-Remove-dead-code.patch b/SOURCES/libvirt-cmdVcpuPin-Remove-dead-code.patch new file mode 100644 index 0000000..57ad82b --- /dev/null +++ b/SOURCES/libvirt-cmdVcpuPin-Remove-dead-code.patch @@ -0,0 +1,43 @@ +From aa17035794369f33a9e4c3a3c625fd65b36e3320 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Michal Privoznik +Date: Thu, 16 Jul 2015 13:45:52 +0200 +Subject: [PATCH] cmdVcpuPin: Remove dead code + +There's this condition: + +flags & VIR_DOMAIN_AFFECT_CURRENT && virDomainIsActive(dom) + +which can never be true since VIR_DOMAIN_AFFECT_CURRENT has hardcoded +value of zero. Therefore virDomainIsActive() is a dead code. However, +the condition could make sense if it is rewritten as the following: + +!(flags & VIR_DOMAIN_AFFECT_CONFIG) && virDomainIsActive(dom) + +Signed-off-by: Michal Privoznik +(cherry picked from commit 416d0e94181086e572107ab9c295b70d98f0782b) + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1160559 + +Signed-off-by: Pavel Hrdina +Signed-off-by: Jiri Denemark +--- + tools/virsh-domain.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c +index ac04ded..f7edeeb 100644 +--- a/tools/virsh-domain.c ++++ b/tools/virsh-domain.c +@@ -6499,7 +6499,7 @@ cmdVcpuPin(vshControl *ctl, const vshCmd *cmd) + + if (got_vcpu && vcpu >= ncpus) { + if (flags & VIR_DOMAIN_AFFECT_LIVE || +- (flags & VIR_DOMAIN_AFFECT_CURRENT && ++ (!(flags & VIR_DOMAIN_AFFECT_CONFIG) && + virDomainIsActive(dom) == 1)) + vshError(ctl, + _("vcpu %d is out of range of live cpu count %d"), +-- +2.5.0 + diff --git a/SOURCES/libvirt-conf-Add-XML-parser-flag-that-will-allow-us-to-do-incompatible-updates.patch b/SOURCES/libvirt-conf-Add-XML-parser-flag-that-will-allow-us-to-do-incompatible-updates.patch new file mode 100644 index 0000000..679c609 --- /dev/null +++ b/SOURCES/libvirt-conf-Add-XML-parser-flag-that-will-allow-us-to-do-incompatible-updates.patch @@ -0,0 +1,99 @@ +From fd2d738d9c12aeea42167e0de3662af5a64d93d5 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:41 +0200 +Subject: [PATCH] conf: Add XML parser flag that will allow us to do + incompatible updates + +https://bugzilla.redhat.com/show_bug.cgi?id=1252685 + +Add a new parser flag that will mark code paths that parse XML files +wich will not be used with existing VM state so that post parse +callbacks can possibly do ABI incompatible changes if needed. + +(cherry picked from commit 59173c3dd94fc090d2776be3986a1014ddbf2396) + +Conflicts: + src/qemu/qemu_driver.c - context + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.h | 2 ++ + src/qemu/qemu_driver.c | 12 ++++++++---- + src/qemu/qemu_migration.c | 3 ++- + 3 files changed, 12 insertions(+), 5 deletions(-) + +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 63685c6..bac64b3 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2613,6 +2613,8 @@ typedef enum { + /* don't validate os.type and arch against capabilities. Prevents + * VMs from disappearing when qemu is removed and libvirtd is restarted */ + VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS = 1 << 8, ++ /* allow updates in post parse callback that would break ABI otherwise */ ++ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 9, + } virDomainDefParseFlags; + + typedef enum { +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 0f3e987..f15b14a 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -1714,7 +1714,8 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn, + unsigned int start_flags = VIR_QEMU_PROCESS_START_COLD; + virQEMUCapsPtr qemuCaps = NULL; + virCapsPtr caps = NULL; +- unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; ++ unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE | ++ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE; + + virCheckFlags(VIR_DOMAIN_START_PAUSED | + VIR_DOMAIN_START_AUTODESTROY | +@@ -7179,7 +7180,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, + goto cleanup; + + def = virDomainDefParseString(xmlData, caps, driver->xmlopt, +- VIR_DOMAIN_DEF_PARSE_INACTIVE); ++ VIR_DOMAIN_DEF_PARSE_INACTIVE | ++ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE); + if (!def) + goto cleanup; + +@@ -7494,7 +7496,8 @@ static virDomainPtr qemuDomainDefineXMLFlags(virConnectPtr conn, const char *xml + virQEMUCapsPtr qemuCaps = NULL; + virQEMUDriverConfigPtr cfg; + virCapsPtr caps = NULL; +- unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; ++ unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE | ++ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE; + + virCheckFlags(VIR_DOMAIN_DEFINE_VALIDATE, NULL); + +@@ -8449,7 +8452,8 @@ static int qemuDomainAttachDeviceFlags(virDomainPtr dom, const char *xml, + virDomainDefPtr vmdef = NULL; + virDomainDeviceDefPtr dev = NULL, dev_copy = NULL; + int ret = -1; +- unsigned int affect, parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; ++ unsigned int affect, parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE | ++ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE; + virQEMUCapsPtr qemuCaps = NULL; + qemuDomainObjPrivatePtr priv; + virQEMUDriverConfigPtr cfg = NULL; +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 93f561f..cb82687 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -1257,7 +1257,8 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, + } + mig->persistent = virDomainDefParseNode(doc, nodes[0], + caps, driver->xmlopt, +- VIR_DOMAIN_DEF_PARSE_INACTIVE); ++ VIR_DOMAIN_DEF_PARSE_INACTIVE | ++ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE); + if (!mig->persistent) { + /* virDomainDefParseNode already reported + * an error for us */ +-- +2.5.3 + diff --git a/SOURCES/libvirt-conf-Add-channel-state-for-virtio-channels-to-the-XML.patch b/SOURCES/libvirt-conf-Add-channel-state-for-virtio-channels-to-the-XML.patch deleted file mode 100644 index 5383976..0000000 --- a/SOURCES/libvirt-conf-Add-channel-state-for-virtio-channels-to-the-XML.patch +++ /dev/null @@ -1,392 +0,0 @@ -From d0fd9e1092939dd2975d41fdbf1df017c71695e5 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Mon, 24 Nov 2014 17:51:14 +0100 -Subject: [PATCH] conf: Add channel state for virtio channels to the XML - -https://bugzilla.redhat.com/show_bug.cgi?id=1146944 - -To track state of virtio channels this patch adds a new output-only -attribute called 'state' to the element of virtio channels. - -This will be later populated with the guest state of the channel. - -(cherry picked from commit 24c25a68c21adc197325a6b43e69367c0085d1b2) - -Conflicts: - src/conf/domain_conf.c - context: brace cleanup not backported - -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 9 ++++- - docs/schemas/domaincommon.rng | 8 ++++ - src/conf/domain_conf.c | 32 +++++++++++++++- - src/conf/domain_conf.h | 12 ++++++ - .../qemuxml2argv-channel-virtio-state.args | 17 +++++++++ - .../qemuxml2argv-channel-virtio-state.xml | 42 +++++++++++++++++++++ - tests/qemuxml2argvtest.c | 2 + - .../qemuxml2xmlout-channel-virtio-state-active.xml | 43 ++++++++++++++++++++++ - ...emuxml2xmlout-channel-virtio-state-inactive.xml | 42 +++++++++++++++++++++ - tests/qemuxml2xmltest.c | 1 + - 10 files changed, 204 insertions(+), 4 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-state.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-state.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-state-active.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-state-inactive.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index e044eab..f8d5b31 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -4896,7 +4896,7 @@ qemu-kvm -net nic,model=? /dev/null - </channel> - <channel type='unix'> - <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/> -- <target type='virtio' name='org.qemu.guest_agent.0'/> -+ <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/> - </channel> - <channel type='spicevmc'> - <target type='virtio' name='com.redhat.spice.0'/> -@@ -4935,7 +4935,12 @@ qemu-kvm -net nic,model=? /dev/null - This is very useful in case of a qemu guest agent, where users don't - usually care about the source path since it's libvirt who talks to - the guest agent. In case users want to utilize this feature, they should -- leave <source> element out. -+ leave <source> element out. Since -+ 1.2.11 the active XML for a virtio channel may contain an optional -+ state attribute that reflects whether a process in the -+ guest is active on the channel. This is an output-only attribute. -+ Possible values for the state attribute are -+ connected and disconnected. - -
spicevmc
-
Paravirtualized SPICE channel. The domain must also have a -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 7cb37c7..4e917b1 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -3384,6 +3384,14 @@ - - - -+ -+ -+ -+ connected -+ disconnected -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index baf16dc..ef6e9cf 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -407,6 +407,11 @@ VIR_ENUM_IMPL(virDomainNetInterfaceLinkState, VIR_DOMAIN_NET_INTERFACE_LINK_STAT - "up", - "down") - -+VIR_ENUM_IMPL(virDomainChrDeviceState, VIR_DOMAIN_CHR_DEVICE_STATE_LAST, -+ "default", -+ "connected", -+ "disconnected"); -+ - VIR_ENUM_IMPL(virDomainChrSerialTarget, - VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST, - "isa-serial", -@@ -7735,13 +7740,15 @@ virDomainChrTargetTypeFromString(virDomainChrDefPtr def, - - static int - virDomainChrDefParseTargetXML(virDomainChrDefPtr def, -- xmlNodePtr cur) -+ xmlNodePtr cur, -+ unsigned int flags) - { - int ret = -1; - unsigned int port; - char *targetType = virXMLPropString(cur, "type"); - char *addrStr = NULL; - char *portStr = NULL; -+ char *stateStr = NULL; - - if ((def->targetType = - virDomainChrTargetTypeFromString(def, def->deviceType, -@@ -7798,6 +7805,20 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr def, - - case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO: - def->target.name = virXMLPropString(cur, "name"); -+ -+ if (!(flags & VIR_DOMAIN_XML_INACTIVE) && -+ (stateStr = virXMLPropString(cur, "state"))) { -+ int tmp; -+ -+ if ((tmp = virDomainChrDeviceStateTypeFromString(stateStr)) <= 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("invalid channel state value '%s'"), -+ stateStr); -+ goto error; -+ } -+ -+ def->state = tmp; -+ } - break; - } - break; -@@ -7826,6 +7847,7 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr def, - VIR_FREE(targetType); - VIR_FREE(addrStr); - VIR_FREE(portStr); -+ VIR_FREE(stateStr); - - return ret; - } -@@ -8201,7 +8223,7 @@ virDomainChrDefParseXML(xmlXPathContextPtr ctxt, - if (cur->type == XML_ELEMENT_NODE) { - if (xmlStrEqual(cur->name, BAD_CAST "target")) { - seenTarget = true; -- if (virDomainChrDefParseTargetXML(def, cur) < 0) { -+ if (virDomainChrDefParseTargetXML(def, cur, flags) < 0) { - goto error; - } - } -@@ -17309,6 +17331,12 @@ virDomainChrDefFormat(virBufferPtr buf, - if (def->target.name) { - virBufferEscapeString(buf, " name='%s'", def->target.name); - } -+ -+ if (def->state != VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT && -+ !(flags & VIR_DOMAIN_XML_INACTIVE)) { -+ virBufferAsprintf(buf, " state='%s'", -+ virDomainChrDeviceStateTypeToString(def->state)); -+ } - break; - } - -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 6768089..f9cccb4 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -985,6 +985,16 @@ struct _virDomainNetDef { - # define VIR_NET_GENERATED_PREFIX "vnet" - - typedef enum { -+ VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT = 0, -+ VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED, -+ VIR_DOMAIN_CHR_DEVICE_STATE_DISCONNECTED, -+ -+ VIR_DOMAIN_CHR_DEVICE_STATE_LAST -+} virDomainChrDeviceState; -+ -+VIR_ENUM_DECL(virDomainChrDeviceState) -+ -+typedef enum { - VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL = 0, - VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL, - VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE, -@@ -1104,6 +1114,8 @@ struct _virDomainChrDef { - char *name; /* virtio */ - } target; - -+ virDomainChrDeviceState state; -+ - virDomainChrSourceDef source; - - virDomainDeviceInfo info; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-state.args b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-state.args -new file mode 100644 -index 0000000..62bf14d ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-state.args -@@ -0,0 +1,17 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \ -+-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ -+-no-acpi -boot c \ -+-device virtio-serial-pci,id=virtio-serial1,bus=pci.0,addr=0xa \ -+-usb -hda /dev/HostVG/QEMUGuest1 \ -+-chardev pty,id=charchannel0 \ -+-device virtserialport,bus=virtio-serial1.0,nr=3,chardev=charchannel0,\ -+id=channel0,name=org.linux-kvm.port.foo \ -+-chardev pty,id=charchannel1 \ -+-device virtserialport,bus=virtio-serial1.0,nr=4,chardev=charchannel1,\ -+id=channel1,name=org.linux-kvm.port.foo1 \ -+-chardev pty,id=charchannel2 \ -+-device virtserialport,bus=virtio-serial1.0,nr=5,chardev=charchannel2,\ -+id=channel2,name=org.linux-kvm.port.foo2 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-state.xml b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-state.xml -new file mode 100644 -index 0000000..044b369 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-state.xml -@@ -0,0 +1,42 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+
-+ -+ -+ -+ -+
-+ -+ -+ -+
-+ -+ -+ -+
-+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 3efe3c9..97af90a 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1051,6 +1051,8 @@ mymain(void) - QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); - DO_TEST("channel-virtio", - QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ DO_TEST("channel-virtio-state", -+ QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); - DO_TEST("channel-virtio-auto", - QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); - DO_TEST("console-virtio", -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-state-active.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-state-active.xml -new file mode 100644 -index 0000000..4f050fc ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-state-active.xml -@@ -0,0 +1,43 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+
-+ -+ -+ -+ -+
-+ -+ -+ -+ -+
-+ -+ -+ -+
-+ -+ -+ -+
-+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-state-inactive.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-state-inactive.xml -new file mode 100644 -index 0000000..5027a1e ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-state-inactive.xml -@@ -0,0 +1,42 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+
-+ -+ -+ -+ -+
-+ -+ -+ -+
-+ -+ -+ -+
-+ -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index f29e4ed..50f5907 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -288,6 +288,7 @@ mymain(void) - DO_TEST("console-virtio-many"); - DO_TEST("channel-guestfwd"); - DO_TEST("channel-virtio"); -+ DO_TEST_DIFFERENT("channel-virtio-state"); - - DO_TEST("hostdev-usb-address"); - DO_TEST("hostdev-pci-address"); --- -2.1.3 - diff --git a/SOURCES/libvirt-conf-Add-getter-for-network-routes.patch b/SOURCES/libvirt-conf-Add-getter-for-network-routes.patch new file mode 100644 index 0000000..50a94b9 --- /dev/null +++ b/SOURCES/libvirt-conf-Add-getter-for-network-routes.patch @@ -0,0 +1,87 @@ +From 4db05578f2b40f0374477bccf85a492a7e8ee8fc Mon Sep 17 00:00:00 2001 +Message-Id: <4db05578f2b40f0374477bccf85a492a7e8ee8fc@dist-git> +From: Martin Kletzander +Date: Thu, 6 Aug 2015 13:10:23 +0200 +Subject: [PATCH] conf: Add getter for network routes + +https://bugzilla.redhat.com/show_bug.cgi?id=1094205 + +Add virNetworkDefGetRouteByIndex() similarly to +virNetworkDefGetIpByIndex(), but for routes. + +Signed-off-by: Martin Kletzander +(cherry picked from commit 0f10eb6a289502b295b56bc0925cf05cfa32193d) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/conf/network_conf.c | 26 ++++++++++++++++++++++++++ + src/conf/network_conf.h | 3 +++ + src/libvirt_private.syms | 1 + + 3 files changed, 30 insertions(+) + +diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c +index 31d4463..72006e9 100644 +--- a/src/conf/network_conf.c ++++ b/src/conf/network_conf.c +@@ -803,6 +803,32 @@ virNetworkDefGetIpByIndex(const virNetworkDef *def, + return NULL; + } + ++/* return routes[index], or NULL if there aren't enough routes */ ++virNetworkRouteDefPtr ++virNetworkDefGetRouteByIndex(const virNetworkDef *def, ++ int family, size_t n) ++{ ++ size_t i; ++ ++ if (!def->routes || n >= def->nroutes) ++ return NULL; ++ ++ if (family == AF_UNSPEC) ++ return def->routes[n]; ++ ++ /* find the nth route of type "family" */ ++ for (i = 0; i < def->nroutes; i++) { ++ virSocketAddrPtr addr = virNetworkRouteDefGetAddress(def->routes[i]); ++ if (VIR_SOCKET_ADDR_IS_FAMILY(addr, family) ++ && (n-- <= 0)) { ++ return def->routes[i]; ++ } ++ } ++ ++ /* failed to find enough of the right family */ ++ return NULL; ++} ++ + /* return number of 1 bits in netmask for the network's ipAddress, + * or -1 on error + */ +diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h +index 9411a02..1cd5100 100644 +--- a/src/conf/network_conf.h ++++ b/src/conf/network_conf.h +@@ -360,6 +360,9 @@ virPortGroupDefPtr virPortGroupFindByName(virNetworkDefPtr net, + virNetworkIpDefPtr + virNetworkDefGetIpByIndex(const virNetworkDef *def, + int family, size_t n); ++virNetworkRouteDefPtr ++virNetworkDefGetRouteByIndex(const virNetworkDef *def, ++ int family, size_t n); + int virNetworkIpDefPrefix(const virNetworkIpDef *def); + int virNetworkIpDefNetmask(const virNetworkIpDef *def, + virSocketAddrPtr netmask); +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index a6b523a..46e535e 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -597,6 +597,7 @@ virNetworkDefFormat; + virNetworkDefFormatBuf; + virNetworkDefFree; + virNetworkDefGetIpByIndex; ++virNetworkDefGetRouteByIndex; + virNetworkDefParseFile; + virNetworkDefParseNode; + virNetworkDefParseString; +-- +2.5.0 + diff --git a/SOURCES/libvirt-conf-Add-helper-to-determine-whether-memory-hotplug-is-enabled-for-a-vm.patch b/SOURCES/libvirt-conf-Add-helper-to-determine-whether-memory-hotplug-is-enabled-for-a-vm.patch new file mode 100644 index 0000000..aaa52e6 --- /dev/null +++ b/SOURCES/libvirt-conf-Add-helper-to-determine-whether-memory-hotplug-is-enabled-for-a-vm.patch @@ -0,0 +1,130 @@ +From b0dc796ccdf858a0fdb22a811fd28b4ed3d6dce5 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:37 +0200 +Subject: [PATCH] conf: Add helper to determine whether memory hotplug is + enabled for a vm + +https://bugzilla.redhat.com/show_bug.cgi?id=1252685 + +Add a simple helper so that the code doesn't have to rewrite the same +condition multiple times. + +(cherry picked from commit 1891cad5420a3a1727177d1c762b23104c9ccc6d) + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 11 +++++++++-- + src/conf/domain_conf.h | 1 + + src/libvirt_private.syms | 1 + + src/qemu/qemu_command.c | 2 +- + src/qemu/qemu_domain.c | 2 +- + src/qemu/qemu_migration.c | 5 ++--- + 6 files changed, 15 insertions(+), 7 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 15d3a5e..2dc5912 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -1141,7 +1141,7 @@ int + virDomainDefCheckUnsupportedMemoryHotplug(virDomainDefPtr def) + { + /* memory hotplug tunables are not supported by this driver */ +- if (def->mem.max_memory > 0 || def->mem.memory_slots > 0) { ++ if (virDomainDefHasMemoryHotplug(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("memory hotplug tunables are not " + "supported by this hypervisor driver")); +@@ -7637,6 +7637,13 @@ virDomainParseMemoryLimit(const char *xpath, + } + + ++bool ++virDomainDefHasMemoryHotplug(const virDomainDef *def) ++{ ++ return def->mem.memory_slots > 0 || def->mem.max_memory > 0; ++} ++ ++ + /** + * virDomainDefGetMemoryInitial: + * @def: domain definition +@@ -21342,7 +21349,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, + xmlIndentTreeOutput = oldIndentTreeOutput; + } + +- if (def->mem.max_memory) { ++ if (virDomainDefHasMemoryHotplug(def)) { + virBufferAsprintf(buf, + "%llu\n", + def->mem.memory_slots, def->mem.max_memory); +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 3040ddc..902dfb9 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2288,6 +2288,7 @@ struct _virDomainDef { + unsigned long long virDomainDefGetMemoryInitial(virDomainDefPtr def); + void virDomainDefSetMemoryInitial(virDomainDefPtr def, unsigned long long size); + unsigned long long virDomainDefGetMemoryActual(virDomainDefPtr def); ++bool virDomainDefHasMemoryHotplug(const virDomainDef *def); + + typedef enum { + VIR_DOMAIN_KEY_WRAP_CIPHER_NAME_AES, +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 9332194..335f8d0 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -215,6 +215,7 @@ virDomainDefGetMemoryActual; + virDomainDefGetMemoryInitial; + virDomainDefGetSecurityLabelDef; + virDomainDefHasDeviceAddress; ++virDomainDefHasMemoryHotplug; + virDomainDefMaybeAddController; + virDomainDefMaybeAddInput; + virDomainDefNeedsPlacementAdvice; +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 47d91c6..ade75e3 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9045,7 +9045,7 @@ qemuBuildCommandLine(virConnectPtr conn, + + virCommandAddArg(cmd, "-m"); + +- if (def->mem.max_memory) { ++ if (virDomainDefHasMemoryHotplug(def)) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PC_DIMM)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("memory hotplug isn't supported by this QEMU binary")); +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index e4a9c55..9d9fb06 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -1347,7 +1347,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, + } + + if (dev->type == VIR_DOMAIN_DEVICE_MEMORY && +- def->mem.max_memory == 0) { ++ !virDomainDefHasMemoryHotplug(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("maxMemory has to be specified when using memory " + "devices ")); +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 58fcb94..93f561f 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -2988,10 +2988,9 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver, + } + } + +- if (vm->def->mem.max_memory || ++ if (virDomainDefHasMemoryHotplug(vm->def) || + ((flags & VIR_MIGRATE_PERSIST_DEST) && +- vm->newDef && +- vm->newDef->mem.max_memory)) ++ vm->newDef && virDomainDefHasMemoryHotplug(vm->newDef))) + cookieFlags |= QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG; + + if (!(mig = qemuMigrationEatCookie(driver, vm, NULL, 0, 0))) +-- +2.5.3 + diff --git a/SOURCES/libvirt-conf-Add-ioeventfd-option-for-controllers.patch b/SOURCES/libvirt-conf-Add-ioeventfd-option-for-controllers.patch new file mode 100644 index 0000000..d9f76e7 --- /dev/null +++ b/SOURCES/libvirt-conf-Add-ioeventfd-option-for-controllers.patch @@ -0,0 +1,192 @@ +From 77f59c5205af71af094a1a87b2502a8e286369ef Mon Sep 17 00:00:00 2001 +Message-Id: <77f59c5205af71af094a1a87b2502a8e286369ef@dist-git> +From: Martin Kletzander +Date: Thu, 3 Sep 2015 15:55:43 +0200 +Subject: [PATCH] conf: Add ioeventfd option for controllers + +https://bugzilla.redhat.com/show_bug.cgi?id=1150484 + +This will be used with a virtio-scsi controller later on. + +Signed-off-by: Martin Kletzander +(cherry picked from commit 35eecddee3fd822285a4ac619ac972f3714e8edc) +Signed-off-by: Martin Kletzander + + Conflicts: + src/conf/domain_conf.c -- controller (sub)models +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 8 ++++++ + docs/schemas/domaincommon.rng | 3 +++ + src/conf/domain_conf.c | 20 +++++++++++++-- + src/conf/domain_conf.h | 1 + + .../qemuxml2argv-disk-virtio-scsi-ioeventfd.xml | 29 ++++++++++++++++++++++ + tests/qemuxml2xmltest.c | 1 + + 6 files changed, 60 insertions(+), 2 deletions(-) + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.xml + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index cb11b1f..0bf5845 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -3000,6 +3000,14 @@ + a sector is 512 bytes. + Since 1.2.7 (QEMU and KVM only) +
++
ioeventfd
++
++ The optional ioeventfd attribute specifies ++ whether the controller should use ++ ++ I/O asynchronous handling or not. Accepted values are ++ "on" and "off". Since 1.2.18 ++
+ +

+ USB companion controllers have an optional +diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng +index 1120003..1739015 100644 +--- a/docs/schemas/domaincommon.rng ++++ b/docs/schemas/domaincommon.rng +@@ -1790,6 +1790,9 @@ + + + ++ ++ ++ + + + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index b4503c3..15d3a5e 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -7734,6 +7734,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, + char *queues = NULL; + char *cmd_per_lun = NULL; + char *max_sectors = NULL; ++ char *ioeventfd = NULL; + xmlNodePtr saved = ctxt->node; + int rc; + +@@ -7779,6 +7780,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, + queues = virXMLPropString(cur, "queues"); + cmd_per_lun = virXMLPropString(cur, "cmd_per_lun"); + max_sectors = virXMLPropString(cur, "max_sectors"); ++ ioeventfd = virXMLPropString(cur, "ioeventfd"); + } + } + cur = cur->next; +@@ -7802,6 +7804,13 @@ virDomainControllerDefParseXML(xmlNodePtr node, + goto error; + } + ++ if (ioeventfd && ++ (def->ioeventfd = virTristateSwitchTypeFromString(ioeventfd)) < 0) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Malformed 'ioeventfd' value %s'"), max_sectors); ++ goto error; ++ } ++ + if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && + def->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) { + VIR_DEBUG("Ignoring device address for none model usb controller"); +@@ -7915,6 +7924,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, + VIR_FREE(queues); + VIR_FREE(cmd_per_lun); + VIR_FREE(max_sectors); ++ VIR_FREE(ioeventfd); + + return def; + +@@ -18980,12 +18990,13 @@ virDomainControllerDefFormat(virBufferPtr buf, + break; + } + +- if (def->queues || def->cmd_per_lun || def->max_sectors || ++ if (def->queues || def->cmd_per_lun || def->max_sectors || def->ioeventfd || + virDomainDeviceInfoNeedsFormat(&def->info, flags) || pcihole64) { + virBufferAddLit(buf, ">\n"); + virBufferAdjustIndent(buf, 2); + +- if (def->queues || def->cmd_per_lun || def->max_sectors) { ++ if (def->queues || def->cmd_per_lun || ++ def->max_sectors || def->ioeventfd) { + virBufferAddLit(buf, "queues) + virBufferAsprintf(buf, " queues='%u'", def->queues); +@@ -18995,6 +19006,11 @@ virDomainControllerDefFormat(virBufferPtr buf, + + if (def->max_sectors) + virBufferAsprintf(buf, " max_sectors='%u'", def->max_sectors); ++ ++ if (def->ioeventfd) { ++ virBufferAsprintf(buf, " ioeventfd='%s'", ++ virTristateSwitchTypeToString(def->ioeventfd)); ++ } + virBufferAddLit(buf, "/>\n"); + } + +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index ed0ccba..3040ddc 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -807,6 +807,7 @@ struct _virDomainControllerDef { + unsigned int queues; + unsigned int cmd_per_lun; + unsigned int max_sectors; ++ int ioeventfd; /* enum virTristateSwitch */ + union { + virDomainVirtioSerialOpts vioserial; + virDomainPCIControllerOpts pciopts; +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.xml +new file mode 100644 +index 0000000..f4487eb +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.xml +@@ -0,0 +1,29 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 8 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu ++ ++ ++ ++

++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c +index 09806b2..5f88c5d 100644 +--- a/tests/qemuxml2xmltest.c ++++ b/tests/qemuxml2xmltest.c +@@ -421,6 +421,7 @@ mymain(void) + DO_TEST("disk-virtio-scsi-num_queues"); + DO_TEST("disk-virtio-scsi-cmd_per_lun"); + DO_TEST("disk-virtio-scsi-max_sectors"); ++ DO_TEST("disk-virtio-scsi-ioeventfd"); + DO_TEST("disk-scsi-megasas"); + DO_TEST_DIFFERENT("disk-mirror-old"); + DO_TEST_FULL("disk-mirror", false, WHEN_ACTIVE); +-- +2.5.1 + diff --git a/SOURCES/libvirt-conf-Allow-error-reporting-in-virDomainDiskSourceIsBlockType.patch b/SOURCES/libvirt-conf-Allow-error-reporting-in-virDomainDiskSourceIsBlockType.patch new file mode 100644 index 0000000..5f07124 --- /dev/null +++ b/SOURCES/libvirt-conf-Allow-error-reporting-in-virDomainDiskSourceIsBlockType.patch @@ -0,0 +1,168 @@ +From c98b451c7f34d5884a59ae5514cd6334065362b2 Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Tue, 4 Aug 2015 08:05:52 -0400 +Subject: [PATCH] conf: Allow error reporting in virDomainDiskSourceIsBlockType + +https://bugzilla.redhat.com/show_bug.cgi?id=1238545 + +Rather than provide a somewhat generic error message when the API +returns false, allow the caller to supply a "report = true" option +in order to cause virReportError's to describe which of the 3 paths +that can cause failure. + +Some callers don't care about what caused the failure, they just want +to have a true/false - for those, calling with report = false should +be sufficient. + +(cherry picked from commit 36025c552cae6c79ab9e54f65e758907845846ac) +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 21 ++++++++++++++++++--- + src/conf/domain_conf.h | 2 +- + src/lxc/lxc_cgroup.c | 2 +- + src/lxc/lxc_driver.c | 6 ++---- + src/qemu/qemu_command.c | 5 +---- + src/qemu/qemu_conf.c | 6 +++--- + 6 files changed, 26 insertions(+), 16 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index d990180..72d87dd 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -23812,10 +23812,16 @@ virDomainDefFindDevice(virDomainDefPtr def, + * Return true if its source is block type, or false otherwise. + */ + bool +-virDomainDiskSourceIsBlockType(virStorageSourcePtr src) ++virDomainDiskSourceIsBlockType(virStorageSourcePtr src, ++ bool report) + { +- if (!src->path) ++ if (!src->path) { ++ if (report) ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("source path not found for device='lun' " ++ "using type='%d'"), src->type); + return false; ++ } + + if (src->type == VIR_STORAGE_TYPE_BLOCK) + return true; +@@ -23831,11 +23837,20 @@ virDomainDiskSourceIsBlockType(virStorageSourcePtr src) + * (e.g. set sgio=filtered|unfiltered for it) in libvirt. + */ + if (src->srcpool->pooltype == VIR_STORAGE_POOL_ISCSI && +- src->srcpool->mode == VIR_STORAGE_SOURCE_POOL_MODE_DIRECT) ++ src->srcpool->mode == VIR_STORAGE_SOURCE_POOL_MODE_DIRECT) { ++ if (report) ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("disk device='lun' for iSCSI is not " ++ "supported with mode='direct'.")); + return false; ++ } + + return true; + } ++ if (report) ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("disk device='lun' is only valid for block " ++ "type disk source")); + return false; + } + +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 0adaefc..604d0b8 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -3126,7 +3126,7 @@ int virDomainDefFindDevice(virDomainDefPtr def, + virDomainDeviceDefPtr dev, + bool reportError); + +-bool virDomainDiskSourceIsBlockType(virStorageSourcePtr src) ++bool virDomainDiskSourceIsBlockType(virStorageSourcePtr src, bool report) + ATTRIBUTE_NONNULL(1); + + void virDomainChrSourceDefClear(virDomainChrSourceDefPtr def); +diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c +index 507d567..e9caa3e 100644 +--- a/src/lxc/lxc_cgroup.c ++++ b/src/lxc/lxc_cgroup.c +@@ -382,7 +382,7 @@ static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def, + + VIR_DEBUG("Allowing any disk block devs"); + for (i = 0; i < def->ndisks; i++) { +- if (!virDomainDiskSourceIsBlockType(def->disks[i]->src)) ++ if (!virDomainDiskSourceIsBlockType(def->disks[i]->src, false)) + continue; + + if (virCgroupAllowDevicePath(cgroup, +diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c +index cc1277b..5ecfc7a 100644 +--- a/src/lxc/lxc_driver.c ++++ b/src/lxc/lxc_driver.c +@@ -4069,11 +4069,9 @@ lxcDomainAttachDeviceDiskLive(virLXCDriverPtr driver, + goto cleanup; + } + +- if (!virDomainDiskSourceIsBlockType(def->src)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("Can't setup disk for non-block device")); ++ if (!virDomainDiskSourceIsBlockType(def->src, true)) + goto cleanup; +- } ++ + src = virDomainDiskGetSource(def); + if (src == NULL) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 48d2ee0..feba308 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -3453,10 +3453,7 @@ qemuCheckDiskConfig(virDomainDiskDefPtr disk) + virStorageNetProtocolTypeToString(disk->src->protocol)); + goto error; + } +- } else if (!virDomainDiskSourceIsBlockType(disk->src)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("disk device='lun' is only valid for block " +- "type disk source")); ++ } else if (!virDomainDiskSourceIsBlockType(disk->src, true)) { + goto error; + } + if (disk->wwn) { +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index d521886..7c2947c 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1178,7 +1178,7 @@ qemuAddSharedDisk(virQEMUDriverPtr driver, + char *key = NULL; + int ret = -1; + +- if (!disk->src->shared || !virDomainDiskSourceIsBlockType(disk->src)) ++ if (!disk->src->shared || !virDomainDiskSourceIsBlockType(disk->src, false)) + return 0; + + qemuDriverLock(driver); +@@ -1315,7 +1315,7 @@ qemuRemoveSharedDisk(virQEMUDriverPtr driver, + char *key = NULL; + int ret = -1; + +- if (!disk->src->shared || !virDomainDiskSourceIsBlockType(disk->src)) ++ if (!disk->src->shared || !virDomainDiskSourceIsBlockType(disk->src, false)) + return 0; + + qemuDriverLock(driver); +@@ -1400,7 +1400,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + disk = dev->data.disk; + + if (disk->device != VIR_DOMAIN_DISK_DEVICE_LUN || +- !virDomainDiskSourceIsBlockType(disk->src)) ++ !virDomainDiskSourceIsBlockType(disk->src, false)) + return 0; + + path = virDomainDiskGetSource(disk); +-- +2.5.0 + diff --git a/SOURCES/libvirt-conf-Check-for-attach-disk-usage-of-iothread-0.patch b/SOURCES/libvirt-conf-Check-for-attach-disk-usage-of-iothread-0.patch new file mode 100644 index 0000000..3d4a7bf --- /dev/null +++ b/SOURCES/libvirt-conf-Check-for-attach-disk-usage-of-iothread-0.patch @@ -0,0 +1,37 @@ +From 17254fa42facf18071c99604472aa0b878ac904a Mon Sep 17 00:00:00 2001 +Message-Id: <17254fa42facf18071c99604472aa0b878ac904a@dist-git> +From: John Ferlan +Date: Thu, 20 Aug 2015 12:23:49 -0400 +Subject: [PATCH] conf: Check for attach disk usage of iothread=0 + +https://bugzilla.redhat.com/show_bug.cgi?id=1253108 + +Since iothreadid = 0 is invalid, we need to check for it when attempting +to add a disk; otherwise, someone would think/believe their attempt to +add an IOThread to the disk would succeed. Luckily other code ignored +things when ->iothread == 0... + +(cherry picked from commit cb5d0193aa13bf922136bb0fc7520f97b0af52f9) +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 9aee04f..b4503c3 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -7321,7 +7321,8 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, + } + + if (driverIOThread) { +- if (virStrToLong_uip(driverIOThread, NULL, 10, &def->iothread) < 0) { ++ if (virStrToLong_uip(driverIOThread, NULL, 10, &def->iothread) < 0 || ++ def->iothread == 0) { + virReportError(VIR_ERR_XML_ERROR, + _("Invalid iothread attribute in disk driver " + "element: %s"), driverIOThread); +-- +2.5.0 + diff --git a/SOURCES/libvirt-conf-Disallow-nonexistent-NUMA-nodes-for-hugepages.patch b/SOURCES/libvirt-conf-Disallow-nonexistent-NUMA-nodes-for-hugepages.patch deleted file mode 100644 index 5012610..0000000 --- a/SOURCES/libvirt-conf-Disallow-nonexistent-NUMA-nodes-for-hugepages.patch +++ /dev/null @@ -1,148 +0,0 @@ -From b6d5f5ac3f21362e2e790d3ad3bc3875652b6489 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Thu, 18 Sep 2014 14:39:57 +0200 -Subject: [PATCH] conf: Disallow nonexistent NUMA nodes for hugepages - -https://bugzilla.redhat.com/show_bug.cgi?id=1135396 - -As of 136ad4974 it is possible to specify different huge pages per -guest NUMA node. However, there's no check if nodeset specified in -./hugepages/page contains only those guest NUMA nodes that exist. -In other words with current code it is possible to define meaningless -combination: - - - - - - - - 4 - - - - - - - - - -Notice the node 4 in ? - -Signed-off-by: Michal Privoznik -(cherry picked from commit ec982f6d929f3c2343d4ea9b06e49c23e6c526ba) - -Conflicts: - tests/qemuxml2argvtest.c: Context as c7abf2c8 is not - backported yet. -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 24 ++++++++++++ - .../qemuxml2argv-hugepages-pages4.xml | 45 ++++++++++++++++++++++ - tests/qemuxml2argvtest.c | 2 + - 3 files changed, 71 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages4.xml - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 81395a8..45667d9 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -6549,6 +6549,30 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - goto cleanup; - } - -+ for (i = 0; i < def->mem.nhugepages; i++) { -+ ssize_t next_bit, pos = 0; -+ -+ if (!def->mem.hugepages[i].nodemask) { -+ /* This is the master hugepage to use. Skip it as it has no -+ * nodemask anyway. */ -+ continue; -+ } -+ -+ if (def->cpu && def->cpu->ncells) { -+ /* Fortunately, we allow only guest NUMA nodes to be continuous -+ * starting from zero. */ -+ pos = def->cpu->ncells - 1; -+ } -+ -+ next_bit = virBitmapNextSetBit(def->mem.hugepages[i].nodemask, pos); -+ if (next_bit >= 0) { -+ virReportError(VIR_ERR_XML_DETAIL, -+ _("hugepages: node %zd not found"), -+ next_bit); -+ goto cleanup; -+ } -+ } -+ - for (i = 0; i < def->cpu->ncells; i++) { - int cellmem = VIR_DIV_UP(def->cpu->cells[i].mem, 1024); - def->cpu->cells[i].mem = cellmem * 1024; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages4.xml b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages4.xml -new file mode 100644 -index 0000000..a3ed29b ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages4.xml -@@ -0,0 +1,45 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 4194304 -+ 4194304 -+ -+ -+ -+ -+ -+ -+ 4 -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 515058e..3b5f31a 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -686,6 +686,8 @@ mymain(void) - QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST("hugepages-shared", QEMU_CAPS_MEM_PATH, QEMU_CAPS_OBJECT_MEMORY_RAM, - QEMU_CAPS_OBJECT_MEMORY_FILE); -+ DO_TEST_FAILURE("hugepages-pages4", QEMU_CAPS_MEM_PATH, -+ QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST("nosharepages", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MEM_MERGE); - DO_TEST("disk-cdrom", NONE); - DO_TEST("disk-cdrom-network-http", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE, --- -2.1.0 - diff --git a/SOURCES/libvirt-conf-Document-all-VIR_DOMAIN_DEF_PARSE_-flags.patch b/SOURCES/libvirt-conf-Document-all-VIR_DOMAIN_DEF_PARSE_-flags.patch new file mode 100644 index 0000000..2503310 --- /dev/null +++ b/SOURCES/libvirt-conf-Document-all-VIR_DOMAIN_DEF_PARSE_-flags.patch @@ -0,0 +1,50 @@ +From 1a3e9b5e8b750025aa2c51ae5dd1cd2f98278340 Mon Sep 17 00:00:00 2001 +Message-Id: <1a3e9b5e8b750025aa2c51ae5dd1cd2f98278340@dist-git> +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:40 +0200 +Subject: [PATCH] conf: Document all VIR_DOMAIN_DEF_PARSE_* flags + +https://bugzilla.redhat.com/show_bug.cgi?id=1252685 + +(cherry picked from commit 24e3b0eda1373608c1c4f1176530d324418ae82b) + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.h | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index e0102db..63685c6 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2593,19 +2593,25 @@ void virDomainObjListRemoveLocked(virDomainObjListPtr doms, + typedef enum { + /* parse internal domain status information */ + VIR_DOMAIN_DEF_PARSE_STATUS = 1 << 0, ++ /* Parse only parts of the XML that would be present in an inactive libvirt ++ * XML. Note that the flag does not imply that ABI incompatible ++ * transformations can be used, since it's used to strip runtime info when ++ * restoring save images/migration. */ + VIR_DOMAIN_DEF_PARSE_INACTIVE = 1 << 1, + /* parse element */ + VIR_DOMAIN_DEF_PARSE_ACTUAL_NET = 1 << 2, + /* parse original states of host PCI device */ + VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES = 1 << 3, ++ /* internal flag passed to device info sub-parser to allow using */ + VIR_DOMAIN_DEF_PARSE_ALLOW_ROM = 1 << 4, ++ /* internal flag passed to device info sub-parser to allow specifying boot order */ + VIR_DOMAIN_DEF_PARSE_ALLOW_BOOT = 1 << 5, + /* parse only source half of */ + VIR_DOMAIN_DEF_PARSE_DISK_SOURCE = 1 << 6, ++ /* perform RNG schema validation on the passed XML document */ + VIR_DOMAIN_DEF_PARSE_VALIDATE = 1 << 7, + /* don't validate os.type and arch against capabilities. Prevents +- * VMs from disappearing when qemu is removed and libvirtd is restarted +- */ ++ * VMs from disappearing when qemu is removed and libvirtd is restarted */ + VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS = 1 << 8, + } virDomainDefParseFlags; + +-- +2.5.3 + diff --git a/SOURCES/libvirt-conf-Don-t-allow-duplicated-target-names-regardless-of-bus.patch b/SOURCES/libvirt-conf-Don-t-allow-duplicated-target-names-regardless-of-bus.patch new file mode 100644 index 0000000..a17e7de --- /dev/null +++ b/SOURCES/libvirt-conf-Don-t-allow-duplicated-target-names-regardless-of-bus.patch @@ -0,0 +1,96 @@ +From fbced70807b7564359803a3877fa796c90b32f9f Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Thu, 9 Jul 2015 08:45:36 -0400 +Subject: [PATCH] conf: Don't allow duplicated target names regardless of bus + +https://bugzilla.redhat.com/show_bug.cgi?id=1142631 + +Commit id 'e0e290552' added a check to determine if the same bus +had the same target value. It seems that's not quite good enough +as the check should check the target name value regardless of bus type. + +Also added a DO_TEST_DIFFERENT to exhibit the issue + +(cherry picked from commit 2e09729b1c1cc0096be4edd2d939bf1044aec506) +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 3 +- + .../qemuxml2argv-disk-same-targets.xml | 35 ++++++++++++++++++++++ + tests/qemuxml2argvtest.c | 3 ++ + 3 files changed, 39 insertions(+), 2 deletions(-) + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-same-targets.xml + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 006e04e..f3416cf 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -12656,8 +12656,7 @@ virDomainDiskDefDstDuplicates(virDomainDefPtr def) + + for (i = 1; i < def->ndisks; i++) { + for (j = 0; j < i; j++) { +- if (def->disks[i]->bus == def->disks[j]->bus && +- STREQ(def->disks[i]->dst, def->disks[j]->dst)) { ++ if (STREQ(def->disks[i]->dst, def->disks[j]->dst)) { + virReportError(VIR_ERR_XML_ERROR, + _("target '%s' duplicated for disk sources " + "'%s' and '%s'"), +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-same-targets.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-same-targets.xml +new file mode 100644 +index 0000000..3276ce5 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-same-targets.xml +@@ -0,0 +1,35 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index bee6637..4290c06 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -903,6 +903,9 @@ mymain(void) + QEMU_CAPS_DEVICE); + DO_TEST("disk-snapshot", + QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_CACHE_V2, QEMU_CAPS_DRIVE_FORMAT); ++ DO_TEST_FAILURE("disk-same-targets", ++ QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_SCSI_LSI, ++ QEMU_CAPS_DEVICE_USB_STORAGE, QEMU_CAPS_NODEFCONFIG); + DO_TEST("event_idx", + QEMU_CAPS_DRIVE, + QEMU_CAPS_VIRTIO_BLK_EVENT_IDX, +-- +2.4.5 + diff --git a/SOURCES/libvirt-conf-Don-t-always-recalculate-initial-memory-size-from-NUMA-size-totals.patch b/SOURCES/libvirt-conf-Don-t-always-recalculate-initial-memory-size-from-NUMA-size-totals.patch new file mode 100644 index 0000000..1e87d36 --- /dev/null +++ b/SOURCES/libvirt-conf-Don-t-always-recalculate-initial-memory-size-from-NUMA-size-totals.patch @@ -0,0 +1,151 @@ +From ab98ed58d652aff099c8ed1269d01ed23ea81342 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:45 +0200 +Subject: [PATCH] conf: Don't always recalculate initial memory size from NUMA + size totals + +https://bugzilla.redhat.com/show_bug.cgi?id=1252685 + +When implementing memory hotplug I've opted to recalculate the initial +memory size (contents of the element) as a sum of the sizes of +NUMA nodes when NUMA was enabled. This was based on an assumption that +qemu did not allow starting when the NUMA node size total didn't equal +to the initial memory size. Unfortunately the check was introduced to +qemu just lately. + +This patch uses the new XML parser flag to decide whether it's safe to +update the memory size total from the NUMA cell sizes or not. + +As an additional improvement we now report an error in case when the +size of hotplug memory would exceed the total memory size. + +The rest of the changes assures that the function is called with correct +flags. + +(cherry picked from commit 0fed5a7bc79865fe00fd5a328a2e520934c52ff7) + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 37 +++++++++++++++++++++++++++++-------- + src/conf/domain_conf.h | 1 + + src/qemu/qemu_command.c | 3 ++- + 3 files changed, 32 insertions(+), 9 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 3625310..f5320fe 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -3640,15 +3640,34 @@ virDomainDefRemoveDuplicateMetadata(virDomainDefPtr def) + + + static int +-virDomainDefPostParseMemory(virDomainDefPtr def) ++virDomainDefPostParseMemory(virDomainDefPtr def, ++ unsigned int parseFlags) + { + size_t i; ++ unsigned long long numaMemory = 0; ++ unsigned long long hotplugMemory = 0; + +- if ((def->mem.initial_memory = virDomainNumaGetMemorySize(def->numa)) == 0) { +- def->mem.initial_memory = def->mem.total_memory; ++ /* Attempt to infer the initial memory size from the sum NUMA memory sizes ++ * in case ABI updates are allowed or the element wasn't specified */ ++ if (def->mem.total_memory == 0 || ++ parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) ++ numaMemory = virDomainNumaGetMemorySize(def->numa); + ++ if (numaMemory) { ++ virDomainDefSetMemoryInitial(def, numaMemory); ++ } else { ++ /* calculate the sizes of hotplug memory */ + for (i = 0; i < def->nmems; i++) +- def->mem.initial_memory -= def->mems[i]->size; ++ hotplugMemory += def->mems[i]->size; ++ ++ if (hotplugMemory > def->mem.total_memory) { ++ virReportError(VIR_ERR_XML_ERROR, "%s", ++ _("Total size of memory devices exceeds the total " ++ "memory size")); ++ return -1; ++ } ++ ++ virDomainDefSetMemoryInitial(def, def->mem.total_memory - hotplugMemory); + } + + if (virDomainDefGetMemoryInitial(def) == 0) { +@@ -3684,7 +3703,8 @@ virDomainDefPostParseMemory(virDomainDefPtr def) + + static int + virDomainDefPostParseInternal(virDomainDefPtr def, +- virCapsPtr caps ATTRIBUTE_UNUSED) ++ virCapsPtr caps ATTRIBUTE_UNUSED, ++ unsigned int parseFlags) + { + size_t i; + +@@ -3695,7 +3715,7 @@ virDomainDefPostParseInternal(virDomainDefPtr def, + return -1; + } + +- if (virDomainDefPostParseMemory(def) < 0) ++ if (virDomainDefPostParseMemory(def, parseFlags) < 0) + return -1; + + /* +@@ -3993,6 +4013,7 @@ virDomainDefPostParseDeviceIterator(virDomainDefPtr def ATTRIBUTE_UNUSED, + int + virDomainDefPostParse(virDomainDefPtr def, + virCapsPtr caps, ++ unsigned int parseFlags, + virDomainXMLOptionPtr xmlopt) + { + int ret; +@@ -4018,7 +4039,7 @@ virDomainDefPostParse(virDomainDefPtr def, + return ret; + + +- if ((ret = virDomainDefPostParseInternal(def, caps)) < 0) ++ if ((ret = virDomainDefPostParseInternal(def, caps, parseFlags)) < 0) + return ret; + + return 0; +@@ -16278,7 +16299,7 @@ virDomainDefParseXML(xmlDocPtr xml, + goto error; + + /* callback to fill driver specific domain aspects */ +- if (virDomainDefPostParse(def, caps, xmlopt) < 0) ++ if (virDomainDefPostParse(def, caps, flags, xmlopt) < 0) + goto error; + + /* Auto-add any implied controllers which aren't present */ +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 61bf963..e322adf 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2423,6 +2423,7 @@ virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt) + int + virDomainDefPostParse(virDomainDefPtr def, + virCapsPtr caps, ++ unsigned int parseFlags, + virDomainXMLOptionPtr xmlopt); + + static inline bool +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 3fd695b..701ccc3 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -13672,7 +13672,8 @@ qemuParseCommandLine(virCapsPtr qemuCaps, + if (virDomainDefAddImplicitControllers(def) < 0) + goto error; + +- if (virDomainDefPostParse(def, qemuCaps, xmlopt) < 0) ++ if (virDomainDefPostParse(def, qemuCaps, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, ++ xmlopt) < 0) + goto error; + + if (cmd->num_args || cmd->num_env) { +-- +2.5.3 + diff --git a/SOURCES/libvirt-conf-Don-t-format-actual-network-definition-in-migratable-XML.patch b/SOURCES/libvirt-conf-Don-t-format-actual-network-definition-in-migratable-XML.patch deleted file mode 100644 index e18201c..0000000 --- a/SOURCES/libvirt-conf-Don-t-format-actual-network-definition-in-migratable-XML.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 0373f12faad115fd5ff148ec7b4952a04e9bbdd9 Mon Sep 17 00:00:00 2001 -Message-Id: <0373f12faad115fd5ff148ec7b4952a04e9bbdd9@dist-git> -From: Luyao Huang -Date: Thu, 25 Dec 2014 11:38:00 +0800 -Subject: [PATCH] conf: Don't format actual network definition in migratable - XML - -https://bugzilla.redhat.com/show_bug.cgi?id=1177194 - -When migrate a vm, we will generate a xml via qemuDomainDefFormatLive and -pass this xml to target libvirtd. Libvirt will use the current network -state in def->data.network.actual to generate the xml, this will make -migrate failed when we set a network type guest interface use a macvtap -network as a source in a vm then migrate vm to another host(which has the -different macvtap network settings: different interface name, bridge name...) - -Add a flag check in virDomainNetDefFormat, if we set a VIR_DOMAIN_XML_MIGRATABLE -flag when call virDomainNetDefFormat, we won't get the current vm interface -state. - -Signed-off-by: Luyao Huang -Signed-off-by: Jiri Denemark -(cherry picked from commit db19a4a3c6f72e464bc3ad00e904d8df13887382) -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 19 ++++++++++++------- - 1 file changed, 12 insertions(+), 7 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 8c161b5..bbd204a 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -16977,18 +16977,23 @@ virDomainNetDefFormat(virBufferPtr buf, - virDomainNetDefPtr def, - unsigned int flags) - { -- /* publicActual is true if we should report the current state in -- * def->data.network.actual *instead of* the config (*not* in -- * addition to) -- */ - unsigned int actualType = virDomainNetGetActualType(def); -- bool publicActual -- = (def->type == VIR_DOMAIN_NET_TYPE_NETWORK && def->data.network.actual && -- !(flags & (VIR_DOMAIN_XML_INACTIVE | VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET))); -+ bool publicActual = false; - const char *typeStr; - virDomainHostdevDefPtr hostdef = NULL; - char macstr[VIR_MAC_STRING_BUFLEN]; - -+ /* publicActual is true if we should report the current state in -+ * def->data.network.actual *instead of* the config (*not* in -+ * addition to) -+ */ -+ if (def->type == VIR_DOMAIN_NET_TYPE_NETWORK && -+ def->data.network.actual && -+ !(flags & (VIR_DOMAIN_XML_INACTIVE | -+ VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET | -+ VIR_DOMAIN_XML_MIGRATABLE))) -+ publicActual = true; -+ - if (publicActual) { - if (!(typeStr = virDomainNetTypeToString(actualType))) { - virReportError(VIR_ERR_INTERNAL_ERROR, --- -2.2.1 - diff --git a/SOURCES/libvirt-conf-Don-t-try-formating-non-existing-addresses.patch b/SOURCES/libvirt-conf-Don-t-try-formating-non-existing-addresses.patch new file mode 100644 index 0000000..3b58561 --- /dev/null +++ b/SOURCES/libvirt-conf-Don-t-try-formating-non-existing-addresses.patch @@ -0,0 +1,138 @@ +From 82e798b603e50a2177f485294cb984590627c504 Mon Sep 17 00:00:00 2001 +Message-Id: <82e798b603e50a2177f485294cb984590627c504@dist-git> +From: Martin Kletzander +Date: Tue, 11 Aug 2015 13:13:13 -0400 +Subject: [PATCH] conf: Don't try formating non-existing addresses + +Commit a6f9af8292b6 added checking for address colisions between +starting and ending addresses of forwarding addresses, but forgot that +there might be no addresses set at all. + +This fixes an error in the original patch for: + + https://bugzilla.redhat.com/show_bug.cgi?id=985653 + +Signed-off-by: Martin Kletzander +(cherry picked from commit 1f24c1494a85d663fa36047922a7974a292a46a7) +Signed-off-by: Jiri Denemark +--- + src/conf/network_conf.c | 23 ++++++++++++++++--- + .../nat-network-forward-nat-no-address.xml | 25 +++++++++++++++++++++ + .../nat-network-forward-nat-no-address.xml | 26 ++++++++++++++++++++++ + tests/networkxml2xmltest.c | 1 + + 4 files changed, 72 insertions(+), 3 deletions(-) + create mode 100644 tests/networkxml2xmlin/nat-network-forward-nat-no-address.xml + create mode 100644 tests/networkxml2xmlout/nat-network-forward-nat-no-address.xml + +diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c +index b03c2fd..e765c65 100644 +--- a/src/conf/network_conf.c ++++ b/src/conf/network_conf.c +@@ -1729,9 +1729,26 @@ virNetworkForwardNatDefParseXML(const char *networkName, + goto cleanup; + } + +- /* verify that start <= end */ +- if (virSocketAddrGetRange(&def->addr.start, &def->addr.end, NULL, 0) < 0) +- goto cleanup; ++ if (addrStart && addrEnd) { ++ /* verify that start <= end */ ++ if (virSocketAddrGetRange(&def->addr.start, &def->addr.end, NULL, 0) < 0) ++ goto cleanup; ++ } else { ++ if (addrStart) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Only start address '%s' specified in in " ++ " in network '%s'"), ++ addrStart, networkName); ++ goto cleanup; ++ } ++ if (addrEnd) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Only end address '%s' specified in in " ++ " in network '%s'"), ++ addrEnd, networkName); ++ goto cleanup; ++ } ++ } + + /* ports for SNAT and MASQUERADE */ + nNatPorts = virXPathNodeSet("./port", ctxt, &natPortNodes); +diff --git a/tests/networkxml2xmlin/nat-network-forward-nat-no-address.xml b/tests/networkxml2xmlin/nat-network-forward-nat-no-address.xml +new file mode 100644 +index 0000000..97a6452 +--- /dev/null ++++ b/tests/networkxml2xmlin/nat-network-forward-nat-no-address.xml +@@ -0,0 +1,25 @@ ++ ++ default ++ 81ff0d90-c91e-6742-64da-4a736edb9a9b ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/networkxml2xmlout/nat-network-forward-nat-no-address.xml b/tests/networkxml2xmlout/nat-network-forward-nat-no-address.xml +new file mode 100644 +index 0000000..f19e34d +--- /dev/null ++++ b/tests/networkxml2xmlout/nat-network-forward-nat-no-address.xml +@@ -0,0 +1,26 @@ ++ ++ default ++ 81ff0d90-c91e-6742-64da-4a736edb9a9b ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c +index 290336e..8d60aa8 100644 +--- a/tests/networkxml2xmltest.c ++++ b/tests/networkxml2xmltest.c +@@ -99,6 +99,7 @@ mymain(void) + DO_TEST("nat-network-dns-forward-plain"); + DO_TEST("nat-network-dns-forwarders"); + DO_TEST("nat-network-forward-nat-address"); ++ DO_TEST("nat-network-forward-nat-no-address"); + DO_TEST("8021Qbh-net"); + DO_TEST("direct-net"); + DO_TEST("host-bridge-net"); +-- +2.5.0 + diff --git a/SOURCES/libvirt-conf-Drop-VIR_DOMAIN_DEF_PARSE_CLOCK_ADJUST-flag.patch b/SOURCES/libvirt-conf-Drop-VIR_DOMAIN_DEF_PARSE_CLOCK_ADJUST-flag.patch new file mode 100644 index 0000000..5000cd8 --- /dev/null +++ b/SOURCES/libvirt-conf-Drop-VIR_DOMAIN_DEF_PARSE_CLOCK_ADJUST-flag.patch @@ -0,0 +1,72 @@ +From 73ef3128010cfa342184fd47c798673b072cecf4 Mon Sep 17 00:00:00 2001 +Message-Id: <73ef3128010cfa342184fd47c798673b072cecf4@dist-git> +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:39 +0200 +Subject: [PATCH] conf: Drop VIR_DOMAIN_DEF_PARSE_CLOCK_ADJUST flag + +https://bugzilla.redhat.com/show_bug.cgi?id=1252685 + +The flag was used only for formatting the XML and once the parser and +formatter flags were split in 0ecd6851093945dd5ddc78266c61b577c65394ae +it doesn't make sense any more to have it. + +(cherry picked from commit ed94ad9e40a029d552c005a5d5f214af5fc43558) + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 1 - + src/conf/domain_conf.h | 7 +++---- + tests/qemuxml2xmltest.c | 3 +-- + 3 files changed, 4 insertions(+), 7 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 2dc5912..3a3c238 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -22521,7 +22521,6 @@ virDomainObjListLoadStatus(virDomainObjListPtr doms, + VIR_DOMAIN_DEF_PARSE_STATUS | + VIR_DOMAIN_DEF_PARSE_ACTUAL_NET | + VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES | +- VIR_DOMAIN_DEF_PARSE_CLOCK_ADJUST | + VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS))) + goto error; + +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 902dfb9..e0102db 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2600,14 +2600,13 @@ typedef enum { + VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES = 1 << 3, + VIR_DOMAIN_DEF_PARSE_ALLOW_ROM = 1 << 4, + VIR_DOMAIN_DEF_PARSE_ALLOW_BOOT = 1 << 5, +- VIR_DOMAIN_DEF_PARSE_CLOCK_ADJUST = 1 << 6, + /* parse only source half of */ +- VIR_DOMAIN_DEF_PARSE_DISK_SOURCE = 1 << 7, +- VIR_DOMAIN_DEF_PARSE_VALIDATE = 1 << 8, ++ VIR_DOMAIN_DEF_PARSE_DISK_SOURCE = 1 << 6, ++ VIR_DOMAIN_DEF_PARSE_VALIDATE = 1 << 7, + /* don't validate os.type and arch against capabilities. Prevents + * VMs from disappearing when qemu is removed and libvirtd is restarted + */ +- VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS = 1 << 9, ++ VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS = 1 << 8, + } virDomainDefParseFlags; + + typedef enum { +diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c +index d498610..03bfbda 100644 +--- a/tests/qemuxml2xmltest.c ++++ b/tests/qemuxml2xmltest.c +@@ -180,8 +180,7 @@ testCompareStatusXMLToXMLFiles(const void *opaque) + driver.caps, driver.xmlopt, + VIR_DOMAIN_DEF_PARSE_STATUS | + VIR_DOMAIN_DEF_PARSE_ACTUAL_NET | +- VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES | +- VIR_DOMAIN_DEF_PARSE_CLOCK_ADJUST))) { ++ VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES))) { + fprintf(stderr, "Failed to parse domain status XML:\n%s", source); + goto cleanup; + } +-- +2.5.3 + diff --git a/SOURCES/libvirt-conf-Extend-loader-and-introduce-nvram.patch b/SOURCES/libvirt-conf-Extend-loader-and-introduce-nvram.patch deleted file mode 100644 index d41af10..0000000 --- a/SOURCES/libvirt-conf-Extend-loader-and-introduce-nvram.patch +++ /dev/null @@ -1,1303 +0,0 @@ -From 343c98ebdcb3a75cf8a2b8b496da3887ec8f87c3 Mon Sep 17 00:00:00 2001 -Message-Id: <343c98ebdcb3a75cf8a2b8b496da3887ec8f87c3@dist-git> -From: Michal Privoznik -Date: Wed, 10 Sep 2014 10:11:43 +0200 -Subject: [PATCH] conf: Extend and introduce - -https://bugzilla.redhat.com/show_bug.cgi?id=1112257 - -Up to now, users can configure BIOS via the element. With -the upcoming implementation of UEFI this is not enough as BIOS and -UEFI are conceptually different. For instance, while BIOS is ROM, UEFI -is programmable flash (although all writes to code section are -denied). Therefore we need new attribute @type which will -differentiate the two. Then, new attribute @readonly is introduced to -reflect the fact that some images are RO. - -Moreover, the OVMF (which is going to be used mostly), works in two -modes: -1) Code and UEFI variable store is mixed in one file. -2) Code and UEFI variable store is separated in two files - -The latter has advantage of updating the UEFI code without losing the -configuration. However, in order to represent the latter case we need -yet another XML element: . Currently, it has no additional -attributes, it's just a bare element containing path to the variable -store file. - -Signed-off-by: Michal Privoznik -Acked-by: Laszlo Ersek -Signed-off-by: Michal Privoznik -(cherry picked from commit 68bf13dbef8342eaee0bf57c73cebb60b7de11e8) -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 19 ++++- - docs/schemas/domaincommon.rng | 21 ++++++ - src/conf/domain_conf.c | 87 +++++++++++++++++++++- - src/conf/domain_conf.h | 22 +++++- - src/libvirt_private.syms | 3 + - src/qemu/qemu_command.c | 5 +- - src/security/virt-aa-helper.c | 4 +- - src/vbox/vbox_common.c | 7 +- - src/xenapi/xenapi_driver.c | 3 +- - src/xenconfig/xen_common.c | 7 +- - src/xenconfig/xen_sxpr.c | 16 ++-- - tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.xml | 40 ++++++++++ - .../qemuxml2xmlout-pci-bridge-many-disks.xml | 2 +- - tests/qemuxml2xmltest.c | 2 + - tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml | 2 +- - .../sexpr2xml-fv-serial-dev-2-ports.xml | 2 +- - .../sexpr2xml-fv-serial-dev-2nd-port.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml | 2 +- - .../sexpr2xml-fv-serial-tcp-telnet.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-sound.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-utc.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv-v2.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-fv.xml | 2 +- - tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml | 2 +- - tests/xmconfigdata/test-escape-paths.xml | 2 +- - tests/xmconfigdata/test-fullvirt-force-hpet.xml | 2 +- - tests/xmconfigdata/test-fullvirt-force-nohpet.xml | 2 +- - tests/xmconfigdata/test-fullvirt-localtime.xml | 2 +- - tests/xmconfigdata/test-fullvirt-net-ioemu.xml | 2 +- - tests/xmconfigdata/test-fullvirt-net-netfront.xml | 2 +- - tests/xmconfigdata/test-fullvirt-new-cdrom.xml | 2 +- - tests/xmconfigdata/test-fullvirt-old-cdrom.xml | 2 +- - tests/xmconfigdata/test-fullvirt-parallel-tcp.xml | 2 +- - .../test-fullvirt-serial-dev-2-ports.xml | 2 +- - .../test-fullvirt-serial-dev-2nd-port.xml | 2 +- - tests/xmconfigdata/test-fullvirt-serial-file.xml | 2 +- - tests/xmconfigdata/test-fullvirt-serial-null.xml | 2 +- - tests/xmconfigdata/test-fullvirt-serial-pipe.xml | 2 +- - tests/xmconfigdata/test-fullvirt-serial-pty.xml | 2 +- - tests/xmconfigdata/test-fullvirt-serial-stdio.xml | 2 +- - .../test-fullvirt-serial-tcp-telnet.xml | 2 +- - tests/xmconfigdata/test-fullvirt-serial-tcp.xml | 2 +- - tests/xmconfigdata/test-fullvirt-serial-udp.xml | 2 +- - tests/xmconfigdata/test-fullvirt-serial-unix.xml | 2 +- - tests/xmconfigdata/test-fullvirt-sound.xml | 2 +- - tests/xmconfigdata/test-fullvirt-usbmouse.xml | 2 +- - tests/xmconfigdata/test-fullvirt-usbtablet.xml | 2 +- - tests/xmconfigdata/test-fullvirt-utc.xml | 2 +- - tests/xmconfigdata/test-no-source-cdrom.xml | 2 +- - tests/xmconfigdata/test-pci-devs.xml | 2 +- - 69 files changed, 269 insertions(+), 79 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 94236dd..757035a 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -102,7 +102,8 @@ - ... - <os> - <type>hvm</type> -- <loader>/usr/lib/xen/boot/hvmloader</loader> -+ <loader readonly='on' type='rom'>/usr/lib/xen/boot/hvmloader</loader> -+ <nvram>/var/lib/libvirt/nvram/guest_VARS.fd</nvram> - <boot dev='hd'/> - <boot dev='cdrom'/> - <bootmenu enable='yes' timeout='3000'/> -@@ -129,7 +130,21 @@ - used to assist the domain creation process. It is used by Xen - fully virtualized domains as well as setting the QEMU BIOS file - path for QEMU/KVM domains. Xen since 0.1.0, -- QEMU/KVM since 0.9.12 -+ QEMU/KVM since 0.9.12 Then, since -+ 1.2.8 it's possible for the element to have two -+ optional attributes: readonly (accepted values are -+ yes and no) to reflect the fact that the -+ image should be writable or read-only. The second attribute -+ type accepts values rom and -+ pflash. It tells the hypervisor where in the guest -+ memory the file should be mapped. For instance, if the loader -+ path points to an UEFI image, type should be -+ pflash. -+
nvram
-+
Some UEFI firmwares may want to use a non-volatile memory to store -+ some variables. In the host, this is represented as a file and the -+ path to the file is stored in this element. Since -+ 1.2.8
-
boot
-
The dev attribute takes one of the values "fd", "hd", - "cdrom" or "network" and is used to specify the next boot device -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index cedceae..5d9c21c 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -242,6 +242,27 @@ - - - -+ -+ -+ -+ yes -+ no -+ -+ -+ -+ -+ -+ -+ rom -+ pflash -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 53ef694..6ee5c17 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -777,6 +777,11 @@ VIR_ENUM_IMPL(virDomainDiskMirrorState, VIR_DOMAIN_DISK_MIRROR_STATE_LAST, - "abort", - "pivot") - -+VIR_ENUM_IMPL(virDomainLoader, -+ VIR_DOMAIN_LOADER_TYPE_LAST, -+ "rom", -+ "pflash") -+ - /* Internal mapping: subset of block job types that can be present in - * XML (remaining types are not two-phase). */ - VIR_ENUM_DECL(virDomainBlockJob) -@@ -2010,6 +2015,17 @@ virDomainPanicDefFree(virDomainPanicDefPtr panic) - VIR_FREE(panic); - } - -+void -+virDomainLoaderDefFree(virDomainLoaderDefPtr loader) -+{ -+ if (!loader) -+ return; -+ -+ VIR_FREE(loader->path); -+ VIR_FREE(loader->nvram); -+ VIR_FREE(loader); -+} -+ - void virDomainDefFree(virDomainDefPtr def) - { - size_t i; -@@ -2115,7 +2131,7 @@ void virDomainDefFree(virDomainDefPtr def) - VIR_FREE(def->os.cmdline); - VIR_FREE(def->os.dtb); - VIR_FREE(def->os.root); -- VIR_FREE(def->os.loader); -+ virDomainLoaderDefFree(def->os.loader); - VIR_FREE(def->os.bootloader); - VIR_FREE(def->os.bootloaderArgs); - -@@ -11661,6 +11677,42 @@ virDomainDefMaybeAddHostdevSCSIcontroller(virDomainDefPtr def) - return 0; - } - -+static int -+virDomainLoaderDefParseXML(xmlNodePtr node, -+ virDomainLoaderDefPtr loader) -+{ -+ int ret = -1; -+ char *readonly_str = NULL; -+ char *type_str = NULL; -+ -+ readonly_str = virXMLPropString(node, "readonly"); -+ type_str = virXMLPropString(node, "type"); -+ loader->path = (char *) xmlNodeGetContent(node); -+ -+ if (readonly_str && -+ (loader->readonly = virTristateBoolTypeFromString(readonly_str)) <= 0) { -+ virReportError(VIR_ERR_XML_DETAIL, -+ _("unknown readonly value: %s"), readonly_str); -+ goto cleanup; -+ } -+ -+ if (type_str) { -+ int type; -+ if ((type = virDomainLoaderTypeFromString(type_str)) < 0) { -+ virReportError(VIR_ERR_XML_DETAIL, -+ _("unknown type value: %s"), type_str); -+ goto cleanup; -+ } -+ loader->type = type; -+ } -+ -+ ret = 0; -+ cleanup: -+ VIR_FREE(readonly_str); -+ VIR_FREE(type_str); -+ return ret; -+} -+ - static virDomainDefPtr - virDomainDefParseXML(xmlDocPtr xml, - xmlNodePtr root, -@@ -12701,12 +12753,22 @@ virDomainDefParseXML(xmlDocPtr xml, - if (STREQ(def->os.type, "xen") || - STREQ(def->os.type, "hvm") || - STREQ(def->os.type, "uml")) { -+ xmlNodePtr loader_node; -+ - def->os.kernel = virXPathString("string(./os/kernel[1])", ctxt); - def->os.initrd = virXPathString("string(./os/initrd[1])", ctxt); - def->os.cmdline = virXPathString("string(./os/cmdline[1])", ctxt); - def->os.dtb = virXPathString("string(./os/dtb[1])", ctxt); - def->os.root = virXPathString("string(./os/root[1])", ctxt); -- def->os.loader = virXPathString("string(./os/loader[1])", ctxt); -+ if ((loader_node = virXPathNode("./os/loader[1]", ctxt))) { -+ if (VIR_ALLOC(def->os.loader) < 0) -+ goto error; -+ -+ if (virDomainLoaderDefParseXML(loader_node, def->os.loader) < 0) -+ goto error; -+ -+ def->os.loader->nvram = virXPathString("string(./os/nvram[1])", ctxt); -+ } - } - - if (STREQ(def->os.type, "hvm")) { -@@ -17789,6 +17851,23 @@ virDomainHugepagesFormat(virBufferPtr buf, - virBufferAddLit(buf, "\n"); - } - -+static void -+virDomainLoaderDefFormat(virBufferPtr buf, -+ virDomainLoaderDefPtr loader) -+{ -+ const char *readonly = virTristateBoolTypeToString(loader->readonly); -+ const char *type = virDomainLoaderTypeToString(loader->type); -+ -+ virBufferAddLit(buf, "readonly) -+ virBufferAsprintf(buf, " readonly='%s'", readonly); -+ -+ virBufferAsprintf(buf, " type='%s'>", type); -+ -+ virBufferEscapeString(buf, "%s\n", loader->path); -+ virBufferEscapeString(buf, "%s\n", loader->nvram); -+} - - static bool - virDomainDefHasCapabilitiesFeatures(virDomainDefPtr def) -@@ -18109,8 +18188,8 @@ virDomainDefFormatInternal(virDomainDefPtr def, - for (i = 0; def->os.initargv && def->os.initargv[i]; i++) - virBufferEscapeString(buf, "%s\n", - def->os.initargv[i]); -- virBufferEscapeString(buf, "%s\n", -- def->os.loader); -+ if (def->os.loader) -+ virDomainLoaderDefFormat(buf, def->os.loader); - virBufferEscapeString(buf, "%s\n", - def->os.kernel); - virBufferEscapeString(buf, "%s\n", -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 9586c3b..c97a10c 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -1628,6 +1628,26 @@ struct _virDomainBIOSDef { - int rt_delay; - }; - -+typedef enum { -+ VIR_DOMAIN_LOADER_TYPE_ROM = 0, -+ VIR_DOMAIN_LOADER_TYPE_PFLASH, -+ -+ VIR_DOMAIN_LOADER_TYPE_LAST -+} virDomainLoader; -+ -+VIR_ENUM_DECL(virDomainLoader) -+ -+typedef struct _virDomainLoaderDef virDomainLoaderDef; -+typedef virDomainLoaderDef *virDomainLoaderDefPtr; -+struct _virDomainLoaderDef { -+ char *path; -+ int readonly; /* enum virTristateBool */ -+ virDomainLoader type; -+ char *nvram; /* path to non-volatile RAM */ -+}; -+ -+void virDomainLoaderDefFree(virDomainLoaderDefPtr loader); -+ - /* Operating system configuration data & machine / arch */ - typedef struct _virDomainOSDef virDomainOSDef; - typedef virDomainOSDef *virDomainOSDefPtr; -@@ -1647,7 +1667,7 @@ struct _virDomainOSDef { - char *cmdline; - char *dtb; - char *root; -- char *loader; -+ virDomainLoaderDefPtr loader; - char *bootloader; - char *bootloaderArgs; - int smbios_mode; -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index 71fc063..b4b13f9 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -313,6 +313,9 @@ virDomainLifecycleTypeFromString; - virDomainLifecycleTypeToString; - virDomainListFree; - virDomainLiveConfigHelperMethod; -+virDomainLoaderDefFree; -+virDomainLoaderTypeFromString; -+virDomainLoaderTypeToString; - virDomainLockFailureTypeFromString; - virDomainLockFailureTypeToString; - virDomainMemballoonModelTypeFromString; -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 2184caa..3cb2e0b 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -7527,7 +7527,7 @@ qemuBuildCommandLine(virConnectPtr conn, - - if (def->os.loader) { - virCommandAddArg(cmd, "-bios"); -- virCommandAddArg(cmd, def->os.loader); -+ virCommandAddArg(cmd, def->os.loader->path); - } - - /* Set '-m MB' based on maxmem, because the lower 'memory' limit -@@ -11347,7 +11347,8 @@ qemuParseCommandLine(virCapsPtr qemuCaps, - goto error; - } else if (STREQ(arg, "-bios")) { - WANT_VALUE(); -- if (VIR_STRDUP(def->os.loader, val) < 0) -+ if (VIR_ALLOC(def->os.loader) < 0 || -+ VIR_STRDUP(def->os.loader->path, val) < 0) - goto error; - } else if (STREQ(arg, "-initrd")) { - WANT_VALUE(); -diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c -index a0b104c..311ce3b 100644 ---- a/src/security/virt-aa-helper.c -+++ b/src/security/virt-aa-helper.c -@@ -1006,8 +1006,8 @@ get_files(vahControl * ctl) - if (vah_add_file(&buf, ctl->def->os.dtb, "r") != 0) - goto cleanup; - -- if (ctl->def->os.loader && ctl->def->os.loader) -- if (vah_add_file(&buf, ctl->def->os.loader, "r") != 0) -+ if (ctl->def->os.loader && ctl->def->os.loader->path) -+ if (vah_add_file(&buf, ctl->def->os.loader->path, "r") != 0) - goto cleanup; - - for (i = 0; i < ctl->def->ngraphics; i++) { -diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c -index b186ea8..6f56c59 100644 ---- a/src/vbox/vbox_common.c -+++ b/src/vbox/vbox_common.c -@@ -988,7 +988,12 @@ vboxSetBootDeviceOrder(virDomainDefPtr def, vboxGlobalData *data, - VIR_DEBUG("def->os.initrd %s", def->os.initrd); - VIR_DEBUG("def->os.cmdline %s", def->os.cmdline); - VIR_DEBUG("def->os.root %s", def->os.root); -- VIR_DEBUG("def->os.loader %s", def->os.loader); -+ if (def->os.loader) { -+ VIR_DEBUG("def->os.loader->path %s", def->os.loader->path); -+ VIR_DEBUG("def->os.loader->readonly %d", def->os.loader->readonly); -+ VIR_DEBUG("def->os.loader->type %d", def->os.loader->type); -+ VIR_DEBUG("def->os.loader->nvram %s", def->os.loader->nvram); -+ } - VIR_DEBUG("def->os.bootloader %s", def->os.bootloader); - VIR_DEBUG("def->os.bootloaderArgs %s", def->os.bootloaderArgs); - -diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c -index 50331c9..a6eaccc 100644 ---- a/src/xenapi/xenapi_driver.c -+++ b/src/xenapi/xenapi_driver.c -@@ -1427,7 +1427,8 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) - VIR_FREE(boot_policy); - goto error; - } -- if (VIR_STRDUP(defPtr->os.loader, "pygrub") < 0) { -+ if (VIR_ALLOC(defPtr->os.loader) < 0 || -+ VIR_STRDUP(defPtr->os.loader->path, "pygrub") < 0) { - VIR_FREE(boot_policy); - goto error; - } -diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c -index 9beaf6c..abd77b5 100644 ---- a/src/xenconfig/xen_common.c -+++ b/src/xenconfig/xen_common.c -@@ -1065,7 +1065,8 @@ xenParseOS(virConfPtr conf, virDomainDefPtr def) - if (STREQ(def->os.type, "hvm")) { - const char *boot; - -- if (xenConfigCopyString(conf, "kernel", &def->os.loader) < 0) -+ if (VIR_ALLOC(def->os.loader) < 0 || -+ xenConfigCopyString(conf, "kernel", &def->os.loader->path) < 0) - return -1; - - if (xenConfigGetString(conf, "boot", &boot, "c") < 0) -@@ -1740,8 +1741,8 @@ xenFormatOS(virConfPtr conf, virDomainDefPtr def) - if (xenXMConfigSetString(conf, "builder", "hvm") < 0) - return -1; - -- if (def->os.loader && -- xenXMConfigSetString(conf, "kernel", def->os.loader) < 0) -+ if (def->os.loader && def->os.loader->path && -+ xenXMConfigSetString(conf, "kernel", def->os.loader->path) < 0) - return -1; - - for (i = 0; i < def->os.nBootDevs; i++) { -diff --git a/src/xenconfig/xen_sxpr.c b/src/xenconfig/xen_sxpr.c -index ff81c36..e8b9f59 100644 ---- a/src/xenconfig/xen_sxpr.c -+++ b/src/xenconfig/xen_sxpr.c -@@ -93,13 +93,15 @@ xenParseSxprOS(const struct sexpr *node, - int hvm) - { - if (hvm) { -- if (sexpr_node_copy(node, "domain/image/hvm/loader", &def->os.loader) < 0) -+ if (VIR_ALLOC(def->os.loader) < 0) - goto error; -- if (def->os.loader == NULL) { -- if (sexpr_node_copy(node, "domain/image/hvm/kernel", &def->os.loader) < 0) -+ if (sexpr_node_copy(node, "domain/image/hvm/loader", &def->os.loader->path) < 0) -+ goto error; -+ if (def->os.loader->path == NULL) { -+ if (sexpr_node_copy(node, "domain/image/hvm/kernel", &def->os.loader->path) < 0) - goto error; - -- if (def->os.loader == NULL) { -+ if (def->os.loader->path == NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("domain information incomplete, missing HVM loader")); - return -1; -@@ -128,7 +130,7 @@ xenParseSxprOS(const struct sexpr *node, - /* If HVM kenrel == loader, then old xend, so kill off kernel */ - if (hvm && - def->os.kernel && -- STREQ(def->os.kernel, def->os.loader)) { -+ STREQ(def->os.kernel, def->os.loader->path)) { - VIR_FREE(def->os.kernel); - } - /* Drop kernel argument that has no value */ -@@ -2279,9 +2281,9 @@ xenFormatSxpr(virConnectPtr conn, - if (hvm) { - char bootorder[VIR_DOMAIN_BOOT_LAST+1]; - if (def->os.kernel) -- virBufferEscapeSexpr(&buf, "(loader '%s')", def->os.loader); -+ virBufferEscapeSexpr(&buf, "(loader '%s')", def->os.loader->path); - else -- virBufferEscapeSexpr(&buf, "(kernel '%s')", def->os.loader); -+ virBufferEscapeSexpr(&buf, "(kernel '%s')", def->os.loader->path); - - virBufferAsprintf(&buf, "(vcpus %u)", def->maxvcpus); - if (def->vcpus < def->maxvcpus) -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.xml b/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.xml -new file mode 100644 -index 0000000..d8270b1 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.xml -@@ -0,0 +1,40 @@ -+ -+ test-bios -+ 362d1fc1-df7d-193e-5c18-49a71bd1da66 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ /usr/share/OVMF/OVMF_CODE.fd -+ /usr/share/OVMF/OVMF_VARS.fd -+ -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ restart -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-bridge-many-disks.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-bridge-many-disks.xml -index d469b8b..d49f5f4 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-bridge-many-disks.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-bridge-many-disks.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/share/seabios/bios.bin -+ /usr/share/seabios/bios.bin - - - -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index b4ab671..1835fe6 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -395,6 +395,8 @@ mymain(void) - DO_TEST_DIFFERENT("numatune-memnode"); - DO_TEST("numatune-memnode-no-memory"); - -+ DO_TEST("bios-nvram"); -+ - virObjectUnref(driver.caps); - virObjectUnref(driver.xmlopt); - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml b/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml -index 69fe9ef..761952c 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml b/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml -index 3c3147d..2898098 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml -index 716f16b..a0fe30d 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml -index 3dd648b..851797d 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml b/tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml -index 29c1335..09cfe19 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml -@@ -6,7 +6,7 @@ - 2 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - /var/lib/xen/vmlinuz.2Dn2YT - /var/lib/xen/initrd.img.0u-Vhq - method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test/5.91/x86_64/os -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml b/tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml -index 9c59644..44c0f61 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml b/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml -index 67b0b95..29007f0 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml b/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml -index 86b32e9..3dbc999 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml b/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml -index ed7da80..d96350e 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml -index ed3fde6..7ad377c 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml -index 7f5a729..adba6cb 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml -index 10f84dc..b6c3601 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml -index a3fd231..dabe679 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml -index b3f77c9..fb19d74 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml -index e217161..5aa425b 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml -index 3ad2264..3c2ca21 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml -index 001df56..160edbd 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml -index c2496fd..4396efc 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml -index 6dc047e..3d17b58 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml -index 7ccaeac..fc3d457 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml -index b5ad413..14b54f1 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml b/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml -index 7183e79..912df56 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml b/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml -index 7183e79..912df56 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml b/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml -index ae90e33..19eac3b 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml -index f81c47a..40ac8a9 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml b/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml -index c783d93..97f2beb 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml b/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml -index bd3b107..493d1b5 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-fv.xml b/tests/sexpr2xmldata/sexpr2xml-fv.xml -index c783d93..97f2beb 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-fv.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-fv.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml b/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml -index 00d18ce..a3cd7be 100644 ---- a/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml -+++ b/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-escape-paths.xml b/tests/xmconfigdata/test-escape-paths.xml -index de3a7e2..623eaa1 100644 ---- a/tests/xmconfigdata/test-escape-paths.xml -+++ b/tests/xmconfigdata/test-escape-paths.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader&test -+ /usr/lib/xen/boot/hvmloader&test - - - -diff --git a/tests/xmconfigdata/test-fullvirt-force-hpet.xml b/tests/xmconfigdata/test-fullvirt-force-hpet.xml -index 75f8724..57a6531 100644 ---- a/tests/xmconfigdata/test-fullvirt-force-hpet.xml -+++ b/tests/xmconfigdata/test-fullvirt-force-hpet.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-force-nohpet.xml b/tests/xmconfigdata/test-fullvirt-force-nohpet.xml -index e5741b6..f6ebcf6 100644 ---- a/tests/xmconfigdata/test-fullvirt-force-nohpet.xml -+++ b/tests/xmconfigdata/test-fullvirt-force-nohpet.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-localtime.xml b/tests/xmconfigdata/test-fullvirt-localtime.xml -index 8b97e5b..36ab389 100644 ---- a/tests/xmconfigdata/test-fullvirt-localtime.xml -+++ b/tests/xmconfigdata/test-fullvirt-localtime.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-net-ioemu.xml b/tests/xmconfigdata/test-fullvirt-net-ioemu.xml -index f22c085..3618bae 100644 ---- a/tests/xmconfigdata/test-fullvirt-net-ioemu.xml -+++ b/tests/xmconfigdata/test-fullvirt-net-ioemu.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-net-netfront.xml b/tests/xmconfigdata/test-fullvirt-net-netfront.xml -index 177bb6a..6a2a439 100644 ---- a/tests/xmconfigdata/test-fullvirt-net-netfront.xml -+++ b/tests/xmconfigdata/test-fullvirt-net-netfront.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-new-cdrom.xml b/tests/xmconfigdata/test-fullvirt-new-cdrom.xml -index f22c085..3618bae 100644 ---- a/tests/xmconfigdata/test-fullvirt-new-cdrom.xml -+++ b/tests/xmconfigdata/test-fullvirt-new-cdrom.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-old-cdrom.xml b/tests/xmconfigdata/test-fullvirt-old-cdrom.xml -index a592630..7d6014d 100644 ---- a/tests/xmconfigdata/test-fullvirt-old-cdrom.xml -+++ b/tests/xmconfigdata/test-fullvirt-old-cdrom.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml b/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml -index 738e5ab..9b1fd26 100644 ---- a/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml -+++ b/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml b/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml -index 753831a..a64d40b 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml b/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml -index 1a55080..ce2cddb 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-file.xml b/tests/xmconfigdata/test-fullvirt-serial-file.xml -index 0d2ac79..36883de 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-file.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-file.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-null.xml b/tests/xmconfigdata/test-fullvirt-serial-null.xml -index d4b4ae9..982f9d6 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-null.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-null.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-pipe.xml b/tests/xmconfigdata/test-fullvirt-serial-pipe.xml -index 6596dfc..82a1d9b 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-pipe.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-pipe.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-pty.xml b/tests/xmconfigdata/test-fullvirt-serial-pty.xml -index 6c55abb..56ccbea 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-pty.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-pty.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-stdio.xml b/tests/xmconfigdata/test-fullvirt-serial-stdio.xml -index 461f143..e2e9330 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-stdio.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-stdio.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml b/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml -index d2fa7bf..d68d77c 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-tcp.xml b/tests/xmconfigdata/test-fullvirt-serial-tcp.xml -index 60ab8bd..aa3ed5c 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-tcp.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-tcp.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-udp.xml b/tests/xmconfigdata/test-fullvirt-serial-udp.xml -index 6c21cd2..256c722 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-udp.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-udp.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-serial-unix.xml b/tests/xmconfigdata/test-fullvirt-serial-unix.xml -index f21534e..235c8d4 100644 ---- a/tests/xmconfigdata/test-fullvirt-serial-unix.xml -+++ b/tests/xmconfigdata/test-fullvirt-serial-unix.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-sound.xml b/tests/xmconfigdata/test-fullvirt-sound.xml -index f09c16d..1429d10 100644 ---- a/tests/xmconfigdata/test-fullvirt-sound.xml -+++ b/tests/xmconfigdata/test-fullvirt-sound.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-usbmouse.xml b/tests/xmconfigdata/test-fullvirt-usbmouse.xml -index 18a7ff0..25857f1 100644 ---- a/tests/xmconfigdata/test-fullvirt-usbmouse.xml -+++ b/tests/xmconfigdata/test-fullvirt-usbmouse.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-usbtablet.xml b/tests/xmconfigdata/test-fullvirt-usbtablet.xml -index 5cbb007..31b1176 100644 ---- a/tests/xmconfigdata/test-fullvirt-usbtablet.xml -+++ b/tests/xmconfigdata/test-fullvirt-usbtablet.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-fullvirt-utc.xml b/tests/xmconfigdata/test-fullvirt-utc.xml -index f22c085..3618bae 100644 ---- a/tests/xmconfigdata/test-fullvirt-utc.xml -+++ b/tests/xmconfigdata/test-fullvirt-utc.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-no-source-cdrom.xml b/tests/xmconfigdata/test-no-source-cdrom.xml -index 2a457b2..74f1be1 100644 ---- a/tests/xmconfigdata/test-no-source-cdrom.xml -+++ b/tests/xmconfigdata/test-no-source-cdrom.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - -diff --git a/tests/xmconfigdata/test-pci-devs.xml b/tests/xmconfigdata/test-pci-devs.xml -index f828056..1911734 100644 ---- a/tests/xmconfigdata/test-pci-devs.xml -+++ b/tests/xmconfigdata/test-pci-devs.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /usr/lib/xen/boot/hvmloader -+ /usr/lib/xen/boot/hvmloader - - - --- -2.1.0 - diff --git a/SOURCES/libvirt-conf-Fix-libvirtd-crash-matching-hostdev-XML.patch b/SOURCES/libvirt-conf-Fix-libvirtd-crash-matching-hostdev-XML.patch deleted file mode 100644 index 8859369..0000000 --- a/SOURCES/libvirt-conf-Fix-libvirtd-crash-matching-hostdev-XML.patch +++ /dev/null @@ -1,54 +0,0 @@ -From f866045688501547c44e9708f86f11d0f9d5ca8b Mon Sep 17 00:00:00 2001 -Message-Id: -From: Luyao Huang -Date: Mon, 15 Dec 2014 08:01:01 -0500 -Subject: [PATCH] conf: Fix libvirtd crash matching hostdev XML - -https://bugzilla.redhat.com/show_bug.cgi?id=1174053 - -Introduced by commit id '17bddc46f' - fix a libvirtd crash when -matching a network iscsi hostdev with a host iscsi hostdev. - -When we use attach-device to coldplug a network iscsi hostdev, -libvirt will check if there is already a device in XML. But if -the 'b' is a host iscsi hostdev and 'a' is a network iscsi hostdev, -then libvirtd will crash in virDomainHostdevMatchSubsysSCSIiSCSI -because 'b' doesn't have a hostname. - -Add a check in virDomainHostdevMatchSubsys, if the a's protocol -and b's protocol is not the same. - -Following is the backtrace: - -0 0x00007f850d6bc307 in virDomainHostdevMatchSubsysSCSIiSCSI at conf/domain_conf.c:10889 -1 virDomainHostdevMatchSubsys at conf/domain_conf.c:10911 -2 virDomainHostdevMatch at conf/domain_conf.c:10973 -3 virDomainHostdevFind at conf/domain_conf.c:10998 -4 0x00007f84f6a10560 in qemuDomainAttachDeviceConfig at qemu/qemu_driver.c:7223 -5 qemuDomainAttachDeviceFlags at qemu/qemu_driver.c:7554 - -Signed-off-by: Luyao Huang -(cherry picked from commit 5fc1c51743643a02c0306d6c17fe86e9013ce342) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 09ddc25..25f20f8 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -10900,6 +10900,9 @@ virDomainHostdevMatchSubsys(virDomainHostdevDefPtr a, - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: - return virDomainHostdevMatchSubsysUSB(a, b); - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: -+ if (a->source.subsys.u.scsi.protocol != -+ b->source.subsys.u.scsi.protocol) -+ return 0; - if (a->source.subsys.u.scsi.protocol == - VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) - return virDomainHostdevMatchSubsysSCSIiSCSI(a, b); --- -2.2.0 - diff --git a/SOURCES/libvirt-conf-Fix-memory-leak-when-parsing-invalid-network-XML.patch b/SOURCES/libvirt-conf-Fix-memory-leak-when-parsing-invalid-network-XML.patch deleted file mode 100644 index 7a612b9..0000000 --- a/SOURCES/libvirt-conf-Fix-memory-leak-when-parsing-invalid-network-XML.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 871079dd76ebdcff9ccc1cbbdbed660ef2a3f8b1 Mon Sep 17 00:00:00 2001 -Message-Id: <871079dd76ebdcff9ccc1cbbdbed660ef2a3f8b1@dist-git> -From: Jiri Denemark -Date: Thu, 8 Jan 2015 14:48:05 +0100 -Subject: [PATCH] conf: Fix memory leak when parsing invalid network XML - -Don't leak the value of /network/bridge/macTableManager if it's invalid. - -The fix is a small part of upstream commit 3aa05241, which commit -40961978 backported to 7.1 relied on. - -https://bugzilla.redhat.com/show_bug.cgi?id=1180136 ---- - src/conf/network_conf.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c -index 8015bf3..7b19592 100644 ---- a/src/conf/network_conf.c -+++ b/src/conf/network_conf.c -@@ -2021,7 +2021,7 @@ static virNetworkDefPtr - virNetworkDefParseXML(xmlXPathContextPtr ctxt) - { - virNetworkDefPtr def; -- char *tmp; -+ char *tmp = NULL; - char *stp = NULL; - xmlNodePtr *ipNodes = NULL; - xmlNodePtr *routeNodes = NULL; -@@ -2342,6 +2342,7 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt) - return def; - - error: -+ VIR_FREE(tmp); - VIR_FREE(routeNodes); - VIR_FREE(stp); - virNetworkDefFree(def); --- -2.2.1 - diff --git a/SOURCES/libvirt-conf-Pass-private-data-to-Parse-function-of-XML-options.patch b/SOURCES/libvirt-conf-Pass-private-data-to-Parse-function-of-XML-options.patch new file mode 100644 index 0000000..3fcf182 --- /dev/null +++ b/SOURCES/libvirt-conf-Pass-private-data-to-Parse-function-of-XML-options.patch @@ -0,0 +1,116 @@ +From f7cf89a71e2850d227a623909c7d8fada2990538 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Thu, 13 Aug 2015 15:11:46 +0200 +Subject: [PATCH] conf: Pass private data to Parse function of XML options + +https://bugzilla.redhat.com/show_bug.cgi?id=1162947 + +This needs a reorder of XML option definitions. It might come in handy +one day. + +Signed-off-by: Martin Kletzander +(cherry picked from commit 7c8028cda95c3af388f7485e682ed07629bb9e7a) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 2 +- + src/conf/domain_conf.h | 17 +++++++++-------- + src/libxl/libxl_domain.c | 3 ++- + src/lxc/lxc_domain.c | 3 ++- + src/qemu/qemu_domain.c | 3 ++- + 5 files changed, 16 insertions(+), 12 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 8784367..9aee04f 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -16343,7 +16343,7 @@ virDomainObjParseXML(xmlDocPtr xml, + VIR_FREE(nodes); + + if (xmlopt->privateData.parse && +- xmlopt->privateData.parse(ctxt, obj) < 0) ++ xmlopt->privateData.parse(ctxt, obj, &xmlopt->config) < 0) + goto error; + + return obj; +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 1be8e63..ed0ccba 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2357,14 +2357,6 @@ typedef bool (*virDomainObjListACLFilter)(virConnectPtr conn, + typedef struct _virDomainXMLOption virDomainXMLOption; + typedef virDomainXMLOption *virDomainXMLOptionPtr; + +-typedef void *(*virDomainXMLPrivateDataAllocFunc)(void); +-typedef void (*virDomainXMLPrivateDataFreeFunc)(void *); +-typedef virObjectPtr (*virDomainXMLPrivateDataNewFunc)(void); +-typedef int (*virDomainXMLPrivateDataFormatFunc)(virBufferPtr, +- virDomainObjPtr); +-typedef int (*virDomainXMLPrivateDataParseFunc)(xmlXPathContextPtr, +- virDomainObjPtr); +- + /* Called once after everything else has been parsed, for adjusting + * overall domain defaults. */ + typedef int (*virDomainDefPostParseCallback)(virDomainDefPtr def, +@@ -2393,6 +2385,15 @@ struct _virDomainDefParserConfig { + unsigned char macPrefix[VIR_MAC_PREFIX_BUFLEN]; + }; + ++typedef void *(*virDomainXMLPrivateDataAllocFunc)(void); ++typedef void (*virDomainXMLPrivateDataFreeFunc)(void *); ++typedef virObjectPtr (*virDomainXMLPrivateDataNewFunc)(void); ++typedef int (*virDomainXMLPrivateDataFormatFunc)(virBufferPtr, ++ virDomainObjPtr); ++typedef int (*virDomainXMLPrivateDataParseFunc)(xmlXPathContextPtr, ++ virDomainObjPtr, ++ virDomainDefParserConfigPtr); ++ + typedef struct _virDomainXMLPrivateDataCallbacks virDomainXMLPrivateDataCallbacks; + typedef virDomainXMLPrivateDataCallbacks *virDomainXMLPrivateDataCallbacksPtr; + struct _virDomainXMLPrivateDataCallbacks { +diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c +index 8e8a292..7bc4d92 100644 +--- a/src/libxl/libxl_domain.c ++++ b/src/libxl/libxl_domain.c +@@ -224,7 +224,8 @@ libxlDomainObjPrivateFree(void *data) + + static int + libxlDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, +- virDomainObjPtr vm) ++ virDomainObjPtr vm, ++ virDomainDefParserConfigPtr config ATTRIBUTE_UNUSED) + { + libxlDomainObjPrivatePtr priv = vm->privateData; + +diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c +index 70606f3..2f377d8 100644 +--- a/src/lxc/lxc_domain.c ++++ b/src/lxc/lxc_domain.c +@@ -65,7 +65,8 @@ virLXCDomainObjPrivateXMLFormat(virBufferPtr buf, + + static int + virLXCDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, +- virDomainObjPtr vm) ++ virDomainObjPtr vm, ++ virDomainDefParserConfigPtr config ATTRIBUTE_UNUSED) + { + virLXCDomainObjPrivatePtr priv = vm->privateData; + unsigned long long thepid; +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index d95f24f..ca41ca4 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -623,7 +623,8 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, + + static int + qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, +- virDomainObjPtr vm) ++ virDomainObjPtr vm, ++ virDomainDefParserConfigPtr config ATTRIBUTE_UNUSED) + { + qemuDomainObjPrivatePtr priv = vm->privateData; + char *monitorpath; +-- +2.5.0 + diff --git a/SOURCES/libvirt-conf-Pre-calculate-initial-memory-size-instead-of-always-calculating-it.patch b/SOURCES/libvirt-conf-Pre-calculate-initial-memory-size-instead-of-always-calculating-it.patch new file mode 100644 index 0000000..02ed200 --- /dev/null +++ b/SOURCES/libvirt-conf-Pre-calculate-initial-memory-size-instead-of-always-calculating-it.patch @@ -0,0 +1,200 @@ +From 26895224315526096a1a0e3adf36ef1fadc17727 Mon Sep 17 00:00:00 2001 +Message-Id: <26895224315526096a1a0e3adf36ef1fadc17727@dist-git> +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:44 +0200 +Subject: [PATCH] conf: Pre-calculate initial memory size instead of always + calculating it + +https://bugzilla.redhat.com/show_bug.cgi?id=1252685 + +Add 'initial_memory' member to struct virDomainMemtune so that the +memory size can be pre-calculated once instead of inferring it always +again and again. + +Separating of the fields will also allow finer granularity of decisions +in later patches where it will allow to keep the old initial memory +value in cases where we are handling incomming migration from older +versions that did not always update the size from NUMA as the code did +previously. + +The change also requires modification of the qemu memory alignment +function since at the point where we are modifying the size of NUMA +nodes the total size needs to be recalculated too. + +The refactoring done in this patch also fixes a crash in the hyperv +driver that did not properly initialize def->numa and thus +virDomainNumaGetMemorySize(def->numa) crashed. + +In summary this patch should have no functional impact at this point. + +(cherry picked from commit 403e86067d5cb3a6fd8583cb5b08121151bd4d9f) + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 52 +++++++++++++++++++++++++++++------------------- + src/conf/domain_conf.h | 3 +++ + src/libvirt_private.syms | 1 + + src/qemu/qemu_domain.c | 15 +++++++++----- + 4 files changed, 46 insertions(+), 25 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index b28daa6..3625310 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -3642,6 +3642,15 @@ virDomainDefRemoveDuplicateMetadata(virDomainDefPtr def) + static int + virDomainDefPostParseMemory(virDomainDefPtr def) + { ++ size_t i; ++ ++ if ((def->mem.initial_memory = virDomainNumaGetMemorySize(def->numa)) == 0) { ++ def->mem.initial_memory = def->mem.total_memory; ++ ++ for (i = 0; i < def->nmems; i++) ++ def->mem.initial_memory -= def->mems[i]->size; ++ } ++ + if (virDomainDefGetMemoryInitial(def) == 0) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Memory size must be specified via or in the " +@@ -7665,19 +7674,7 @@ virDomainDefHasMemoryHotplug(const virDomainDef *def) + unsigned long long + virDomainDefGetMemoryInitial(virDomainDefPtr def) + { +- unsigned long long ret; +- size_t i; +- +- /* return NUMA memory size total in case numa is enabled */ +- if ((ret = virDomainNumaGetMemorySize(def->numa)) > 0) { +- return ret; +- } else { +- ret = def->mem.total_memory; +- for (i = 0; i < def->nmems; i++) +- ret -= def->mems[i]->size; +- } +- +- return def->mem.total_memory; ++ return def->mem.initial_memory; + } + + +@@ -7686,13 +7683,30 @@ virDomainDefGetMemoryInitial(virDomainDefPtr def) + * @def: domain definition + * @size: size to set + * +- * Sets the total memory size in @def. ++ * Sets the total memory size in @def. This function should be used only by ++ * hypervisors that don't support memory hotplug. + */ + void + virDomainDefSetMemoryTotal(virDomainDefPtr def, + unsigned long long size) + { + def->mem.total_memory = size; ++ def->mem.initial_memory = size; ++} ++ ++ ++/** ++ * virDomainDefSetMemoryInitial: ++ * @def: domain definition ++ * @size: size to set ++ * ++ * Sets the initial memory size (without memory modules) in @def. ++ */ ++void ++virDomainDefSetMemoryInitial(virDomainDefPtr def, ++ unsigned long long size) ++{ ++ def->mem.initial_memory = size; + } + + +@@ -7710,12 +7724,10 @@ virDomainDefGetMemoryActual(virDomainDefPtr def) + unsigned long long ret; + size_t i; + +- if ((ret = virDomainNumaGetMemorySize(def->numa)) > 0) { +- for (i = 0; i < def->nmems; i++) +- ret += def->mems[i]->size; +- } else { +- ret = def->mem.total_memory; +- } ++ ret = def->mem.initial_memory; ++ ++ for (i = 0; i < def->nmems; i++) ++ ret += def->mems[i]->size; + + return ret; + } +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 8099450..61bf963 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2109,6 +2109,8 @@ struct _virDomainMemtune { + /* total memory size including memory modules in kibibytes, this field + * should be accessed only via accessors */ + unsigned long long total_memory; ++ /* initial memory size in kibibytes = total_memory excluding memory modules*/ ++ unsigned long long initial_memory; + unsigned long long cur_balloon; /* in kibibytes, capped at ulong thanks + to virDomainGetInfo */ + +@@ -2288,6 +2290,7 @@ struct _virDomainDef { + + unsigned long long virDomainDefGetMemoryInitial(virDomainDefPtr def); + void virDomainDefSetMemoryTotal(virDomainDefPtr def, unsigned long long size); ++void virDomainDefSetMemoryInitial(virDomainDefPtr def, unsigned long long size); + unsigned long long virDomainDefGetMemoryActual(virDomainDefPtr def); + bool virDomainDefHasMemoryHotplug(const virDomainDef *def); + +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index b1b59b2..16ae24f 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -225,6 +225,7 @@ virDomainDefParseFile; + virDomainDefParseNode; + virDomainDefParseString; + virDomainDefPostParse; ++virDomainDefSetMemoryInitial; + virDomainDefSetMemoryTotal; + virDomainDeleteConfig; + virDomainDeviceAddressIsValid; +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 67c2bb0..77f3d6a 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3171,6 +3171,7 @@ qemuDomainGetMemorySizeAlignment(virDomainDefPtr def ATTRIBUTE_UNUSED) + int + qemuDomainAlignMemorySizes(virDomainDefPtr def) + { ++ unsigned long long initialmem = 0; + unsigned long long mem; + unsigned long long align = qemuDomainGetMemorySizeAlignment(def); + size_t ncells = virDomainNumaGetNodeCount(def->numa); +@@ -3178,13 +3179,17 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) + + /* align NUMA cell sizes if relevant */ + for (i = 0; i < ncells; i++) { +- mem = virDomainNumaGetNodeMemorySize(def->numa, i); +- virDomainNumaSetNodeMemorySize(def->numa, i, VIR_ROUND_UP(mem, align)); ++ mem = VIR_ROUND_UP(virDomainNumaGetNodeMemorySize(def->numa, i), align); ++ initialmem += mem; ++ virDomainNumaSetNodeMemorySize(def->numa, i, mem); + } + +- /* align initial memory size */ +- mem = virDomainDefGetMemoryInitial(def); +- virDomainDefSetMemoryTotal(def, VIR_ROUND_UP(mem, align)); ++ /* align initial memory size, if NUMA is present calculate it as total of ++ * individual aligned NUMA node sizes */ ++ if (initialmem == 0) ++ initialmem = VIR_ROUND_UP(virDomainDefGetMemoryInitial(def), align); ++ ++ virDomainDefSetMemoryInitial(def, initialmem); + + def->mem.max_memory = VIR_ROUND_UP(def->mem.max_memory, align); + +-- +2.5.3 + diff --git a/SOURCES/libvirt-conf-Rename-max_balloon-to-total_memory.patch b/SOURCES/libvirt-conf-Rename-max_balloon-to-total_memory.patch new file mode 100644 index 0000000..524ab57 --- /dev/null +++ b/SOURCES/libvirt-conf-Rename-max_balloon-to-total_memory.patch @@ -0,0 +1,386 @@ +From 524df098e7b82ea193e9f81b1244fae5cff0a937 Mon Sep 17 00:00:00 2001 +Message-Id: <524df098e7b82ea193e9f81b1244fae5cff0a937@dist-git> +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:43 +0200 +Subject: [PATCH] conf: Rename max_balloon to total_memory + +https://bugzilla.redhat.com/show_bug.cgi?id=1252685 + +The name of the variable was misleading. Rename it and it's setting +accessor before other fixes. + +(cherry picked from commit 8059a99025d15b12e62a294b7b6797e4c618eff8) + +Conflicts: + src/libxl/libxl_driver.c - libxlAddDom0 is missing in RHEL + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 18 +++++++++--------- + src/conf/domain_conf.h | 7 ++++--- + src/hyperv/hyperv_driver.c | 2 +- + src/libvirt_private.syms | 2 +- + src/libxl/libxl_driver.c | 2 +- + src/lxc/lxc_driver.c | 2 +- + src/lxc/lxc_native.c | 4 ++-- + src/phyp/phyp_driver.c | 2 +- + src/qemu/qemu_command.c | 4 ++-- + src/qemu/qemu_domain.c | 2 +- + src/qemu/qemu_driver.c | 2 +- + src/test/test_driver.c | 2 +- + src/uml/uml_driver.c | 2 +- + src/vbox/vbox_common.c | 4 ++-- + src/vmx/vmx.c | 2 +- + src/vz/vz_sdk.c | 2 +- + src/xen/xm_internal.c | 2 +- + src/xenapi/xenapi_driver.c | 2 +- + src/xenconfig/xen_common.c | 2 +- + src/xenconfig/xen_sxpr.c | 2 +- + 20 files changed, 34 insertions(+), 33 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 1e32557..b28daa6 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -7672,27 +7672,27 @@ virDomainDefGetMemoryInitial(virDomainDefPtr def) + if ((ret = virDomainNumaGetMemorySize(def->numa)) > 0) { + return ret; + } else { +- ret = def->mem.max_balloon; ++ ret = def->mem.total_memory; + for (i = 0; i < def->nmems; i++) + ret -= def->mems[i]->size; + } + +- return def->mem.max_balloon; ++ return def->mem.total_memory; + } + + + /** +- * virDomainDefSetMemoryInitial: ++ * virDomainDefSetMemoryTotal: + * @def: domain definition + * @size: size to set + * +- * Sets the initial memory size in @def. ++ * Sets the total memory size in @def. + */ + void +-virDomainDefSetMemoryInitial(virDomainDefPtr def, +- unsigned long long size) ++virDomainDefSetMemoryTotal(virDomainDefPtr def, ++ unsigned long long size) + { +- def->mem.max_balloon = size; ++ def->mem.total_memory = size; + } + + +@@ -7714,7 +7714,7 @@ virDomainDefGetMemoryActual(virDomainDefPtr def) + for (i = 0; i < def->nmems; i++) + ret += def->mems[i]->size; + } else { +- ret = def->mem.max_balloon; ++ ret = def->mem.total_memory; + } + + return ret; +@@ -14611,7 +14611,7 @@ virDomainDefParseXML(xmlDocPtr xml, + + /* Extract domain memory */ + if (virDomainParseMemory("./memory[1]", NULL, ctxt, +- &def->mem.max_balloon, false, true) < 0) ++ &def->mem.total_memory, false, true) < 0) + goto error; + + if (virDomainParseMemory("./currentMemory[1]", NULL, ctxt, +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index bac64b3..8099450 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2106,8 +2106,9 @@ typedef struct _virDomainMemtune virDomainMemtune; + typedef virDomainMemtune *virDomainMemtunePtr; + + struct _virDomainMemtune { +- unsigned long long max_balloon; /* in kibibytes, capped at ulong thanks +- to virDomainGetMaxMemory */ ++ /* total memory size including memory modules in kibibytes, this field ++ * should be accessed only via accessors */ ++ unsigned long long total_memory; + unsigned long long cur_balloon; /* in kibibytes, capped at ulong thanks + to virDomainGetInfo */ + +@@ -2286,7 +2287,7 @@ struct _virDomainDef { + }; + + unsigned long long virDomainDefGetMemoryInitial(virDomainDefPtr def); +-void virDomainDefSetMemoryInitial(virDomainDefPtr def, unsigned long long size); ++void virDomainDefSetMemoryTotal(virDomainDefPtr def, unsigned long long size); + unsigned long long virDomainDefGetMemoryActual(virDomainDefPtr def); + bool virDomainDefHasMemoryHotplug(const virDomainDef *def); + +diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c +index b539541..1958bbe 100644 +--- a/src/hyperv/hyperv_driver.c ++++ b/src/hyperv/hyperv_driver.c +@@ -870,7 +870,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) + if (VIR_STRDUP(def->description, virtualSystemSettingData->data->Notes) < 0) + goto cleanup; + +- virDomainDefSetMemoryInitial(def, memorySettingData->data->Limit * 1024); /* megabyte to kilobyte */ ++ virDomainDefSetMemoryTotal(def, memorySettingData->data->Limit * 1024); /* megabyte to kilobyte */ + def->mem.cur_balloon = memorySettingData->data->VirtualQuantity * 1024; /* megabyte to kilobyte */ + + def->vcpus = processorSettingData->data->VirtualQuantity; +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 335f8d0..b1b59b2 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -225,7 +225,7 @@ virDomainDefParseFile; + virDomainDefParseNode; + virDomainDefParseString; + virDomainDefPostParse; +-virDomainDefSetMemoryInitial; ++virDomainDefSetMemoryTotal; + virDomainDeleteConfig; + virDomainDeviceAddressIsValid; + virDomainDeviceAddressTypeToString; +diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c +index 149ef70..f48bcf4 100644 +--- a/src/libxl/libxl_driver.c ++++ b/src/libxl/libxl_driver.c +@@ -1413,7 +1413,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, + if (flags & VIR_DOMAIN_MEM_CONFIG) { + /* Help clang 2.8 decipher the logic flow. */ + sa_assert(persistentDef); +- virDomainDefSetMemoryInitial(persistentDef, newmem); ++ virDomainDefSetMemoryTotal(persistentDef, newmem); + if (persistentDef->mem.cur_balloon > newmem) + persistentDef->mem.cur_balloon = newmem; + ret = virDomainSaveConfig(cfg->configDir, persistentDef); +diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c +index 79f92c3..9a6e44e 100644 +--- a/src/lxc/lxc_driver.c ++++ b/src/lxc/lxc_driver.c +@@ -734,7 +734,7 @@ static int lxcDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, + } + + if (flags & VIR_DOMAIN_AFFECT_CONFIG) { +- virDomainDefSetMemoryInitial(persistentDef, newmem); ++ virDomainDefSetMemoryTotal(persistentDef, newmem); + if (persistentDef->mem.cur_balloon > newmem) + persistentDef->mem.cur_balloon = newmem; + if (virDomainSaveConfig(cfg->configDir, persistentDef) < 0) +diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c +index 6faa701..2f95597 100644 +--- a/src/lxc/lxc_native.c ++++ b/src/lxc/lxc_native.c +@@ -770,7 +770,7 @@ lxcSetMemTune(virDomainDefPtr def, virConfPtr properties) + if (lxcConvertSize(value->str, &size) < 0) + return -1; + size = size / 1024; +- virDomainDefSetMemoryInitial(def, size); ++ virDomainDefSetMemoryTotal(def, size); + def->mem.hard_limit = virMemoryLimitTruncate(size); + } + +@@ -1010,7 +1010,7 @@ lxcParseConfigString(const char *config) + } + + vmdef->id = -1; +- virDomainDefSetMemoryInitial(vmdef, 64 * 1024); ++ virDomainDefSetMemoryTotal(vmdef, 64 * 1024); + + vmdef->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART; + vmdef->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY; +diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c +index 54dec70..2912fc4 100644 +--- a/src/phyp/phyp_driver.c ++++ b/src/phyp/phyp_driver.c +@@ -3281,7 +3281,7 @@ phypDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) + goto err; + } + +- virDomainDefSetMemoryInitial(&def, memory); ++ virDomainDefSetMemoryTotal(&def, memory); + + if ((def.mem.cur_balloon = + phypGetLparMem(dom->conn, managed_system, dom->id, 1)) == 0) { +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index ade75e3..3fd695b 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -12724,7 +12724,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps, + + def->id = -1; + def->mem.cur_balloon = 64 * 1024; +- virDomainDefSetMemoryInitial(def, def->mem.cur_balloon); ++ virDomainDefSetMemoryTotal(def, def->mem.cur_balloon); + def->maxvcpus = 1; + def->vcpus = 1; + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_UTC; +@@ -12930,7 +12930,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps, + _("cannot parse memory level '%s'"), val); + goto error; + } +- virDomainDefSetMemoryInitial(def, mem * 1024); ++ virDomainDefSetMemoryTotal(def, mem * 1024); + def->mem.cur_balloon = mem * 1024; + } else if (STREQ(arg, "-smp")) { + WANT_VALUE(); +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 15cdf7b..67c2bb0 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3184,7 +3184,7 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) + + /* align initial memory size */ + mem = virDomainDefGetMemoryInitial(def); +- virDomainDefSetMemoryInitial(def, VIR_ROUND_UP(mem, align)); ++ virDomainDefSetMemoryTotal(def, VIR_ROUND_UP(mem, align)); + + def->mem.max_memory = VIR_ROUND_UP(def->mem.max_memory, align); + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index f15b14a..e77e548 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -2370,7 +2370,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, + goto endjob; + } + +- virDomainDefSetMemoryInitial(persistentDef, newmem); ++ virDomainDefSetMemoryTotal(persistentDef, newmem); + + if (persistentDef->mem.cur_balloon > newmem) + persistentDef->mem.cur_balloon = newmem; +diff --git a/src/test/test_driver.c b/src/test/test_driver.c +index d38006f..9dcfe11 100644 +--- a/src/test/test_driver.c ++++ b/src/test/test_driver.c +@@ -2256,7 +2256,7 @@ static int testDomainSetMaxMemory(virDomainPtr domain, + return -1; + + /* XXX validate not over host memory wrt to other domains */ +- virDomainDefSetMemoryInitial(privdom->def, memory); ++ virDomainDefSetMemoryTotal(privdom->def, memory); + + virDomainObjEndAPI(&privdom); + return 0; +diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c +index c3c5fa7..2b61f73 100644 +--- a/src/uml/uml_driver.c ++++ b/src/uml/uml_driver.c +@@ -1828,7 +1828,7 @@ static int umlDomainSetMaxMemory(virDomainPtr dom, unsigned long newmax) + goto cleanup; + } + +- virDomainDefSetMemoryInitial(vm->def, newmax); ++ virDomainDefSetMemoryTotal(vm->def, newmax); + ret = 0; + + cleanup: +diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c +index 91a61f8..3e6ed7a 100644 +--- a/src/vbox/vbox_common.c ++++ b/src/vbox/vbox_common.c +@@ -3898,7 +3898,7 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) + * reading and while dumping xml + */ + /* def->mem.max_balloon = maxMemorySize * 1024; */ +- virDomainDefSetMemoryInitial(def, memorySize * 1024); ++ virDomainDefSetMemoryTotal(def, memorySize * 1024); + + gVBoxAPI.UIMachine.GetCPUCount(machine, &CPUCount); + def->maxvcpus = def->vcpus = CPUCount; +@@ -6051,7 +6051,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, + * the notation here seems to be inconsistent while + * reading and while dumping xml + */ +- virDomainDefSetMemoryInitial(def->dom, memorySize * 1024); ++ virDomainDefSetMemoryTotal(def->dom, memorySize * 1024); + def->dom->os.type = VIR_DOMAIN_OSTYPE_HVM; + def->dom->os.arch = virArchFromHost(); + gVBoxAPI.UIMachine.GetCPUCount(machine, &CPUCount); +diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c +index 9ba5848..84f71f7 100644 +--- a/src/vmx/vmx.c ++++ b/src/vmx/vmx.c +@@ -1379,7 +1379,7 @@ virVMXParseConfig(virVMXContext *ctx, + goto cleanup; + } + +- virDomainDefSetMemoryInitial(def, memsize * 1024); /* Scale from megabytes to kilobytes */ ++ virDomainDefSetMemoryTotal(def, memsize * 1024); /* Scale from megabytes to kilobytes */ + + /* vmx:sched.mem.max -> def:mem.cur_balloon */ + if (virVMXGetConfigLong(conf, "sched.mem.max", &sched_mem_max, memsize, +diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c +index a584940..61a0897 100644 +--- a/src/vz/vz_sdk.c ++++ b/src/vz/vz_sdk.c +@@ -1300,7 +1300,7 @@ prlsdkLoadDomain(vzConnPtr privconn, + /* get RAM parameters */ + pret = PrlVmCfg_GetRamSize(sdkdom, &ram); + prlsdkCheckRetGoto(pret, error); +- virDomainDefSetMemoryInitial(def, ram << 10); /* RAM size obtained in Mbytes, ++ virDomainDefSetMemoryTotal(def, ram << 10); /* RAM size obtained in Mbytes, + convert to Kbytes */ + def->mem.cur_balloon = ram << 10; + +diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c +index 59b1cd4..baa7815 100644 +--- a/src/xen/xm_internal.c ++++ b/src/xen/xm_internal.c +@@ -606,7 +606,7 @@ xenXMDomainSetMaxMemory(virConnectPtr conn, + if (entry->def->mem.cur_balloon > memory) + entry->def->mem.cur_balloon = memory; + +- virDomainDefSetMemoryInitial(entry->def, memory); ++ virDomainDefSetMemoryTotal(entry->def, memory); + /* If this fails, should we try to undo our changes to the + * in-memory representation of the config file. I say not! + */ +diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c +index 11f6e91..3045c5a 100644 +--- a/src/xenapi/xenapi_driver.c ++++ b/src/xenapi/xenapi_driver.c +@@ -1492,7 +1492,7 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) + VIR_FREE(val); + } + memory = xenapiDomainGetMaxMemory(dom); +- virDomainDefSetMemoryInitial(defPtr, memory); ++ virDomainDefSetMemoryTotal(defPtr, memory); + if (xen_vm_get_memory_dynamic_max(session, &dynamic_mem, vm)) { + defPtr->mem.cur_balloon = (unsigned long) (dynamic_mem / 1024); + } else { +diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c +index 0dfe60e..0890c73 100644 +--- a/src/xenconfig/xen_common.c ++++ b/src/xenconfig/xen_common.c +@@ -316,7 +316,7 @@ xenParseMem(virConfPtr conf, virDomainDefPtr def) + return -1; + + def->mem.cur_balloon *= 1024; +- virDomainDefSetMemoryInitial(def, memory * 1024); ++ virDomainDefSetMemoryTotal(def, memory * 1024); + + return 0; + } +diff --git a/src/xenconfig/xen_sxpr.c b/src/xenconfig/xen_sxpr.c +index 05e938a..66f67b5 100644 +--- a/src/xenconfig/xen_sxpr.c ++++ b/src/xenconfig/xen_sxpr.c +@@ -1154,7 +1154,7 @@ xenParseSxpr(const struct sexpr *root, + } + } + +- virDomainDefSetMemoryInitial(def, (sexpr_u64(root, "domain/maxmem") << 10)); ++ virDomainDefSetMemoryTotal(def, (sexpr_u64(root, "domain/maxmem") << 10)); + def->mem.cur_balloon = (sexpr_u64(root, "domain/memory") << 10); + + if (def->mem.cur_balloon > virDomainDefGetMemoryActual(def)) +-- +2.5.3 + diff --git a/SOURCES/libvirt-conf-Split-memory-related-post-parse-stuff-into-separate-function.patch b/SOURCES/libvirt-conf-Split-memory-related-post-parse-stuff-into-separate-function.patch new file mode 100644 index 0000000..ddb171c --- /dev/null +++ b/SOURCES/libvirt-conf-Split-memory-related-post-parse-stuff-into-separate-function.patch @@ -0,0 +1,74 @@ +From db2a67e72870284bcf40584d405bb74bd7437786 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:42 +0200 +Subject: [PATCH] conf: Split memory related post parse stuff into separate + function + +https://bugzilla.redhat.com/show_bug.cgi?id=1252685 + +The post parse func is growing rather large. Since later patches will +introduce more logic in the memory post parse code, split it into a +separate handler. + +(cherry picked from commit 849b5fc4f609885b9976b633c6efaba0beee2fe3) + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 32 +++++++++++++++++++++----------- + 1 file changed, 21 insertions(+), 11 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 3a3c238..1e32557 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -3640,18 +3640,8 @@ virDomainDefRemoveDuplicateMetadata(virDomainDefPtr def) + + + static int +-virDomainDefPostParseInternal(virDomainDefPtr def, +- virCapsPtr caps ATTRIBUTE_UNUSED) ++virDomainDefPostParseMemory(virDomainDefPtr def) + { +- size_t i; +- +- /* verify init path for container based domains */ +- if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) { +- virReportError(VIR_ERR_XML_ERROR, "%s", +- _("init binary must be specified")); +- return -1; +- } +- + if (virDomainDefGetMemoryInitial(def) == 0) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Memory size must be specified via or in the " +@@ -3679,6 +3669,26 @@ virDomainDefPostParseInternal(virDomainDefPtr def, + return -1; + } + ++ return 0; ++} ++ ++ ++static int ++virDomainDefPostParseInternal(virDomainDefPtr def, ++ virCapsPtr caps ATTRIBUTE_UNUSED) ++{ ++ size_t i; ++ ++ /* verify init path for container based domains */ ++ if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) { ++ virReportError(VIR_ERR_XML_ERROR, "%s", ++ _("init binary must be specified")); ++ return -1; ++ } ++ ++ if (virDomainDefPostParseMemory(def) < 0) ++ return -1; ++ + /* + * Some really crazy backcompat stuff for consoles + * +-- +2.5.3 + diff --git a/SOURCES/libvirt-conf-add-backend-element-to-interfaces.patch b/SOURCES/libvirt-conf-add-backend-element-to-interfaces.patch deleted file mode 100644 index 8f88472..0000000 --- a/SOURCES/libvirt-conf-add-backend-element-to-interfaces.patch +++ /dev/null @@ -1,202 +0,0 @@ -From 1f343ca2d34c0bd5f012079ab07a7c1cc9bf0fe4 Mon Sep 17 00:00:00 2001 -Message-Id: <1f343ca2d34c0bd5f012079ab07a7c1cc9bf0fe4@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Wed, 17 Sep 2014 19:15:58 +0200 -Subject: [PATCH] conf: add backend element to interfaces - -https://bugzilla.redhat.com/show_bug.cgi?id=1139362 - -For tuning the network, alternative devices -for creating tap and vhost devices can be specified via: - - -(cherry picked from commit af8b4a2e6fc264dda4c7fda9b1696a16e59caeb4) - -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 20 +++++++++ - docs/schemas/domaincommon.rng | 10 +++++ - src/conf/domain_conf.c | 11 +++++ - src/conf/domain_conf.h | 4 ++ - tests/qemuxml2argvdata/qemuxml2argv-tap-vhost.xml | 52 +++++++++++++++++++++++ - tests/qemuxml2xmltest.c | 2 + - 6 files changed, 99 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-tap-vhost.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index ade40f3..a3ab5cf 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -3956,6 +3956,26 @@ qemu-kvm -net nic,model=? /dev/null -
- - -+
Setting network backend-specific options
-+ -+
-+  ...
-+  <devices>
-+    <interface type='network'>
-+      <source network='default'/>
-+      <target dev='vnet1'/>
-+      <model type='virtio'/>
-+      <backend tap='/dev/net/tun' vhost='/dev/net-vhost'/>
-+      <driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5'/>
-+    </interface>
-+  </devices>
-+  ...
-+ -+

-+ For tuning the backend of the network, the backend element -+ can be used. Supported attributes are tap and vhost, -+ allowing to override the default devices for creating tap and vhost devices. -+

-
Overriding the target element
- -
-diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
-index 75006f5..31974ac 100644
---- a/docs/schemas/domaincommon.rng
-+++ b/docs/schemas/domaincommon.rng
-@@ -2335,6 +2335,16 @@
-         
-       
-       
-+        
-+           
-+             
-+           
-+           
-+             
-+           
-+        
-+      
-+      
-         
-           
-             
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index ea727a1..7d78b0b 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -1412,6 +1412,8 @@ void virDomainNetDefFree(virDomainNetDefPtr def)
-         break;
-     }
- 
-+    VIR_FREE(def->backend.tap);
-+    VIR_FREE(def->backend.vhost);
-     VIR_FREE(def->virtPortProfile);
-     VIR_FREE(def->script);
-     VIR_FREE(def->ifname);
-@@ -7033,6 +7035,9 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
-             } else if (xmlStrEqual(cur->name, BAD_CAST "vlan")) {
-                 if (virNetDevVlanParse(cur, ctxt, &def->vlan) < 0)
-                     goto error;
-+            } else if (xmlStrEqual(cur->name, BAD_CAST "backend")) {
-+                def->backend.tap = virXMLPropString(cur, "tap");
-+                def->backend.vhost = virXMLPropString(cur, "vhost");
-             }
-         }
-         cur = cur->next;
-@@ -16550,6 +16555,12 @@ virDomainNetDefFormat(virBufferPtr buf,
-             virBufferAddLit(buf, "/>\n");
-         }
-     }
-+    if (def->backend.tap || def->backend.vhost) {
-+        virBufferAddLit(buf, "backend.tap);
-+        virBufferEscapeString(buf, " vhost='%s'", def->backend.vhost);
-+        virBufferAddLit(buf, "/>\n");
-+    }
-     if (def->filter) {
-         if (virNWFilterFormatParamAttributes(buf, def->filterparams,
-                                              def->filter) < 0)
-diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
-index 3316fb6..c93b73c 100644
---- a/src/conf/domain_conf.h
-+++ b/src/conf/domain_conf.h
-@@ -897,6 +897,10 @@ struct _virDomainNetDef {
-             unsigned int queues; /* Multiqueue virtio-net */
-         } virtio;
-     } driver;
-+    struct {
-+        char *tap;
-+        char *vhost;
-+    } backend;
-     union {
-         struct {
-             char *dev;
-diff --git a/tests/qemuxml2argvdata/qemuxml2argv-tap-vhost.xml b/tests/qemuxml2argvdata/qemuxml2argv-tap-vhost.xml
-new file mode 100644
-index 0000000..3237c6a
---- /dev/null
-+++ b/tests/qemuxml2argvdata/qemuxml2argv-tap-vhost.xml
-@@ -0,0 +1,52 @@
-+
-+  test
-+  bba65c0e-c049-934f-b6aa-4e2c0582acdf
-+  1048576
-+  1048576
-+  1
-+  
-+    hvm
-+    
-+    
-+    
-+  
-+  
-+  destroy
-+  restart
-+  restart
-+  
-+    /usr/bin/qemu
-+    
-+      
-+      
-+      
-+      
-+ -+ -+ -+ -+ -+ -+
-+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 180665b..1e06f38 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -399,6 +399,8 @@ mymain(void) - - DO_TEST("bios-nvram"); - -+ DO_TEST("tap-vhost"); -+ - virObjectUnref(driver.caps); - virObjectUnref(driver.xmlopt); - --- -2.1.0 - diff --git a/SOURCES/libvirt-conf-add-options-for-disabling-segment-offloading.patch b/SOURCES/libvirt-conf-add-options-for-disabling-segment-offloading.patch deleted file mode 100644 index b684a59..0000000 --- a/SOURCES/libvirt-conf-add-options-for-disabling-segment-offloading.patch +++ /dev/null @@ -1,498 +0,0 @@ -From 18fd00f5fdad7b2a65e94a0013901a2f8c1c6cde Mon Sep 17 00:00:00 2001 -Message-Id: <18fd00f5fdad7b2a65e94a0013901a2f8c1c6cde@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Wed, 24 Sep 2014 16:55:44 +0200 -Subject: [PATCH] conf: add options for disabling segment offloading - -https://bugzilla.redhat.com/show_bug.cgi?id=1139364 - -Add options for tuning segment offloading: - - - - -which control the respective host_ and guest_ properties -of the virtio-net device. - -(cherry picked from commit 5b3536ae90a27e6c83ad222e286f08856037c195) - -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 24 ++- - docs/schemas/domaincommon.rng | 66 ++++++- - src/conf/domain_conf.c | 218 ++++++++++++++++++++- - src/conf/domain_conf.h | 15 ++ - .../qemuxml2argv-net-virtio-disable-offloads.xml | 35 ++++ - tests/qemuxml2xmltest.c | 1 + - 6 files changed, 351 insertions(+), 8 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 8c03ebb..830bfa2 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -3868,7 +3868,11 @@ qemu-kvm -net nic,model=? /dev/null - <source network='default'/> - <target dev='vnet1'/> - <model type='virtio'/> -- <driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5'/> -+ <driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5'> -+ <host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off'/> -+ <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/> -+ </driver> -+ - </interface> - </devices> - ...
-@@ -3972,6 +3976,24 @@ qemu-kvm -net nic,model=? /dev/null - processor, resulting in much higher throughput. - Since 1.0.6 (QEMU and KVM only) - -+
host offloading options
-+
-+ The csum, gso, tso4, -+ tso6, ecn and ufo -+ attributes with possible values on -+ and off can be used to turn off host offloading options. -+ By default, the supported offloads are enabled by QEMU. -+ Since 1.2.9 (QEMU only) -+
-+
guest offloading options
-+
-+ The csum, tso4, -+ tso6, ecn and ufo -+ attributes with possible values on -+ and off can be used to turn off guest offloading options. -+ By default, the supported offloads are enabled by QEMU. -+ Since 1.2.9 (QEMU only) -+
- - -
Setting network backend-specific options
-diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 19dc82f..ccfb511 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -2364,7 +2364,71 @@ - - - -- -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index a4db3c3..4e80467 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -6893,6 +6893,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, - char *ioeventfd = NULL; - char *event_idx = NULL; - char *queues = NULL; -+ char *str = NULL; - char *filter = NULL; - char *internal = NULL; - char *devaddr = NULL; -@@ -7381,6 +7382,115 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, - } - def->driver.virtio.queues = q; - } -+ if ((str = virXPathString("string(./driver/host/@csum)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown host csum mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.host.csum = val; -+ } -+ VIR_FREE(str); -+ if ((str = virXPathString("string(./driver/host/@gso)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown host gso mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.host.gso = val; -+ } -+ VIR_FREE(str); -+ if ((str = virXPathString("string(./driver/host/@tso4)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown host tso4 mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.host.tso4 = val; -+ } -+ VIR_FREE(str); -+ if ((str = virXPathString("string(./driver/host/@tso6)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown host tso6 mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.host.tso6 = val; -+ } -+ VIR_FREE(str); -+ if ((str = virXPathString("string(./driver/host/@ecn)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown host ecn mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.host.ecn = val; -+ } -+ VIR_FREE(str); -+ if ((str = virXPathString("string(./driver/host/@ufo)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown host ufo mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.host.ufo = val; -+ } -+ VIR_FREE(str); -+ if ((str = virXPathString("string(./driver/guest/@csum)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown guest csum mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.guest.csum = val; -+ } -+ VIR_FREE(str); -+ if ((str = virXPathString("string(./driver/guest/@tso4)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown guest tso4 mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.guest.tso4 = val; -+ } -+ VIR_FREE(str); -+ if ((str = virXPathString("string(./driver/guest/@tso6)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown guest tso6 mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.guest.tso6 = val; -+ } -+ VIR_FREE(str); -+ if ((str = virXPathString("string(./driver/guest/@ecn)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown guest ecn mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.guest.ecn = val; -+ } -+ VIR_FREE(str); -+ if ((str = virXPathString("string(./driver/guest/@ufo)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unknown guest ufo mode '%s'"), -+ str); -+ goto error; -+ } -+ def->driver.virtio.guest.ufo = val; -+ } - } - - def->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT; -@@ -7438,6 +7548,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, - VIR_FREE(ioeventfd); - VIR_FREE(event_idx); - VIR_FREE(queues); -+ VIR_FREE(str); - VIR_FREE(filter); - VIR_FREE(type); - VIR_FREE(internal); -@@ -16443,6 +16554,80 @@ virDomainActualNetDefFormat(virBufferPtr buf, - - - static int -+virDomainVirtioNetGuestOptsFormat(char **outstr, -+ virDomainNetDefPtr def) -+{ -+ virBuffer buf = VIR_BUFFER_INITIALIZER; -+ if (def->driver.virtio.guest.csum) { -+ virBufferAsprintf(&buf, "csum='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.guest.csum)); -+ } -+ if (def->driver.virtio.guest.tso4) { -+ virBufferAsprintf(&buf, "tso4='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.guest.tso4)); -+ } -+ if (def->driver.virtio.guest.tso6) { -+ virBufferAsprintf(&buf, "tso6='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.guest.tso6)); -+ } -+ if (def->driver.virtio.guest.ecn) { -+ virBufferAsprintf(&buf, "ecn='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.guest.ecn)); -+ } -+ if (def->driver.virtio.guest.ufo) { -+ virBufferAsprintf(&buf, "ufo='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.guest.ufo)); -+ } -+ virBufferTrim(&buf, " ", -1); -+ -+ if (virBufferCheckError(&buf) < 0) -+ return -1; -+ -+ *outstr = virBufferContentAndReset(&buf); -+ return 0; -+} -+ -+ -+static int -+virDomainVirtioNetHostOptsFormat(char **outstr, -+ virDomainNetDefPtr def) -+{ -+ virBuffer buf = VIR_BUFFER_INITIALIZER; -+ if (def->driver.virtio.host.csum) { -+ virBufferAsprintf(&buf, "csum='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.host.csum)); -+ } -+ if (def->driver.virtio.host.gso) { -+ virBufferAsprintf(&buf, "gso='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.host.gso)); -+ } -+ if (def->driver.virtio.host.tso4) { -+ virBufferAsprintf(&buf, "tso4='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.host.tso4)); -+ } -+ if (def->driver.virtio.host.tso6) { -+ virBufferAsprintf(&buf, "tso6='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.host.tso6)); -+ } -+ if (def->driver.virtio.host.ecn) { -+ virBufferAsprintf(&buf, "ecn='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.host.ecn)); -+ } -+ if (def->driver.virtio.host.ufo) { -+ virBufferAsprintf(&buf, "ufo='%s' ", -+ virTristateSwitchTypeToString(def->driver.virtio.host.ufo)); -+ } -+ virBufferTrim(&buf, " ", -1); -+ -+ if (virBufferCheckError(&buf) < 0) -+ return -1; -+ -+ *outstr = virBufferContentAndReset(&buf); -+ return 0; -+} -+ -+ -+static int - virDomainVirtioNetDriverFormat(char **outstr, - virDomainNetDefPtr def) - { -@@ -16493,7 +16678,6 @@ virDomainNetDefFormat(virBufferPtr buf, - virDomainHostdevDefPtr hostdef = NULL; - char macstr[VIR_MAC_STRING_BUFLEN]; - -- - if (publicActual) { - if (!(typeStr = virDomainNetTypeToString(actualType))) { - virReportError(VIR_ERR_INTERNAL_ERROR, -@@ -16652,14 +16836,36 @@ virDomainNetDefFormat(virBufferPtr buf, - virBufferEscapeString(buf, "\n", - def->model); - if (STREQ(def->model, "virtio")) { -- char *str; -+ char *str = NULL, *gueststr = NULL, *hoststr = NULL; -+ int rc = 0; - -- if (virDomainVirtioNetDriverFormat(&str, def) < 0) -- return -1; -+ if (virDomainVirtioNetDriverFormat(&str, def) < 0 || -+ virDomainVirtioNetGuestOptsFormat(&gueststr, def) < 0 || -+ virDomainVirtioNetHostOptsFormat(&hoststr, def) < 0) -+ rc = -1; - -- if (str) -- virBufferAsprintf(buf, "\n", str); -+ if (!gueststr && !hoststr) { -+ if (str) -+ virBufferAsprintf(buf, "\n", str); -+ } else { -+ if (str) -+ virBufferAsprintf(buf, "\n", str); -+ else -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ if (hoststr) -+ virBufferAsprintf(buf, "\n", hoststr); -+ if (gueststr) -+ virBufferAsprintf(buf, "\n", gueststr); -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ } - VIR_FREE(str); -+ VIR_FREE(hoststr); -+ VIR_FREE(gueststr); -+ -+ if (rc < 0) -+ return -1; - } - } - if (def->backend.tap || def->backend.vhost) { -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index decd4be..39f1948 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -895,6 +895,21 @@ struct _virDomainNetDef { - virTristateSwitch ioeventfd; - virTristateSwitch event_idx; - unsigned int queues; /* Multiqueue virtio-net */ -+ struct { -+ virTristateSwitch csum; -+ virTristateSwitch gso; -+ virTristateSwitch tso4; -+ virTristateSwitch tso6; -+ virTristateSwitch ecn; -+ virTristateSwitch ufo; -+ } host; -+ struct { -+ virTristateSwitch csum; -+ virTristateSwitch tso4; -+ virTristateSwitch tso6; -+ virTristateSwitch ecn; -+ virTristateSwitch ufo; -+ } guest; - } virtio; - } driver; - struct { -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.xml -new file mode 100644 -index 0000000..e368c43 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.xml -@@ -0,0 +1,35 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 3ca64d4..ee05212 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -261,6 +261,7 @@ mymain(void) - DO_TEST("net-user"); - DO_TEST("net-virtio"); - DO_TEST("net-virtio-device"); -+ DO_TEST("net-virtio-disable-offloads"); - DO_TEST("net-eth"); - DO_TEST("net-eth-ifname"); - DO_TEST("net-virtio-network-portgroup"); --- -2.1.1 - diff --git a/SOURCES/libvirt-conf-add-trustGuestRxFilters-attribute-to-network-and-domain-interface.patch b/SOURCES/libvirt-conf-add-trustGuestRxFilters-attribute-to-network-and-domain-interface.patch deleted file mode 100644 index 3ff14b1..0000000 --- a/SOURCES/libvirt-conf-add-trustGuestRxFilters-attribute-to-network-and-domain-interface.patch +++ /dev/null @@ -1,556 +0,0 @@ -From ab2444643bb5f1549a5d089d7988758837dfc96e Mon Sep 17 00:00:00 2001 -Message-Id: -From: Laine Stump -Date: Mon, 3 Nov 2014 10:00:15 -0500 -Subject: [PATCH] conf: add trustGuestRxFilters attribute to network and domain - interface - -https://bugzilla.redhat.com/show_bug.cgi?id=848199 - -This new attribute will control whether or not libvirt will pay -attention to guest notifications about changes to network device mac -addresses and receive filters. The default for this is 'no' (for -security reasons). If it is set to 'yes' *and* the specified device -model and connection support it (currently only macvtap+virtio) then -libvirt will watch for NIC_RX_FILTER_CHANGED events, and when it -receives one, it will issue a query-rx-filter command, retrieve the -result, and modify the host-side macvtap interface's mac address and -unicast/multicast filters accordingly. - -The functionality behind this attribute will be in a later patch. This -patch merely adds the attribute to the top-level of a domain's - as well as to and , and adds -documentation and schema/xml2xml tests. Rather than adding even more -test files, I've just added the net attribute in various applicable -places of existing test files. - -(cherry picked from commit 07450cd42951d5007ab28d8e522f65d948181674) - -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 40 +++++++++++++++++---- - docs/formatnetwork.html.in | 29 +++++++++++++-- - docs/schemas/domaincommon.rng | 5 +++ - docs/schemas/network.rng | 10 ++++++ - src/conf/domain_conf.c | 42 ++++++++++++++++++++++ - src/conf/domain_conf.h | 3 ++ - src/conf/network_conf.c | 36 +++++++++++++++++++ - src/conf/network_conf.h | 2 ++ - src/libvirt_private.syms | 1 + - tests/networkxml2xmlin/vepa-net.xml | 4 +-- - tests/networkxml2xmlout/vepa-net.xml | 4 +-- - .../qemuxml2argv-net-virtio-network-portgroup.xml | 4 +-- - 12 files changed, 164 insertions(+), 16 deletions(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index e00fe47..80af7fa 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -3343,10 +3343,9 @@ -
-   ...
-   <devices>
--    <interface type='bridge'>
--      <source bridge='xenbr0'/>
--      <mac address='00:16:3e:5d:c7:9e'/>
--      <script path='vif-bridge'/>
-+    <interface type='direct' trustGuestRxFilters='yes'>
-+      <source dev='eth0'/>
-+      <mac address='52:54:00:5d:c7:9e'/>
-       <boot order='1'/>
-       <rom bar='off'/>
-     </interface>
-@@ -3356,8 +3355,23 @@
-     

- There are several possibilities for specifying a network - interface visible to the guest. Each subsection below provides -- more details about common setup options. Additionally, -- each <interface> element has an -+ more details about common setup options. -+

-+

-+ Since 1.2.10), -+ the interface element -+ property trustGuestRxFilters provides the -+ capability for the host to detect and trust reports from the -+ guest regarding changes to the interface mac address and receive -+ filters by setting the attribute to yes. The default -+ setting for the attribute is no for security -+ reasons and support depends on the guest network device model as -+ well as the type of connection on the host - currently it is -+ only supported for the virtio ddevice model and for macvtap -+ connections on the host. -+

-+

-+ Each <interface> element has an - optional <address> sub-element that can tie - the interface to a particular pci slot, with - attribute type='pci' -@@ -3589,6 +3603,18 @@ - being the default mode. The individual modes cause the delivery of - packets to behave as follows: -

-+

-+ If the model type is set to virtio and -+ interface's trustGuestRxFilters attribute is set -+ to yes, changes made to the interface mac address, -+ unicast/multicast receive filters, and vlan settings in the -+ guest will be monitored and propagated to the associated macvtap -+ device on the host (Since -+ 1.2.10). If trustGuestRxFilters is not set, -+ or is not supported for the device model in use, an attempted -+ change to the mac address originating from the guest side will -+ result in a non-working network connection. -+

- -
-
vepa
-@@ -3621,7 +3647,7 @@ - ... - <devices> - ... -- <interface type='direct'> -+ <interface type='direct' trustGuestRxFilters='no'> - <source dev='eth0' mode='vepa'/> - </interface> - </devices> -diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in -index 1a8ad8e..dc438ae 100644 ---- a/docs/formatnetwork.html.in -+++ b/docs/formatnetwork.html.in -@@ -35,7 +35,7 @@ -

- -
--      <network ipv6='yes'>
-+      <network ipv6='yes' trustGuestRxFilters='no'>
-         <name>default</name>
-         <uuid>3e3fce45-4f53-4fa7-bb32-11f34168b82b</uuid>
-         ...
-@@ -60,6 +60,16 @@ - to have guest-to-guest communications. For further information, - see the example below for the example with no gateway addresses. - Since 1.0.1 -+
trustGuestRxFilters='yes'
-+
The optional parameter trustGuestRxFilters can -+ be used to set that attribute of the same name for each domain -+ interface connected to this network (since -+ 1.2.10). See -+ the Network -+ interfaces section of the domain XML documentation for -+ more details. Note that an explicit setting of this attribute -+ in a portgroup or the individual domain interface will -+ override the setting in the network.
-
- -

Connectivity

-@@ -606,7 +616,7 @@ - <outbound average='1000' peak='5000' burst='5120'/> - </bandwidth> - </portgroup> -- <portgroup name='sales'> -+ <portgroup name='sales' trustGuestRxFilters='no'> - <virtualport type='802.1Qbh'> - <parameters profileid='salestest'/> - </virtualport> -@@ -626,7 +636,7 @@ - network can have multiple portgroup elements (and one of those - can optionally be designated as the 'default' portgroup for the - network), and each portgroup has a name, as well as various -- subelements associated with it. The currently supported -+ attributes and subelements associated with it. The currently supported - subelements are <bandwidth> - (described here) - and <virtualport> -@@ -650,6 +660,19 @@ - considered an error, and will prevent the interface from - starting. -

-+

-+ portgroups also support the optional -+ parameter trustGuestRxFilters which can be used to -+ set that attribute of the same name for each domain interface -+ using this portgroup (since -+ 1.2.10). See -+ the Network -+ interfaces section of the domain XML documentation for more -+ details. Note that an explicit setting of this attribute in the -+ portgroup overrides the network-wide setting, and an explicit -+ setting in the individual domain interface will override the -+ setting in the portgroup. -+

- -
Static Routes
-

-diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 8d96daa..c010c45 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -2240,6 +2240,11 @@ - - - -+ -+ -+ -+ -+ - - - ++ ++ + + + +@@ -326,6 +332,15 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +-- +2.4.5 + diff --git a/SOURCES/libvirt-cpu-Align-ppc64-CPU-data-with-x86.patch b/SOURCES/libvirt-cpu-Align-ppc64-CPU-data-with-x86.patch new file mode 100644 index 0000000..c5fb052 --- /dev/null +++ b/SOURCES/libvirt-cpu-Align-ppc64-CPU-data-with-x86.patch @@ -0,0 +1,251 @@ +From d7efd0615b63be6fad7c0833f988430e79ced194 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:16:04 +0200 +Subject: [PATCH] cpu: Align ppc64 CPU data with x86 + +Use a typedef instead of the plain struct and heap allocation. This +will make it easier to extend the ppc64 specific CPU data later on. + +(cherry picked from commit adb865df85c525f0cffa995b8fd4e7f897c8f35c) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu.h | 2 +- + src/cpu/cpu_ppc64.c | 86 ++++++++++++++++++++++++++++++++++++------------ + src/cpu/cpu_ppc64_data.h | 3 +- + 3 files changed, 68 insertions(+), 23 deletions(-) + +diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h +index 49d4226..7375876 100644 +--- a/src/cpu/cpu.h ++++ b/src/cpu/cpu.h +@@ -38,7 +38,7 @@ struct _virCPUData { + virArch arch; + union { + virCPUx86Data *x86; +- struct cpuPPC64Data ppc64; ++ virCPUppc64Data *ppc64; + /* generic driver needs no data */ + } data; + }; +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index efac739..6c78ab8 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -48,7 +48,7 @@ struct ppc64_vendor { + struct ppc64_model { + char *name; + const struct ppc64_vendor *vendor; +- struct cpuPPC64Data data; ++ virCPUppc64Data *data; + struct ppc64_model *next; + }; + +@@ -58,6 +58,25 @@ struct ppc64_map { + }; + + static void ++ppc64DataFree(virCPUppc64Data *data) ++{ ++ VIR_FREE(data); ++} ++ ++static virCPUppc64Data * ++ppc64DataCopy(const virCPUppc64Data *data) ++{ ++ virCPUppc64Data *copy; ++ ++ if (VIR_ALLOC(copy) < 0) ++ return NULL; ++ ++ copy->pvr = data->pvr; ++ ++ return copy; ++} ++ ++static void + ppc64VendorFree(struct ppc64_vendor *vendor) + { + if (!vendor) +@@ -90,6 +109,7 @@ ppc64ModelFree(struct ppc64_model *model) + if (!model) + return; + ++ ppc64DataFree(model->data); + VIR_FREE(model->name); + VIR_FREE(model); + } +@@ -99,16 +119,22 @@ ppc64ModelCopy(const struct ppc64_model *model) + { + struct ppc64_model *copy; + +- if (VIR_ALLOC(copy) < 0 || +- VIR_STRDUP(copy->name, model->name) < 0) { +- ppc64ModelFree(copy); +- return NULL; +- } ++ if (VIR_ALLOC(copy) < 0) ++ goto error; ++ ++ if (VIR_STRDUP(copy->name, model->name) < 0) ++ goto error; ++ ++ if (!(copy->data = ppc64DataCopy(model->data))) ++ goto error; + +- copy->data.pvr = model->data.pvr; + copy->vendor = model->vendor; + + return copy; ++ ++ error: ++ ppc64ModelFree(copy); ++ return NULL; + } + + static struct ppc64_model * +@@ -136,7 +162,7 @@ ppc64ModelFindPVR(const struct ppc64_map *map, + + model = map->models; + while (model) { +- if (model->data.pvr == pvr) ++ if (model->data->pvr == pvr) + return model; + + model = model->next; +@@ -237,6 +263,11 @@ ppc64ModelLoad(xmlXPathContextPtr ctxt, + if (VIR_ALLOC(model) < 0) + return -1; + ++ if (VIR_ALLOC(model->data) < 0) { ++ ppc64ModelFree(model); ++ return -1; ++ } ++ + model->name = virXPathString("string(@name)", ctxt); + if (!model->name) { + virReportError(VIR_ERR_INTERNAL_ERROR, +@@ -274,7 +305,7 @@ ppc64ModelLoad(xmlXPathContextPtr ctxt, + model->name); + goto ignore; + } +- model->data.pvr = pvr; ++ model->data->pvr = pvr; + + if (!map->models) { + map->models = model; +@@ -318,7 +349,7 @@ ppc64LoadMap(void) + struct ppc64_map *map; + + if (VIR_ALLOC(map) < 0) +- return NULL; ++ goto error; + + if (cpuMapLoad("ppc64", ppc64MapLoadCallback, map) < 0) + goto error; +@@ -332,7 +363,7 @@ ppc64LoadMap(void) + + static virCPUDataPtr + ppc64MakeCPUData(virArch arch, +- struct cpuPPC64Data *data) ++ virCPUppc64Data *data) + { + virCPUDataPtr cpuData; + +@@ -340,7 +371,9 @@ ppc64MakeCPUData(virArch arch, + return NULL; + + cpuData->arch = arch; +- cpuData->data.ppc64 = *data; ++ ++ if (!(cpuData->data.ppc64 = ppc64DataCopy(data))) ++ VIR_FREE(cpuData); + + return cpuData; + } +@@ -421,7 +454,7 @@ ppc64Compute(virCPUDefPtr host, + } + + if (guestData) +- if (!(*guestData = ppc64MakeCPUData(arch, &guest_model->data))) ++ if (!(*guestData = ppc64MakeCPUData(arch, guest_model->data))) + goto cleanup; + + ret = VIR_CPU_COMPARE_IDENTICAL; +@@ -473,10 +506,10 @@ ppc64DriverDecode(virCPUDefPtr cpu, + if (!data || !(map = ppc64LoadMap())) + return -1; + +- if (!(model = ppc64ModelFindPVR(map, data->data.ppc64.pvr))) { ++ if (!(model = ppc64ModelFindPVR(map, data->data.ppc64->pvr))) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("Cannot find CPU model with PVR 0x%08x"), +- data->data.ppc64.pvr); ++ data->data.ppc64->pvr); + goto cleanup; + } + +@@ -506,25 +539,36 @@ ppc64DriverFree(virCPUDataPtr data) + if (!data) + return; + ++ ppc64DataFree(data->data.ppc64); + VIR_FREE(data); + } + + static virCPUDataPtr + ppc64DriverNodeData(virArch arch) + { +- virCPUDataPtr cpuData; ++ virCPUDataPtr nodeData; ++ virCPUppc64Data *data; + +- if (VIR_ALLOC(cpuData) < 0) +- return NULL; ++ if (VIR_ALLOC(nodeData) < 0) ++ goto error; + +- cpuData->arch = arch; ++ if (VIR_ALLOC(data) < 0) ++ goto error; ++ ++ data = nodeData->data.ppc64; + + #if defined(__powerpc__) || defined(__powerpc64__) + asm("mfpvr %0" +- : "=r" (cpuData->data.ppc64.pvr)); ++ : "=r" (data->pvr)); + #endif + +- return cpuData; ++ nodeData->arch = arch; ++ ++ return nodeData; ++ ++ error: ++ ppc64DriverFree(nodeData); ++ return NULL; + } + + static virCPUCompareResult +diff --git a/src/cpu/cpu_ppc64_data.h b/src/cpu/cpu_ppc64_data.h +index 45152de..c18fc63 100644 +--- a/src/cpu/cpu_ppc64_data.h ++++ b/src/cpu/cpu_ppc64_data.h +@@ -26,7 +26,8 @@ + + # include + +-struct cpuPPC64Data { ++typedef struct _virCPUppc64Data virCPUppc64Data; ++struct _virCPUppc64Data { + uint32_t pvr; + }; + +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Better-support-for-ppc64-compatibility-modes.patch b/SOURCES/libvirt-cpu-Better-support-for-ppc64-compatibility-modes.patch new file mode 100644 index 0000000..c389db9 --- /dev/null +++ b/SOURCES/libvirt-cpu-Better-support-for-ppc64-compatibility-modes.patch @@ -0,0 +1,137 @@ +From 487347db121ea526b8bd8c90fef223b57b058530 Mon Sep 17 00:00:00 2001 +Message-Id: <487347db121ea526b8bd8c90fef223b57b058530@dist-git> +From: Andrea Bolognani +Date: Fri, 21 Aug 2015 16:36:02 -0700 +Subject: [PATCH] cpu: Better support for ppc64 compatibility modes + +Not all combinations of host CPU models and compatibility modes +are valid, so we need to make sure we don't try to do something +that QEMU will reject. + +Moreover, we need to apply a different logic to guests using +host-model and host-passthrough modes when testing them for host +compatibility. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1251927 +(cherry picked from commit 2f913162ed615faa7227d7366b39fa59b23f233d) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1251927 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 86 insertions(+), 3 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 72b8fa0..a72cc32 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -84,6 +84,53 @@ ppc64ConvertLegacyCPUDef(const virCPUDef *legacy) + return cpu; + } + ++/* Some hosts can run guests in compatibility mode, but not all ++ * host CPUs support this and not all combinations are valid. ++ * This function performs the necessary checks */ ++static virCPUCompareResult ++ppc64CheckCompatibilityMode(const char *host_model, ++ const char *compat_mode) ++{ ++ int host; ++ int compat; ++ char *tmp; ++ virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR; ++ ++ if (!compat_mode) ++ return VIR_CPU_COMPARE_IDENTICAL; ++ ++ /* Valid host CPUs: POWER6, POWER7, POWER8 */ ++ if (!STRPREFIX(host_model, "POWER") || ++ !(tmp = (char *) host_model + strlen("POWER")) || ++ virStrToLong_i(tmp, NULL, 10, &host) < 0 || ++ host < 6 || host > 8) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ "%s", ++ _("Host CPU does not support compatibility modes")); ++ goto out; ++ } ++ ++ /* Valid compatibility modes: power6, power7, power8 */ ++ if (!STRPREFIX(compat_mode, "power") || ++ !(tmp = (char *) compat_mode + strlen("power")) || ++ virStrToLong_i(tmp, NULL, 10, &compat) < 0 || ++ compat < 6 || compat > 8) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Unknown compatibility mode %s"), ++ compat_mode); ++ goto out; ++ } ++ ++ /* Version check */ ++ if (compat > host) ++ ret = VIR_CPU_COMPARE_INCOMPATIBLE; ++ else ++ ret = VIR_CPU_COMPARE_IDENTICAL; ++ ++ out: ++ return ret; ++} ++ + static void + ppc64DataFree(virCPUppc64Data *data) + { +@@ -509,11 +556,47 @@ ppc64Compute(virCPUDefPtr host, + goto cleanup; + } + +- if (!(map = ppc64LoadMap()) || +- !(host_model = ppc64ModelFromCPU(host, map)) || +- !(guest_model = ppc64ModelFromCPU(cpu, map))) ++ if (!(map = ppc64LoadMap())) + goto cleanup; + ++ /* Host CPU information */ ++ if (!(host_model = ppc64ModelFromCPU(host, map))) ++ goto cleanup; ++ ++ if (cpu->type == VIR_CPU_TYPE_GUEST) { ++ /* Guest CPU information */ ++ virCPUCompareResult tmp; ++ switch (cpu->mode) { ++ case VIR_CPU_MODE_HOST_MODEL: ++ /* host-model only: ++ * we need to take compatibility modes into account */ ++ tmp = ppc64CheckCompatibilityMode(host->model, cpu->model); ++ if (tmp != VIR_CPU_COMPARE_IDENTICAL) { ++ ret = tmp; ++ goto cleanup; ++ } ++ /* fallthrough */ ++ ++ case VIR_CPU_MODE_HOST_PASSTHROUGH: ++ /* host-model and host-passthrough: ++ * the guest CPU is the same as the host */ ++ if (!(guest_model = ppc64ModelCopy(host_model))) ++ goto cleanup; ++ break; ++ ++ case VIR_CPU_MODE_CUSTOM: ++ /* custom: ++ * look up guest CPU information */ ++ if (!(guest_model = ppc64ModelFromCPU(cpu, map))) ++ goto cleanup; ++ break; ++ } ++ } else { ++ /* Other host CPU information */ ++ if (!(guest_model = ppc64ModelFromCPU(cpu, map))) ++ goto cleanup; ++ } ++ + if (STRNEQ(guest_model->name, host_model->name)) { + VIR_DEBUG("host CPU model does not match required CPU model %s", + guest_model->name); +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-CPU-model-names-have-to-match-on-ppc64.patch b/SOURCES/libvirt-cpu-CPU-model-names-have-to-match-on-ppc64.patch new file mode 100644 index 0000000..0b1ab1b --- /dev/null +++ b/SOURCES/libvirt-cpu-CPU-model-names-have-to-match-on-ppc64.patch @@ -0,0 +1,114 @@ +From f9bb279a947c2b296a05bfe77881a8dda3b01e31 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:16:01 +0200 +Subject: [PATCH] cpu: CPU model names have to match on ppc64 + +Limitations of the POWER architecture mean that you can't run +eg. a POWER7 guest on a POWER8 host when using KVM. This applies +to all guests, not just those using VIR_CPU_MATCH_STRICT in the +CPU definition; in fact, exact and strict CPU matching are +basically the same on ppc64. + +This means, of course, that hosts using different CPUs have to be +considered incompatible as well. + +Change ppc64Compute(), called by cpuGuestData(), to reflect this +fact and update test cases accordingly. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 +(cherry picked from commit 96b2c7459cb689a27996c2d69131e245940bc533) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 5 +---- + tests/cputest.c | 4 ++-- + tests/cputestdata/ppc64-guest.xml | 2 +- + tests/cputestdata/ppc64-host+guest,ppc_models-result.xml | 2 +- + .../ppc64-host+guest-nofallback,ppc_models,POWER7_v2.1-result.xml | 5 ----- + 5 files changed, 5 insertions(+), 13 deletions(-) + delete mode 100644 tests/cputestdata/ppc64-host+guest-nofallback,ppc_models,POWER7_v2.1-result.xml + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 53d8fb0..0769956 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -350,7 +350,6 @@ ppc64Compute(virCPUDefPtr host, + const virCPUDef *cpu, + virCPUDataPtr *guestData, + char **message) +- + { + struct ppc64_map *map = NULL; + struct ppc64_model *host_model = NULL; +@@ -407,9 +406,7 @@ ppc64Compute(virCPUDefPtr host, + !(guest_model = ppc64ModelFromCPU(cpu, map))) + goto cleanup; + +- if (cpu->type == VIR_CPU_TYPE_GUEST && +- cpu->match == VIR_CPU_MATCH_STRICT && +- STRNEQ(guest_model->name, host_model->name)) { ++ if (STRNEQ(guest_model->name, host_model->name)) { + VIR_DEBUG("host CPU model does not match required CPU model %s", + guest_model->name); + if (message && +diff --git a/tests/cputest.c b/tests/cputest.c +index 93f9d2e..1e84fd3 100644 +--- a/tests/cputest.c ++++ b/tests/cputest.c +@@ -501,7 +501,7 @@ static const char *model486[] = { "486" }; + static const char *nomodel[] = { "nomodel" }; + static const char *models[] = { "qemu64", "core2duo", "Nehalem" }; + static const char *haswell[] = { "SandyBridge", "Haswell" }; +-static const char *ppc_models[] = { "POWER7", "POWER7_v2.1", "POWER8_v1.0"}; ++static const char *ppc_models[] = { "POWER7", "POWER7_v2.1", "POWER7_v2.3", "POWER8_v1.0"}; + + static int + mymain(void) +@@ -662,7 +662,7 @@ mymain(void) + NULL, "Haswell-noTSX", 0); + + DO_TEST_GUESTDATA("ppc64", "host", "guest", ppc_models, NULL, 0); +- DO_TEST_GUESTDATA("ppc64", "host", "guest-nofallback", ppc_models, "POWER7_v2.1", 0); ++ DO_TEST_GUESTDATA("ppc64", "host", "guest-nofallback", ppc_models, "POWER7_v2.1", -1); + + return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; + } +diff --git a/tests/cputestdata/ppc64-guest.xml b/tests/cputestdata/ppc64-guest.xml +index ac81ec0..9e91501 100644 +--- a/tests/cputestdata/ppc64-guest.xml ++++ b/tests/cputestdata/ppc64-guest.xml +@@ -1,4 +1,4 @@ + +- POWER8_v1.0 ++ POWER7_v2.3 + + +diff --git a/tests/cputestdata/ppc64-host+guest,ppc_models-result.xml b/tests/cputestdata/ppc64-host+guest,ppc_models-result.xml +index 0cb0830..3e55f68 100644 +--- a/tests/cputestdata/ppc64-host+guest,ppc_models-result.xml ++++ b/tests/cputestdata/ppc64-host+guest,ppc_models-result.xml +@@ -1,5 +1,5 @@ + + ppc64 +- POWER8_v1.0 ++ POWER7_v2.3 + IBM + +diff --git a/tests/cputestdata/ppc64-host+guest-nofallback,ppc_models,POWER7_v2.1-result.xml b/tests/cputestdata/ppc64-host+guest-nofallback,ppc_models,POWER7_v2.1-result.xml +deleted file mode 100644 +index 7e58361..0000000 +--- a/tests/cputestdata/ppc64-host+guest-nofallback,ppc_models,POWER7_v2.1-result.xml ++++ /dev/null +@@ -1,5 +0,0 @@ +- +- ppc64 +- POWER7_v2.1 +- IBM +- +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Don-t-update-host-model-guest-CPUs-on-ppc64.patch b/SOURCES/libvirt-cpu-Don-t-update-host-model-guest-CPUs-on-ppc64.patch new file mode 100644 index 0000000..0fd8245 --- /dev/null +++ b/SOURCES/libvirt-cpu-Don-t-update-host-model-guest-CPUs-on-ppc64.patch @@ -0,0 +1,48 @@ +From 202a17ed092c28749335bc7ed1641c5590841be6 Mon Sep 17 00:00:00 2001 +Message-Id: <202a17ed092c28749335bc7ed1641c5590841be6@dist-git> +From: Andrea Bolognani +Date: Fri, 21 Aug 2015 16:36:01 -0700 +Subject: [PATCH] cpu: Don't update host-model guest CPUs on ppc64 + +If a guest CPU is defined using + + + +the sub-element will contain the compatibility mode to use. +That means we can't just copy the host CPU model on cpuUpdate(), +otherwise we'll overwrite that information and migration of such +guests will fail. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1251927 +(cherry picked from commit 6d7c2f65c103c9b98baf595d14725e62651bdb1b) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1251927 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 85aa5bc..72b8fa0 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -667,13 +667,13 @@ ppc64DriverUpdate(virCPUDefPtr guest, + const virCPUDef *host) + { + switch ((virCPUMode) guest->mode) { +- case VIR_CPU_MODE_HOST_MODEL: + case VIR_CPU_MODE_HOST_PASSTHROUGH: + guest->match = VIR_CPU_MATCH_EXACT; + guest->fallback = VIR_CPU_FALLBACK_FORBID; + virCPUDefFreeModel(guest); + return virCPUDefCopyModel(guest, host, true); + ++ case VIR_CPU_MODE_HOST_MODEL: + case VIR_CPU_MODE_CUSTOM: + return 0; + +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Fix-segfault-in-the-ppc64-driver.patch b/SOURCES/libvirt-cpu-Fix-segfault-in-the-ppc64-driver.patch new file mode 100644 index 0000000..258a4be --- /dev/null +++ b/SOURCES/libvirt-cpu-Fix-segfault-in-the-ppc64-driver.patch @@ -0,0 +1,36 @@ +From 7306403f40cb6bf780db655dbd66867dad989df7 Mon Sep 17 00:00:00 2001 +Message-Id: <7306403f40cb6bf780db655dbd66867dad989df7@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 18:46:54 +0200 +Subject: [PATCH] cpu: Fix segfault in the ppc64 driver + +Commit adb865d introduced some changes in ppc64DriverNodeData() +that cause libvirtd to crash on startup unless this patch is +applied as well. + +(cherry picked from commit 133c25c81c9ef79053d8d67a1e897846f9d7adb5) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 33fec8b..85aa5bc 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -628,7 +628,7 @@ ppc64DriverNodeData(virArch arch) + if (VIR_ALLOC(nodeData) < 0) + goto error; + +- if (VIR_ALLOC(data) < 0) ++ if (VIR_ALLOC(nodeData->data.ppc64) < 0) + goto error; + + data = nodeData->data.ppc64; +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Forbid-model-fallback-in-the-ppc64-driver.patch b/SOURCES/libvirt-cpu-Forbid-model-fallback-in-the-ppc64-driver.patch new file mode 100644 index 0000000..dbc4325 --- /dev/null +++ b/SOURCES/libvirt-cpu-Forbid-model-fallback-in-the-ppc64-driver.patch @@ -0,0 +1,46 @@ +From 10b9626e8866873f047662b6e2ecdccd3235d76d Mon Sep 17 00:00:00 2001 +Message-Id: <10b9626e8866873f047662b6e2ecdccd3235d76d@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:16:10 +0200 +Subject: [PATCH] cpu: Forbid model fallback in the ppc64 driver + +Unlike what happens on x86, on ppc64 you can't mix and match CPU +features to obtain the guest CPU you want regardless of the host +CPU, so the concept of model fallback doesn't apply. + +Make sure CPU definitions emitted by the driver, eg. as output of +the cpuBaseline() and cpuUpdate() calls, reflect this fact. + +(cherry picked from commit 344d1675e84be60c024080afd74f0da6d25c5f6b) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index f24fc41..33fec8b 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -670,6 +670,7 @@ ppc64DriverUpdate(virCPUDefPtr guest, + case VIR_CPU_MODE_HOST_MODEL: + case VIR_CPU_MODE_HOST_PASSTHROUGH: + guest->match = VIR_CPU_MATCH_EXACT; ++ guest->fallback = VIR_CPU_FALLBACK_FORBID; + virCPUDefFreeModel(guest); + return virCPUDefCopyModel(guest, host, true); + +@@ -768,6 +769,7 @@ ppc64DriverBaseline(virCPUDefPtr *cpus, + + cpu->type = VIR_CPU_TYPE_GUEST; + cpu->match = VIR_CPU_MATCH_EXACT; ++ cpu->fallback = VIR_CPU_FALLBACK_FORBID; + + cleanup: + ppc64MapFree(map); +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Implement-backwards-compatibility-in-the-ppc64-driver.patch b/SOURCES/libvirt-cpu-Implement-backwards-compatibility-in-the-ppc64-driver.patch new file mode 100644 index 0000000..443741a --- /dev/null +++ b/SOURCES/libvirt-cpu-Implement-backwards-compatibility-in-the-ppc64-driver.patch @@ -0,0 +1,113 @@ +From 12305284ccf9163e90fbfc9b2c14ac735796e781 Mon Sep 17 00:00:00 2001 +Message-Id: <12305284ccf9163e90fbfc9b2c14ac735796e781@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:16:09 +0200 +Subject: [PATCH] cpu: Implement backwards compatibility in the ppc64 driver + +All previously recognized CPU models (POWER7_v2.1, POWER7_v2.3, +POWER7+_v2.1 and POWER8_v1.0) are internally converted to the +corrisponding generation name so that existing guests don't stop +working. + +(cherry picked from commit dee2247afa78c66db737626acb30afe04bd7cdef) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 45 insertions(+), 2 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index fafd84c..f24fc41 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -57,6 +57,33 @@ struct ppc64_map { + struct ppc64_model *models; + }; + ++/* Convert a legacy CPU definition by transforming ++ * model names to generation names: ++ * POWER7_v2.1 => POWER7 ++ * POWER7_v2.3 => POWER7 ++ * POWER7+_v2.1 => POWER7 ++ * POWER8_v1.0 => POWER8 */ ++static virCPUDefPtr ++ppc64ConvertLegacyCPUDef(const virCPUDef *legacy) ++{ ++ virCPUDefPtr cpu; ++ ++ if (!(cpu = virCPUDefCopy(legacy))) ++ goto out; ++ ++ if (!(STREQ(cpu->model, "POWER7_v2.1") || ++ STREQ(cpu->model, "POWER7_v2.3") || ++ STREQ(cpu->model, "POWER7+_v2.1") || ++ STREQ(cpu->model, "POWER8_v1.0"))) { ++ goto out; ++ } ++ ++ cpu->model[strlen("POWERx")] = 0; ++ ++ out: ++ return cpu; ++} ++ + static void + ppc64DataFree(virCPUppc64Data *data) + { +@@ -424,18 +451,22 @@ ppc64MakeCPUData(virArch arch, + + static virCPUCompareResult + ppc64Compute(virCPUDefPtr host, +- const virCPUDef *cpu, ++ const virCPUDef *other, + virCPUDataPtr *guestData, + char **message) + { + struct ppc64_map *map = NULL; + struct ppc64_model *host_model = NULL; + struct ppc64_model *guest_model = NULL; +- ++ virCPUDefPtr cpu = NULL; + virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR; + virArch arch; + size_t i; + ++ /* Ensure existing configurations are handled correctly */ ++ if (!(cpu = ppc64ConvertLegacyCPUDef(other))) ++ goto cleanup; ++ + if (cpu->arch != VIR_ARCH_NONE) { + bool found = false; + +@@ -504,6 +535,7 @@ ppc64Compute(virCPUDefPtr host, + ret = VIR_CPU_COMPARE_IDENTICAL; + + cleanup: ++ virCPUDefFree(cpu); + ppc64MapFree(map); + ppc64ModelFree(host_model); + ppc64ModelFree(guest_model); +@@ -681,6 +713,17 @@ ppc64DriverBaseline(virCPUDefPtr *cpus, + for (i = 0; i < ncpus; i++) { + const struct ppc64_vendor *vnd; + ++ /* Hosts running old (<= 1.2.18) versions of libvirt will report ++ * strings like 'power7+' or 'power8e' instead of proper CPU model ++ * names in the capabilities XML; moreover, they lack information ++ * about some proper CPU models like 'POWER8'. ++ * This implies two things: ++ * 1) baseline among such hosts never worked ++ * 2) while a few models, eg. 'POWER8_v1.0', could work on both ++ * old and new versions of libvirt, the information we have ++ * here is not enough to pick such a model ++ * Hence we just compare models by name to decide whether or not ++ * two hosts are compatible */ + if (STRNEQ(cpus[i]->model, model->name)) { + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("CPUs are incompatible")); +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Indentation-changes-in-the-ppc64-driver.patch b/SOURCES/libvirt-cpu-Indentation-changes-in-the-ppc64-driver.patch new file mode 100644 index 0000000..e89afab --- /dev/null +++ b/SOURCES/libvirt-cpu-Indentation-changes-in-the-ppc64-driver.patch @@ -0,0 +1,46 @@ +From 429baeb240d7d34abe27d87a76971311029a0704 Mon Sep 17 00:00:00 2001 +Message-Id: <429baeb240d7d34abe27d87a76971311029a0704@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:15:52 +0200 +Subject: [PATCH] cpu: Indentation changes in the ppc64 driver + +(cherry picked from commit 4ff3e939e7225f7a502e029067c848855815b569) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 7a48903..c3a51fb 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -340,7 +340,8 @@ ppc64LoadMap(void) + } + + static virCPUDataPtr +-ppc64MakeCPUData(virArch arch, struct cpuPPC64Data *data) ++ppc64MakeCPUData(virArch arch, ++ struct cpuPPC64Data *data) + { + virCPUDataPtr cpuData; + +@@ -695,9 +696,9 @@ ppc64GetModels(char ***models) + } + + struct cpuArchDriver cpuDriverPPC64 = { +- .name = "ppc64", +- .arch = archs, +- .narch = ARRAY_CARDINALITY(archs), ++ .name = "ppc64", ++ .arch = archs, ++ .narch = ARRAY_CARDINALITY(archs), + .compare = ppc64Compare, + .decode = ppc64Decode, + .encode = NULL, +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Introduce-IvyBridge-CPU-model.patch b/SOURCES/libvirt-cpu-Introduce-IvyBridge-CPU-model.patch new file mode 100644 index 0000000..4a60a71 --- /dev/null +++ b/SOURCES/libvirt-cpu-Introduce-IvyBridge-CPU-model.patch @@ -0,0 +1,77 @@ +From f7a5372992addeee44662958aa5b4d036d21fcf1 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Fri, 4 Sep 2015 15:06:40 +0200 +Subject: [PATCH] cpu: Introduce IvyBridge CPU model + +https://bugzilla.redhat.com/show_bug.cgi?id=1254420 + +Signed-off-by: Jiri Denemark +(cherry picked from commit 87205512565529b8baeb108e3d0fe376fc20c967) +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_map.xml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml +index c304c9a..e49d255 100644 +--- a/src/cpu/cpu_map.xml ++++ b/src/cpu/cpu_map.xml +@@ -515,6 +515,54 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +-- +2.5.1 + diff --git a/SOURCES/libvirt-cpu-Mark-driver-functions-in-ppc64-driver.patch b/SOURCES/libvirt-cpu-Mark-driver-functions-in-ppc64-driver.patch new file mode 100644 index 0000000..9fe7983 --- /dev/null +++ b/SOURCES/libvirt-cpu-Mark-driver-functions-in-ppc64-driver.patch @@ -0,0 +1,159 @@ +From f48120d7df0abb0fba08e8f42e7f135981ab5011 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:15:53 +0200 +Subject: [PATCH] cpu: Mark driver functions in ppc64 driver + +Use the ppc64Driver prefix for all functions that are used to +fill in the cpuDriverPPC64 structure, ie. those that are going +to be called by the generic CPU code. + +This makes it clear which functions are exported and which are +implementation details; it also gets rid of the ambiguity that +affected the ppc64DataFree() function which, despite what the +name suggested, was not related to ppc64DataCopy() and could +not be used to release the memory allocated for a +virCPUppc64Data* instance. + +No functional changes. + +(cherry picked from commit 2686bf229247279da79505238b001cf45e0b6950) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 62 ++++++++++++++++++++++++++--------------------------- + 1 file changed, 31 insertions(+), 31 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index c3a51fb..5140297 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -448,9 +448,9 @@ ppc64Compute(virCPUDefPtr host, + } + + static virCPUCompareResult +-ppc64Compare(virCPUDefPtr host, +- virCPUDefPtr cpu, +- bool failIncompatible) ++ppc64DriverCompare(virCPUDefPtr host, ++ virCPUDefPtr cpu, ++ bool failIncompatible) + { + if ((cpu->arch == VIR_ARCH_NONE || host->arch == cpu->arch) && + STREQ(host->model, cpu->model)) +@@ -465,12 +465,12 @@ ppc64Compare(virCPUDefPtr host, + } + + static int +-ppc64Decode(virCPUDefPtr cpu, +- const virCPUData *data, +- const char **models, +- unsigned int nmodels, +- const char *preferred ATTRIBUTE_UNUSED, +- unsigned int flags) ++ppc64DriverDecode(virCPUDefPtr cpu, ++ const virCPUData *data, ++ const char **models, ++ unsigned int nmodels, ++ const char *preferred ATTRIBUTE_UNUSED, ++ unsigned int flags) + { + int ret = -1; + struct ppc64_map *map; +@@ -510,7 +510,7 @@ ppc64Decode(virCPUDefPtr cpu, + + + static void +-ppc64DataFree(virCPUDataPtr data) ++ppc64DriverFree(virCPUDataPtr data) + { + if (data == NULL) + return; +@@ -519,7 +519,7 @@ ppc64DataFree(virCPUDataPtr data) + } + + static virCPUDataPtr +-ppc64NodeData(virArch arch) ++ppc64DriverNodeData(virArch arch) + { + virCPUDataPtr cpuData; + +@@ -537,17 +537,17 @@ ppc64NodeData(virArch arch) + } + + static virCPUCompareResult +-ppc64GuestData(virCPUDefPtr host, +- virCPUDefPtr guest, +- virCPUDataPtr *data, +- char **message) ++ppc64DriverGuestData(virCPUDefPtr host, ++ virCPUDefPtr guest, ++ virCPUDataPtr *data, ++ char **message) + { + return ppc64Compute(host, guest, data, message); + } + + static int +-ppc64Update(virCPUDefPtr guest, +- const virCPUDef *host) ++ppc64DriverUpdate(virCPUDefPtr guest, ++ const virCPUDef *host) + { + switch ((virCPUMode) guest->mode) { + case VIR_CPU_MODE_HOST_MODEL: +@@ -569,11 +569,11 @@ ppc64Update(virCPUDefPtr guest, + } + + static virCPUDefPtr +-ppc64Baseline(virCPUDefPtr *cpus, +- unsigned int ncpus, +- const char **models ATTRIBUTE_UNUSED, +- unsigned int nmodels ATTRIBUTE_UNUSED, +- unsigned int flags) ++ppc64DriverBaseline(virCPUDefPtr *cpus, ++ unsigned int ncpus, ++ const char **models ATTRIBUTE_UNUSED, ++ unsigned int nmodels ATTRIBUTE_UNUSED, ++ unsigned int flags) + { + struct ppc64_map *map = NULL; + const struct ppc64_model *model; +@@ -653,7 +653,7 @@ ppc64Baseline(virCPUDefPtr *cpus, + } + + static int +-ppc64GetModels(char ***models) ++ppc64DriverGetModels(char ***models) + { + struct ppc64_map *map; + struct ppc64_model *model; +@@ -699,14 +699,14 @@ struct cpuArchDriver cpuDriverPPC64 = { + .name = "ppc64", + .arch = archs, + .narch = ARRAY_CARDINALITY(archs), +- .compare = ppc64Compare, +- .decode = ppc64Decode, ++ .compare = ppc64DriverCompare, ++ .decode = ppc64DriverDecode, + .encode = NULL, +- .free = ppc64DataFree, +- .nodeData = ppc64NodeData, +- .guestData = ppc64GuestData, +- .baseline = ppc64Baseline, +- .update = ppc64Update, ++ .free = ppc64DriverFree, ++ .nodeData = ppc64DriverNodeData, ++ .guestData = ppc64DriverGuestData, ++ .baseline = ppc64DriverBaseline, ++ .update = ppc64DriverUpdate, + .hasFeature = NULL, +- .getModels = ppc64GetModels, ++ .getModels = ppc64DriverGetModels, + }; +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Move-check-for-NULL-CPU-model-inside-the-driver.patch b/SOURCES/libvirt-cpu-Move-check-for-NULL-CPU-model-inside-the-driver.patch new file mode 100644 index 0000000..b041c86 --- /dev/null +++ b/SOURCES/libvirt-cpu-Move-check-for-NULL-CPU-model-inside-the-driver.patch @@ -0,0 +1,108 @@ +From 71ec836090966a629753444b19d3beb6e490a571 Mon Sep 17 00:00:00 2001 +Message-Id: <71ec836090966a629753444b19d3beb6e490a571@dist-git> +From: Andrea Bolognani +Date: Fri, 21 Aug 2015 16:36:03 -0700 +Subject: [PATCH] cpu: Move check for NULL CPU model inside the driver + +While the check is appropriate for eg. the x86 and generic drivers, +there are some valid ppc64 guest configurations where the CPU +model is supposed to be NULL. + +Moving this check from the generic code to the drivers makes it +possible to accomodate both use cases. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1251927 +(cherry picked from commit 5750149fedb2ec7f1aaaad8286650255718c861d) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1251927 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu.c | 12 ------------ + src/cpu/cpu_generic.c | 6 ++++++ + src/cpu/cpu_ppc64.c | 3 ++- + src/cpu/cpu_x86.c | 6 ++++++ + 4 files changed, 14 insertions(+), 13 deletions(-) + +diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c +index 731df26..1952b53 100644 +--- a/src/cpu/cpu.c ++++ b/src/cpu/cpu.c +@@ -142,12 +142,6 @@ cpuCompare(virCPUDefPtr host, + + VIR_DEBUG("host=%p, cpu=%p", host, cpu); + +- if (!cpu->model) { +- virReportError(VIR_ERR_INVALID_ARG, "%s", +- _("no guest CPU model specified")); +- return VIR_CPU_COMPARE_ERROR; +- } +- + if ((driver = cpuGetSubDriver(host->arch)) == NULL) + return VIR_CPU_COMPARE_ERROR; + +@@ -376,12 +370,6 @@ cpuGuestData(virCPUDefPtr host, + + VIR_DEBUG("host=%p, guest=%p, data=%p, msg=%p", host, guest, data, msg); + +- if (!guest->model) { +- virReportError(VIR_ERR_INVALID_ARG, "%s", +- _("no guest CPU model specified")); +- return VIR_CPU_COMPARE_ERROR; +- } +- + if ((driver = cpuGetSubDriver(host->arch)) == NULL) + return VIR_CPU_COMPARE_ERROR; + +diff --git a/src/cpu/cpu_generic.c b/src/cpu/cpu_generic.c +index a9cde4c..f26a62d 100644 +--- a/src/cpu/cpu_generic.c ++++ b/src/cpu/cpu_generic.c +@@ -65,6 +65,12 @@ genericCompare(virCPUDefPtr host, + size_t i; + unsigned int reqfeatures; + ++ if (!cpu->model) { ++ virReportError(VIR_ERR_INVALID_ARG, "%s", ++ _("no guest CPU model specified")); ++ goto cleanup; ++ } ++ + if ((cpu->arch != VIR_ARCH_NONE && + host->arch != cpu->arch) || + STRNEQ(host->model, cpu->model)) { +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index a72cc32..364c8ed 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -71,7 +71,8 @@ ppc64ConvertLegacyCPUDef(const virCPUDef *legacy) + if (!(cpu = virCPUDefCopy(legacy))) + goto out; + +- if (!(STREQ(cpu->model, "POWER7_v2.1") || ++ if (!cpu->model || ++ !(STREQ(cpu->model, "POWER7_v2.1") || + STREQ(cpu->model, "POWER7_v2.3") || + STREQ(cpu->model, "POWER7+_v2.1") || + STREQ(cpu->model, "POWER8_v1.0"))) { +diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c +index f5f7697..90949f6 100644 +--- a/src/cpu/cpu_x86.c ++++ b/src/cpu/cpu_x86.c +@@ -1371,6 +1371,12 @@ x86Compute(virCPUDefPtr host, + virArch arch; + size_t i; + ++ if (!cpu->model) { ++ virReportError(VIR_ERR_INVALID_ARG, "%s", ++ _("no guest CPU model specified")); ++ return VIR_CPU_COMPARE_ERROR; ++ } ++ + if (cpu->arch != VIR_ARCH_NONE) { + bool found = false; + +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Never-skip-CPU-model-name-check-in-ppc64-driver.patch b/SOURCES/libvirt-cpu-Never-skip-CPU-model-name-check-in-ppc64-driver.patch new file mode 100644 index 0000000..d58989d --- /dev/null +++ b/SOURCES/libvirt-cpu-Never-skip-CPU-model-name-check-in-ppc64-driver.patch @@ -0,0 +1,75 @@ +From 22376689ed26a2bba1c8a9fa328a046eee0da4c4 Mon Sep 17 00:00:00 2001 +Message-Id: <22376689ed26a2bba1c8a9fa328a046eee0da4c4@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:16:00 +0200 +Subject: [PATCH] cpu: Never skip CPU model name check in ppc64 driver + +ppc64Compute(), called by cpuNodeData(), is used not only to retrieve +the driver-specific data associated to a guest CPU definition, but +also to check whether said guest CPU is compatible with the host CPU. + +If the user is not interested in the CPU data, it's perfectly fine +to pass a NULL pointer instead of a return location, and the +compatibility data returned should not be affected by this. One of +the checks, specifically the one on CPU model name, was however +only performed if the return location was non-NULL. + +(cherry picked from commit 8382136d42fd2caf2e5c7ad3b579f4fc5f104533) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 31 +++++++++++++++---------------- + 1 file changed, 15 insertions(+), 16 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 5921263..53d8fb0 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -407,26 +407,25 @@ ppc64Compute(virCPUDefPtr host, + !(guest_model = ppc64ModelFromCPU(cpu, map))) + goto cleanup; + +- if (guestData) { +- if (cpu->type == VIR_CPU_TYPE_GUEST && +- cpu->match == VIR_CPU_MATCH_STRICT && +- STRNEQ(guest_model->name, host_model->name)) { +- VIR_DEBUG("host CPU model does not match required CPU model %s", +- guest_model->name); +- if (message && +- virAsprintf(message, +- _("host CPU model does not match required " +- "CPU model %s"), +- guest_model->name) < 0) +- goto cleanup; +- +- ret = VIR_CPU_COMPARE_INCOMPATIBLE; ++ if (cpu->type == VIR_CPU_TYPE_GUEST && ++ cpu->match == VIR_CPU_MATCH_STRICT && ++ STRNEQ(guest_model->name, host_model->name)) { ++ VIR_DEBUG("host CPU model does not match required CPU model %s", ++ guest_model->name); ++ if (message && ++ virAsprintf(message, ++ _("host CPU model does not match required " ++ "CPU model %s"), ++ guest_model->name) < 0) + goto cleanup; +- } + ++ ret = VIR_CPU_COMPARE_INCOMPATIBLE; ++ goto cleanup; ++ } ++ ++ if (guestData) + if (!(*guestData = ppc64MakeCPUData(arch, &guest_model->data))) + goto cleanup; +- } + + ret = VIR_CPU_COMPARE_IDENTICAL; + +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Parse-and-use-PVR-masks-in-the-ppc64-driver.patch b/SOURCES/libvirt-cpu-Parse-and-use-PVR-masks-in-the-ppc64-driver.patch new file mode 100644 index 0000000..f01df6b --- /dev/null +++ b/SOURCES/libvirt-cpu-Parse-and-use-PVR-masks-in-the-ppc64-driver.patch @@ -0,0 +1,139 @@ +From 9407ad274bb1494c343fedb2894faf9bd2e18618 Mon Sep 17 00:00:00 2001 +Message-Id: <9407ad274bb1494c343fedb2894faf9bd2e18618@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:16:07 +0200 +Subject: [PATCH] cpu: Parse and use PVR masks in the ppc64 driver + +Instead of relying on a hard-coded mask value, read it from the CPU +map XML and use it when looking up models by PVR. + +(cherry picked from commit 5d0aa93c509a93b7e60b1066e5a912b42f575916) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_map.xml | 14 +++++++------- + src/cpu/cpu_ppc64.c | 23 +++++++++++++---------- + src/cpu/cpu_ppc64_data.h | 1 + + 3 files changed, 21 insertions(+), 17 deletions(-) + +diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml +index 9474a1b..4e7ca2a 100644 +--- a/src/cpu/cpu_map.xml ++++ b/src/cpu/cpu_map.xml +@@ -630,30 +630,30 @@ + + + +- ++ + + + + +- +- ++ ++ + + + + +- +- ++ ++ + + + + + +- ++ + + + + +- ++ + + + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index ba33e05..fafd84c 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -81,8 +81,10 @@ ppc64DataCopy(const virCPUppc64Data *data) + + copy->len = data->len; + +- for (i = 0; i < data->len; i++) ++ for (i = 0; i < data->len; i++) { + copy->pvr[i].value = data->pvr[i].value; ++ copy->pvr[i].mask = data->pvr[i].mask; ++ } + + return copy; + +@@ -179,20 +181,12 @@ ppc64ModelFindPVR(const struct ppc64_map *map, + model = map->models; + while (model) { + for (i = 0; i < model->data->len; i++) { +- if (model->data->pvr[i].value == pvr) ++ if ((pvr & model->data->pvr[i].mask) == model->data->pvr[i].value) + return model; + } + model = model->next; + } + +- /* PowerPC Processor Version Register is interpreted as follows : +- * Higher order 16 bits : Power ISA generation. +- * Lower order 16 bits : CPU chip version number. +- * If the exact CPU isn't found, return the nearest matching CPU generation +- */ +- if (pvr & 0x0000FFFFul) +- return ppc64ModelFindPVR(map, (pvr & 0xFFFF0000ul)); +- + return NULL; + } + +@@ -345,6 +339,14 @@ ppc64ModelLoad(xmlXPathContextPtr ctxt, + goto ignore; + } + model->data->pvr[i].value = pvr; ++ ++ if (virXPathULongHex("string(./@mask)", ctxt, &pvr) < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Missing or invalid PVR mask in CPU model %s"), ++ model->name); ++ goto ignore; ++ } ++ model->data->pvr[i].mask = pvr; + } + + if (!map->models) { +@@ -608,6 +610,7 @@ ppc64DriverNodeData(virArch arch) + asm("mfpvr %0" + : "=r" (data->pvr[0].value)); + #endif ++ data->pvr[0].mask = 0xfffffffful; + + nodeData->arch = arch; + +diff --git a/src/cpu/cpu_ppc64_data.h b/src/cpu/cpu_ppc64_data.h +index 0d3cb0b..c0a130e 100644 +--- a/src/cpu/cpu_ppc64_data.h ++++ b/src/cpu/cpu_ppc64_data.h +@@ -29,6 +29,7 @@ + typedef struct _virCPUppc64PVR virCPUppc64PVR; + struct _virCPUppc64PVR { + uint32_t value; ++ uint32_t mask; + }; + + typedef struct _virCPUppc64Data virCPUppc64Data; +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Remove-ISA-information-from-CPU-map-XML.patch b/SOURCES/libvirt-cpu-Remove-ISA-information-from-CPU-map-XML.patch new file mode 100644 index 0000000..0a06fa7 --- /dev/null +++ b/SOURCES/libvirt-cpu-Remove-ISA-information-from-CPU-map-XML.patch @@ -0,0 +1,59 @@ +From b57bf75ae9f4fd163f79fb71c5e98f852a8fd825 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:15:57 +0200 +Subject: [PATCH] cpu: Remove ISA information from CPU map XML + +The information is not used anywhere in libvirt. + +No functional changes. + +(cherry picked from commit cb8c0e1102c9d70b921dc41438b994ed5a08a7f8) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_map.xml | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml +index 51474e1..50516e3 100644 +--- a/src/cpu/cpu_map.xml ++++ b/src/cpu/cpu_map.xml +@@ -655,31 +655,26 @@ + + + +- + + + + + +- + + + + + +- + + + + + +- + + + + + +- + + + +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Rename-powerpc-ppc-ppc64-exported-symbols.patch b/SOURCES/libvirt-cpu-Rename-powerpc-ppc-ppc64-exported-symbols.patch new file mode 100644 index 0000000..4311d64 --- /dev/null +++ b/SOURCES/libvirt-cpu-Rename-powerpc-ppc-ppc64-exported-symbols.patch @@ -0,0 +1,189 @@ +From 1875eb905dd54477adea1ad55cd5e8b9f91cab15 Mon Sep 17 00:00:00 2001 +Message-Id: <1875eb905dd54477adea1ad55cd5e8b9f91cab15@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:15:50 +0200 +Subject: [PATCH] cpu: Rename {powerpc, ppc} => ppc64 (exported symbols) + +Only the symbols exported by the driver have been updated; +the driver implementation itself still uses the old names +internally. + +No functional changes. + +(cherry picked from commit e89733c4a443b6ea3a32c8e2f0dcd554c1ffd645) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu.c | 2 +- + src/cpu/cpu.h | 2 +- + src/cpu/cpu_ppc64.c | 18 +++++++++--------- + src/cpu/cpu_ppc64.h | 10 +++++----- + src/cpu/cpu_ppc64_data.h | 10 +++++----- + 5 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c +index 2e34f81..731df26 100644 +--- a/src/cpu/cpu.c ++++ b/src/cpu/cpu.c +@@ -44,7 +44,7 @@ VIR_LOG_INIT("cpu.cpu"); + + static struct cpuArchDriver *drivers[] = { + &cpuDriverX86, +- &cpuDriverPowerPC, ++ &cpuDriverPPC64, + &cpuDriverS390, + &cpuDriverArm, + &cpuDriverAARCH64, +diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h +index c0371cd..49d4226 100644 +--- a/src/cpu/cpu.h ++++ b/src/cpu/cpu.h +@@ -38,7 +38,7 @@ struct _virCPUData { + virArch arch; + union { + virCPUx86Data *x86; +- struct cpuPPCData ppc; ++ struct cpuPPC64Data ppc64; + /* generic driver needs no data */ + } data; + }; +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 7866bdd..bec4bf8 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -1,5 +1,5 @@ + /* +- * cpu_ppc64.c: CPU driver for PowerPC CPUs ++ * cpu_ppc64.c: CPU driver for 64-bit PowerPC CPUs + * + * Copyright (C) 2013 Red Hat, Inc. + * Copyright (C) IBM Corporation, 2010 +@@ -36,7 +36,7 @@ + + #define VIR_FROM_THIS VIR_FROM_CPU + +-VIR_LOG_INIT("cpu.cpu_powerpc"); ++VIR_LOG_INIT("cpu.cpu_ppc64"); + + static const virArch archs[] = { VIR_ARCH_PPC64, VIR_ARCH_PPC64LE }; + +@@ -48,7 +48,7 @@ struct ppc_vendor { + struct ppc_model { + char *name; + const struct ppc_vendor *vendor; +- struct cpuPPCData data; ++ struct cpuPPC64Data data; + struct ppc_model *next; + }; + +@@ -340,7 +340,7 @@ ppcLoadMap(void) + } + + static virCPUDataPtr +-ppcMakeCPUData(virArch arch, struct cpuPPCData *data) ++ppcMakeCPUData(virArch arch, struct cpuPPC64Data *data) + { + virCPUDataPtr cpuData; + +@@ -348,7 +348,7 @@ ppcMakeCPUData(virArch arch, struct cpuPPCData *data) + return NULL; + + cpuData->arch = arch; +- cpuData->data.ppc = *data; ++ cpuData->data.ppc64 = *data; + data = NULL; + + return cpuData; +@@ -480,10 +480,10 @@ ppcDecode(virCPUDefPtr cpu, + if (data == NULL || (map = ppcLoadMap()) == NULL) + return -1; + +- if (!(model = ppcModelFindPVR(map, data->data.ppc.pvr))) { ++ if (!(model = ppcModelFindPVR(map, data->data.ppc64.pvr))) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("Cannot find CPU model with PVR 0x%08x"), +- data->data.ppc.pvr); ++ data->data.ppc64.pvr); + goto cleanup; + } + +@@ -529,7 +529,7 @@ ppcNodeData(virArch arch) + + #if defined(__powerpc__) || defined(__powerpc64__) + asm("mfpvr %0" +- : "=r" (cpuData->data.ppc.pvr)); ++ : "=r" (cpuData->data.ppc64.pvr)); + #endif + + return cpuData; +@@ -694,7 +694,7 @@ ppcGetModels(char ***models) + goto cleanup; + } + +-struct cpuArchDriver cpuDriverPowerPC = { ++struct cpuArchDriver cpuDriverPPC64 = { + .name = "ppc64", + .arch = archs, + .narch = ARRAY_CARDINALITY(archs), +diff --git a/src/cpu/cpu_ppc64.h b/src/cpu/cpu_ppc64.h +index e9ef2be..a6c9659 100644 +--- a/src/cpu/cpu_ppc64.h ++++ b/src/cpu/cpu_ppc64.h +@@ -1,5 +1,5 @@ + /* +- * cpu_ppc64.h: CPU driver for PowerPC CPUs ++ * cpu_ppc64.h: CPU driver for 64-bit PowerPC CPUs + * + * Copyright (C) Copyright (C) IBM Corporation, 2010 + * +@@ -22,11 +22,11 @@ + * Prerna Saxena + */ + +-#ifndef __VIR_CPU_POWERPC_H__ +-# define __VIR_CPU_POWERPC_H__ ++#ifndef __VIR_CPU_PPC64_H__ ++# define __VIR_CPU_PPC64_H__ + + # include "cpu.h" + +-extern struct cpuArchDriver cpuDriverPowerPC; ++extern struct cpuArchDriver cpuDriverPPC64; + +-#endif /* __VIR_CPU_POWERPC_H__ */ ++#endif /* __VIR_CPU_PPC64_H__ */ +diff --git a/src/cpu/cpu_ppc64_data.h b/src/cpu/cpu_ppc64_data.h +index a70b099..45152de 100644 +--- a/src/cpu/cpu_ppc64_data.h ++++ b/src/cpu/cpu_ppc64_data.h +@@ -1,5 +1,5 @@ + /* +- * cpu_ppc64_data.h: PowerPC specific CPU data ++ * cpu_ppc64_data.h: 64-bit PowerPC CPU specific data + * + * Copyright (C) 2012 IBM Corporation. + * +@@ -21,13 +21,13 @@ + * Li Zhang + */ + +-#ifndef __VIR_CPU_PPC_DATA_H__ +-# define __VIR_CPU_PPC_DATA_H__ ++#ifndef __VIR_CPU_PPC64_DATA_H__ ++# define __VIR_CPU_PPC64_DATA_H__ + + # include + +-struct cpuPPCData { ++struct cpuPPC64Data { + uint32_t pvr; + }; + +-#endif /* __VIR_CPU_PPC_DATA_H__ */ ++#endif /* __VIR_CPU_PPC64_DATA_H__ */ +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Rename-powerpc-ppc-ppc64-filesystem.patch b/SOURCES/libvirt-cpu-Rename-powerpc-ppc-ppc64-filesystem.patch new file mode 100644 index 0000000..27aaaa8 --- /dev/null +++ b/SOURCES/libvirt-cpu-Rename-powerpc-ppc-ppc64-filesystem.patch @@ -0,0 +1,1682 @@ +From 81e7bf1fe3b4c70180f8d9b1d89071c13f804002 Mon Sep 17 00:00:00 2001 +Message-Id: <81e7bf1fe3b4c70180f8d9b1d89071c13f804002@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:15:49 +0200 +Subject: [PATCH] cpu: Rename {powerpc, ppc} => ppc64 (filesystem) + +The driver only supports VIR_ARCH_PPC64 and VIR_ARCH_PPC64LE. + +Just shuffling files around and updating the build system +accordingly. No functional changes. + +(cherry picked from commit ef770f016021967359c9443c3bab0f77a55e4afe) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + po/POTFILES.in | 2 +- + src/Makefile.am | 5 +- + src/cpu/cpu.c | 2 +- + src/cpu/cpu.h | 2 +- + src/cpu/cpu_powerpc.c | 711 ----------------------------------------------- + src/cpu/cpu_powerpc.h | 32 --- + src/cpu/cpu_ppc64.c | 711 +++++++++++++++++++++++++++++++++++++++++++++++ + src/cpu/cpu_ppc64.h | 32 +++ + src/cpu/cpu_ppc64_data.h | 33 +++ + src/cpu/cpu_ppc_data.h | 33 --- + 10 files changed, 782 insertions(+), 781 deletions(-) + delete mode 100644 src/cpu/cpu_powerpc.c + delete mode 100644 src/cpu/cpu_powerpc.h + create mode 100644 src/cpu/cpu_ppc64.c + create mode 100644 src/cpu/cpu_ppc64.h + create mode 100644 src/cpu/cpu_ppc64_data.h + delete mode 100644 src/cpu/cpu_ppc_data.h + +diff --git a/po/POTFILES.in b/po/POTFILES.in +index a75f5ae..c58a7c1 100644 +--- a/po/POTFILES.in ++++ b/po/POTFILES.in +@@ -39,7 +39,7 @@ src/conf/virchrdev.c + src/cpu/cpu.c + src/cpu/cpu_generic.c + src/cpu/cpu_map.c +-src/cpu/cpu_powerpc.c ++src/cpu/cpu_ppc64.c + src/cpu/cpu_x86.c + src/driver.c + src/esx/esx_driver.c +diff --git a/src/Makefile.am b/src/Makefile.am +index be63e26..62b8fd6 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -1008,8 +1008,9 @@ CPU_SOURCES = \ + cpu/cpu_s390.h cpu/cpu_s390.c \ + cpu/cpu_arm.h cpu/cpu_arm.c \ + cpu/cpu_aarch64.h cpu/cpu_aarch64.c \ +- cpu/cpu_map.h cpu/cpu_map.c cpu/cpu_powerpc.h \ +- cpu/cpu_powerpc.c cpu/cpu_ppc_data.h ++ cpu/cpu_ppc64.h cpu/cpu_ppc64.c \ ++ cpu/cpu_ppc64_data.h \ ++ cpu/cpu_map.h cpu/cpu_map.c + + VMX_SOURCES = \ + vmx/vmx.c vmx/vmx.h +diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c +index 9e67ddd..2e34f81 100644 +--- a/src/cpu/cpu.c ++++ b/src/cpu/cpu.c +@@ -29,7 +29,7 @@ + #include "cpu.h" + #include "cpu_map.h" + #include "cpu_x86.h" +-#include "cpu_powerpc.h" ++#include "cpu_ppc64.h" + #include "cpu_s390.h" + #include "cpu_arm.h" + #include "cpu_aarch64.h" +diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h +index 09e9538..c0371cd 100644 +--- a/src/cpu/cpu.h ++++ b/src/cpu/cpu.h +@@ -29,7 +29,7 @@ + # include "virarch.h" + # include "conf/cpu_conf.h" + # include "cpu_x86_data.h" +-# include "cpu_ppc_data.h" ++# include "cpu_ppc64_data.h" + + + typedef struct _virCPUData virCPUData; +diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c +deleted file mode 100644 +index 733a0cd..0000000 +--- a/src/cpu/cpu_powerpc.c ++++ /dev/null +@@ -1,711 +0,0 @@ +-/* +- * cpu_powerpc.c: CPU driver for PowerPC CPUs +- * +- * Copyright (C) 2013 Red Hat, Inc. +- * Copyright (C) IBM Corporation, 2010 +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library. If not, see +- * . +- * +- * Authors: +- * Anton Blanchard +- * Prerna Saxena +- * Li Zhang +- */ +- +-#include +-#include +- +-#include "virlog.h" +-#include "viralloc.h" +-#include "cpu.h" +-#include "virstring.h" +-#include "cpu_map.h" +-#include "virbuffer.h" +- +-#define VIR_FROM_THIS VIR_FROM_CPU +- +-VIR_LOG_INIT("cpu.cpu_powerpc"); +- +-static const virArch archs[] = { VIR_ARCH_PPC64, VIR_ARCH_PPC64LE }; +- +-struct ppc_vendor { +- char *name; +- struct ppc_vendor *next; +-}; +- +-struct ppc_model { +- char *name; +- const struct ppc_vendor *vendor; +- struct cpuPPCData data; +- struct ppc_model *next; +-}; +- +-struct ppc_map { +- struct ppc_vendor *vendors; +- struct ppc_model *models; +-}; +- +- +-static void +-ppcModelFree(struct ppc_model *model) +-{ +- if (model == NULL) +- return; +- +- VIR_FREE(model->name); +- VIR_FREE(model); +-} +- +-static struct ppc_model * +-ppcModelFind(const struct ppc_map *map, +- const char *name) +-{ +- struct ppc_model *model; +- +- model = map->models; +- while (model != NULL) { +- if (STREQ(model->name, name)) +- return model; +- +- model = model->next; +- } +- +- return NULL; +-} +- +-static struct ppc_model * +-ppcModelFindPVR(const struct ppc_map *map, +- uint32_t pvr) +-{ +- struct ppc_model *model; +- +- model = map->models; +- while (model != NULL) { +- if (model->data.pvr == pvr) +- return model; +- +- model = model->next; +- } +- +- /* PowerPC Processor Version Register is interpreted as follows : +- * Higher order 16 bits : Power ISA generation. +- * Lower order 16 bits : CPU chip version number. +- * If the exact CPU isn't found, return the nearest matching CPU generation +- */ +- if (pvr & 0x0000FFFFul) +- return ppcModelFindPVR(map, (pvr & 0xFFFF0000ul)); +- +- return NULL; +-} +- +-static struct ppc_model * +-ppcModelCopy(const struct ppc_model *model) +-{ +- struct ppc_model *copy; +- +- if (VIR_ALLOC(copy) < 0 || +- VIR_STRDUP(copy->name, model->name) < 0) { +- ppcModelFree(copy); +- return NULL; +- } +- +- copy->data.pvr = model->data.pvr; +- copy->vendor = model->vendor; +- +- return copy; +-} +- +-static struct ppc_vendor * +-ppcVendorFind(const struct ppc_map *map, +- const char *name) +-{ +- struct ppc_vendor *vendor; +- +- vendor = map->vendors; +- while (vendor) { +- if (STREQ(vendor->name, name)) +- return vendor; +- +- vendor = vendor->next; +- } +- +- return NULL; +-} +- +-static void +-ppcVendorFree(struct ppc_vendor *vendor) +-{ +- if (!vendor) +- return; +- +- VIR_FREE(vendor->name); +- VIR_FREE(vendor); +-} +- +-static struct ppc_model * +-ppcModelFromCPU(const virCPUDef *cpu, +- const struct ppc_map *map) +-{ +- struct ppc_model *model = NULL; +- +- if ((model = ppcModelFind(map, cpu->model)) == NULL) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Unknown CPU model %s"), cpu->model); +- goto error; +- } +- +- if ((model = ppcModelCopy(model)) == NULL) +- goto error; +- +- return model; +- +- error: +- ppcModelFree(model); +- return NULL; +-} +- +- +-static int +-ppcVendorLoad(xmlXPathContextPtr ctxt, +- struct ppc_map *map) +-{ +- struct ppc_vendor *vendor = NULL; +- +- if (VIR_ALLOC(vendor) < 0) +- return -1; +- +- vendor->name = virXPathString("string(@name)", ctxt); +- if (!vendor->name) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- "%s", _("Missing CPU vendor name")); +- goto ignore; +- } +- +- if (ppcVendorFind(map, vendor->name)) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("CPU vendor %s already defined"), vendor->name); +- goto ignore; +- } +- +- if (!map->vendors) { +- map->vendors = vendor; +- } else { +- vendor->next = map->vendors; +- map->vendors = vendor; +- } +- +- cleanup: +- return 0; +- +- ignore: +- ppcVendorFree(vendor); +- goto cleanup; +-} +- +-static int +-ppcModelLoad(xmlXPathContextPtr ctxt, +- struct ppc_map *map) +-{ +- struct ppc_model *model; +- char *vendor = NULL; +- unsigned long pvr; +- +- if (VIR_ALLOC(model) < 0) +- return -1; +- +- model->name = virXPathString("string(@name)", ctxt); +- if (!model->name) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- "%s", _("Missing CPU model name")); +- goto ignore; +- } +- +- if (ppcModelFind(map, model->name)) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("CPU model %s already defined"), model->name); +- goto ignore; +- } +- +- if (virXPathBoolean("boolean(./vendor)", ctxt)) { +- vendor = virXPathString("string(./vendor/@name)", ctxt); +- if (!vendor) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Invalid vendor element in CPU model %s"), +- model->name); +- goto ignore; +- } +- +- if (!(model->vendor = ppcVendorFind(map, vendor))) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Unknown vendor %s referenced by CPU model %s"), +- vendor, model->name); +- goto ignore; +- } +- } +- +- if (!virXPathBoolean("boolean(./pvr)", ctxt) || +- virXPathULongHex("string(./pvr/@value)", ctxt, &pvr) < 0) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Missing or invalid PVR value in CPU model %s"), +- model->name); +- goto ignore; +- } +- model->data.pvr = pvr; +- +- if (map->models == NULL) { +- map->models = model; +- } else { +- model->next = map->models; +- map->models = model; +- } +- +- cleanup: +- VIR_FREE(vendor); +- return 0; +- +- ignore: +- ppcModelFree(model); +- goto cleanup; +-} +- +-static int +-ppcMapLoadCallback(cpuMapElement element, +- xmlXPathContextPtr ctxt, +- void *data) +-{ +- struct ppc_map *map = data; +- +- switch (element) { +- case CPU_MAP_ELEMENT_VENDOR: +- return ppcVendorLoad(ctxt, map); +- case CPU_MAP_ELEMENT_MODEL: +- return ppcModelLoad(ctxt, map); +- case CPU_MAP_ELEMENT_FEATURE: +- case CPU_MAP_ELEMENT_LAST: +- break; +- } +- +- return 0; +-} +- +-static void +-ppcMapFree(struct ppc_map *map) +-{ +- if (map == NULL) +- return; +- +- while (map->models != NULL) { +- struct ppc_model *model = map->models; +- map->models = model->next; +- ppcModelFree(model); +- } +- +- while (map->vendors != NULL) { +- struct ppc_vendor *vendor = map->vendors; +- map->vendors = vendor->next; +- ppcVendorFree(vendor); +- } +- +- VIR_FREE(map); +-} +- +-static struct ppc_map * +-ppcLoadMap(void) +-{ +- struct ppc_map *map; +- +- if (VIR_ALLOC(map) < 0) +- return NULL; +- +- if (cpuMapLoad("ppc64", ppcMapLoadCallback, map) < 0) +- goto error; +- +- return map; +- +- error: +- ppcMapFree(map); +- return NULL; +-} +- +-static virCPUDataPtr +-ppcMakeCPUData(virArch arch, struct cpuPPCData *data) +-{ +- virCPUDataPtr cpuData; +- +- if (VIR_ALLOC(cpuData) < 0) +- return NULL; +- +- cpuData->arch = arch; +- cpuData->data.ppc = *data; +- data = NULL; +- +- return cpuData; +-} +- +-static virCPUCompareResult +-ppcCompute(virCPUDefPtr host, +- const virCPUDef *cpu, +- virCPUDataPtr *guestData, +- char **message) +- +-{ +- struct ppc_map *map = NULL; +- struct ppc_model *host_model = NULL; +- struct ppc_model *guest_model = NULL; +- +- virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR; +- virArch arch; +- size_t i; +- +- if (cpu->arch != VIR_ARCH_NONE) { +- bool found = false; +- +- for (i = 0; i < ARRAY_CARDINALITY(archs); i++) { +- if (archs[i] == cpu->arch) { +- found = true; +- break; +- } +- } +- +- if (!found) { +- VIR_DEBUG("CPU arch %s does not match host arch", +- virArchToString(cpu->arch)); +- if (message && +- virAsprintf(message, +- _("CPU arch %s does not match host arch"), +- virArchToString(cpu->arch)) < 0) +- goto cleanup; +- +- ret = VIR_CPU_COMPARE_INCOMPATIBLE; +- goto cleanup; +- } +- arch = cpu->arch; +- } else { +- arch = host->arch; +- } +- +- if (cpu->vendor && +- (!host->vendor || STRNEQ(cpu->vendor, host->vendor))) { +- VIR_DEBUG("host CPU vendor does not match required CPU vendor %s", +- cpu->vendor); +- if (message && +- virAsprintf(message, +- _("host CPU vendor does not match required " +- "CPU vendor %s"), +- cpu->vendor) < 0) +- goto cleanup; +- +- ret = VIR_CPU_COMPARE_INCOMPATIBLE; +- goto cleanup; +- } +- +- if (!(map = ppcLoadMap()) || +- !(host_model = ppcModelFromCPU(host, map)) || +- !(guest_model = ppcModelFromCPU(cpu, map))) +- goto cleanup; +- +- if (guestData != NULL) { +- if (cpu->type == VIR_CPU_TYPE_GUEST && +- cpu->match == VIR_CPU_MATCH_STRICT && +- STRNEQ(guest_model->name, host_model->name)) { +- VIR_DEBUG("host CPU model does not match required CPU model %s", +- guest_model->name); +- if (message && +- virAsprintf(message, +- _("host CPU model does not match required " +- "CPU model %s"), +- guest_model->name) < 0) +- goto cleanup; +- +- ret = VIR_CPU_COMPARE_INCOMPATIBLE; +- goto cleanup; +- } +- +- if (!(*guestData = ppcMakeCPUData(arch, &guest_model->data))) +- goto cleanup; +- } +- +- ret = VIR_CPU_COMPARE_IDENTICAL; +- +- cleanup: +- ppcMapFree(map); +- ppcModelFree(host_model); +- ppcModelFree(guest_model); +- return ret; +-} +- +-static virCPUCompareResult +-ppcCompare(virCPUDefPtr host, +- virCPUDefPtr cpu, +- bool failIncompatible) +-{ +- if ((cpu->arch == VIR_ARCH_NONE || host->arch == cpu->arch) && +- STREQ(host->model, cpu->model)) +- return VIR_CPU_COMPARE_IDENTICAL; +- +- if (failIncompatible) { +- virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL); +- return VIR_CPU_COMPARE_ERROR; +- } else { +- return VIR_CPU_COMPARE_INCOMPATIBLE; +- } +-} +- +-static int +-ppcDecode(virCPUDefPtr cpu, +- const virCPUData *data, +- const char **models, +- unsigned int nmodels, +- const char *preferred ATTRIBUTE_UNUSED, +- unsigned int flags) +-{ +- int ret = -1; +- struct ppc_map *map; +- const struct ppc_model *model; +- +- virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, -1); +- +- if (data == NULL || (map = ppcLoadMap()) == NULL) +- return -1; +- +- if (!(model = ppcModelFindPVR(map, data->data.ppc.pvr))) { +- virReportError(VIR_ERR_OPERATION_FAILED, +- _("Cannot find CPU model with PVR 0x%08x"), +- data->data.ppc.pvr); +- goto cleanup; +- } +- +- if (!cpuModelIsAllowed(model->name, models, nmodels)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, +- _("CPU model %s is not supported by hypervisor"), +- model->name); +- goto cleanup; +- } +- +- if (VIR_STRDUP(cpu->model, model->name) < 0 || +- (model->vendor && VIR_STRDUP(cpu->vendor, model->vendor->name) < 0)) { +- goto cleanup; +- } +- +- ret = 0; +- +- cleanup: +- ppcMapFree(map); +- +- return ret; +-} +- +- +-static void +-ppcDataFree(virCPUDataPtr data) +-{ +- if (data == NULL) +- return; +- +- VIR_FREE(data); +-} +- +-static virCPUDataPtr +-ppcNodeData(virArch arch) +-{ +- virCPUDataPtr cpuData; +- +- if (VIR_ALLOC(cpuData) < 0) +- return NULL; +- +- cpuData->arch = arch; +- +-#if defined(__powerpc__) || defined(__powerpc64__) +- asm("mfpvr %0" +- : "=r" (cpuData->data.ppc.pvr)); +-#endif +- +- return cpuData; +-} +- +-static virCPUCompareResult +-ppcGuestData(virCPUDefPtr host, +- virCPUDefPtr guest, +- virCPUDataPtr *data, +- char **message) +-{ +- return ppcCompute(host, guest, data, message); +-} +- +-static int +-ppcUpdate(virCPUDefPtr guest, +- const virCPUDef *host) +-{ +- switch ((virCPUMode) guest->mode) { +- case VIR_CPU_MODE_HOST_MODEL: +- case VIR_CPU_MODE_HOST_PASSTHROUGH: +- guest->match = VIR_CPU_MATCH_EXACT; +- virCPUDefFreeModel(guest); +- return virCPUDefCopyModel(guest, host, true); +- +- case VIR_CPU_MODE_CUSTOM: +- return 0; +- +- case VIR_CPU_MODE_LAST: +- break; +- } +- +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Unexpected CPU mode: %d"), guest->mode); +- return -1; +-} +- +-static virCPUDefPtr +-ppcBaseline(virCPUDefPtr *cpus, +- unsigned int ncpus, +- const char **models ATTRIBUTE_UNUSED, +- unsigned int nmodels ATTRIBUTE_UNUSED, +- unsigned int flags) +-{ +- struct ppc_map *map = NULL; +- const struct ppc_model *model; +- const struct ppc_vendor *vendor = NULL; +- virCPUDefPtr cpu = NULL; +- size_t i; +- +- virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | +- VIR_CONNECT_BASELINE_CPU_MIGRATABLE, NULL); +- +- if (!(map = ppcLoadMap())) +- goto error; +- +- if (!(model = ppcModelFind(map, cpus[0]->model))) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Unknown CPU model %s"), cpus[0]->model); +- goto error; +- } +- +- for (i = 0; i < ncpus; i++) { +- const struct ppc_vendor *vnd; +- +- if (STRNEQ(cpus[i]->model, model->name)) { +- virReportError(VIR_ERR_OPERATION_FAILED, "%s", +- _("CPUs are incompatible")); +- goto error; +- } +- +- if (!cpus[i]->vendor) +- continue; +- +- if (!(vnd = ppcVendorFind(map, cpus[i]->vendor))) { +- virReportError(VIR_ERR_OPERATION_FAILED, +- _("Unknown CPU vendor %s"), cpus[i]->vendor); +- goto error; +- } +- +- if (model->vendor) { +- if (model->vendor != vnd) { +- virReportError(VIR_ERR_OPERATION_FAILED, +- _("CPU vendor %s of model %s differs from " +- "vendor %s"), +- model->vendor->name, model->name, +- vnd->name); +- goto error; +- } +- } else if (vendor) { +- if (vendor != vnd) { +- virReportError(VIR_ERR_OPERATION_FAILED, "%s", +- _("CPU vendors do not match")); +- goto error; +- } +- } else { +- vendor = vnd; +- } +- } +- +- if (VIR_ALLOC(cpu) < 0 || +- VIR_STRDUP(cpu->model, model->name) < 0) +- goto error; +- +- if (vendor && VIR_STRDUP(cpu->vendor, vendor->name) < 0) +- goto error; +- +- cpu->type = VIR_CPU_TYPE_GUEST; +- cpu->match = VIR_CPU_MATCH_EXACT; +- +- cleanup: +- ppcMapFree(map); +- +- return cpu; +- +- error: +- virCPUDefFree(cpu); +- cpu = NULL; +- goto cleanup; +-} +- +-static int +-ppcGetModels(char ***models) +-{ +- struct ppc_map *map; +- struct ppc_model *model; +- char *name; +- size_t nmodels = 0; +- +- if (!(map = ppcLoadMap())) +- goto error; +- +- if (models && VIR_ALLOC_N(*models, 0) < 0) +- goto error; +- +- model = map->models; +- while (model != NULL) { +- if (models) { +- if (VIR_STRDUP(name, model->name) < 0) +- goto error; +- +- if (VIR_APPEND_ELEMENT(*models, nmodels, name) < 0) +- goto error; +- } else { +- nmodels++; +- } +- +- model = model->next; +- } +- +- cleanup: +- ppcMapFree(map); +- +- return nmodels; +- +- error: +- if (models) { +- virStringFreeList(*models); +- *models = NULL; +- } +- nmodels = -1; +- goto cleanup; +-} +- +-struct cpuArchDriver cpuDriverPowerPC = { +- .name = "ppc64", +- .arch = archs, +- .narch = ARRAY_CARDINALITY(archs), +- .compare = ppcCompare, +- .decode = ppcDecode, +- .encode = NULL, +- .free = ppcDataFree, +- .nodeData = ppcNodeData, +- .guestData = ppcGuestData, +- .baseline = ppcBaseline, +- .update = ppcUpdate, +- .hasFeature = NULL, +- .getModels = ppcGetModels, +-}; +diff --git a/src/cpu/cpu_powerpc.h b/src/cpu/cpu_powerpc.h +deleted file mode 100644 +index 312886e..0000000 +--- a/src/cpu/cpu_powerpc.h ++++ /dev/null +@@ -1,32 +0,0 @@ +-/* +- * cpu_powerpc.h: CPU driver for PowerPC CPUs +- * +- * Copyright (C) Copyright (C) IBM Corporation, 2010 +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library. If not, see +- * . +- * +- * Authors: +- * Anton Blanchard +- * Prerna Saxena +- */ +- +-#ifndef __VIR_CPU_POWERPC_H__ +-# define __VIR_CPU_POWERPC_H__ +- +-# include "cpu.h" +- +-extern struct cpuArchDriver cpuDriverPowerPC; +- +-#endif /* __VIR_CPU_POWERPC_H__ */ +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +new file mode 100644 +index 0000000..7866bdd +--- /dev/null ++++ b/src/cpu/cpu_ppc64.c +@@ -0,0 +1,711 @@ ++/* ++ * cpu_ppc64.c: CPU driver for PowerPC CPUs ++ * ++ * Copyright (C) 2013 Red Hat, Inc. ++ * Copyright (C) IBM Corporation, 2010 ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library. If not, see ++ * . ++ * ++ * Authors: ++ * Anton Blanchard ++ * Prerna Saxena ++ * Li Zhang ++ */ ++ ++#include ++#include ++ ++#include "virlog.h" ++#include "viralloc.h" ++#include "cpu.h" ++#include "virstring.h" ++#include "cpu_map.h" ++#include "virbuffer.h" ++ ++#define VIR_FROM_THIS VIR_FROM_CPU ++ ++VIR_LOG_INIT("cpu.cpu_powerpc"); ++ ++static const virArch archs[] = { VIR_ARCH_PPC64, VIR_ARCH_PPC64LE }; ++ ++struct ppc_vendor { ++ char *name; ++ struct ppc_vendor *next; ++}; ++ ++struct ppc_model { ++ char *name; ++ const struct ppc_vendor *vendor; ++ struct cpuPPCData data; ++ struct ppc_model *next; ++}; ++ ++struct ppc_map { ++ struct ppc_vendor *vendors; ++ struct ppc_model *models; ++}; ++ ++ ++static void ++ppcModelFree(struct ppc_model *model) ++{ ++ if (model == NULL) ++ return; ++ ++ VIR_FREE(model->name); ++ VIR_FREE(model); ++} ++ ++static struct ppc_model * ++ppcModelFind(const struct ppc_map *map, ++ const char *name) ++{ ++ struct ppc_model *model; ++ ++ model = map->models; ++ while (model != NULL) { ++ if (STREQ(model->name, name)) ++ return model; ++ ++ model = model->next; ++ } ++ ++ return NULL; ++} ++ ++static struct ppc_model * ++ppcModelFindPVR(const struct ppc_map *map, ++ uint32_t pvr) ++{ ++ struct ppc_model *model; ++ ++ model = map->models; ++ while (model != NULL) { ++ if (model->data.pvr == pvr) ++ return model; ++ ++ model = model->next; ++ } ++ ++ /* PowerPC Processor Version Register is interpreted as follows : ++ * Higher order 16 bits : Power ISA generation. ++ * Lower order 16 bits : CPU chip version number. ++ * If the exact CPU isn't found, return the nearest matching CPU generation ++ */ ++ if (pvr & 0x0000FFFFul) ++ return ppcModelFindPVR(map, (pvr & 0xFFFF0000ul)); ++ ++ return NULL; ++} ++ ++static struct ppc_model * ++ppcModelCopy(const struct ppc_model *model) ++{ ++ struct ppc_model *copy; ++ ++ if (VIR_ALLOC(copy) < 0 || ++ VIR_STRDUP(copy->name, model->name) < 0) { ++ ppcModelFree(copy); ++ return NULL; ++ } ++ ++ copy->data.pvr = model->data.pvr; ++ copy->vendor = model->vendor; ++ ++ return copy; ++} ++ ++static struct ppc_vendor * ++ppcVendorFind(const struct ppc_map *map, ++ const char *name) ++{ ++ struct ppc_vendor *vendor; ++ ++ vendor = map->vendors; ++ while (vendor) { ++ if (STREQ(vendor->name, name)) ++ return vendor; ++ ++ vendor = vendor->next; ++ } ++ ++ return NULL; ++} ++ ++static void ++ppcVendorFree(struct ppc_vendor *vendor) ++{ ++ if (!vendor) ++ return; ++ ++ VIR_FREE(vendor->name); ++ VIR_FREE(vendor); ++} ++ ++static struct ppc_model * ++ppcModelFromCPU(const virCPUDef *cpu, ++ const struct ppc_map *map) ++{ ++ struct ppc_model *model = NULL; ++ ++ if ((model = ppcModelFind(map, cpu->model)) == NULL) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Unknown CPU model %s"), cpu->model); ++ goto error; ++ } ++ ++ if ((model = ppcModelCopy(model)) == NULL) ++ goto error; ++ ++ return model; ++ ++ error: ++ ppcModelFree(model); ++ return NULL; ++} ++ ++ ++static int ++ppcVendorLoad(xmlXPathContextPtr ctxt, ++ struct ppc_map *map) ++{ ++ struct ppc_vendor *vendor = NULL; ++ ++ if (VIR_ALLOC(vendor) < 0) ++ return -1; ++ ++ vendor->name = virXPathString("string(@name)", ctxt); ++ if (!vendor->name) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ "%s", _("Missing CPU vendor name")); ++ goto ignore; ++ } ++ ++ if (ppcVendorFind(map, vendor->name)) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("CPU vendor %s already defined"), vendor->name); ++ goto ignore; ++ } ++ ++ if (!map->vendors) { ++ map->vendors = vendor; ++ } else { ++ vendor->next = map->vendors; ++ map->vendors = vendor; ++ } ++ ++ cleanup: ++ return 0; ++ ++ ignore: ++ ppcVendorFree(vendor); ++ goto cleanup; ++} ++ ++static int ++ppcModelLoad(xmlXPathContextPtr ctxt, ++ struct ppc_map *map) ++{ ++ struct ppc_model *model; ++ char *vendor = NULL; ++ unsigned long pvr; ++ ++ if (VIR_ALLOC(model) < 0) ++ return -1; ++ ++ model->name = virXPathString("string(@name)", ctxt); ++ if (!model->name) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ "%s", _("Missing CPU model name")); ++ goto ignore; ++ } ++ ++ if (ppcModelFind(map, model->name)) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("CPU model %s already defined"), model->name); ++ goto ignore; ++ } ++ ++ if (virXPathBoolean("boolean(./vendor)", ctxt)) { ++ vendor = virXPathString("string(./vendor/@name)", ctxt); ++ if (!vendor) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Invalid vendor element in CPU model %s"), ++ model->name); ++ goto ignore; ++ } ++ ++ if (!(model->vendor = ppcVendorFind(map, vendor))) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Unknown vendor %s referenced by CPU model %s"), ++ vendor, model->name); ++ goto ignore; ++ } ++ } ++ ++ if (!virXPathBoolean("boolean(./pvr)", ctxt) || ++ virXPathULongHex("string(./pvr/@value)", ctxt, &pvr) < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Missing or invalid PVR value in CPU model %s"), ++ model->name); ++ goto ignore; ++ } ++ model->data.pvr = pvr; ++ ++ if (map->models == NULL) { ++ map->models = model; ++ } else { ++ model->next = map->models; ++ map->models = model; ++ } ++ ++ cleanup: ++ VIR_FREE(vendor); ++ return 0; ++ ++ ignore: ++ ppcModelFree(model); ++ goto cleanup; ++} ++ ++static int ++ppcMapLoadCallback(cpuMapElement element, ++ xmlXPathContextPtr ctxt, ++ void *data) ++{ ++ struct ppc_map *map = data; ++ ++ switch (element) { ++ case CPU_MAP_ELEMENT_VENDOR: ++ return ppcVendorLoad(ctxt, map); ++ case CPU_MAP_ELEMENT_MODEL: ++ return ppcModelLoad(ctxt, map); ++ case CPU_MAP_ELEMENT_FEATURE: ++ case CPU_MAP_ELEMENT_LAST: ++ break; ++ } ++ ++ return 0; ++} ++ ++static void ++ppcMapFree(struct ppc_map *map) ++{ ++ if (map == NULL) ++ return; ++ ++ while (map->models != NULL) { ++ struct ppc_model *model = map->models; ++ map->models = model->next; ++ ppcModelFree(model); ++ } ++ ++ while (map->vendors != NULL) { ++ struct ppc_vendor *vendor = map->vendors; ++ map->vendors = vendor->next; ++ ppcVendorFree(vendor); ++ } ++ ++ VIR_FREE(map); ++} ++ ++static struct ppc_map * ++ppcLoadMap(void) ++{ ++ struct ppc_map *map; ++ ++ if (VIR_ALLOC(map) < 0) ++ return NULL; ++ ++ if (cpuMapLoad("ppc64", ppcMapLoadCallback, map) < 0) ++ goto error; ++ ++ return map; ++ ++ error: ++ ppcMapFree(map); ++ return NULL; ++} ++ ++static virCPUDataPtr ++ppcMakeCPUData(virArch arch, struct cpuPPCData *data) ++{ ++ virCPUDataPtr cpuData; ++ ++ if (VIR_ALLOC(cpuData) < 0) ++ return NULL; ++ ++ cpuData->arch = arch; ++ cpuData->data.ppc = *data; ++ data = NULL; ++ ++ return cpuData; ++} ++ ++static virCPUCompareResult ++ppcCompute(virCPUDefPtr host, ++ const virCPUDef *cpu, ++ virCPUDataPtr *guestData, ++ char **message) ++ ++{ ++ struct ppc_map *map = NULL; ++ struct ppc_model *host_model = NULL; ++ struct ppc_model *guest_model = NULL; ++ ++ virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR; ++ virArch arch; ++ size_t i; ++ ++ if (cpu->arch != VIR_ARCH_NONE) { ++ bool found = false; ++ ++ for (i = 0; i < ARRAY_CARDINALITY(archs); i++) { ++ if (archs[i] == cpu->arch) { ++ found = true; ++ break; ++ } ++ } ++ ++ if (!found) { ++ VIR_DEBUG("CPU arch %s does not match host arch", ++ virArchToString(cpu->arch)); ++ if (message && ++ virAsprintf(message, ++ _("CPU arch %s does not match host arch"), ++ virArchToString(cpu->arch)) < 0) ++ goto cleanup; ++ ++ ret = VIR_CPU_COMPARE_INCOMPATIBLE; ++ goto cleanup; ++ } ++ arch = cpu->arch; ++ } else { ++ arch = host->arch; ++ } ++ ++ if (cpu->vendor && ++ (!host->vendor || STRNEQ(cpu->vendor, host->vendor))) { ++ VIR_DEBUG("host CPU vendor does not match required CPU vendor %s", ++ cpu->vendor); ++ if (message && ++ virAsprintf(message, ++ _("host CPU vendor does not match required " ++ "CPU vendor %s"), ++ cpu->vendor) < 0) ++ goto cleanup; ++ ++ ret = VIR_CPU_COMPARE_INCOMPATIBLE; ++ goto cleanup; ++ } ++ ++ if (!(map = ppcLoadMap()) || ++ !(host_model = ppcModelFromCPU(host, map)) || ++ !(guest_model = ppcModelFromCPU(cpu, map))) ++ goto cleanup; ++ ++ if (guestData != NULL) { ++ if (cpu->type == VIR_CPU_TYPE_GUEST && ++ cpu->match == VIR_CPU_MATCH_STRICT && ++ STRNEQ(guest_model->name, host_model->name)) { ++ VIR_DEBUG("host CPU model does not match required CPU model %s", ++ guest_model->name); ++ if (message && ++ virAsprintf(message, ++ _("host CPU model does not match required " ++ "CPU model %s"), ++ guest_model->name) < 0) ++ goto cleanup; ++ ++ ret = VIR_CPU_COMPARE_INCOMPATIBLE; ++ goto cleanup; ++ } ++ ++ if (!(*guestData = ppcMakeCPUData(arch, &guest_model->data))) ++ goto cleanup; ++ } ++ ++ ret = VIR_CPU_COMPARE_IDENTICAL; ++ ++ cleanup: ++ ppcMapFree(map); ++ ppcModelFree(host_model); ++ ppcModelFree(guest_model); ++ return ret; ++} ++ ++static virCPUCompareResult ++ppcCompare(virCPUDefPtr host, ++ virCPUDefPtr cpu, ++ bool failIncompatible) ++{ ++ if ((cpu->arch == VIR_ARCH_NONE || host->arch == cpu->arch) && ++ STREQ(host->model, cpu->model)) ++ return VIR_CPU_COMPARE_IDENTICAL; ++ ++ if (failIncompatible) { ++ virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL); ++ return VIR_CPU_COMPARE_ERROR; ++ } else { ++ return VIR_CPU_COMPARE_INCOMPATIBLE; ++ } ++} ++ ++static int ++ppcDecode(virCPUDefPtr cpu, ++ const virCPUData *data, ++ const char **models, ++ unsigned int nmodels, ++ const char *preferred ATTRIBUTE_UNUSED, ++ unsigned int flags) ++{ ++ int ret = -1; ++ struct ppc_map *map; ++ const struct ppc_model *model; ++ ++ virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, -1); ++ ++ if (data == NULL || (map = ppcLoadMap()) == NULL) ++ return -1; ++ ++ if (!(model = ppcModelFindPVR(map, data->data.ppc.pvr))) { ++ virReportError(VIR_ERR_OPERATION_FAILED, ++ _("Cannot find CPU model with PVR 0x%08x"), ++ data->data.ppc.pvr); ++ goto cleanup; ++ } ++ ++ if (!cpuModelIsAllowed(model->name, models, nmodels)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("CPU model %s is not supported by hypervisor"), ++ model->name); ++ goto cleanup; ++ } ++ ++ if (VIR_STRDUP(cpu->model, model->name) < 0 || ++ (model->vendor && VIR_STRDUP(cpu->vendor, model->vendor->name) < 0)) { ++ goto cleanup; ++ } ++ ++ ret = 0; ++ ++ cleanup: ++ ppcMapFree(map); ++ ++ return ret; ++} ++ ++ ++static void ++ppcDataFree(virCPUDataPtr data) ++{ ++ if (data == NULL) ++ return; ++ ++ VIR_FREE(data); ++} ++ ++static virCPUDataPtr ++ppcNodeData(virArch arch) ++{ ++ virCPUDataPtr cpuData; ++ ++ if (VIR_ALLOC(cpuData) < 0) ++ return NULL; ++ ++ cpuData->arch = arch; ++ ++#if defined(__powerpc__) || defined(__powerpc64__) ++ asm("mfpvr %0" ++ : "=r" (cpuData->data.ppc.pvr)); ++#endif ++ ++ return cpuData; ++} ++ ++static virCPUCompareResult ++ppcGuestData(virCPUDefPtr host, ++ virCPUDefPtr guest, ++ virCPUDataPtr *data, ++ char **message) ++{ ++ return ppcCompute(host, guest, data, message); ++} ++ ++static int ++ppcUpdate(virCPUDefPtr guest, ++ const virCPUDef *host) ++{ ++ switch ((virCPUMode) guest->mode) { ++ case VIR_CPU_MODE_HOST_MODEL: ++ case VIR_CPU_MODE_HOST_PASSTHROUGH: ++ guest->match = VIR_CPU_MATCH_EXACT; ++ virCPUDefFreeModel(guest); ++ return virCPUDefCopyModel(guest, host, true); ++ ++ case VIR_CPU_MODE_CUSTOM: ++ return 0; ++ ++ case VIR_CPU_MODE_LAST: ++ break; ++ } ++ ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Unexpected CPU mode: %d"), guest->mode); ++ return -1; ++} ++ ++static virCPUDefPtr ++ppcBaseline(virCPUDefPtr *cpus, ++ unsigned int ncpus, ++ const char **models ATTRIBUTE_UNUSED, ++ unsigned int nmodels ATTRIBUTE_UNUSED, ++ unsigned int flags) ++{ ++ struct ppc_map *map = NULL; ++ const struct ppc_model *model; ++ const struct ppc_vendor *vendor = NULL; ++ virCPUDefPtr cpu = NULL; ++ size_t i; ++ ++ virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | ++ VIR_CONNECT_BASELINE_CPU_MIGRATABLE, NULL); ++ ++ if (!(map = ppcLoadMap())) ++ goto error; ++ ++ if (!(model = ppcModelFind(map, cpus[0]->model))) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Unknown CPU model %s"), cpus[0]->model); ++ goto error; ++ } ++ ++ for (i = 0; i < ncpus; i++) { ++ const struct ppc_vendor *vnd; ++ ++ if (STRNEQ(cpus[i]->model, model->name)) { ++ virReportError(VIR_ERR_OPERATION_FAILED, "%s", ++ _("CPUs are incompatible")); ++ goto error; ++ } ++ ++ if (!cpus[i]->vendor) ++ continue; ++ ++ if (!(vnd = ppcVendorFind(map, cpus[i]->vendor))) { ++ virReportError(VIR_ERR_OPERATION_FAILED, ++ _("Unknown CPU vendor %s"), cpus[i]->vendor); ++ goto error; ++ } ++ ++ if (model->vendor) { ++ if (model->vendor != vnd) { ++ virReportError(VIR_ERR_OPERATION_FAILED, ++ _("CPU vendor %s of model %s differs from " ++ "vendor %s"), ++ model->vendor->name, model->name, ++ vnd->name); ++ goto error; ++ } ++ } else if (vendor) { ++ if (vendor != vnd) { ++ virReportError(VIR_ERR_OPERATION_FAILED, "%s", ++ _("CPU vendors do not match")); ++ goto error; ++ } ++ } else { ++ vendor = vnd; ++ } ++ } ++ ++ if (VIR_ALLOC(cpu) < 0 || ++ VIR_STRDUP(cpu->model, model->name) < 0) ++ goto error; ++ ++ if (vendor && VIR_STRDUP(cpu->vendor, vendor->name) < 0) ++ goto error; ++ ++ cpu->type = VIR_CPU_TYPE_GUEST; ++ cpu->match = VIR_CPU_MATCH_EXACT; ++ ++ cleanup: ++ ppcMapFree(map); ++ ++ return cpu; ++ ++ error: ++ virCPUDefFree(cpu); ++ cpu = NULL; ++ goto cleanup; ++} ++ ++static int ++ppcGetModels(char ***models) ++{ ++ struct ppc_map *map; ++ struct ppc_model *model; ++ char *name; ++ size_t nmodels = 0; ++ ++ if (!(map = ppcLoadMap())) ++ goto error; ++ ++ if (models && VIR_ALLOC_N(*models, 0) < 0) ++ goto error; ++ ++ model = map->models; ++ while (model != NULL) { ++ if (models) { ++ if (VIR_STRDUP(name, model->name) < 0) ++ goto error; ++ ++ if (VIR_APPEND_ELEMENT(*models, nmodels, name) < 0) ++ goto error; ++ } else { ++ nmodels++; ++ } ++ ++ model = model->next; ++ } ++ ++ cleanup: ++ ppcMapFree(map); ++ ++ return nmodels; ++ ++ error: ++ if (models) { ++ virStringFreeList(*models); ++ *models = NULL; ++ } ++ nmodels = -1; ++ goto cleanup; ++} ++ ++struct cpuArchDriver cpuDriverPowerPC = { ++ .name = "ppc64", ++ .arch = archs, ++ .narch = ARRAY_CARDINALITY(archs), ++ .compare = ppcCompare, ++ .decode = ppcDecode, ++ .encode = NULL, ++ .free = ppcDataFree, ++ .nodeData = ppcNodeData, ++ .guestData = ppcGuestData, ++ .baseline = ppcBaseline, ++ .update = ppcUpdate, ++ .hasFeature = NULL, ++ .getModels = ppcGetModels, ++}; +diff --git a/src/cpu/cpu_ppc64.h b/src/cpu/cpu_ppc64.h +new file mode 100644 +index 0000000..e9ef2be +--- /dev/null ++++ b/src/cpu/cpu_ppc64.h +@@ -0,0 +1,32 @@ ++/* ++ * cpu_ppc64.h: CPU driver for PowerPC CPUs ++ * ++ * Copyright (C) Copyright (C) IBM Corporation, 2010 ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library. If not, see ++ * . ++ * ++ * Authors: ++ * Anton Blanchard ++ * Prerna Saxena ++ */ ++ ++#ifndef __VIR_CPU_POWERPC_H__ ++# define __VIR_CPU_POWERPC_H__ ++ ++# include "cpu.h" ++ ++extern struct cpuArchDriver cpuDriverPowerPC; ++ ++#endif /* __VIR_CPU_POWERPC_H__ */ +diff --git a/src/cpu/cpu_ppc64_data.h b/src/cpu/cpu_ppc64_data.h +new file mode 100644 +index 0000000..a70b099 +--- /dev/null ++++ b/src/cpu/cpu_ppc64_data.h +@@ -0,0 +1,33 @@ ++/* ++ * cpu_ppc64_data.h: PowerPC specific CPU data ++ * ++ * Copyright (C) 2012 IBM Corporation. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; If not, see ++ * . ++ * ++ * Authors: ++ * Li Zhang ++ */ ++ ++#ifndef __VIR_CPU_PPC_DATA_H__ ++# define __VIR_CPU_PPC_DATA_H__ ++ ++# include ++ ++struct cpuPPCData { ++ uint32_t pvr; ++}; ++ ++#endif /* __VIR_CPU_PPC_DATA_H__ */ +diff --git a/src/cpu/cpu_ppc_data.h b/src/cpu/cpu_ppc_data.h +deleted file mode 100644 +index 685332a..0000000 +--- a/src/cpu/cpu_ppc_data.h ++++ /dev/null +@@ -1,33 +0,0 @@ +-/* +- * cpu_ppc_data.h: PowerPC specific CPU data +- * +- * Copyright (C) 2012 IBM Corporation. +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library; If not, see +- * . +- * +- * Authors: +- * Li Zhang +- */ +- +-#ifndef __VIR_CPU_PPC_DATA_H__ +-# define __VIR_CPU_PPC_DATA_H__ +- +-# include +- +-struct cpuPPCData { +- uint32_t pvr; +-}; +- +-#endif /* __VIR_CPU_PPC_DATA_H__ */ +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Rename-powerpc-ppc-ppc64-internal-symbols.patch b/SOURCES/libvirt-cpu-Rename-powerpc-ppc-ppc64-internal-symbols.patch new file mode 100644 index 0000000..0c55e9e --- /dev/null +++ b/SOURCES/libvirt-cpu-Rename-powerpc-ppc-ppc64-internal-symbols.patch @@ -0,0 +1,590 @@ +From e59a9b1e5c000a9c20b8af6cce57bffb9c92221f Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:15:51 +0200 +Subject: [PATCH] cpu: Rename {powerpc, ppc} => ppc64 (internal symbols) + +Update the names of the symbols used internally by the driver. + +No functional changes. + +(cherry picked from commit 3d1515890b8c3630bc7d4c865f3309c154ade174) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 250 ++++++++++++++++++++++++++-------------------------- + 1 file changed, 125 insertions(+), 125 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index bec4bf8..7a48903 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -40,26 +40,26 @@ VIR_LOG_INIT("cpu.cpu_ppc64"); + + static const virArch archs[] = { VIR_ARCH_PPC64, VIR_ARCH_PPC64LE }; + +-struct ppc_vendor { ++struct ppc64_vendor { + char *name; +- struct ppc_vendor *next; ++ struct ppc64_vendor *next; + }; + +-struct ppc_model { ++struct ppc64_model { + char *name; +- const struct ppc_vendor *vendor; ++ const struct ppc64_vendor *vendor; + struct cpuPPC64Data data; +- struct ppc_model *next; ++ struct ppc64_model *next; + }; + +-struct ppc_map { +- struct ppc_vendor *vendors; +- struct ppc_model *models; ++struct ppc64_map { ++ struct ppc64_vendor *vendors; ++ struct ppc64_model *models; + }; + + + static void +-ppcModelFree(struct ppc_model *model) ++ppc64ModelFree(struct ppc64_model *model) + { + if (model == NULL) + return; +@@ -68,11 +68,11 @@ ppcModelFree(struct ppc_model *model) + VIR_FREE(model); + } + +-static struct ppc_model * +-ppcModelFind(const struct ppc_map *map, +- const char *name) ++static struct ppc64_model * ++ppc64ModelFind(const struct ppc64_map *map, ++ const char *name) + { +- struct ppc_model *model; ++ struct ppc64_model *model; + + model = map->models; + while (model != NULL) { +@@ -85,11 +85,11 @@ ppcModelFind(const struct ppc_map *map, + return NULL; + } + +-static struct ppc_model * +-ppcModelFindPVR(const struct ppc_map *map, +- uint32_t pvr) ++static struct ppc64_model * ++ppc64ModelFindPVR(const struct ppc64_map *map, ++ uint32_t pvr) + { +- struct ppc_model *model; ++ struct ppc64_model *model; + + model = map->models; + while (model != NULL) { +@@ -105,19 +105,19 @@ ppcModelFindPVR(const struct ppc_map *map, + * If the exact CPU isn't found, return the nearest matching CPU generation + */ + if (pvr & 0x0000FFFFul) +- return ppcModelFindPVR(map, (pvr & 0xFFFF0000ul)); ++ return ppc64ModelFindPVR(map, (pvr & 0xFFFF0000ul)); + + return NULL; + } + +-static struct ppc_model * +-ppcModelCopy(const struct ppc_model *model) ++static struct ppc64_model * ++ppc64ModelCopy(const struct ppc64_model *model) + { +- struct ppc_model *copy; ++ struct ppc64_model *copy; + + if (VIR_ALLOC(copy) < 0 || + VIR_STRDUP(copy->name, model->name) < 0) { +- ppcModelFree(copy); ++ ppc64ModelFree(copy); + return NULL; + } + +@@ -127,11 +127,11 @@ ppcModelCopy(const struct ppc_model *model) + return copy; + } + +-static struct ppc_vendor * +-ppcVendorFind(const struct ppc_map *map, +- const char *name) ++static struct ppc64_vendor * ++ppc64VendorFind(const struct ppc64_map *map, ++ const char *name) + { +- struct ppc_vendor *vendor; ++ struct ppc64_vendor *vendor; + + vendor = map->vendors; + while (vendor) { +@@ -145,7 +145,7 @@ ppcVendorFind(const struct ppc_map *map, + } + + static void +-ppcVendorFree(struct ppc_vendor *vendor) ++ppc64VendorFree(struct ppc64_vendor *vendor) + { + if (!vendor) + return; +@@ -154,34 +154,34 @@ ppcVendorFree(struct ppc_vendor *vendor) + VIR_FREE(vendor); + } + +-static struct ppc_model * +-ppcModelFromCPU(const virCPUDef *cpu, +- const struct ppc_map *map) ++static struct ppc64_model * ++ppc64ModelFromCPU(const virCPUDef *cpu, ++ const struct ppc64_map *map) + { +- struct ppc_model *model = NULL; ++ struct ppc64_model *model = NULL; + +- if ((model = ppcModelFind(map, cpu->model)) == NULL) { ++ if ((model = ppc64ModelFind(map, cpu->model)) == NULL) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown CPU model %s"), cpu->model); + goto error; + } + +- if ((model = ppcModelCopy(model)) == NULL) ++ if ((model = ppc64ModelCopy(model)) == NULL) + goto error; + + return model; + + error: +- ppcModelFree(model); ++ ppc64ModelFree(model); + return NULL; + } + + + static int +-ppcVendorLoad(xmlXPathContextPtr ctxt, +- struct ppc_map *map) ++ppc64VendorLoad(xmlXPathContextPtr ctxt, ++ struct ppc64_map *map) + { +- struct ppc_vendor *vendor = NULL; ++ struct ppc64_vendor *vendor = NULL; + + if (VIR_ALLOC(vendor) < 0) + return -1; +@@ -193,7 +193,7 @@ ppcVendorLoad(xmlXPathContextPtr ctxt, + goto ignore; + } + +- if (ppcVendorFind(map, vendor->name)) { ++ if (ppc64VendorFind(map, vendor->name)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("CPU vendor %s already defined"), vendor->name); + goto ignore; +@@ -210,15 +210,15 @@ ppcVendorLoad(xmlXPathContextPtr ctxt, + return 0; + + ignore: +- ppcVendorFree(vendor); ++ ppc64VendorFree(vendor); + goto cleanup; + } + + static int +-ppcModelLoad(xmlXPathContextPtr ctxt, +- struct ppc_map *map) ++ppc64ModelLoad(xmlXPathContextPtr ctxt, ++ struct ppc64_map *map) + { +- struct ppc_model *model; ++ struct ppc64_model *model; + char *vendor = NULL; + unsigned long pvr; + +@@ -232,7 +232,7 @@ ppcModelLoad(xmlXPathContextPtr ctxt, + goto ignore; + } + +- if (ppcModelFind(map, model->name)) { ++ if (ppc64ModelFind(map, model->name)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("CPU model %s already defined"), model->name); + goto ignore; +@@ -247,7 +247,7 @@ ppcModelLoad(xmlXPathContextPtr ctxt, + goto ignore; + } + +- if (!(model->vendor = ppcVendorFind(map, vendor))) { ++ if (!(model->vendor = ppc64VendorFind(map, vendor))) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown vendor %s referenced by CPU model %s"), + vendor, model->name); +@@ -276,22 +276,22 @@ ppcModelLoad(xmlXPathContextPtr ctxt, + return 0; + + ignore: +- ppcModelFree(model); ++ ppc64ModelFree(model); + goto cleanup; + } + + static int +-ppcMapLoadCallback(cpuMapElement element, +- xmlXPathContextPtr ctxt, +- void *data) ++ppc64MapLoadCallback(cpuMapElement element, ++ xmlXPathContextPtr ctxt, ++ void *data) + { +- struct ppc_map *map = data; ++ struct ppc64_map *map = data; + + switch (element) { + case CPU_MAP_ELEMENT_VENDOR: +- return ppcVendorLoad(ctxt, map); ++ return ppc64VendorLoad(ctxt, map); + case CPU_MAP_ELEMENT_MODEL: +- return ppcModelLoad(ctxt, map); ++ return ppc64ModelLoad(ctxt, map); + case CPU_MAP_ELEMENT_FEATURE: + case CPU_MAP_ELEMENT_LAST: + break; +@@ -301,46 +301,46 @@ ppcMapLoadCallback(cpuMapElement element, + } + + static void +-ppcMapFree(struct ppc_map *map) ++ppc64MapFree(struct ppc64_map *map) + { + if (map == NULL) + return; + + while (map->models != NULL) { +- struct ppc_model *model = map->models; ++ struct ppc64_model *model = map->models; + map->models = model->next; +- ppcModelFree(model); ++ ppc64ModelFree(model); + } + + while (map->vendors != NULL) { +- struct ppc_vendor *vendor = map->vendors; ++ struct ppc64_vendor *vendor = map->vendors; + map->vendors = vendor->next; +- ppcVendorFree(vendor); ++ ppc64VendorFree(vendor); + } + + VIR_FREE(map); + } + +-static struct ppc_map * +-ppcLoadMap(void) ++static struct ppc64_map * ++ppc64LoadMap(void) + { +- struct ppc_map *map; ++ struct ppc64_map *map; + + if (VIR_ALLOC(map) < 0) + return NULL; + +- if (cpuMapLoad("ppc64", ppcMapLoadCallback, map) < 0) ++ if (cpuMapLoad("ppc64", ppc64MapLoadCallback, map) < 0) + goto error; + + return map; + + error: +- ppcMapFree(map); ++ ppc64MapFree(map); + return NULL; + } + + static virCPUDataPtr +-ppcMakeCPUData(virArch arch, struct cpuPPC64Data *data) ++ppc64MakeCPUData(virArch arch, struct cpuPPC64Data *data) + { + virCPUDataPtr cpuData; + +@@ -355,15 +355,15 @@ ppcMakeCPUData(virArch arch, struct cpuPPC64Data *data) + } + + static virCPUCompareResult +-ppcCompute(virCPUDefPtr host, +- const virCPUDef *cpu, +- virCPUDataPtr *guestData, +- char **message) ++ppc64Compute(virCPUDefPtr host, ++ const virCPUDef *cpu, ++ virCPUDataPtr *guestData, ++ char **message) + + { +- struct ppc_map *map = NULL; +- struct ppc_model *host_model = NULL; +- struct ppc_model *guest_model = NULL; ++ struct ppc64_map *map = NULL; ++ struct ppc64_model *host_model = NULL; ++ struct ppc64_model *guest_model = NULL; + + virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR; + virArch arch; +@@ -411,9 +411,9 @@ ppcCompute(virCPUDefPtr host, + goto cleanup; + } + +- if (!(map = ppcLoadMap()) || +- !(host_model = ppcModelFromCPU(host, map)) || +- !(guest_model = ppcModelFromCPU(cpu, map))) ++ if (!(map = ppc64LoadMap()) || ++ !(host_model = ppc64ModelFromCPU(host, map)) || ++ !(guest_model = ppc64ModelFromCPU(cpu, map))) + goto cleanup; + + if (guestData != NULL) { +@@ -433,23 +433,23 @@ ppcCompute(virCPUDefPtr host, + goto cleanup; + } + +- if (!(*guestData = ppcMakeCPUData(arch, &guest_model->data))) ++ if (!(*guestData = ppc64MakeCPUData(arch, &guest_model->data))) + goto cleanup; + } + + ret = VIR_CPU_COMPARE_IDENTICAL; + + cleanup: +- ppcMapFree(map); +- ppcModelFree(host_model); +- ppcModelFree(guest_model); ++ ppc64MapFree(map); ++ ppc64ModelFree(host_model); ++ ppc64ModelFree(guest_model); + return ret; + } + + static virCPUCompareResult +-ppcCompare(virCPUDefPtr host, +- virCPUDefPtr cpu, +- bool failIncompatible) ++ppc64Compare(virCPUDefPtr host, ++ virCPUDefPtr cpu, ++ bool failIncompatible) + { + if ((cpu->arch == VIR_ARCH_NONE || host->arch == cpu->arch) && + STREQ(host->model, cpu->model)) +@@ -464,23 +464,23 @@ ppcCompare(virCPUDefPtr host, + } + + static int +-ppcDecode(virCPUDefPtr cpu, +- const virCPUData *data, +- const char **models, +- unsigned int nmodels, +- const char *preferred ATTRIBUTE_UNUSED, +- unsigned int flags) ++ppc64Decode(virCPUDefPtr cpu, ++ const virCPUData *data, ++ const char **models, ++ unsigned int nmodels, ++ const char *preferred ATTRIBUTE_UNUSED, ++ unsigned int flags) + { + int ret = -1; +- struct ppc_map *map; +- const struct ppc_model *model; ++ struct ppc64_map *map; ++ const struct ppc64_model *model; + + virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, -1); + +- if (data == NULL || (map = ppcLoadMap()) == NULL) ++ if (data == NULL || (map = ppc64LoadMap()) == NULL) + return -1; + +- if (!(model = ppcModelFindPVR(map, data->data.ppc64.pvr))) { ++ if (!(model = ppc64ModelFindPVR(map, data->data.ppc64.pvr))) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("Cannot find CPU model with PVR 0x%08x"), + data->data.ppc64.pvr); +@@ -502,14 +502,14 @@ ppcDecode(virCPUDefPtr cpu, + ret = 0; + + cleanup: +- ppcMapFree(map); ++ ppc64MapFree(map); + + return ret; + } + + + static void +-ppcDataFree(virCPUDataPtr data) ++ppc64DataFree(virCPUDataPtr data) + { + if (data == NULL) + return; +@@ -518,7 +518,7 @@ ppcDataFree(virCPUDataPtr data) + } + + static virCPUDataPtr +-ppcNodeData(virArch arch) ++ppc64NodeData(virArch arch) + { + virCPUDataPtr cpuData; + +@@ -536,17 +536,17 @@ ppcNodeData(virArch arch) + } + + static virCPUCompareResult +-ppcGuestData(virCPUDefPtr host, +- virCPUDefPtr guest, +- virCPUDataPtr *data, +- char **message) ++ppc64GuestData(virCPUDefPtr host, ++ virCPUDefPtr guest, ++ virCPUDataPtr *data, ++ char **message) + { +- return ppcCompute(host, guest, data, message); ++ return ppc64Compute(host, guest, data, message); + } + + static int +-ppcUpdate(virCPUDefPtr guest, +- const virCPUDef *host) ++ppc64Update(virCPUDefPtr guest, ++ const virCPUDef *host) + { + switch ((virCPUMode) guest->mode) { + case VIR_CPU_MODE_HOST_MODEL: +@@ -568,32 +568,32 @@ ppcUpdate(virCPUDefPtr guest, + } + + static virCPUDefPtr +-ppcBaseline(virCPUDefPtr *cpus, +- unsigned int ncpus, +- const char **models ATTRIBUTE_UNUSED, +- unsigned int nmodels ATTRIBUTE_UNUSED, +- unsigned int flags) ++ppc64Baseline(virCPUDefPtr *cpus, ++ unsigned int ncpus, ++ const char **models ATTRIBUTE_UNUSED, ++ unsigned int nmodels ATTRIBUTE_UNUSED, ++ unsigned int flags) + { +- struct ppc_map *map = NULL; +- const struct ppc_model *model; +- const struct ppc_vendor *vendor = NULL; ++ struct ppc64_map *map = NULL; ++ const struct ppc64_model *model; ++ const struct ppc64_vendor *vendor = NULL; + virCPUDefPtr cpu = NULL; + size_t i; + + virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | + VIR_CONNECT_BASELINE_CPU_MIGRATABLE, NULL); + +- if (!(map = ppcLoadMap())) ++ if (!(map = ppc64LoadMap())) + goto error; + +- if (!(model = ppcModelFind(map, cpus[0]->model))) { ++ if (!(model = ppc64ModelFind(map, cpus[0]->model))) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown CPU model %s"), cpus[0]->model); + goto error; + } + + for (i = 0; i < ncpus; i++) { +- const struct ppc_vendor *vnd; ++ const struct ppc64_vendor *vnd; + + if (STRNEQ(cpus[i]->model, model->name)) { + virReportError(VIR_ERR_OPERATION_FAILED, "%s", +@@ -604,7 +604,7 @@ ppcBaseline(virCPUDefPtr *cpus, + if (!cpus[i]->vendor) + continue; + +- if (!(vnd = ppcVendorFind(map, cpus[i]->vendor))) { ++ if (!(vnd = ppc64VendorFind(map, cpus[i]->vendor))) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("Unknown CPU vendor %s"), cpus[i]->vendor); + goto error; +@@ -641,7 +641,7 @@ ppcBaseline(virCPUDefPtr *cpus, + cpu->match = VIR_CPU_MATCH_EXACT; + + cleanup: +- ppcMapFree(map); ++ ppc64MapFree(map); + + return cpu; + +@@ -652,14 +652,14 @@ ppcBaseline(virCPUDefPtr *cpus, + } + + static int +-ppcGetModels(char ***models) ++ppc64GetModels(char ***models) + { +- struct ppc_map *map; +- struct ppc_model *model; ++ struct ppc64_map *map; ++ struct ppc64_model *model; + char *name; + size_t nmodels = 0; + +- if (!(map = ppcLoadMap())) ++ if (!(map = ppc64LoadMap())) + goto error; + + if (models && VIR_ALLOC_N(*models, 0) < 0) +@@ -681,7 +681,7 @@ ppcGetModels(char ***models) + } + + cleanup: +- ppcMapFree(map); ++ ppc64MapFree(map); + + return nmodels; + +@@ -698,14 +698,14 @@ struct cpuArchDriver cpuDriverPPC64 = { + .name = "ppc64", + .arch = archs, + .narch = ARRAY_CARDINALITY(archs), +- .compare = ppcCompare, +- .decode = ppcDecode, ++ .compare = ppc64Compare, ++ .decode = ppc64Decode, + .encode = NULL, +- .free = ppcDataFree, +- .nodeData = ppcNodeData, +- .guestData = ppcGuestData, +- .baseline = ppcBaseline, +- .update = ppcUpdate, ++ .free = ppc64DataFree, ++ .nodeData = ppc64NodeData, ++ .guestData = ppc64GuestData, ++ .baseline = ppc64Baseline, ++ .update = ppc64Update, + .hasFeature = NULL, +- .getModels = ppcGetModels, ++ .getModels = ppc64GetModels, + }; +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Reorder-functions-in-the-ppc64-driver.patch b/SOURCES/libvirt-cpu-Reorder-functions-in-the-ppc64-driver.patch new file mode 100644 index 0000000..4034413 --- /dev/null +++ b/SOURCES/libvirt-cpu-Reorder-functions-in-the-ppc64-driver.patch @@ -0,0 +1,199 @@ +From 7109e51ae80c27f817fd6f88fe4006099c6fa83c Mon Sep 17 00:00:00 2001 +Message-Id: <7109e51ae80c27f817fd6f88fe4006099c6fa83c@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:15:56 +0200 +Subject: [PATCH] cpu: Reorder functions in the ppc64 driver + +Having the functions grouped together this way will avoid further +shuffling around down the line. + +No functional changes. + +(cherry picked from commit b85b51f2a5254287ffcb28ebd6f744d857481afc) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 129 +++++++++++++++++++++++++--------------------------- + 1 file changed, 63 insertions(+), 66 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 18dbf86..5921263 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -57,6 +57,32 @@ struct ppc64_map { + struct ppc64_model *models; + }; + ++static void ++ppc64VendorFree(struct ppc64_vendor *vendor) ++{ ++ if (!vendor) ++ return; ++ ++ VIR_FREE(vendor->name); ++ VIR_FREE(vendor); ++} ++ ++static struct ppc64_vendor * ++ppc64VendorFind(const struct ppc64_map *map, ++ const char *name) ++{ ++ struct ppc64_vendor *vendor; ++ ++ vendor = map->vendors; ++ while (vendor) { ++ if (STREQ(vendor->name, name)) ++ return vendor; ++ ++ vendor = vendor->next; ++ } ++ ++ return NULL; ++} + + static void + ppc64ModelFree(struct ppc64_model *model) +@@ -69,6 +95,23 @@ ppc64ModelFree(struct ppc64_model *model) + } + + static struct ppc64_model * ++ppc64ModelCopy(const struct ppc64_model *model) ++{ ++ struct ppc64_model *copy; ++ ++ if (VIR_ALLOC(copy) < 0 || ++ VIR_STRDUP(copy->name, model->name) < 0) { ++ ppc64ModelFree(copy); ++ return NULL; ++ } ++ ++ copy->data.pvr = model->data.pvr; ++ copy->vendor = model->vendor; ++ ++ return copy; ++} ++ ++static struct ppc64_model * + ppc64ModelFind(const struct ppc64_map *map, + const char *name) + { +@@ -111,50 +154,6 @@ ppc64ModelFindPVR(const struct ppc64_map *map, + } + + static struct ppc64_model * +-ppc64ModelCopy(const struct ppc64_model *model) +-{ +- struct ppc64_model *copy; +- +- if (VIR_ALLOC(copy) < 0 || +- VIR_STRDUP(copy->name, model->name) < 0) { +- ppc64ModelFree(copy); +- return NULL; +- } +- +- copy->data.pvr = model->data.pvr; +- copy->vendor = model->vendor; +- +- return copy; +-} +- +-static struct ppc64_vendor * +-ppc64VendorFind(const struct ppc64_map *map, +- const char *name) +-{ +- struct ppc64_vendor *vendor; +- +- vendor = map->vendors; +- while (vendor) { +- if (STREQ(vendor->name, name)) +- return vendor; +- +- vendor = vendor->next; +- } +- +- return NULL; +-} +- +-static void +-ppc64VendorFree(struct ppc64_vendor *vendor) +-{ +- if (!vendor) +- return; +- +- VIR_FREE(vendor->name); +- VIR_FREE(vendor); +-} +- +-static struct ppc64_model * + ppc64ModelFromCPU(const virCPUDef *cpu, + const struct ppc64_map *map) + { +@@ -169,6 +168,26 @@ ppc64ModelFromCPU(const virCPUDef *cpu, + return ppc64ModelCopy(model); + } + ++static void ++ppc64MapFree(struct ppc64_map *map) ++{ ++ if (!map) ++ return; ++ ++ while (map->models) { ++ struct ppc64_model *model = map->models; ++ map->models = model->next; ++ ppc64ModelFree(model); ++ } ++ ++ while (map->vendors) { ++ struct ppc64_vendor *vendor = map->vendors; ++ map->vendors = vendor->next; ++ ppc64VendorFree(vendor); ++ } ++ ++ VIR_FREE(map); ++} + + static int + ppc64VendorLoad(xmlXPathContextPtr ctxt, +@@ -293,27 +312,6 @@ ppc64MapLoadCallback(cpuMapElement element, + return 0; + } + +-static void +-ppc64MapFree(struct ppc64_map *map) +-{ +- if (!map) +- return; +- +- while (map->models) { +- struct ppc64_model *model = map->models; +- map->models = model->next; +- ppc64ModelFree(model); +- } +- +- while (map->vendors) { +- struct ppc64_vendor *vendor = map->vendors; +- map->vendors = vendor->next; +- ppc64VendorFree(vendor); +- } +- +- VIR_FREE(map); +-} +- + static struct ppc64_map * + ppc64LoadMap(void) + { +@@ -500,7 +498,6 @@ ppc64DriverDecode(virCPUDefPtr cpu, + return ret; + } + +- + static void + ppc64DriverFree(virCPUDataPtr data) + { +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Simplify-NULL-handling-in-ppc64-driver.patch b/SOURCES/libvirt-cpu-Simplify-NULL-handling-in-ppc64-driver.patch new file mode 100644 index 0000000..e5c1354 --- /dev/null +++ b/SOURCES/libvirt-cpu-Simplify-NULL-handling-in-ppc64-driver.patch @@ -0,0 +1,168 @@ +From 168e6ce50e183acb95a8ca49cee8114dd880f17a Mon Sep 17 00:00:00 2001 +Message-Id: <168e6ce50e183acb95a8ca49cee8114dd880f17a@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:15:54 +0200 +Subject: [PATCH] cpu: Simplify NULL handling in ppc64 driver + +Use briefer checks, eg. (!model) instead of (model == NULL), and +avoid initializing to NULL a pointer that would be assigned in +the first line of the function anyway. + +Also remove a pointless NULL assignment. + +No functional changes. + +(cherry picked from commit 4590f0678f7c74e988f53882e710a67a3b15fc68) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 33 ++++++++++++++++----------------- + 1 file changed, 16 insertions(+), 17 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 5140297..05ff8f2 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -61,7 +61,7 @@ struct ppc64_map { + static void + ppc64ModelFree(struct ppc64_model *model) + { +- if (model == NULL) ++ if (!model) + return; + + VIR_FREE(model->name); +@@ -75,7 +75,7 @@ ppc64ModelFind(const struct ppc64_map *map, + struct ppc64_model *model; + + model = map->models; +- while (model != NULL) { ++ while (model) { + if (STREQ(model->name, name)) + return model; + +@@ -92,7 +92,7 @@ ppc64ModelFindPVR(const struct ppc64_map *map, + struct ppc64_model *model; + + model = map->models; +- while (model != NULL) { ++ while (model) { + if (model->data.pvr == pvr) + return model; + +@@ -158,15 +158,15 @@ static struct ppc64_model * + ppc64ModelFromCPU(const virCPUDef *cpu, + const struct ppc64_map *map) + { +- struct ppc64_model *model = NULL; ++ struct ppc64_model *model; + +- if ((model = ppc64ModelFind(map, cpu->model)) == NULL) { ++ if (!(model = ppc64ModelFind(map, cpu->model))) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown CPU model %s"), cpu->model); + goto error; + } + +- if ((model = ppc64ModelCopy(model)) == NULL) ++ if (!(model = ppc64ModelCopy(model))) + goto error; + + return model; +@@ -181,7 +181,7 @@ static int + ppc64VendorLoad(xmlXPathContextPtr ctxt, + struct ppc64_map *map) + { +- struct ppc64_vendor *vendor = NULL; ++ struct ppc64_vendor *vendor; + + if (VIR_ALLOC(vendor) < 0) + return -1; +@@ -264,7 +264,7 @@ ppc64ModelLoad(xmlXPathContextPtr ctxt, + } + model->data.pvr = pvr; + +- if (map->models == NULL) { ++ if (!map->models) { + map->models = model; + } else { + model->next = map->models; +@@ -303,16 +303,16 @@ ppc64MapLoadCallback(cpuMapElement element, + static void + ppc64MapFree(struct ppc64_map *map) + { +- if (map == NULL) ++ if (!map) + return; + +- while (map->models != NULL) { ++ while (map->models) { + struct ppc64_model *model = map->models; + map->models = model->next; + ppc64ModelFree(model); + } + +- while (map->vendors != NULL) { ++ while (map->vendors) { + struct ppc64_vendor *vendor = map->vendors; + map->vendors = vendor->next; + ppc64VendorFree(vendor); +@@ -350,7 +350,6 @@ ppc64MakeCPUData(virArch arch, + + cpuData->arch = arch; + cpuData->data.ppc64 = *data; +- data = NULL; + + return cpuData; + } +@@ -417,7 +416,7 @@ ppc64Compute(virCPUDefPtr host, + !(guest_model = ppc64ModelFromCPU(cpu, map))) + goto cleanup; + +- if (guestData != NULL) { ++ if (guestData) { + if (cpu->type == VIR_CPU_TYPE_GUEST && + cpu->match == VIR_CPU_MATCH_STRICT && + STRNEQ(guest_model->name, host_model->name)) { +@@ -478,7 +477,7 @@ ppc64DriverDecode(virCPUDefPtr cpu, + + virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, -1); + +- if (data == NULL || (map = ppc64LoadMap()) == NULL) ++ if (!data || !(map = ppc64LoadMap())) + return -1; + + if (!(model = ppc64ModelFindPVR(map, data->data.ppc64.pvr))) { +@@ -512,7 +511,7 @@ ppc64DriverDecode(virCPUDefPtr cpu, + static void + ppc64DriverFree(virCPUDataPtr data) + { +- if (data == NULL) ++ if (!data) + return; + + VIR_FREE(data); +@@ -575,7 +574,7 @@ ppc64DriverBaseline(virCPUDefPtr *cpus, + unsigned int nmodels ATTRIBUTE_UNUSED, + unsigned int flags) + { +- struct ppc64_map *map = NULL; ++ struct ppc64_map *map; + const struct ppc64_model *model; + const struct ppc64_vendor *vendor = NULL; + virCPUDefPtr cpu = NULL; +@@ -667,7 +666,7 @@ ppc64DriverGetModels(char ***models) + goto error; + + model = map->models; +- while (model != NULL) { ++ while (model) { + if (models) { + if (VIR_STRDUP(name, model->name) < 0) + goto error; +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Simplify-ppc64-part-of-CPU-map-XML.patch b/SOURCES/libvirt-cpu-Simplify-ppc64-part-of-CPU-map-XML.patch new file mode 100644 index 0000000..45d478d --- /dev/null +++ b/SOURCES/libvirt-cpu-Simplify-ppc64-part-of-CPU-map-XML.patch @@ -0,0 +1,91 @@ +From 21dd3b6c09f3777e3859e74757372b59ebf4535e Mon Sep 17 00:00:00 2001 +Message-Id: <21dd3b6c09f3777e3859e74757372b59ebf4535e@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:16:06 +0200 +Subject: [PATCH] cpu: Simplify ppc64 part of CPU map XML + +Use multiple PVRs per CPU model to reduce the number of models we +need to keep track of. + +Remove specific CPU models (eg. POWER7+_v2.1): the corresponding +generic CPU model (eg. POWER7) should be used instead to ensure +the guest can be booted on any compatible host. + +Get rid of all the entries that did not match any of the CPU +models supported by QEMU, like power8 and power8e. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 +(cherry picked from commit d87359af5eb5b21848da1906f8e34f107bbea151) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_map.xml | 39 +++------------------------------------ + 1 file changed, 3 insertions(+), 36 deletions(-) + +diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml +index 50516e3..9474a1b 100644 +--- a/src/cpu/cpu_map.xml ++++ b/src/cpu/cpu_map.xml +@@ -628,53 +628,20 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ++ + + + + +- ++ + + +- +- +- +- + + + +- ++ + + +- +- +- +- + + + +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Simplify-ppc64ModelFromCPU.patch b/SOURCES/libvirt-cpu-Simplify-ppc64ModelFromCPU.patch new file mode 100644 index 0000000..f954d76 --- /dev/null +++ b/SOURCES/libvirt-cpu-Simplify-ppc64ModelFromCPU.patch @@ -0,0 +1,43 @@ +From b787e0f4846d1175c5ed7dd8aeecb4b78eaf0c47 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:15:55 +0200 +Subject: [PATCH] cpu: Simplify ppc64ModelFromCPU() + +(cherry picked from commit c238d16af4fccfb829274c1a4dbf2748d81f7714) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 05ff8f2..18dbf86 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -163,17 +163,10 @@ ppc64ModelFromCPU(const virCPUDef *cpu, + if (!(model = ppc64ModelFind(map, cpu->model))) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown CPU model %s"), cpu->model); +- goto error; ++ return NULL; + } + +- if (!(model = ppc64ModelCopy(model))) +- goto error; +- +- return model; +- +- error: +- ppc64ModelFree(model); +- return NULL; ++ return ppc64ModelCopy(model); + } + + +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Support-multiple-PVRs-in-the-ppc64-driver.patch b/SOURCES/libvirt-cpu-Support-multiple-PVRs-in-the-ppc64-driver.patch new file mode 100644 index 0000000..10c15ae --- /dev/null +++ b/SOURCES/libvirt-cpu-Support-multiple-PVRs-in-the-ppc64-driver.patch @@ -0,0 +1,195 @@ +From 6b1d9c4ab470b81eb903bebc8255911142a01df9 Mon Sep 17 00:00:00 2001 +Message-Id: <6b1d9c4ab470b81eb903bebc8255911142a01df9@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:16:05 +0200 +Subject: [PATCH] cpu: Support multiple PVRs in the ppc64 driver + +This will allow us to perform PVR matching more broadly, eg. consider +both POWER8 and POWER8E CPUs to be the same even though they have +different PVR values. + +(cherry picked from commit 59fcc9619522d4ac837dafc3c04f6309761f3c5b) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 71 ++++++++++++++++++++++++++++++++++++++++-------- + src/cpu/cpu_ppc64_data.h | 8 +++++- + 2 files changed, 66 insertions(+), 13 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 6c78ab8..ba33e05 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -60,6 +60,10 @@ struct ppc64_map { + static void + ppc64DataFree(virCPUppc64Data *data) + { ++ if (!data) ++ return; ++ ++ VIR_FREE(data->pvr); + VIR_FREE(data); + } + +@@ -67,13 +71,24 @@ static virCPUppc64Data * + ppc64DataCopy(const virCPUppc64Data *data) + { + virCPUppc64Data *copy; ++ size_t i; + + if (VIR_ALLOC(copy) < 0) +- return NULL; ++ goto error; + +- copy->pvr = data->pvr; ++ if (VIR_ALLOC_N(copy->pvr, data->len) < 0) ++ goto error; ++ ++ copy->len = data->len; ++ ++ for (i = 0; i < data->len; i++) ++ copy->pvr[i].value = data->pvr[i].value; + + return copy; ++ ++ error: ++ ppc64DataFree(copy); ++ return NULL; + } + + static void +@@ -159,12 +174,14 @@ ppc64ModelFindPVR(const struct ppc64_map *map, + uint32_t pvr) + { + struct ppc64_model *model; ++ size_t i; + + model = map->models; + while (model) { +- if (model->data->pvr == pvr) +- return model; +- ++ for (i = 0; i < model->data->len; i++) { ++ if (model->data->pvr[i].value == pvr) ++ return model; ++ } + model = model->next; + } + +@@ -257,8 +274,16 @@ ppc64ModelLoad(xmlXPathContextPtr ctxt, + struct ppc64_map *map) + { + struct ppc64_model *model; ++ xmlNodePtr *nodes = NULL; ++ xmlNodePtr bookmark; + char *vendor = NULL; + unsigned long pvr; ++ size_t i; ++ int n; ++ ++ /* Save the node the context was pointing to, as we're going ++ * to change it later. It's going to be restored on exit */ ++ bookmark = ctxt->node; + + if (VIR_ALLOC(model) < 0) + return -1; +@@ -298,14 +323,29 @@ ppc64ModelLoad(xmlXPathContextPtr ctxt, + } + } + +- if (!virXPathBoolean("boolean(./pvr)", ctxt) || +- virXPathULongHex("string(./pvr/@value)", ctxt, &pvr) < 0) { ++ if ((n = virXPathNodeSet("./pvr", ctxt, &nodes)) <= 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Missing or invalid PVR value in CPU model %s"), ++ _("Missing PVR information for CPU model %s"), + model->name); + goto ignore; + } +- model->data->pvr = pvr; ++ ++ if (VIR_ALLOC_N(model->data->pvr, n) < 0) ++ goto ignore; ++ ++ model->data->len = n; ++ ++ for (i = 0; i < n; i++) { ++ ctxt->node = nodes[i]; ++ ++ if (virXPathULongHex("string(./@value)", ctxt, &pvr) < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Missing or invalid PVR value in CPU model %s"), ++ model->name); ++ goto ignore; ++ } ++ model->data->pvr[i].value = pvr; ++ } + + if (!map->models) { + map->models = model; +@@ -315,7 +355,9 @@ ppc64ModelLoad(xmlXPathContextPtr ctxt, + } + + cleanup: ++ ctxt->node = bookmark; + VIR_FREE(vendor); ++ VIR_FREE(nodes); + return 0; + + ignore: +@@ -506,10 +548,10 @@ ppc64DriverDecode(virCPUDefPtr cpu, + if (!data || !(map = ppc64LoadMap())) + return -1; + +- if (!(model = ppc64ModelFindPVR(map, data->data.ppc64->pvr))) { ++ if (!(model = ppc64ModelFindPVR(map, data->data.ppc64->pvr[0].value))) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("Cannot find CPU model with PVR 0x%08x"), +- data->data.ppc64->pvr); ++ data->data.ppc64->pvr[0].value); + goto cleanup; + } + +@@ -557,9 +599,14 @@ ppc64DriverNodeData(virArch arch) + + data = nodeData->data.ppc64; + ++ if (VIR_ALLOC_N(data->pvr, 1) < 0) ++ goto error; ++ ++ data->len = 1; ++ + #if defined(__powerpc__) || defined(__powerpc64__) + asm("mfpvr %0" +- : "=r" (data->pvr)); ++ : "=r" (data->pvr[0].value)); + #endif + + nodeData->arch = arch; +diff --git a/src/cpu/cpu_ppc64_data.h b/src/cpu/cpu_ppc64_data.h +index c18fc63..0d3cb0b 100644 +--- a/src/cpu/cpu_ppc64_data.h ++++ b/src/cpu/cpu_ppc64_data.h +@@ -26,9 +26,15 @@ + + # include + ++typedef struct _virCPUppc64PVR virCPUppc64PVR; ++struct _virCPUppc64PVR { ++ uint32_t value; ++}; ++ + typedef struct _virCPUppc64Data virCPUppc64Data; + struct _virCPUppc64Data { +- uint32_t pvr; ++ size_t len; ++ virCPUppc64PVR *pvr; + }; + + #endif /* __VIR_CPU_PPC64_DATA_H__ */ +-- +2.5.0 + diff --git a/SOURCES/libvirt-cpu-Use-ppc64Compute-to-implement-ppc64DriverCompare.patch b/SOURCES/libvirt-cpu-Use-ppc64Compute-to-implement-ppc64DriverCompare.patch new file mode 100644 index 0000000..ec2af7e --- /dev/null +++ b/SOURCES/libvirt-cpu-Use-ppc64Compute-to-implement-ppc64DriverCompare.patch @@ -0,0 +1,58 @@ +From 9dcd200a892eb8880baff291e42a630252c15a3d Mon Sep 17 00:00:00 2001 +Message-Id: <9dcd200a892eb8880baff291e42a630252c15a3d@dist-git> +From: Andrea Bolognani +Date: Tue, 11 Aug 2015 17:16:02 +0200 +Subject: [PATCH] cpu: Use ppc64Compute() to implement ppc64DriverCompare() + +This ensures comparison of two CPU definitions will be consistent +regardless of the fact that it is performed using cpuCompare() or +cpuGuestData(). The x86 driver uses the same exact code. + +(cherry picked from commit d574094d309eee5fdfcea3de4f06aed154975d83) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_ppc64.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c +index 0769956..efac739 100644 +--- a/src/cpu/cpu_ppc64.c ++++ b/src/cpu/cpu_ppc64.c +@@ -438,16 +438,22 @@ ppc64DriverCompare(virCPUDefPtr host, + virCPUDefPtr cpu, + bool failIncompatible) + { +- if ((cpu->arch == VIR_ARCH_NONE || host->arch == cpu->arch) && +- STREQ(host->model, cpu->model)) +- return VIR_CPU_COMPARE_IDENTICAL; ++ virCPUCompareResult ret; ++ char *message = NULL; + +- if (failIncompatible) { +- virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL); +- return VIR_CPU_COMPARE_ERROR; +- } else { +- return VIR_CPU_COMPARE_INCOMPATIBLE; ++ ret = ppc64Compute(host, cpu, NULL, &message); ++ ++ if (failIncompatible && ret == VIR_CPU_COMPARE_INCOMPATIBLE) { ++ ret = VIR_CPU_COMPARE_ERROR; ++ if (message) { ++ virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s", message); ++ } else { ++ virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL); ++ } + } ++ VIR_FREE(message); ++ ++ return ret; + } + + static int +-- +2.5.0 + diff --git a/SOURCES/libvirt-cputune-allow-interleaved-xml.patch b/SOURCES/libvirt-cputune-allow-interleaved-xml.patch deleted file mode 100644 index 2870c5f..0000000 --- a/SOURCES/libvirt-cputune-allow-interleaved-xml.patch +++ /dev/null @@ -1,238 +0,0 @@ -From 321333e5be4da74a158e9607d310605a8b44679b Mon Sep 17 00:00:00 2001 -Message-Id: <321333e5be4da74a158e9607d310605a8b44679b@dist-git> -From: Eric Blake -Date: Thu, 18 Sep 2014 09:29:57 -0400 -Subject: [PATCH] cputune: allow interleaved xml - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -I noticed this with the recent iothread pinning code, but the -problem existed longer than that. The XML validation required -users to supply children in a strict order, even though -there was no conceptual reason why they can't occur in any order. - -docs/ changes best viewed with -w - -* docs/schemas/domaincommon.rng (cputune): Add interleave. -* tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml: Swap -up order, copying canonical form... -* tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml: -...here. -* tests/qemuxml2xmltest.c (mymain): Mark the difference. - -Signed-off-by: Eric Blake -(cherry picked from commit 7e8feed4a74b623eca0580a3db140eab2b5fa2b9) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - docs/schemas/domaincommon.rng | 106 +++++++++++---------- - .../qemuxml2argv-cputune-iothreads.xml | 15 +-- - .../qemuxml2xmlout-cputune-iothreads.xml | 38 ++++++++ - tests/qemuxml2xmltest.c | 2 +- - 4 files changed, 101 insertions(+), 60 deletions(-) - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index d61d3ad..badc17b 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -768,58 +768,60 @@ - - - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml b/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml -index 435d0ae..c8cc025 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml -@@ -6,14 +6,15 @@ - 2 - 2 - -- 2048 -- 1000000 -- -1 -- -- -- -- -+ - -+ -+ -+ -+ -+ -1 -+ 1000000 -+ 2048 - - - hvm -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml -new file mode 100644 -index 0000000..3684483 ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml -@@ -0,0 +1,38 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 2 -+ 2 -+ -+ 2048 -+ 1000000 -+ -1 -+ -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+

-+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 843e66d..3ca64d4 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -303,7 +303,7 @@ mymain(void) - - DO_TEST("smp"); - DO_TEST("iothreads"); -- DO_TEST("cputune-iothreads"); -+ DO_TEST_DIFFERENT("cputune-iothreads"); - DO_TEST("iothreads-disk"); - DO_TEST("lease"); - DO_TEST("event_idx"); --- -2.1.0 - diff --git a/SOURCES/libvirt-cputune_event-queue-the-event-for-cputune-updates.patch b/SOURCES/libvirt-cputune_event-queue-the-event-for-cputune-updates.patch deleted file mode 100644 index ba0905f..0000000 --- a/SOURCES/libvirt-cputune_event-queue-the-event-for-cputune-updates.patch +++ /dev/null @@ -1,332 +0,0 @@ -From 723e2b82385ad3c32c866ddc75198697f9bd2411 Mon Sep 17 00:00:00 2001 -Message-Id: <723e2b82385ad3c32c866ddc75198697f9bd2411@dist-git> -From: Pavel Hrdina -Date: Fri, 26 Sep 2014 12:44:00 +0200 -Subject: [PATCH] cputune_event: queue the event for cputune updates - -Now we have universal tunable event so we can use it for reporting -changes to user. The cputune values will be prefixed with "cputune" to -distinguish it from other tunable events. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 0dce260cc81b284e1073688b6d7900040b679da2) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1115898 -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 63 ++++++++++++++++++++++++++++++++++ - src/qemu/qemu_cgroup.c | 19 ++++++++++- - src/qemu/qemu_driver.c | 81 ++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 162 insertions(+), 1 deletion(-) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 56c665c..b78f110 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -5168,6 +5168,66 @@ typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn, - void *opaque); - - /** -+ * VIR_DOMAIN_EVENT_CPUTUNE_VCPUPIN: -+ * -+ * Macro represents formatted pinning for one vcpu specified by id which is -+ * appended to the parameter name, for example "cputune.vcpupin1", -+ * as VIR_TYPED_PARAM_STRING. -+ */ -+#define VIR_DOMAIN_EVENT_CPUTUNE_VCPUPIN "cputune.vcpupin%u" -+ -+/** -+ * VIR_DOMAIN_EVENT_CPUTUNE_EMULATORIN: -+ * -+ * Macro represents formatted pinning for emulator process, -+ * as VIR_TYPED_PARAM_STRING. -+ */ -+#define VIR_DOMAIN_EVENT_CPUTUNE_EMULATORIN "cputune.emulatorpin" -+ -+/** -+ * VIR_DOMAIN_EVENT_CPUTUNE_CPU_SHARES: -+ * -+ * Macro represents proportional weight of the scheduler used on the -+ * host cpu, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_EVENT_CPUTUNE_CPU_SHARES "cputune.cpu_shares" -+ -+/** -+ * VIR_DOMAIN_EVENT_CPUTUNE_VCPU_PERIOD: -+ * -+ * Macro represents the enforcement period for a quota, in microseconds, -+ * for vcpus only, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_EVENT_CPUTUNE_VCPU_PERIOD "cputune.vcpu_period" -+ -+/** -+ * VIR_DOMAIN_EVENT_CPUTUNE_VCPU_QUOTA: -+ * -+ * Macro represents the maximum bandwidth to be used within a period for -+ * vcpus only, when using the posix scheduler, as VIR_TYPED_PARAM_LLONG. -+ */ -+#define VIR_DOMAIN_EVENT_CPUTUNE_VCPU_QUOTA "cputune.vcpu_quota" -+ -+/** -+ * VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_PERIOD: -+ * -+ * Macro represents the enforcement period for a quota in microseconds, -+ * when using the posix scheduler, for all emulator activity not tied to -+ * vcpus, as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_PERIOD "cputune.emulator_period" -+ -+/** -+ * VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_QUOTA: -+ * -+ * Macro represents the maximum bandwidth to be used within a period for -+ * all emulator activity not tied to vcpus, when using the posix scheduler, -+ * as an VIR_TYPED_PARAM_LLONG. -+ */ -+#define VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_QUOTA "cputune.emulator_quota" -+ -+ -+/** - * virConnectDomainEventTunableCallback: - * @conn: connection object - * @dom: domain on which the event occurred -@@ -5179,6 +5239,9 @@ typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn, - * be freed in the callback handler as it's done internally after the callback - * handler is executed. - * -+ * Currently supported name spaces: -+ * "cputune.*" -+ * - * The callback signature to use when registering for an event of type - * VIR_DOMAIN_EVENT_ID_TUNABLE with virConnectDomainEventRegisterAny() - */ -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index 7c6b2c1..300946a 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -34,6 +34,7 @@ - #include "virscsi.h" - #include "virstring.h" - #include "virfile.h" -+#include "virtypedparam.h" - - #define VIR_FROM_THIS VIR_FROM_QEMU - -@@ -676,6 +677,10 @@ static int - qemuSetupCpuCgroup(virDomainObjPtr vm) - { - qemuDomainObjPrivatePtr priv = vm->privateData; -+ virObjectEventPtr event = NULL; -+ virTypedParameterPtr eventParams = NULL; -+ int eventNparams = 0; -+ int eventMaxparams = 0; - - if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU)) { - if (vm->def->cputune.sharesSpecified) { -@@ -694,7 +699,19 @@ qemuSetupCpuCgroup(virDomainObjPtr vm) - - if (virCgroupGetCpuShares(priv->cgroup, &val) < 0) - return -1; -- vm->def->cputune.shares = val; -+ if (vm->def->cputune.shares != val) { -+ vm->def->cputune.shares = val; -+ if (virTypedParamsAddULLong(&eventParams, &eventNparams, -+ &eventMaxparams, -+ VIR_DOMAIN_EVENT_CPUTUNE_CPU_SHARES, -+ val) < 0) -+ return -1; -+ -+ event = virDomainEventTunableNewFromObj(vm, eventParams, eventNparams); -+ } -+ -+ if (event) -+ qemuDomainEventQueue(vm->privateData, event); - } - - return 0; -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 46be72c..663c98d 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4474,6 +4474,12 @@ qemuDomainPinVcpuFlags(virDomainPtr dom, - virBitmapPtr pcpumap = NULL; - virQEMUDriverConfigPtr cfg = NULL; - virCapsPtr caps = NULL; -+ virObjectEventPtr event = NULL; -+ char paramField[VIR_TYPED_PARAM_FIELD_LENGTH] = ""; -+ char *str = NULL; -+ virTypedParameterPtr eventParams = NULL; -+ int eventNparams = 0; -+ int eventMaxparams = 0; - - virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | - VIR_DOMAIN_AFFECT_CONFIG, -1); -@@ -4581,6 +4587,18 @@ qemuDomainPinVcpuFlags(virDomainPtr dom, - - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) - goto cleanup; -+ -+ if (snprintf(paramField, VIR_TYPED_PARAM_FIELD_LENGTH, -+ VIR_DOMAIN_EVENT_CPUTUNE_VCPUPIN, vcpu) < 0) { -+ goto cleanup; -+ } -+ -+ str = virBitmapFormat(pcpumap); -+ if (virTypedParamsAddString(&eventParams, &eventNparams, -+ &eventMaxparams, paramField, str) < 0) -+ goto cleanup; -+ -+ event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams); - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { -@@ -4616,6 +4634,9 @@ qemuDomainPinVcpuFlags(virDomainPtr dom, - virCgroupFree(&cgroup_vcpu); - if (vm) - virObjectUnlock(vm); -+ if (event) -+ qemuDomainEventQueue(driver, event); -+ VIR_FREE(str); - virBitmapFree(pcpumap); - virObjectUnref(caps); - virObjectUnref(cfg); -@@ -4740,6 +4761,12 @@ qemuDomainPinEmulator(virDomainPtr dom, - virBitmapPtr pcpumap = NULL; - virQEMUDriverConfigPtr cfg = NULL; - virCapsPtr caps = NULL; -+ virObjectEventPtr event = NULL; -+ char * str = NULL; -+ virTypedParameterPtr eventParams = NULL; -+ int eventNparams = 0; -+ int eventMaxparams = 0; -+ - - virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | - VIR_DOMAIN_AFFECT_CONFIG, -1); -@@ -4845,6 +4872,15 @@ qemuDomainPinEmulator(virDomainPtr dom, - - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) - goto cleanup; -+ -+ str = virBitmapFormat(pcpumap); -+ if (virTypedParamsAddString(&eventParams, &eventNparams, -+ &eventMaxparams, -+ VIR_DOMAIN_EVENT_CPUTUNE_EMULATORIN, -+ str) < 0) -+ goto cleanup; -+ -+ event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams); - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { -@@ -4874,6 +4910,9 @@ qemuDomainPinEmulator(virDomainPtr dom, - cleanup: - if (cgroup_emulator) - virCgroupFree(&cgroup_emulator); -+ if (event) -+ qemuDomainEventQueue(driver, event); -+ VIR_FREE(str); - virBitmapFree(pcpumap); - virObjectUnref(caps); - if (vm) -@@ -9201,6 +9240,10 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - virQEMUDriverConfigPtr cfg = NULL; - virCapsPtr caps = NULL; - qemuDomainObjPrivatePtr priv; -+ virObjectEventPtr event = NULL; -+ virTypedParameterPtr eventParams = NULL; -+ int eventNparams = 0; -+ int eventMaxNparams = 0; - - virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | - VIR_DOMAIN_AFFECT_CONFIG, -1); -@@ -9271,6 +9314,12 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - - vm->def->cputune.shares = val; - vm->def->cputune.sharesSpecified = true; -+ -+ if (virTypedParamsAddULLong(&eventParams, &eventNparams, -+ &eventMaxNparams, -+ VIR_DOMAIN_EVENT_CPUTUNE_CPU_SHARES, -+ val) < 0) -+ goto cleanup; - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { -@@ -9288,6 +9337,12 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - goto cleanup; - - vm->def->cputune.period = value_ul; -+ -+ if (virTypedParamsAddULLong(&eventParams, &eventNparams, -+ &eventMaxNparams, -+ VIR_DOMAIN_EVENT_CPUTUNE_VCPU_PERIOD, -+ value_ul) < 0) -+ goto cleanup; - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) -@@ -9302,6 +9357,12 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - goto cleanup; - - vm->def->cputune.quota = value_l; -+ -+ if (virTypedParamsAddLLong(&eventParams, &eventNparams, -+ &eventMaxNparams, -+ VIR_DOMAIN_EVENT_CPUTUNE_VCPU_QUOTA, -+ value_l) < 0) -+ goto cleanup; - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) -@@ -9317,6 +9378,12 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - goto cleanup; - - vm->def->cputune.emulator_period = value_ul; -+ -+ if (virTypedParamsAddULLong(&eventParams, &eventNparams, -+ &eventMaxNparams, -+ VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_PERIOD, -+ value_ul) < 0) -+ goto cleanup; - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) -@@ -9332,6 +9399,12 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - goto cleanup; - - vm->def->cputune.emulator_quota = value_l; -+ -+ if (virTypedParamsAddLLong(&eventParams, &eventNparams, -+ &eventMaxNparams, -+ VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_QUOTA, -+ value_l) < 0) -+ goto cleanup; - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) -@@ -9342,6 +9415,12 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) - goto cleanup; - -+ if (eventNparams) { -+ event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams); -+ eventNparams = 0; -+ if (event) -+ qemuDomainEventQueue(driver, event); -+ } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { - rc = virDomainSaveConfig(cfg->configDir, vmdef); -@@ -9358,6 +9437,8 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, - virDomainDefFree(vmdef); - if (vm) - virObjectUnlock(vm); -+ if (eventNparams) -+ virTypedParamsFree(eventParams, eventNparams); - virObjectUnref(caps); - virObjectUnref(cfg); - return ret; --- -2.1.1 - diff --git a/SOURCES/libvirt-daemon-Resolve-Coverity-RESOURCE_LEAK.patch b/SOURCES/libvirt-daemon-Resolve-Coverity-RESOURCE_LEAK.patch deleted file mode 100644 index 9446dde..0000000 --- a/SOURCES/libvirt-daemon-Resolve-Coverity-RESOURCE_LEAK.patch +++ /dev/null @@ -1,50 +0,0 @@ -From fb5f9100a7ca6e8d63b1ec2b1c5d3ae12f146d71 Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Mon, 15 Sep 2014 15:13:56 -0400 -Subject: [PATCH] daemon: Resolve Coverity RESOURCE_LEAK - -https://bugzilla.redhat.com/show_bug.cgi?id=1141209 - -With eblake's help - adjust the checks for stdinfd/stdoutfd to ensure the -values are within the range we expect; otherwise the dup2()'s and subsequent -VIR_CLOSE() calls cause Coverity to believe there's a resource leak. - -Signed-off-by: John Ferlan -(cherry picked from commit c77ac79d6b5a6758f3a980d2edfd0abda9aa7d3e) -Signed-off-by: Jiri Denemark ---- - daemon/libvirtd.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c -index 0503cd0..05ee50e 100644 ---- a/daemon/libvirtd.c -+++ b/daemon/libvirtd.c -@@ -163,9 +163,9 @@ static int daemonForkIntoBackground(const char *argv0) - - VIR_FORCE_CLOSE(statuspipe[0]); - -- if ((stdinfd = open("/dev/null", O_RDONLY)) < 0) -+ if ((stdinfd = open("/dev/null", O_RDONLY)) <= STDERR_FILENO) - goto cleanup; -- if ((stdoutfd = open("/dev/null", O_WRONLY)) < 0) -+ if ((stdoutfd = open("/dev/null", O_WRONLY)) <= STDERR_FILENO) - goto cleanup; - if (dup2(stdinfd, STDIN_FILENO) != STDIN_FILENO) - goto cleanup; -@@ -173,9 +173,9 @@ static int daemonForkIntoBackground(const char *argv0) - goto cleanup; - if (dup2(stdoutfd, STDERR_FILENO) != STDERR_FILENO) - goto cleanup; -- if (stdinfd > STDERR_FILENO && VIR_CLOSE(stdinfd) < 0) -+ if (VIR_CLOSE(stdinfd) < 0) - goto cleanup; -- if (stdoutfd > STDERR_FILENO && VIR_CLOSE(stdoutfd) < 0) -+ if (VIR_CLOSE(stdoutfd) < 0) - goto cleanup; - - if (setsid() < 0) --- -2.1.0 - diff --git a/SOURCES/libvirt-doc-fix-mismatched-ACL-attribute-name.patch b/SOURCES/libvirt-doc-fix-mismatched-ACL-attribute-name.patch deleted file mode 100644 index 793b4c1..0000000 --- a/SOURCES/libvirt-doc-fix-mismatched-ACL-attribute-name.patch +++ /dev/null @@ -1,34 +0,0 @@ -From e2c22f81649827150a3d2238a742bf0da6dc28fd Mon Sep 17 00:00:00 2001 -Message-Id: -From: Luyao Huang -Date: Mon, 24 Nov 2014 13:46:34 +0100 -Subject: [PATCH] doc: fix mismatched ACL attribute name - -As documented in https://bugzilla.redhat.com/show_bug.cgi?id=1161358, -the ACL attribute should be named: interface_macaddr - -Signed-off-by: Luyao Huang -Signed-off-by: Eric Blake -(cherry picked from commit d53d52d4c0299f5161bdeeccc925169d68ac990f) -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - docs/aclpolkit.html.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/docs/aclpolkit.html.in b/docs/aclpolkit.html.in -index 91b5296..e5a9b16 100644 ---- a/docs/aclpolkit.html.in -+++ b/docs/aclpolkit.html.in -@@ -121,7 +121,7 @@ - Name of the network interface, unique to the local host - - -- interface_mac -+ interface_macaddr - MAC address of the network interface, not unique - - --- -2.1.3 - diff --git a/SOURCES/libvirt-docs-Add-Fibre-Channel-NPIV-supported-option-for-volume-lun-config.patch b/SOURCES/libvirt-docs-Add-Fibre-Channel-NPIV-supported-option-for-volume-lun-config.patch new file mode 100644 index 0000000..f02c3ea --- /dev/null +++ b/SOURCES/libvirt-docs-Add-Fibre-Channel-NPIV-supported-option-for-volume-lun-config.patch @@ -0,0 +1,40 @@ +From a45c385857dc2d5a19f9d1509e1d473466d68a60 Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Tue, 4 Aug 2015 08:05:51 -0400 +Subject: [PATCH] docs: Add Fibre Channel NPIV supported option for volume lun + config + +https://bugzilla.redhat.com/show_bug.cgi?id=1238545 + +"Further" clarification (and testing) shows that using a SCSI Fibre +Channel NPIV device/lun from a storage pool as a will work. So just add that to the allowable options + +Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1230179 + +(cherry picked from commit 4ae72f131b7eb7e860d4400378f47d5383f13705) +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index ea2fff8..8785200 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -1973,7 +1973,9 @@ + valid when the type is "block" or "network" for + protocol='iscsi' or when the type + is "volume" when using an iSCSI source pool +- for mode "host". ++ for mode "host" or as an ++ NPIV ++ virtual Host Bus Adapter (vHBA) using a Fibre Channel storage pool. + Configured in this manner, the LUN behaves identically to "disk", + except that generic SCSI commands from the guest are accepted + and passed through to the physical device. Also note that +-- +2.5.0 + diff --git a/SOURCES/libvirt-docs-Clarify-unprivileged-sgio-feature.patch b/SOURCES/libvirt-docs-Clarify-unprivileged-sgio-feature.patch new file mode 100644 index 0000000..a143358 --- /dev/null +++ b/SOURCES/libvirt-docs-Clarify-unprivileged-sgio-feature.patch @@ -0,0 +1,58 @@ +From 63bdd9e26d72427008c4a63ea371d0da0329947f Mon Sep 17 00:00:00 2001 +Message-Id: <63bdd9e26d72427008c4a63ea371d0da0329947f@dist-git> +From: John Ferlan +Date: Thu, 9 Jul 2015 08:28:50 -0400 +Subject: [PATCH] docs: Clarify unprivileged sgio feature + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +Update the descriptions for disk and hostdev sgio in order to indicate +not all hypervisors and OS's support this feature + +Signed-off-by: John Ferlan +(cherry picked from commit 4f4ac3913a379ad7d3880c57cfe7304c4a22cc22) +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index e2ccfa5..cb11b1f 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -2004,10 +2004,10 @@ +
sgio attribute + since 1.0.2
+
+- Indicates whether the kernel will filter unprivileged +- SG_IO commands for the disk, valid settings are "filtered" or +- "unfiltered". Defaults to "filtered". Similar to rawio, +- sgio is only valid for device 'lun'. ++ If supported by the hypervisor and OS, indicates whether ++ unprivileged SG_IO commands are filtered for the disk. Valid ++ settings are "filtered" or "unfiltered" where the default is ++ "filtered". Only available when the device is 'lun'. +
+
snapshot attribute + since 0.9.5
+@@ -3239,11 +3239,12 @@ + +
scsi
+
For SCSI devices, user is responsible to make sure the device +- is not used by host. The optional sgio +- (since 1.0.6) attribute indicates +- whether the kernel will filter unprivileged SG_IO commands for +- the disk, valid settings are "filtered" or "unfiltered". +- The default is "filtered". The optional rawio ++ is not used by host. If supported by the hypervisor and OS, the ++ optional sgio (since 1.0.6) ++ attribute indicates whether unprivileged SG_IO commands are ++ filtered for the disk. Valid settings are "filtered" or ++ "unfiltered", where the default is "filtered". ++ The optional rawio + (since 1.2.9) attribute indicates + whether the lun needs the rawio capability. Valid settings are + "yes" or "no". See the rawio description within the +-- +2.5.1 + diff --git a/SOURCES/libvirt-docs-Document-NVRAM-behavior-on-transient-domains.patch b/SOURCES/libvirt-docs-Document-NVRAM-behavior-on-transient-domains.patch deleted file mode 100644 index 3567551..0000000 --- a/SOURCES/libvirt-docs-Document-NVRAM-behavior-on-transient-domains.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 22e3737a8ba5750ecbd5d96f2679b11ef6f125af Mon Sep 17 00:00:00 2001 -Message-Id: <22e3737a8ba5750ecbd5d96f2679b11ef6f125af@dist-git> -From: Michal Privoznik -Date: Wed, 19 Nov 2014 09:37:02 +0100 -Subject: [PATCH] docs: Document NVRAM behavior on transient domains - -https://bugzilla.redhat.com/show_bug.cgi?id=1026772 - -Since 1.2.8 it's possible to use OVMF on domains. Moreover, it's -possible to have libvirt create NVRAM file per domain. Later, -when domain is undefined, the file is removed too. However, -things are a bit complicated when domain's transient. There's no -undefine to transient domains. There are two options: 1) leave -the file behind and let mgmt app remove it. 2) remove it -automatically as domain dies. -But, in some scenarios mgmt app may want to preserve the file, -copy it somewhere safe, and then copy it back when the domain is -starting again. And this wouldn't be possible with case 2). So, -even though case 1) leaves some files behind (possibly undeleted -for a long time), the files themselves are small (128K each). And -data loss is worse than full disk, isn't it? - -Signed-off-by: Michal Privoznik -(cherry picked from commit 401702d92eb28faffbb7a8b63baca67ef7d9a5b5) -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 80af7fa..138b5e1 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -147,7 +147,10 @@ - started up libvirt copies so called master NVRAM store file defined - in qemu.conf. If needed, the template - attribute can be used to per domain override map of master NVRAM stores -- from the config file. Since 1.2.8
-+ from the config file. Note, that for transient domains if the NVRAM file -+ has been created by libvirt it is left behind and it is management -+ application's responsibility to save and remove file (if needed to be -+ persistent). Since 1.2.8 -
boot
-
The dev attribute takes one of the values "fd", "hd", - "cdrom" or "network" and is used to specify the next boot device --- -2.1.3 - diff --git a/SOURCES/libvirt-docs-Document-how-libvirt-handles-companion-controllers.patch b/SOURCES/libvirt-docs-Document-how-libvirt-handles-companion-controllers.patch new file mode 100644 index 0000000..d2c1e2a --- /dev/null +++ b/SOURCES/libvirt-docs-Document-how-libvirt-handles-companion-controllers.patch @@ -0,0 +1,41 @@ +From 476ed77dafaf2b43298ddd936320cd5d3739e0a1 Mon Sep 17 00:00:00 2001 +Message-Id: <476ed77dafaf2b43298ddd936320cd5d3739e0a1@dist-git> +From: Martin Kletzander +Date: Thu, 6 Aug 2015 13:10:43 +0200 +Subject: [PATCH] docs: Document how libvirt handles companion controllers + +The information on companion controllers we give in our documentation is +rather sparse. For example, it looks like any controller can be used as +a companion one. Also, when using ich9-uhci2, for example, we are able +to set some sensible defaults, but it might get confusing for the user +as we don't do that for all controller models. + +https://bugzilla.redhat.com/show_bug.cgi?id=1069590 + +Signed-off-by: Martin Kletzander +(cherry picked from commit b84a2cd87dad4a10e3a0064c30ac3df037048101) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index 8785200..e2ccfa5 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -3007,6 +3007,11 @@ + relationship of the companion to its master controller. + A companion controller is on the same bus as its master, so + the companion index value should be equal. ++ Not all controller models can be used as companion controllers ++ and libvirt might provide some sensible defaults (settings ++ of master startport and function of an ++ address) for some particular models. ++ Preferred companion controllers are ich-uhci[123]. +

+ +
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-docs-conf-schema-add-support-for-shared-memory-mapping.patch b/SOURCES/libvirt-docs-conf-schema-add-support-for-shared-memory-mapping.patch
deleted file mode 100644
index 74f873c..0000000
--- a/SOURCES/libvirt-docs-conf-schema-add-support-for-shared-memory-mapping.patch
+++ /dev/null
@@ -1,283 +0,0 @@
-From 37b4578539091288a7e7851799ebf4289272706e Mon Sep 17 00:00:00 2001
-Message-Id: <37b4578539091288a7e7851799ebf4289272706e@dist-git>
-From: Martin Kletzander 
-Date: Wed, 17 Sep 2014 16:17:56 +0200
-Subject: [PATCH] docs, conf, schema: add support for shared memory mapping
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1133144
-
-Signed-off-by: Martin Kletzander 
-(cherry picked from commit def6b35989362cc7ce8474256e19d877ff07a711)
-Signed-off-by: Jiri Denemark 
----
- docs/formatdomain.html.in                          |  7 +++-
- docs/schemas/domaincommon.rng                      |  8 ++++
- src/conf/cpu_conf.c                                | 30 ++++++++++++++-
- src/conf/cpu_conf.h                                | 17 ++++++--
- .../qemuxml2argv-cpu-numa-memshared.xml            | 28 ++++++++++++++
- .../qemuxml2argv-hugepages-shared.xml              | 45 ++++++++++++++++++++++
- tests/qemuxml2xmltest.c                            |  2 +
- 7 files changed, 131 insertions(+), 6 deletions(-)
- create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.xml
- create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.xml
-
-diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
-index a2ea758..ade40f3 100644
---- a/docs/formatdomain.html.in
-+++ b/docs/formatdomain.html.in
-@@ -1123,7 +1123,7 @@
-     ...
-     <numa>
-       <cell id='0' cpus='0-3' memory='512000'/>
--      <cell id='1' cpus='4-7' memory='512000'/>
-+      <cell id='1' cpus='4-7' memory='512000' memAccess='shared'/>
-     </numa>
-     ...
-   </cpu>
-@@ -1140,6 +1140,11 @@
-       assigned ids in the increasing order starting from
-       0.  Mixing cells with and without the id attribute
-       is not recommended as it may result in unwanted behaviour.
-+
-+      Since 1.2.9 the optional attribute
-+      memAccess can control whether the memory is to be
-+      mapped as "shared" or "private".  This is valid only for
-+      hugepages-backed memory.
-     

- -

-diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 6ae940a..75006f5 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -4092,6 +4092,14 @@ - - - -+ -+ -+ -+ shared -+ private -+ -+ -+ - - - -diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c -index 5003cf1..e190641 100644 ---- a/src/conf/cpu_conf.c -+++ b/src/conf/cpu_conf.c -@@ -56,6 +56,11 @@ VIR_ENUM_IMPL(virCPUFeaturePolicy, VIR_CPU_FEATURE_LAST, - "disable", - "forbid") - -+VIR_ENUM_IMPL(virMemAccess, VIR_MEM_ACCESS_LAST, -+ "default", -+ "shared", -+ "private") -+ - - void ATTRIBUTE_NONNULL(1) - virCPUDefFreeModel(virCPUDefPtr def) -@@ -435,7 +440,7 @@ virCPUDefParseXML(xmlNodePtr node, - def->ncells = n; - - for (i = 0; i < n; i++) { -- char *cpus, *memory; -+ char *cpus, *memory, *memAccessStr; - int ret, ncpus = 0; - unsigned int cur_cell; - char *tmp = NULL; -@@ -491,7 +496,7 @@ virCPUDefParseXML(xmlNodePtr node, - goto error; - } - -- ret = virStrToLong_ui(memory, NULL, 10, &def->cells[cur_cell].mem); -+ ret = virStrToLong_ui(memory, NULL, 10, &def->cells[cur_cell].mem); - if (ret == -1) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("Invalid 'memory' attribute in NUMA cell")); -@@ -499,6 +504,22 @@ virCPUDefParseXML(xmlNodePtr node, - goto error; - } - VIR_FREE(memory); -+ -+ memAccessStr = virXMLPropString(nodes[i], "memAccess"); -+ if (memAccessStr) { -+ def->cells[cur_cell].memAccess = -+ virMemAccessTypeFromString(memAccessStr); -+ -+ if (def->cells[cur_cell].memAccess <= 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Invalid 'memAccess' attribute " -+ "value '%s'"), -+ memAccessStr); -+ VIR_FREE(memAccessStr); -+ goto cleanup; -+ } -+ VIR_FREE(memAccessStr); -+ } - } - } - -@@ -674,10 +695,15 @@ virCPUDefFormatBuf(virBufferPtr buf, - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); - for (i = 0; i < def->ncells; i++) { -+ virMemAccess memAccess = def->cells[i].memAccess; -+ - virBufferAddLit(buf, "cells[i].cpustr); - virBufferAsprintf(buf, " memory='%d'", def->cells[i].mem); -+ if (memAccess) -+ virBufferAsprintf(buf, " memAccess='%s'", -+ virMemAccessTypeToString(memAccess)); - virBufferAddLit(buf, "/>\n"); - } - virBufferAdjustIndent(buf, -2); -diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h -index 2d538db..d45210b 100644 ---- a/src/conf/cpu_conf.h -+++ b/src/conf/cpu_conf.h -@@ -83,6 +83,16 @@ typedef enum { - - VIR_ENUM_DECL(virCPUFeaturePolicy) - -+typedef enum { -+ VIR_MEM_ACCESS_DEFAULT, -+ VIR_MEM_ACCESS_SHARED, -+ VIR_MEM_ACCESS_PRIVATE, -+ -+ VIR_MEM_ACCESS_LAST, -+} virMemAccess; -+ -+VIR_ENUM_DECL(virMemAccess) -+ - typedef struct _virCPUFeatureDef virCPUFeatureDef; - typedef virCPUFeatureDef *virCPUFeatureDefPtr; - struct _virCPUFeatureDef { -@@ -93,9 +103,10 @@ struct _virCPUFeatureDef { - typedef struct _virCellDef virCellDef; - typedef virCellDef *virCellDefPtr; - struct _virCellDef { -- virBitmapPtr cpumask; /* CPUs that are part of this node */ -- char *cpustr; /* CPUs stored in string form for dumpxml */ -- unsigned int mem; /* Node memory in kB */ -+ virBitmapPtr cpumask; /* CPUs that are part of this node */ -+ char *cpustr; /* CPUs stored in string form for dumpxml */ -+ unsigned int mem; /* Node memory in kB */ -+ virMemAccess memAccess; - }; - - typedef struct _virCPUDef virCPUDef; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.xml -new file mode 100644 -index 0000000..cf7c040 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.xml -@@ -0,0 +1,28 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 16 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.xml b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.xml -new file mode 100644 -index 0000000..e7db69c ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.xml -@@ -0,0 +1,45 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 4194304 -+ 4194304 -+ -+ -+ -+ -+ -+ -+ 4 -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+

-+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 1835fe6..180665b 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -205,6 +205,7 @@ mymain(void) - DO_TEST("hugepages-pages"); - DO_TEST("hugepages-pages2"); - DO_TEST("hugepages-pages3"); -+ DO_TEST("hugepages-shared"); - DO_TEST("nosharepages"); - DO_TEST("disk-aio"); - DO_TEST("disk-cdrom"); -@@ -390,6 +391,7 @@ mymain(void) - DO_TEST_DIFFERENT("cpu-numa1"); - DO_TEST_DIFFERENT("cpu-numa2"); - DO_TEST("cpu-numa-disjoint"); -+ DO_TEST("cpu-numa-memshared"); - - DO_TEST_DIFFERENT("numatune-auto-prefer"); - DO_TEST_DIFFERENT("numatune-memnode"); --- -2.1.0 - diff --git a/SOURCES/libvirt-docs-conf-schema-add-support-for-shmem-device.patch b/SOURCES/libvirt-docs-conf-schema-add-support-for-shmem-device.patch deleted file mode 100644 index 805f3da..0000000 --- a/SOURCES/libvirt-docs-conf-schema-add-support-for-shmem-device.patch +++ /dev/null @@ -1,651 +0,0 @@ -From c9aea427cc39190d178c584548b71e099a66df71 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Martin Kletzander -Date: Fri, 3 Oct 2014 22:54:55 +0200 -Subject: [PATCH] docs, conf, schema: add support for shmem device - -https://bugzilla.redhat.com/show_bug.cgi?id=1126991 - -This patch adds parsing/formatting code as well as documentation for -shared memory devices. This will currently be only accessible in QEMU -using it's ivshmem device, but is designed as generic as possible to -allow future expansion for other hypervisors. - -In the devices section in the domain XML users may specify: - -- For shmem device using a server: - - - - 32 - - - -- For ivshmem device not using an ivshmem server: - - - 32 - - -Most of the configuration is made optional so it also allows -specifications like: - - - - - -Signed-off-by: Maxime Leroy -Signed-off-by: Martin Kletzander -(cherry picked from commit 540a84ec89c1634d5e17ba7b8d96049c960bb1b4) -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 52 ++++++ - docs/schemas/domaincommon.rng | 39 +++++ - src/conf/domain_conf.c | 184 ++++++++++++++++++++- - src/conf/domain_conf.h | 24 +++ - src/qemu/qemu_hotplug.c | 1 + - .../qemuxml2argv-shmem-msi-only.xml | 24 +++ - tests/qemuxml2argvdata/qemuxml2argv-shmem.xml | 51 ++++++ - tests/qemuxml2argvtest.c | 2 + - tests/qemuxml2xmltest.c | 1 + - 9 files changed, 377 insertions(+), 1 deletion(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-shmem-msi-only.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-shmem.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index ee00eca..dac81ab 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -5582,6 +5582,58 @@ qemu-kvm -net nic,model=? /dev/null -
- - -+

Shared memory device

-+ -+

-+ A shared memory device allows to share a memory region between -+ different virtual machines and the host. -+ Since 1.2.9, QEMU and KVM only -+

-+ -+
-+  ...
-+  <devices>
-+    <shmem name='my_shmem0'>
-+      <size unit='M'>4</size>
-+    </shmem>
-+    <shmem name='shmem_server'>
-+      <size unit='M'>2</size>
-+      <server path='/tmp/socket-shmem'/>
-+      <msi vectors='32' ioeventfd='on'/>
-+    </shmem>
-+  </devices>
-+  ...
-+
-+ -+
-+
shmem
-+
-+ The shmem element has one mandatory attribute, -+ name to identify the shared memory. -+
-+
size
-+
-+ The optional size element specifies the size of the shared -+ memory. This must be power of 2 and greater than or equal to 1 MiB. -+
-+
server
-+
-+ The optional server element can be used to configure a server -+ socket the device is supposed to connect to. The optional -+ path attribute specifies the path to the unix socket and -+ defaults to /var/lib/libvirt/shmem/$shmem-$name-sock. -+
-+
msi
-+
-+ The optional msi element enables/disables (values "on"/"off", -+ respectively) MSI interrupts. This option can currently be used only -+ together with the server element. The vectors -+ attribute can be used to specify the number of interrupt -+ vectors. The ioeventd attribute enables/disables (values -+ "on"/"off", respectively) ioeventfd. -+
-+
-+ -

Security label

- -

-diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index e561486..8d96daa 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -3274,6 +3274,44 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -@@ -3860,6 +3898,7 @@ - - - -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 40626b8..2768660 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -252,7 +252,8 @@ VIR_ENUM_IMPL(virDomainDevice, VIR_DOMAIN_DEVICE_LAST, - "chr", - "memballoon", - "nvram", -- "rng") -+ "rng", -+ "shmem") - - VIR_ENUM_IMPL(virDomainDeviceAddress, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST, - "none", -@@ -1717,6 +1718,17 @@ void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def) - VIR_FREE(def); - } - -+void virDomainShmemDefFree(virDomainShmemDefPtr def) -+{ -+ if (!def) -+ return; -+ -+ virDomainDeviceInfoClear(&def->info); -+ VIR_FREE(def->server.path); -+ VIR_FREE(def->name); -+ VIR_FREE(def); -+} -+ - void virDomainVideoDefFree(virDomainVideoDefPtr def) - { - if (!def) -@@ -1918,6 +1930,9 @@ void virDomainDeviceDefFree(virDomainDeviceDefPtr def) - case VIR_DOMAIN_DEVICE_NVRAM: - virDomainNVRAMDefFree(def->data.nvram); - break; -+ case VIR_DOMAIN_DEVICE_SHMEM: -+ virDomainShmemDefFree(def->data.shmem); -+ break; - case VIR_DOMAIN_DEVICE_LAST: - case VIR_DOMAIN_DEVICE_NONE: - break; -@@ -2178,6 +2193,10 @@ void virDomainDefFree(virDomainDefPtr def) - - virDomainRedirFilterDefFree(def->redirfilter); - -+ for (i = 0; i < def->nshmems; i++) -+ virDomainShmemDefFree(def->shmems[i]); -+ VIR_FREE(def->shmems); -+ - if (def->namespaceData && def->ns.free) - (def->ns.free)(def->namespaceData); - -@@ -2610,6 +2629,8 @@ virDomainDeviceGetInfo(virDomainDeviceDefPtr device) - return &device->data.memballoon->info; - case VIR_DOMAIN_DEVICE_NVRAM: - return &device->data.nvram->info; -+ case VIR_DOMAIN_DEVICE_SHMEM: -+ return &device->data.shmem->info; - case VIR_DOMAIN_DEVICE_RNG: - return &device->data.rng->info; - -@@ -2825,6 +2846,12 @@ virDomainDeviceInfoIterateInternal(virDomainDefPtr def, - if (cb(def, &device, &def->hubs[i]->info, opaque) < 0) - return -1; - } -+ device.type = VIR_DOMAIN_DEVICE_SHMEM; -+ for (i = 0; i < def->nshmems; i++) { -+ device.data.shmem = def->shmems[i]; -+ if (cb(def, &device, &def->shmems[i]->info, opaque) < 0) -+ return -1; -+ } - - /* Coverity is not very happy with this - all dead_error_condition */ - #if !STATIC_ANALYSIS -@@ -2853,6 +2880,7 @@ virDomainDeviceInfoIterateInternal(virDomainDefPtr def, - case VIR_DOMAIN_DEVICE_CHR: - case VIR_DOMAIN_DEVICE_MEMBALLOON: - case VIR_DOMAIN_DEVICE_NVRAM: -+ case VIR_DOMAIN_DEVICE_SHMEM: - case VIR_DOMAIN_DEVICE_LAST: - case VIR_DOMAIN_DEVICE_RNG: - break; -@@ -9687,6 +9715,84 @@ virDomainNVRAMDefParseXML(xmlNodePtr node, - return NULL; - } - -+static virDomainShmemDefPtr -+virDomainShmemDefParseXML(xmlNodePtr node, -+ xmlXPathContextPtr ctxt, -+ unsigned int flags) -+{ -+ char *tmp = NULL; -+ virDomainShmemDefPtr def = NULL; -+ virDomainShmemDefPtr ret = NULL; -+ xmlNodePtr msi = NULL; -+ xmlNodePtr save = ctxt->node; -+ xmlNodePtr server = NULL; -+ -+ -+ if (VIR_ALLOC(def) < 0) -+ return NULL; -+ -+ ctxt->node = node; -+ -+ if (!(def->name = virXMLPropString(node, "name"))) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("shmem element must contain 'name' attribute")); -+ goto cleanup; -+ } -+ -+ if (virDomainParseScaledValue("./size[1]", ctxt, &def->size, -+ 1, ULLONG_MAX, false) < 0) -+ goto cleanup; -+ -+ if ((server = virXPathNode("./server", ctxt))) { -+ def->server.enabled = true; -+ -+ if ((tmp = virXMLPropString(server, "path"))) -+ def->server.path = virFileSanitizePath(tmp); -+ VIR_FREE(tmp); -+ } -+ -+ if ((msi = virXPathNode("./msi", ctxt))) { -+ def->msi.enabled = true; -+ -+ if ((tmp = virXMLPropString(msi, "vectors")) && -+ virStrToLong_uip(tmp, NULL, 0, &def->msi.vectors) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("invalid number of vectors for shmem: '%s'"), -+ tmp); -+ goto cleanup; -+ } -+ VIR_FREE(tmp); -+ -+ if ((tmp = virXMLPropString(msi, "ioeventfd")) && -+ (def->msi.ioeventfd = virTristateSwitchTypeFromString(tmp)) <= 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("invalid msi ioeventfd setting for shmem: '%s'"), -+ tmp); -+ goto cleanup; -+ } -+ VIR_FREE(tmp); -+ } -+ -+ /* msi option is only relevant with a server */ -+ if (def->msi.enabled && !def->server.enabled) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("msi option is only supported with a server")); -+ goto cleanup; -+ } -+ -+ if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0) -+ goto cleanup; -+ -+ -+ ret = def; -+ def = NULL; -+ cleanup: -+ ctxt->node = save; -+ VIR_FREE(tmp); -+ virDomainShmemDefFree(def); -+ return ret; -+} -+ - static virSysinfoDefPtr - virSysinfoParseXML(xmlNodePtr node, - xmlXPathContextPtr ctxt, -@@ -10543,6 +10649,10 @@ virDomainDeviceDefParse(const char *xmlStr, - if (!(dev->data.nvram = virDomainNVRAMDefParseXML(node, flags))) - goto error; - break; -+ case VIR_DOMAIN_DEVICE_SHMEM: -+ if (!(dev->data.shmem = virDomainShmemDefParseXML(node, ctxt, flags))) -+ goto error; -+ break; - case VIR_DOMAIN_DEVICE_NONE: - case VIR_DOMAIN_DEVICE_LAST: - break; -@@ -13630,6 +13740,25 @@ virDomainDefParseXML(xmlDocPtr xml, - VIR_FREE(nodes); - } - -+ /* analysis of the shmem devices */ -+ if ((n = virXPathNodeSet("./devices/shmem", ctxt, &nodes)) < 0) { -+ goto error; -+ } -+ if (n && VIR_ALLOC_N(def->shmems, n) < 0) -+ goto error; -+ -+ node = ctxt->node; -+ for (i = 0; i < n; i++) { -+ virDomainShmemDefPtr shmem; -+ ctxt->node = nodes[i]; -+ shmem = virDomainShmemDefParseXML(nodes[i], ctxt, flags); -+ if (!shmem) -+ goto error; -+ -+ def->shmems[def->nshmems++] = shmem; -+ } -+ ctxt->node = node; -+ VIR_FREE(nodes); - - /* analysis of the user namespace mapping */ - if ((n = virXPathNodeSet("./idmap/uid", ctxt, &nodes)) < 0) -@@ -17419,6 +17548,54 @@ static int virDomainPanicDefFormat(virBufferPtr buf, - } - - static int -+virDomainShmemDefFormat(virBufferPtr buf, -+ virDomainShmemDefPtr def, -+ unsigned int flags) -+{ -+ virBufferAsprintf(buf, "name); -+ -+ if (!def->size && -+ !def->server.enabled && -+ !def->msi.enabled && -+ !virDomainDeviceInfoIsSet(&def->info, flags)) { -+ virBufferAddLit(buf, "/>\n"); -+ return 0; -+ } else { -+ virBufferAddLit(buf, ">\n"); -+ } -+ -+ virBufferAdjustIndent(buf, 2); -+ -+ if (def->size) -+ virBufferAsprintf(buf, "%llu\n", -+ VIR_DIV_UP(def->size, 1024 * 1024)); -+ -+ if (def->server.enabled) { -+ virBufferAddLit(buf, "server.path); -+ virBufferAddLit(buf, "/>\n"); -+ } -+ -+ if (def->msi.enabled) { -+ virBufferAddLit(buf, "msi.vectors) -+ virBufferAsprintf(buf, " vectors='%u'", def->msi.vectors); -+ if (def->msi.ioeventfd) -+ virBufferAsprintf(buf, " ioeventfd='%s'", -+ virTristateSwitchTypeToString(def->msi.ioeventfd)); -+ virBufferAddLit(buf, "/>\n"); -+ } -+ -+ if (virDomainDeviceInfoFormat(buf, &def->info, flags) < 0) -+ return -1; -+ -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ -+ return 0; -+} -+ -+static int - virDomainRNGDefFormat(virBufferPtr buf, - virDomainRNGDefPtr def, - unsigned int flags) -@@ -19038,6 +19215,10 @@ virDomainDefFormatInternal(virDomainDefPtr def, - virDomainPanicDefFormat(buf, def->panic) < 0) - goto error; - -+ for (n = 0; n < def->nshmems; n++) -+ if (virDomainShmemDefFormat(buf, def->shmems[n], flags) < 0) -+ goto error; -+ - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); - -@@ -20403,6 +20584,7 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src, - case VIR_DOMAIN_DEVICE_SMARTCARD: - case VIR_DOMAIN_DEVICE_MEMBALLOON: - case VIR_DOMAIN_DEVICE_NVRAM: -+ case VIR_DOMAIN_DEVICE_SHMEM: - case VIR_DOMAIN_DEVICE_LAST: - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Copying definition of '%d' type " -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index b981020..9da6d2d 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -136,6 +136,9 @@ typedef virDomainPanicDef *virDomainPanicDefPtr; - typedef struct _virDomainChrSourceDef virDomainChrSourceDef; - typedef virDomainChrSourceDef *virDomainChrSourceDefPtr; - -+typedef struct _virDomainShmemDef virDomainShmemDef; -+typedef virDomainShmemDef *virDomainShmemDefPtr; -+ - /* Flags for the 'type' field in virDomainDeviceDef */ - typedef enum { - VIR_DOMAIN_DEVICE_NONE = 0, -@@ -157,6 +160,7 @@ typedef enum { - VIR_DOMAIN_DEVICE_MEMBALLOON, - VIR_DOMAIN_DEVICE_NVRAM, - VIR_DOMAIN_DEVICE_RNG, -+ VIR_DOMAIN_DEVICE_SHMEM, - - VIR_DOMAIN_DEVICE_LAST - } virDomainDeviceType; -@@ -184,6 +188,7 @@ struct _virDomainDeviceDef { - virDomainMemballoonDefPtr memballoon; - virDomainNVRAMDefPtr nvram; - virDomainRNGDefPtr rng; -+ virDomainShmemDefPtr shmem; - } data; - }; - -@@ -1507,6 +1512,21 @@ struct _virDomainNVRAMDef { - virDomainDeviceInfo info; - }; - -+struct _virDomainShmemDef { -+ char *name; -+ unsigned long long size; -+ struct { -+ bool enabled; -+ char *path; -+ } server; -+ struct { -+ bool enabled; -+ unsigned vectors; -+ virTristateSwitch ioeventfd; -+ } msi; -+ virDomainDeviceInfo info; -+}; -+ - typedef enum { - VIR_DOMAIN_SMBIOS_NONE = 0, - VIR_DOMAIN_SMBIOS_EMULATE, -@@ -2063,6 +2083,9 @@ struct _virDomainDef { - size_t nrngs; - virDomainRNGDefPtr *rngs; - -+ size_t nshmems; -+ virDomainShmemDefPtr *shmems; -+ - /* Only 1 */ - virDomainWatchdogDefPtr watchdog; - virDomainMemballoonDefPtr memballoon; -@@ -2260,6 +2283,7 @@ void virDomainHostdevDefFree(virDomainHostdevDefPtr def); - void virDomainHubDefFree(virDomainHubDefPtr def); - void virDomainRedirdevDefFree(virDomainRedirdevDefPtr def); - void virDomainRedirFilterDefFree(virDomainRedirFilterDefPtr def); -+void virDomainShmemDefFree(virDomainShmemDefPtr def); - void virDomainDeviceDefFree(virDomainDeviceDefPtr def); - virDomainDeviceDefPtr virDomainDeviceDefCopy(virDomainDeviceDefPtr src, - const virDomainDef *def, -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 33e2dff..8eb2419 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -2858,6 +2858,7 @@ qemuDomainRemoveDevice(virQEMUDriverPtr driver, - case VIR_DOMAIN_DEVICE_MEMBALLOON: - case VIR_DOMAIN_DEVICE_NVRAM: - case VIR_DOMAIN_DEVICE_RNG: -+ case VIR_DOMAIN_DEVICE_SHMEM: - case VIR_DOMAIN_DEVICE_LAST: - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("don't know how to remove a %s device"), -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-shmem-msi-only.xml b/tests/qemuxml2argvdata/qemuxml2argv-shmem-msi-only.xml -new file mode 100644 -index 0000000..d70279c ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-shmem-msi-only.xml -@@ -0,0 +1,24 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-shmem.xml b/tests/qemuxml2argvdata/qemuxml2argv-shmem.xml -new file mode 100644 -index 0000000..fd79c89 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-shmem.xml -@@ -0,0 +1,51 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+ -+ 128 -+ -+ -+ 256 -+ -+ -+ 512 -+ -+ -+ -+ 1024 -+ -+ -+ -+ 2048 -+ -+ -+ -+ -+ 4096 -+ -+ -+ -+ -+ 8192 -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 410540f..ae8bbfc 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1463,6 +1463,8 @@ mymain(void) - - DO_TEST("fips-enabled", QEMU_CAPS_ENABLE_FIPS); - -+ DO_TEST_PARSE_ERROR("shmem-msi-only", NONE); -+ - virObjectUnref(driver.config); - virObjectUnref(driver.caps); - virObjectUnref(driver.xmlopt); -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 6e71cb2..f29e4ed 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -403,6 +403,7 @@ mymain(void) - DO_TEST("bios-nvram"); - - DO_TEST("tap-vhost"); -+ DO_TEST("shmem"); - - virObjectUnref(driver.caps); - virObjectUnref(driver.xmlopt); --- -2.1.2 - diff --git a/SOURCES/libvirt-docs-domain-Move-docs-for-storage-hosts-under-the-source-element.patch b/SOURCES/libvirt-docs-domain-Move-docs-for-storage-hosts-under-the-source-element.patch deleted file mode 100644 index 50b3ab6..0000000 --- a/SOURCES/libvirt-docs-domain-Move-docs-for-storage-hosts-under-the-source-element.patch +++ /dev/null @@ -1,150 +0,0 @@ -From 8eb0db45ab482868736bff1be85bd604d0d97fc5 Mon Sep 17 00:00:00 2001 -Message-Id: <8eb0db45ab482868736bff1be85bd604d0d97fc5@dist-git> -From: Peter Krempa -Date: Fri, 21 Nov 2014 15:04:03 +0100 -Subject: [PATCH] docs: domain: Move docs for storage hosts under the - element - -https://bugzilla.redhat.com/show_bug.cgi?id=1164528 - -The docs describing the element that are under the -element in the XML document were incorrectly placed under the -element. Move them to the correct place. - -(cherry picked from commit 33b282eadc9a9bd69f2f0d12360d3be0a772eafe) - -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 109 +++++++++++++++++++++++++--------------------- - 1 file changed, 59 insertions(+), 50 deletions(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 138b5e1..a458067 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -1938,6 +1938,65 @@ - may have zero or more host sub-elements used to - specify the hosts to connect. -

-+ -+
-+
host
-+
-+

-+ The host element supports 4 attributes, viz. "name", -+ "port", "transport" and "socket", which specify the hostname, -+ the port number, transport type and path to socket, respectively. -+ The meaning of this element and the number of the elements depend -+ on the protocol attribute. -+

-+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+
Protocol Meaning Number of hosts Default port
nbd a server running nbd-server only one 10809
iscsi an iSCSI server only one 3260
rbd monitor servers of RBD one or more 6789
sheepdog one of the sheepdog servers (default is localhost:7000) zero or one 7000
gluster a server running glusterd daemon only one 24007
-+

-+ gluster supports "tcp", "rdma", "unix" as valid values for the -+ transport attribute. nbd supports "tcp" and "unix". Others only -+ support "tcp". If nothing is specified, "tcp" is assumed. If the -+ transport is "unix", the socket attribute specifies the path to an -+ AF_UNIX socket. -+

-+
-+
-+ -

- For a "file" or "volume" disk type which represents a cdrom or floppy - (the device attribute), it is possible to define -@@ -2268,56 +2327,6 @@ - characters. - Since 1.0.1 - --

host
--
The host element supports 4 attributes, viz. "name", -- "port", "transport" and "socket", which specify the hostname, the port -- number, transport type and path to socket, respectively. The meaning -- of this element and the number of the elements depend on the protocol -- attribute. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Protocol Meaning Number of hosts Default port
nbd a server running nbd-server only one 10809
iscsi an iSCSI server only one 3260
rbd monitor servers of RBD one or more 6789
sheepdog one of the sheepdog servers (default is localhost:7000) zero or one 7000
gluster a server running glusterd daemon only one 24007
-- gluster supports "tcp", "rdma", "unix" as valid values for the -- transport attribute. nbd supports "tcp" and "unix". Others only -- support "tcp". If nothing is specified, "tcp" is assumed. If the -- transport is "unix", the socket attribute specifies the path to an -- AF_UNIX socket. --
-
address
-
If present, the address element ties the disk - to a given slot of a controller (the --- -2.1.3 - diff --git a/SOURCES/libvirt-domain-Fix-crash-if-trying-to-live-update-disk-serial.patch b/SOURCES/libvirt-domain-Fix-crash-if-trying-to-live-update-disk-serial.patch new file mode 100644 index 0000000..655e23a --- /dev/null +++ b/SOURCES/libvirt-domain-Fix-crash-if-trying-to-live-update-disk-serial.patch @@ -0,0 +1,62 @@ +From af566a030c4a70ed037eda075a4c09f14732482b Mon Sep 17 00:00:00 2001 +Message-Id: +From: Cole Robinson +Date: Wed, 12 Aug 2015 10:47:16 +0200 +Subject: [PATCH] domain: Fix crash if trying to live update disk + +https://bugzilla.redhat.com/show_bug.cgi?id=1007228 + +If you pass XML to UpdateDevice, and the original device +didn't have a block, libvirtd crashes trying to read the original +NULL serial string. + +Use _NULLABLE string comparisons to avoid the crash. A couple other +properties needed the change too. + +(cherry picked from commit c7790408d7e16b1ad00a690433d9310f104994f7) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + 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 aa1b860..8784367 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -5783,28 +5783,28 @@ virDomainDiskDiffersSourceOnly(virDomainDiskDefPtr disk, + + CHECK_EQ(transient, "transient", true); + +- if (disk->serial && STRNEQ(disk->serial, orig_disk->serial)) { ++ if (disk->serial && STRNEQ_NULLABLE(disk->serial, orig_disk->serial)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("cannot modify field '%s' of the disk"), + "serial"); + return false; + } + +- if (disk->wwn && STRNEQ(disk->wwn, orig_disk->wwn)) { ++ if (disk->wwn && STRNEQ_NULLABLE(disk->wwn, orig_disk->wwn)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("cannot modify field '%s' of the disk"), + "wwn"); + return false; + } + +- if (disk->vendor && STRNEQ(disk->vendor, orig_disk->vendor)) { ++ if (disk->vendor && STRNEQ_NULLABLE(disk->vendor, orig_disk->vendor)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("cannot modify field '%s' of the disk"), + "vendor"); + return false; + } + +- if (disk->product && STRNEQ(disk->product, orig_disk->product)) { ++ if (disk->product && STRNEQ_NULLABLE(disk->product, orig_disk->product)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("cannot modify field '%s' of the disk"), + "product"); +-- +2.5.0 + diff --git a/SOURCES/libvirt-domain-Fix-migratable-XML-with-graphics-listen.patch b/SOURCES/libvirt-domain-Fix-migratable-XML-with-graphics-listen.patch new file mode 100644 index 0000000..da96777 --- /dev/null +++ b/SOURCES/libvirt-domain-Fix-migratable-XML-with-graphics-listen.patch @@ -0,0 +1,64 @@ +From 180a82fb0eb876cd8d42aedb4ecf05f0423ffe9b Mon Sep 17 00:00:00 2001 +Message-Id: <180a82fb0eb876cd8d42aedb4ecf05f0423ffe9b@dist-git> +From: Jiri Denemark +Date: Wed, 23 Sep 2015 14:48:06 +0200 +Subject: [PATCH] domain: Fix migratable XML with graphics/@listen + +As of commit 6992994, we set graphics/@listen attribute according to the +first listen child element even if that element is of type='network'. +This was done for backward compatibility with applications which only +support the original listen attribute. However, by doing so we broke +migration to older libvirt which tried to check that the listen +attribute matches one of the listen child elements but which did not +take type='network' elements into account. + +We are not concerned about compatibility with old applications when +formatting domain XML for migration for two reasons. The XML is consumed +only by libvirtd and the IP address associated with type='network' +listen address on the source host is just useless on the destination +host. Thus, we can safely avoid propagating the type='network' IP +address to graphics/@listen attribute when creating migratable XML. + +https://bugzilla.redhat.com/show_bug.cgi?id=1265111 + +Signed-off-by: Jiri Denemark +(cherry picked from commit c0806dc30bda562810b0d686e33c903862e3c8f1) +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index f5320fe..a0ecc94 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -20824,19 +20824,17 @@ virDomainGraphicsDefFormat(virBufferPtr buf, + * . This is done to improve backward compatibility. + */ + for (i = 0; i < def->nListens; i++) { +- virDomainGraphicsListenType listenType; +- + if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE && + def->listens[i].fromConfig) + continue; +- listenType = virDomainGraphicsListenGetType(def, i); + +- if (listenType == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS || +- (listenType == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK && +- !(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE))) { +- if ((listenAddr = virDomainGraphicsListenGetAddress(def, i))) +- break; +- } ++ if (def->listens[i].type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK && ++ flags & (VIR_DOMAIN_DEF_FORMAT_INACTIVE | ++ VIR_DOMAIN_DEF_FORMAT_MIGRATABLE)) ++ continue; ++ ++ if ((listenAddr = virDomainGraphicsListenGetAddress(def, i))) ++ break; + } + + virBufferAsprintf(buf, " -From: John Ferlan -Date: Thu, 18 Sep 2014 09:29:55 -0400 -Subject: [PATCH] domain_conf: Add iothreadpin to cputune - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -Add an option 'iothreadpin' to the to allow for setting the -CPU affinity for each IOThread. - -The iothreadspin will mimic the vcpupin with respect to being able to -assign each iothread to a specific CPU, although iothreads ids start -at 1 while vcpu ids start at 0. This matches the iothread naming scheme. - -(cherry picked from commit 938fb12fad6d15c9fdb73f998c4e0ec1e278721f) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 18 +++ - docs/schemas/domaincommon.rng | 10 ++ - src/conf/domain_conf.c | 124 +++++++++++++++++++-- - src/conf/domain_conf.h | 2 + - .../qemuxml2argv-cputune-iothreads.xml | 38 +++++++ - tests/qemuxml2xmltest.c | 1 + - 6 files changed, 182 insertions(+), 11 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index b947848..8c03ebb 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -526,6 +526,8 @@ - <vcpupin vcpu="2" cpuset="2,3"/> - <vcpupin vcpu="3" cpuset="0,4"/> - <emulatorpin cpuset="1-3"/> -+ <iothreadpin iothread="1" cpuset="5,6"/> -+ <iothreadpin iothread="2" cpuset="7,8"/> - <shares>2048</shares> - <period>1000000</period> - <quota>-1</quota> -@@ -567,6 +569,22 @@ - attribute placement of element vcpu is - "auto". -
-+
iothreadpin
-+
-+ The optional iothreadpin element specifies which of host -+ physical CPUs the IOThreads will be pinned to. If this is omitted -+ and attribute cpuset of element vcpu is -+ not specified, the IOThreads are pinned to all the physical CPUs -+ by default. There are two required attributes, the attribute -+ iothread specifies the IOThread id and the attribute -+ cpuset specifying which physical CPUs to pin to. The -+ iothread value begins at "1" through the number of -+ iothreads -+ allocated to the domain. A value of "0" is not permitted. -+ NB, iothreadpin is not allowed if attribute -+ placement of element vcpu is "auto". -+ Since 1.2.9 -+
-
shares
-
- The optional shares element specifies the proportional -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 31974ac..d61d3ad 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -810,6 +810,16 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 7d78b0b..c03affe 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -2169,6 +2169,9 @@ void virDomainDefFree(virDomainDefPtr def) - - virDomainVcpuPinDefFree(def->cputune.emulatorpin); - -+ virDomainVcpuPinDefArrayFree(def->cputune.iothreadspin, -+ def->cputune.niothreadspin); -+ - virDomainNumatuneFree(def->numatune); - - virSysinfoDefFree(def->sysinfo); -@@ -11415,6 +11418,9 @@ virDomainPanicDefParseXML(xmlNodePtr node) - * and emulatorpin has the form of - * - * -+ * and an iothreadspin has the form -+ * -+ * - * A vcpuid of -1 is valid and only valid for emulatorpin. So callers - * have to check the returned cpuid for validity. - */ -@@ -11422,11 +11428,13 @@ static virDomainVcpuPinDefPtr - virDomainVcpuPinDefParseXML(xmlNodePtr node, - xmlXPathContextPtr ctxt, - int maxvcpus, -- bool emulator) -+ bool emulator, -+ bool iothreads) - { - virDomainVcpuPinDefPtr def; - xmlNodePtr oldnode = ctxt->node; - int vcpuid = -1; -+ unsigned int iothreadid; - char *tmp = NULL; - int ret; - -@@ -11435,7 +11443,7 @@ virDomainVcpuPinDefParseXML(xmlNodePtr node, - - ctxt->node = node; - -- if (!emulator) { -+ if (!emulator && !iothreads) { - ret = virXPathInt("string(./@vcpu)", ctxt, &vcpuid); - if ((ret == -2) || (vcpuid < -1)) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -11456,10 +11464,41 @@ virDomainVcpuPinDefParseXML(xmlNodePtr node, - def->vcpuid = vcpuid; - } - -+ if (iothreads && (tmp = virXPathString("string(./@iothread)", ctxt))) { -+ if (virStrToLong_uip(tmp, NULL, 10, &iothreadid) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("invalid setting for iothread '%s'"), tmp); -+ goto error; -+ } -+ VIR_FREE(tmp); -+ -+ if (iothreadid == 0) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("zero is an invalid iothread id value")); -+ goto error; -+ } -+ -+ /* NB: maxvcpus is actually def->iothreads -+ * IOThreads are numbered "iothread1...iothread", where -+ * "n" is the iothreads value -+ */ -+ if (iothreadid > maxvcpus) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("iothread id must not exceed iothreads")); -+ goto error; -+ } -+ -+ /* Rather than creating our own structure we are reusing the vCPU */ -+ def->vcpuid = iothreadid; -+ } -+ - if (!(tmp = virXMLPropString(node, "cpuset"))) { - if (emulator) - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing cpuset for emulatorpin")); -+ else if (iothreads) -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("missing cpuset for iothreadpin")); - else - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing cpuset for vcpupin")); -@@ -12138,7 +12177,7 @@ virDomainDefParseXML(xmlDocPtr xml, - for (i = 0; i < n; i++) { - virDomainVcpuPinDefPtr vcpupin = NULL; - vcpupin = virDomainVcpuPinDefParseXML(nodes[i], ctxt, -- def->maxvcpus, false); -+ def->maxvcpus, false, false); - - if (!vcpupin) - goto error; -@@ -12213,8 +12252,9 @@ virDomainDefParseXML(xmlDocPtr xml, - goto error; - } - -- def->cputune.emulatorpin = virDomainVcpuPinDefParseXML(nodes[0], ctxt, -- 0, true); -+ def->cputune.emulatorpin = virDomainVcpuPinDefParseXML(nodes[0], -+ ctxt, 0, -+ true, false); - - if (!def->cputune.emulatorpin) - goto error; -@@ -12224,6 +12264,49 @@ virDomainDefParseXML(xmlDocPtr xml, - } - VIR_FREE(nodes); - -+ -+ if ((n = virXPathNodeSet("./cputune/iothreadpin", ctxt, &nodes)) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("cannot extract iothreadpin nodes")); -+ goto error; -+ } -+ -+ /* Ignore iothreadpin if placement is "auto", they -+ * conflict with each other, and placement can't be -+ * simply ignored, as 's placement defaults to it. -+ */ -+ if (n) { -+ if (def->placement_mode != VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) { -+ if (VIR_ALLOC_N(def->cputune.iothreadspin, n) < 0) -+ goto error; -+ -+ for (i = 0; i < n; i++) { -+ virDomainVcpuPinDefPtr iothreadpin = NULL; -+ iothreadpin = virDomainVcpuPinDefParseXML(nodes[i], ctxt, -+ def->iothreads, -+ false, true); -+ if (!iothreadpin) -+ goto error; -+ -+ if (virDomainVcpuPinIsDuplicate(def->cputune.iothreadspin, -+ def->cputune.niothreadspin, -+ iothreadpin->vcpuid)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("duplicate iothreadpin for same iothread")); -+ virDomainVcpuPinDefFree(iothreadpin); -+ goto error; -+ } -+ -+ def->cputune.iothreadspin[def->cputune.niothreadspin++] = -+ iothreadpin; -+ } -+ } else { -+ VIR_WARN("Ignore iothreadpin for placement is 'auto'"); -+ } -+ } -+ VIR_FREE(nodes); -+ -+ - /* analysis of cpu handling */ - if ((node = virXPathNode("./cpu[1]", ctxt)) != NULL) { - xmlNodePtr oldnode = ctxt->node; -@@ -17917,6 +18000,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, - int n; - size_t i; - bool blkio = false; -+ bool cputune = false; - - virCheckFlags(DUMPXML_FLAGS | - VIR_DOMAIN_XML_INTERNAL_STATUS | -@@ -18108,8 +18192,11 @@ virDomainDefFormatInternal(virDomainDefPtr def, - (def->cputune.nvcpupin && !virDomainIsAllVcpupinInherited(def)) || - def->cputune.period || def->cputune.quota || - def->cputune.emulatorpin || -- def->cputune.emulator_period || def->cputune.emulator_quota) -+ def->cputune.emulator_period || def->cputune.emulator_quota || -+ def->cputune.niothreadspin) { - virBufferAddLit(buf, "\n"); -+ cputune = true; -+ } - - virBufferAdjustIndent(buf, 2); - if (def->cputune.sharesSpecified) -@@ -18160,12 +18247,27 @@ virDomainDefFormatInternal(virDomainDefPtr def, - virBufferAsprintf(buf, "cpuset='%s'/>\n", cpumask); - VIR_FREE(cpumask); - } -+ -+ for (i = 0; i < def->cputune.niothreadspin; i++) { -+ char *cpumask; -+ /* Ignore the iothreadpin which inherit from "cpuset of "." */ -+ if (def->cpumask && -+ virBitmapEqual(def->cpumask, -+ def->cputune.iothreadspin[i]->cpumask)) -+ continue; -+ -+ virBufferAsprintf(buf, "cputune.iothreadspin[i]->vcpuid); -+ -+ if (!(cpumask = virBitmapFormat(def->cputune.iothreadspin[i]->cpumask))) -+ goto error; -+ -+ virBufferAsprintf(buf, "cpuset='%s'/>\n", cpumask); -+ VIR_FREE(cpumask); -+ } -+ - virBufferAdjustIndent(buf, -2); -- if (def->cputune.sharesSpecified || -- (def->cputune.nvcpupin && !virDomainIsAllVcpupinInherited(def)) || -- def->cputune.period || def->cputune.quota || -- def->cputune.emulatorpin || -- def->cputune.emulator_period || def->cputune.emulator_quota) -+ if (cputune) - virBufferAddLit(buf, "\n"); - - if (virDomainNumatuneFormatXML(buf, def->numatune) < 0) -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index c93b73c..decd4be 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -1953,6 +1953,8 @@ struct _virDomainDef { - size_t nvcpupin; - virDomainVcpuPinDefPtr *vcpupin; - virDomainVcpuPinDefPtr emulatorpin; -+ size_t niothreadspin; -+ virDomainVcpuPinDefPtr *iothreadspin; - } cputune; - - virDomainNumatunePtr numatune; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml b/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml -new file mode 100644 -index 0000000..435d0ae ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml -@@ -0,0 +1,38 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 2 -+ 2 -+ -+ 2048 -+ 1000000 -+ -1 -+ -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 1e06f38..843e66d 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -303,6 +303,7 @@ mymain(void) - - DO_TEST("smp"); - DO_TEST("iothreads"); -+ DO_TEST("cputune-iothreads"); - DO_TEST("iothreads-disk"); - DO_TEST("lease"); - DO_TEST("event_idx"); --- -2.1.0 - diff --git a/SOURCES/libvirt-domain_conf-Resolve-Coverity-COPY_PASTE_ERROR.patch b/SOURCES/libvirt-domain_conf-Resolve-Coverity-COPY_PASTE_ERROR.patch deleted file mode 100644 index 2634cea..0000000 --- a/SOURCES/libvirt-domain_conf-Resolve-Coverity-COPY_PASTE_ERROR.patch +++ /dev/null @@ -1,39 +0,0 @@ -From bc849e9b9d3b7bf3d8240a2a5da4d3ad6282d9f3 Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Mon, 15 Sep 2014 15:13:57 -0400 -Subject: [PATCH] domain_conf: Resolve Coverity COPY_PASTE_ERROR - -https://bugzilla.redhat.com/show_bug.cgi?id=1141209 - -Seems when commit id 'ea130e3b' added the checks to ensure each of -the hard_limit, soft_limit, and swap_hard_limit wasn't set at -VIR_DOMAIN_MEMORY_PARAM_UNLIMITED - a copy/paste error of using -the 'hard_limit' for each comparison was done. Adjust the code. - -(cherry picked from commit 96aa6052a14379eca23e0ba428355e5c1dab7e04) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 84f5f1d..ea727a1 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -18036,9 +18036,9 @@ virDomainDefFormatInternal(virDomainDefPtr def, - if ((def->mem.hard_limit && - def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) || - (def->mem.soft_limit && -- def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) || -+ def->mem.soft_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) || - (def->mem.swap_hard_limit && -- def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) || -+ def->mem.swap_hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) || - def->mem.min_guarantee) { - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); --- -2.1.0 - diff --git a/SOURCES/libvirt-domain_conf-fix-domain-deadlock.patch b/SOURCES/libvirt-domain_conf-fix-domain-deadlock.patch deleted file mode 100644 index 5b15130..0000000 --- a/SOURCES/libvirt-domain_conf-fix-domain-deadlock.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 75b4e447d3543c275de196c48569139ee2ecb50c Mon Sep 17 00:00:00 2001 -Message-Id: <75b4e447d3543c275de196c48569139ee2ecb50c@dist-git> -From: Pavel Hrdina -Date: Mon, 6 Oct 2014 16:52:24 +0200 -Subject: [PATCH] domain_conf: fix domain deadlock - -If you use public api virConnectListAllDomains() with second parameter -set to NULL to get only the number of domains you will lock out all -other operations with domains. - -Introduced by commit 2c680804. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit fc22b2e74890873848b43fffae43025d22053669) - -CVE-2014-3657 -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index b109330..d1d816d 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -20690,7 +20690,7 @@ virDomainListPopulate(void *payload, - /* just count the machines */ - if (!data->domains) { - data->ndomains++; -- return; -+ goto cleanup; - } - - if (!(dom = virGetDomain(data->conn, vm->def->name, vm->def->uuid))) { --- -2.1.2 - diff --git a/SOURCES/libvirt-domaincaps-Expose-UEFI-binary-path-if-it-exists.patch b/SOURCES/libvirt-domaincaps-Expose-UEFI-binary-path-if-it-exists.patch deleted file mode 100644 index eb1a5dc..0000000 --- a/SOURCES/libvirt-domaincaps-Expose-UEFI-binary-path-if-it-exists.patch +++ /dev/null @@ -1,451 +0,0 @@ -From bbda37d1ca472b0d81f52b24f2f945d978b8bce3 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Thu, 18 Sep 2014 11:45:39 +0200 -Subject: [PATCH] domaincaps: Expose UEFI binary path, if it exists - -https://bugzilla.redhat.com/show_bug.cgi?id=1026772 - -Check to see if the UEFI binary mentioned in qemu.conf actually -exists, and if so expose it in domcapabilities like - - - /path/to/ovmf - - -We introduce some generic domcaps infrastructure for handling -a dynamic list of string values, it may be of use for future bits. - -Signed-off-by: Michal Privoznik -(cherry picked from commit f05b6a918e283929f5d837cd1668cdcdb3834b9a) -Signed-off-by: Jiri Denemark ---- - docs/formatdomaincaps.html.in | 6 +++ - docs/schemas/domaincaps.rng | 17 +++++--- - src/conf/domain_capabilities.c | 29 +++++++++++++ - src/conf/domain_capabilities.h | 8 ++++ - src/qemu/qemu_capabilities.c | 32 +++++++++++--- - src/qemu/qemu_capabilities.h | 7 +++- - src/qemu/qemu_driver.c | 6 ++- - tests/domaincapsschemadata/domaincaps-full.xml | 2 + - .../domaincaps-qemu_1.6.50-1.xml | 1 + - tests/domaincapstest.c | 49 +++++++++++++++++++--- - 10 files changed, 140 insertions(+), 17 deletions(-) - -diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in -index 34d746d..6959dfe 100644 ---- a/docs/formatdomaincaps.html.in -+++ b/docs/formatdomaincaps.html.in -@@ -105,6 +105,7 @@ - ... - <os supported='yes'> - <loader supported='yes'> -+ <value>/usr/share/OVMF/OVMF_CODE.fd</value> - <enum name='type'> - <value>rom</value> - <value>pflash</value> -@@ -122,6 +123,11 @@ -

For the loader element, the following can occur:

- -
-+
value
-+
List of known loader paths. Currently this is only used -+ to advertise known locations of OVMF binaries for qemu. Binaries -+ will only be listed if they actually exist on disk.
-+ -
type
-
Whether loader is a typical BIOS (rom) or - an UEFI binary (pflash). This refers to -diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng -index ad8d966..f4a555f 100644 ---- a/docs/schemas/domaincaps.rng -+++ b/docs/schemas/domaincaps.rng -@@ -47,6 +47,9 @@ - - - -+ -+ -+ - - - -@@ -85,6 +88,14 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ - - - -@@ -100,11 +111,7 @@ - - - -- -- -- -- -- -+ - - - -diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c -index 5a3c8e7..7c59912 100644 ---- a/src/conf/domain_capabilities.c -+++ b/src/conf/domain_capabilities.c -@@ -48,12 +48,28 @@ VIR_ONCE_GLOBAL_INIT(virDomainCaps) - - - static void -+virDomainCapsStringValuesFree(virDomainCapsStringValuesPtr values) -+{ -+ size_t i; -+ -+ if (!values || !values->values) -+ return; -+ -+ for (i = 0; i < values->nvalues; i++) -+ VIR_FREE(values->values[i]); -+ VIR_FREE(values->values); -+} -+ -+ -+static void - virDomainCapsDispose(void *obj) - { - virDomainCapsPtr caps = obj; - - VIR_FREE(caps->path); - VIR_FREE(caps->machine); -+ -+ virDomainCapsStringValuesFree(&caps->os.loader.values); - } - - -@@ -156,6 +172,18 @@ virDomainCapsEnumFormat(virBufferPtr buf, - return ret; - } - -+ -+static void -+virDomainCapsStringValuesFormat(virBufferPtr buf, -+ virDomainCapsStringValuesPtr values) -+{ -+ size_t i; -+ -+ for (i = 0; i < values->nvalues; i++) -+ virBufferEscapeString(buf, "%s\n", values->values[i]); -+} -+ -+ - #define FORMAT_PROLOGUE(item) \ - do { \ - virBufferAsprintf(buf, "<" #item " supported='%s'%s\n", \ -@@ -185,6 +213,7 @@ virDomainCapsLoaderFormat(virBufferPtr buf, - { - FORMAT_PROLOGUE(loader); - -+ virDomainCapsStringValuesFormat(buf, &loader->values); - ENUM_PROCESS(loader, type, virDomainLoaderTypeToString); - ENUM_PROCESS(loader, readonly, virTristateBoolTypeToString); - -diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h -index 768646b..597ac75 100644 ---- a/src/conf/domain_capabilities.h -+++ b/src/conf/domain_capabilities.h -@@ -37,6 +37,13 @@ struct _virDomainCapsEnum { - unsigned int values; /* Bitmask of values supported in the corresponding enum */ - }; - -+typedef struct _virDomainCapsStringValues virDomainCapsStringValues; -+typedef virDomainCapsStringValues *virDomainCapsStringValuesPtr; -+struct _virDomainCapsStringValues { -+ char **values; /* raw string values */ -+ size_t nvalues; /* number of strings */ -+}; -+ - typedef struct _virDomainCapsDevice virDomainCapsDevice; - typedef virDomainCapsDevice *virDomainCapsDevicePtr; - struct _virDomainCapsDevice { -@@ -47,6 +54,7 @@ typedef struct _virDomainCapsLoader virDomainCapsLoader; - typedef virDomainCapsLoader *virDomainCapsLoaderPtr; - struct _virDomainCapsLoader { - virDomainCapsDevice device; -+ virDomainCapsStringValues values; /* Info about values for the element */ - virDomainCapsEnum type; /* Info about virDomainLoader */ - virDomainCapsEnum readonly; /* Info about readonly:virTristateBool */ - }; -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index f398e3a..67bfc36 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -3611,10 +3611,30 @@ virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps) - static int - virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsLoaderPtr loader, -- virArch arch) -+ virArch arch, -+ virQEMUDriverConfigPtr cfg) - { -+ size_t i; -+ - loader->device.supported = true; - -+ if (VIR_ALLOC_N(loader->values.values, cfg->nloader) < 0) -+ return -1; -+ -+ for (i = 0; i < cfg->nloader; i++) { -+ const char *filename = cfg->loader[i]; -+ -+ if (!virFileExists(filename)) { -+ VIR_DEBUG("loader filename=%s does not exist", filename); -+ continue; -+ } -+ -+ if (VIR_STRDUP(loader->values.values[loader->values.nvalues], -+ filename) < 0) -+ return -1; -+ loader->values.nvalues++; -+ } -+ - VIR_DOMAIN_CAPS_ENUM_SET(loader->type, - VIR_DOMAIN_LOADER_TYPE_ROM); - -@@ -3636,12 +3656,13 @@ virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps, - static int - virQEMUCapsFillDomainOSCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsOSPtr os, -- virArch arch) -+ virArch arch, -+ virQEMUDriverConfigPtr cfg) - { - virDomainCapsLoaderPtr loader = &os->loader; - - os->device.supported = true; -- if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, loader, arch) < 0) -+ if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, loader, arch, cfg) < 0) - return -1; - return 0; - } -@@ -3725,7 +3746,8 @@ virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps, - - int - virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, -- virQEMUCapsPtr qemuCaps) -+ virQEMUCapsPtr qemuCaps, -+ virQEMUDriverConfigPtr cfg) - { - virDomainCapsOSPtr os = &domCaps->os; - virDomainCapsDeviceDiskPtr disk = &domCaps->disk; -@@ -3734,7 +3756,7 @@ virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, - - domCaps->maxvcpus = maxvcpus; - -- if (virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch) < 0 || -+ if (virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch, cfg) < 0 || - virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, disk) < 0 || - virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0) - return -1; -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 828bba3..cf69e59 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -324,7 +324,12 @@ int virQEMUCapsInitGuestFromBinary(virCapsPtr caps, - virQEMUCapsPtr kvmbinCaps, - virArch guestarch); - -+/* Forward declaration */ -+typedef struct _virQEMUDriverConfig virQEMUDriverConfig; -+typedef virQEMUDriverConfig *virQEMUDriverConfigPtr; -+ - int virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, -- virQEMUCapsPtr qemuCaps); -+ virQEMUCapsPtr qemuCaps, -+ virQEMUDriverConfigPtr cfg); - - #endif /* __QEMU_CAPABILITIES_H__*/ -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 446dd63..d3ff143 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17068,12 +17068,15 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, - int virttype; /* virDomainVirtType */ - virDomainCapsPtr domCaps = NULL; - int arch = virArchFromHost(); /* virArch */ -+ virQEMUDriverConfigPtr cfg = NULL; - - virCheckFlags(0, ret); - - if (virConnectGetDomainCapabilitiesEnsureACL(conn) < 0) - return ret; - -+ cfg = virQEMUDriverGetConfig(driver); -+ - if (qemuHostdevHostSupportsPassthroughLegacy()) - virttype = VIR_DOMAIN_VIRT_KVM; - else -@@ -17140,11 +17143,12 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, - if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, virttype))) - goto cleanup; - -- if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps) < 0) -+ if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps, cfg) < 0) - goto cleanup; - - ret = virDomainCapsFormat(domCaps); - cleanup: -+ virObjectUnref(cfg); - virObjectUnref(domCaps); - virObjectUnref(qemuCaps); - return ret; -diff --git a/tests/domaincapsschemadata/domaincaps-full.xml b/tests/domaincapsschemadata/domaincaps-full.xml -index 9722772..96202bc 100644 ---- a/tests/domaincapsschemadata/domaincaps-full.xml -+++ b/tests/domaincapsschemadata/domaincaps-full.xml -@@ -6,6 +6,8 @@ - - - -+ /foo/bar -+ /tmp/my_path - - rom - pflash -diff --git a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml -index 568cecb..346ef65 100644 ---- a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml -+++ b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml -@@ -5,6 +5,7 @@ - x86_64 - - -+ /usr/share/OVMF/OVMF_CODE.fd - - rom - pflash -diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c -index 0c4b09f..8543963 100644 ---- a/tests/domaincapstest.c -+++ b/tests/domaincapstest.c -@@ -34,6 +34,27 @@ typedef int (*virDomainCapsFill)(virDomainCapsPtr domCaps, - #define SET_ALL_BITS(x) \ - memset(&(x.values), 0xff, sizeof(x.values)) - -+static int ATTRIBUTE_SENTINEL -+fillStringValues(virDomainCapsStringValuesPtr values, ...) -+{ -+ int ret = 0; -+ va_list list; -+ const char *str; -+ -+ va_start(list, values); -+ while ((str = va_arg(list, const char *))) { -+ if (VIR_REALLOC_N(values->values, values->nvalues + 1) < 0 || -+ VIR_STRDUP(values->values[values->nvalues], str) < 0) { -+ ret = -1; -+ break; -+ } -+ values->nvalues++; -+ } -+ va_end(list); -+ -+ return ret; -+} -+ - static int - fillAll(virDomainCapsPtr domCaps, - void *opaque ATTRIBUTE_UNUSED) -@@ -49,6 +70,11 @@ fillAll(virDomainCapsPtr domCaps, - loader->device.supported = true; - SET_ALL_BITS(loader->type); - SET_ALL_BITS(loader->readonly); -+ if (fillStringValues(&loader->values, -+ "/foo/bar", -+ "/tmp/my_path", -+ NULL) < 0) -+ return -1; - - disk->device.supported = true; - SET_ALL_BITS(disk->diskDevice); -@@ -66,13 +92,21 @@ fillAll(virDomainCapsPtr domCaps, - - #ifdef WITH_QEMU - # include "testutilsqemu.h" -+ -+struct fillQemuCapsData { -+ virQEMUCapsPtr qemuCaps; -+ virQEMUDriverConfigPtr cfg; -+}; -+ - static int - fillQemuCaps(virDomainCapsPtr domCaps, - void *opaque) - { -- virQEMUCapsPtr qemuCaps = (virQEMUCapsPtr) opaque; -+ struct fillQemuCapsData *data = (struct fillQemuCapsData *) opaque; -+ virQEMUCapsPtr qemuCaps = data->qemuCaps; -+ virQEMUDriverConfigPtr cfg = data->cfg; - -- if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps) < 0) -+ if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps, cfg) < 0) - return -1; - - /* The function above tries to query host's KVM & VFIO capabilities by -@@ -97,7 +131,7 @@ buildVirDomainCaps(const char *emulatorbin, - virDomainCapsFill fillFunc, - void *opaque) - { -- virDomainCapsPtr domCaps; -+ virDomainCapsPtr domCaps, ret = NULL; - - if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, type))) - goto cleanup; -@@ -107,8 +141,9 @@ buildVirDomainCaps(const char *emulatorbin, - domCaps = NULL; - } - -+ ret = domCaps; - cleanup: -- return domCaps; -+ return ret; - } - - struct test_virDomainCapsFormatData { -@@ -182,13 +217,16 @@ mymain(void) - - #ifdef WITH_QEMU - -+ virQEMUDriverConfigPtr cfg = virQEMUDriverConfigNew(false); -+ - # define DO_TEST_QEMU(Filename, QemuCapsFile, Emulatorbin, Machine, Arch, Type, ...) \ - do { \ - const char *capsPath = abs_srcdir "/qemucapabilitiesdata/" QemuCapsFile ".caps"; \ - virQEMUCapsPtr qemuCaps = qemuTestParseCapabilities(capsPath); \ -+ struct fillQemuCapsData fillData = {.qemuCaps = qemuCaps, .cfg = cfg}; \ - struct test_virDomainCapsFormatData data = {.filename = Filename, \ - .emulatorbin = Emulatorbin, .machine = Machine, .arch = Arch, \ -- .type = Type, .fillFunc = fillQemuCaps, .opaque = qemuCaps}; \ -+ .type = Type, .fillFunc = fillQemuCaps, .opaque = &fillData}; \ - if (!qemuCaps) { \ - fprintf(stderr, "Unable to build qemu caps from %s\n", capsPath); \ - ret = -1; \ -@@ -199,6 +237,7 @@ mymain(void) - DO_TEST_QEMU("qemu_1.6.50-1", "caps_1.6.50-1", "/usr/bin/qemu-system-x86_64", - "pc-1.2", VIR_ARCH_X86_64, VIR_DOMAIN_VIRT_KVM); - -+ virObjectUnref(cfg); - #endif /* WITH_QEMU */ - - return ret; --- -2.1.0 - diff --git a/SOURCES/libvirt-domaincaps-Expose-UEFI-capability.patch b/SOURCES/libvirt-domaincaps-Expose-UEFI-capability.patch deleted file mode 100644 index c4fc013..0000000 --- a/SOURCES/libvirt-domaincaps-Expose-UEFI-capability.patch +++ /dev/null @@ -1,345 +0,0 @@ -From 2136f434f55fa1bcdc4471e5a7bbd1da6eabb4ee Mon Sep 17 00:00:00 2001 -Message-Id: <2136f434f55fa1bcdc4471e5a7bbd1da6eabb4ee@dist-git> -From: Michal Privoznik -Date: Thu, 18 Sep 2014 11:45:37 +0200 -Subject: [PATCH] domaincaps: Expose UEFI capability - -https://bugzilla.redhat.com/show_bug.cgi?id=1026772 - -As of 542899168c38 we learned libvirt to use UEFI for domains. -However, management applications may firstly query if libvirt -supports it. And this is where virConnectGetDomainCapabilities() -API comes handy. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 4f76621c0edb895431a6fc30c026865dbf1c1316) -Signed-off-by: Jiri Denemark ---- - docs/formatdomaincaps.html.in | 40 ++++++++++++++++++++++ - docs/schemas/domaincaps.rng | 21 ++++++++++++ - src/conf/domain_capabilities.c | 28 +++++++++++++++ - src/conf/domain_capabilities.h | 16 +++++++++ - src/qemu/qemu_capabilities.c | 38 ++++++++++++++++++++ - tests/domaincapsschemadata/domaincaps-basic.xml | 1 + - tests/domaincapsschemadata/domaincaps-full.xml | 13 +++++++ - .../domaincaps-qemu_1.6.50-1.xml | 12 +++++++ - tests/domaincapstest.c | 8 +++++ - 9 files changed, 177 insertions(+) - -diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in -index 66b6017..34d746d 100644 ---- a/docs/formatdomaincaps.html.in -+++ b/docs/formatdomaincaps.html.in -@@ -93,6 +93,46 @@ -
The maximum number of supported virtual CPUs
-
- -+

BIOS bootloader

-+ -+

Sometimes users might want to tweak some BIOS knobs or use -+ UEFI. For cases like that, os -+ element exposes what values can be passed to its children.

-+ -+
-+<domainCapabilities>
-+  ...
-+  <os supported='yes'>
-+    <loader supported='yes'>
-+      <enum name='type'>
-+        <value>rom</value>
-+        <value>pflash</value>
-+      </enum>
-+      <enum name='readonly'>
-+        <value>yes</value>
-+        <value>no</value>
-+      </enum>
-+    </loader>
-+  </os>
-+  ...
-+<domainCapabilities>
-+
-+ -+

For the loader element, the following can occur:

-+ -+
-+
type
-+
Whether loader is a typical BIOS (rom) or -+ an UEFI binary (pflash). This refers to -+ type attribute of the <loader/> -+ element.
-+ -+
readonly
-+
Options for the readonly attribute of the -+ <loader/> element.
-+
-+ -

Devices

- -

-diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng -index 627b699..ad8d966 100644 ---- a/docs/schemas/domaincaps.rng -+++ b/docs/schemas/domaincaps.rng -@@ -26,6 +26,9 @@ - - - -+ -+ -+ - - - -@@ -41,6 +44,24 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c -index df190eb..5a3c8e7 100644 ---- a/src/conf/domain_capabilities.c -+++ b/src/conf/domain_capabilities.c -@@ -178,6 +178,32 @@ virDomainCapsEnumFormat(virBufferPtr buf, - #capsEnum, valToStr); \ - } while (0) - -+ -+static void -+virDomainCapsLoaderFormat(virBufferPtr buf, -+ virDomainCapsLoaderPtr loader) -+{ -+ FORMAT_PROLOGUE(loader); -+ -+ ENUM_PROCESS(loader, type, virDomainLoaderTypeToString); -+ ENUM_PROCESS(loader, readonly, virTristateBoolTypeToString); -+ -+ FORMAT_EPILOGUE(loader); -+} -+ -+static void -+virDomainCapsOSFormat(virBufferPtr buf, -+ virDomainCapsOSPtr os) -+{ -+ virDomainCapsLoaderPtr loader = &os->loader; -+ -+ FORMAT_PROLOGUE(os); -+ -+ virDomainCapsLoaderFormat(buf, loader); -+ -+ FORMAT_EPILOGUE(os); -+} -+ - static void - virDomainCapsDeviceDiskFormat(virBufferPtr buf, - virDomainCapsDeviceDiskPtr const disk) -@@ -225,6 +251,8 @@ virDomainCapsFormatInternal(virBufferPtr buf, - if (caps->maxvcpus) - virBufferAsprintf(buf, "\n", caps->maxvcpus); - -+ virDomainCapsOSFormat(buf, &caps->os); -+ - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); - -diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h -index 731e66f..768646b 100644 ---- a/src/conf/domain_capabilities.h -+++ b/src/conf/domain_capabilities.h -@@ -43,6 +43,21 @@ struct _virDomainCapsDevice { - bool supported; /* true if is supported by hypervisor */ - }; - -+typedef struct _virDomainCapsLoader virDomainCapsLoader; -+typedef virDomainCapsLoader *virDomainCapsLoaderPtr; -+struct _virDomainCapsLoader { -+ virDomainCapsDevice device; -+ virDomainCapsEnum type; /* Info about virDomainLoader */ -+ virDomainCapsEnum readonly; /* Info about readonly:virTristateBool */ -+}; -+ -+typedef struct _virDomainCapsOS virDomainCapsOS; -+typedef virDomainCapsOS *virDomainCapsOSPtr; -+struct _virDomainCapsOS { -+ virDomainCapsDevice device; -+ virDomainCapsLoader loader; /* Info about virDomainLoaderDef */ -+}; -+ - typedef struct _virDomainCapsDeviceDisk virDomainCapsDeviceDisk; - typedef virDomainCapsDeviceDisk *virDomainCapsDeviceDiskPtr; - struct _virDomainCapsDeviceDisk { -@@ -75,6 +90,7 @@ struct _virDomainCaps { - /* Some machine specific info */ - int maxvcpus; - -+ virDomainCapsOS os; - virDomainCapsDeviceDisk disk; - virDomainCapsDeviceHostdev hostdev; - /* add new domain devices here */ -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 4e7c435..65efe3e 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -3609,6 +3609,42 @@ virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps) - - - static void -+virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps, -+ virDomainCapsLoaderPtr loader, -+ virArch arch) -+{ -+ loader->device.supported = true; -+ -+ VIR_DOMAIN_CAPS_ENUM_SET(loader->type, -+ VIR_DOMAIN_LOADER_TYPE_ROM); -+ -+ if (arch == VIR_ARCH_X86_64 && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE) && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_FORMAT)) -+ VIR_DOMAIN_CAPS_ENUM_SET(loader->type, -+ VIR_DOMAIN_LOADER_TYPE_PFLASH); -+ -+ -+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_READONLY)) -+ VIR_DOMAIN_CAPS_ENUM_SET(loader->readonly, -+ VIR_TRISTATE_BOOL_YES, -+ VIR_TRISTATE_BOOL_NO); -+} -+ -+ -+static void -+virQEMUCapsFillDomainOSCaps(virQEMUCapsPtr qemuCaps, -+ virDomainCapsOSPtr os, -+ virArch arch) -+{ -+ virDomainCapsLoaderPtr loader = &os->loader; -+ -+ os->device.supported = true; -+ virQEMUCapsFillDomainLoaderCaps(qemuCaps, loader, arch); -+} -+ -+ -+static void - virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsDeviceDiskPtr disk) - { -@@ -3686,12 +3722,14 @@ void - virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, - virQEMUCapsPtr qemuCaps) - { -+ virDomainCapsOSPtr os = &domCaps->os; - virDomainCapsDeviceDiskPtr disk = &domCaps->disk; - virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev; - int maxvcpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, domCaps->machine); - - domCaps->maxvcpus = maxvcpus; - -+ virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch); - virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, disk); - virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev); - } -diff --git a/tests/domaincapsschemadata/domaincaps-basic.xml b/tests/domaincapsschemadata/domaincaps-basic.xml -index 9963519..6171393 100644 ---- a/tests/domaincapsschemadata/domaincaps-basic.xml -+++ b/tests/domaincapsschemadata/domaincaps-basic.xml -@@ -3,6 +3,7 @@ - uml - my-machine-type - x86_64 -+ - - - -diff --git a/tests/domaincapsschemadata/domaincaps-full.xml b/tests/domaincapsschemadata/domaincaps-full.xml -index 58dd4cb..9722772 100644 ---- a/tests/domaincapsschemadata/domaincaps-full.xml -+++ b/tests/domaincapsschemadata/domaincaps-full.xml -@@ -4,6 +4,19 @@ - my-machine-type - x86_64 - -+ -+ -+ -+ rom -+ pflash -+ -+ -+ default -+ yes -+ no -+ -+ -+ - - - -diff --git a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml -index 8b63993..568cecb 100644 ---- a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml -+++ b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml -@@ -3,6 +3,18 @@ - kvm - pc-1.2 - x86_64 -+ -+ -+ -+ rom -+ pflash -+ -+ -+ yes -+ no -+ -+ -+ - - - -diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c -index 78197e2..f240643 100644 ---- a/tests/domaincapstest.c -+++ b/tests/domaincapstest.c -@@ -38,10 +38,18 @@ static void - fillAll(virDomainCapsPtr domCaps, - void *opaque ATTRIBUTE_UNUSED) - { -+ virDomainCapsOSPtr os = &domCaps->os; -+ virDomainCapsLoaderPtr loader = &os->loader; - virDomainCapsDeviceDiskPtr disk = &domCaps->disk; - virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev; - domCaps->maxvcpus = 255; - -+ os->device.supported = true; -+ -+ loader->device.supported = true; -+ SET_ALL_BITS(loader->type); -+ SET_ALL_BITS(loader->readonly); -+ - disk->device.supported = true; - SET_ALL_BITS(disk->diskDevice); - SET_ALL_BITS(disk->bus); --- -2.1.0 - diff --git a/SOURCES/libvirt-domaincapstest-Run-cleanly-on-systems-missing-OVMF-firmware.patch b/SOURCES/libvirt-domaincapstest-Run-cleanly-on-systems-missing-OVMF-firmware.patch deleted file mode 100644 index f541ec2..0000000 --- a/SOURCES/libvirt-domaincapstest-Run-cleanly-on-systems-missing-OVMF-firmware.patch +++ /dev/null @@ -1,47 +0,0 @@ -From c32465d55a913cf0bd600f34f1cc71ea2ed64f9d Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Thu, 18 Sep 2014 11:45:40 +0200 -Subject: [PATCH] domaincapstest: Run cleanly on systems missing OVMF firmware - -https://bugzilla.redhat.com/show_bug.cgi?id=1026772 - -As of f05b6a918e28 the test produces the list of paths that can -be passed to and libvirt knows about them. However, -during the process of generating the list the paths are checked -for their presence. This may produce different results on -different systems. Therefore, the path - if missing - is -added to pretend it's there. - -Signed-off-by: Michal Privoznik -(cherry picked from commit b3f42da6b77644107bcbaf720d7ed9cef5c798a2) -Signed-off-by: Jiri Denemark ---- - tests/domaincapstest.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c -index 8543963..067ad4d 100644 ---- a/tests/domaincapstest.c -+++ b/tests/domaincapstest.c -@@ -118,6 +118,17 @@ fillQemuCaps(virDomainCapsPtr domCaps, - VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT, - VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM, - VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO); -+ -+ /* Moreover, as of f05b6a918e28 we are expecting to see -+ * OVMF_CODE.fd file which may not exists everywhere. */ -+ if (!domCaps->os.loader.values.nvalues) { -+ virDomainCapsLoaderPtr loader = &domCaps->os.loader; -+ -+ if (fillStringValues(&loader->values, -+ "/usr/share/OVMF/OVMF_CODE.fd", -+ NULL) < 0) -+ return -1; -+ } - return 0; - } - #endif /* WITH_QEMU */ --- -2.1.0 - diff --git a/SOURCES/libvirt-event-Add-guest-agent-lifecycle-event.patch b/SOURCES/libvirt-event-Add-guest-agent-lifecycle-event.patch deleted file mode 100644 index 0b14f3f..0000000 --- a/SOURCES/libvirt-event-Add-guest-agent-lifecycle-event.patch +++ /dev/null @@ -1,482 +0,0 @@ -From a83a22de1508bd32385128421cb89991942df42e Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Mon, 24 Nov 2014 17:51:18 +0100 -Subject: [PATCH] event: Add guest agent lifecycle event - -https://bugzilla.redhat.com/show_bug.cgi?id=1146944 - -As qemu is now able to notify us about change of the channel state used -for communication with the guest agent we now can more precisely track -the state of the guest agent. - -To allow notifying management apps this patch implements a new event -that will be triggered on changes of the guest agent state. - -(cherry picked from commit 1a4609101b63cacc648d7935f3e18898904d2697) - -Conflicts: - include/libvirt/libvirt-domain.h - doesn't exist downstream yet - src/remote/remote_protocol.x - new api missing - src/remote_protocol-structs - new api missing - -Signed-off-by: Jiri Denemark ---- - daemon/remote.c | 36 ++++++++++++++++++++ - include/libvirt/libvirt.h.in | 40 +++++++++++++++++++++++ - src/conf/domain_event.c | 78 ++++++++++++++++++++++++++++++++++++++++++++ - src/conf/domain_event.h | 9 +++++ - src/libvirt_private.syms | 2 ++ - src/remote/remote_driver.c | 31 ++++++++++++++++++ - src/remote/remote_protocol.x | 16 ++++++++- - src/remote_protocol-structs | 7 ++++ - tools/virsh-domain.c | 39 ++++++++++++++++++++++ - 9 files changed, 257 insertions(+), 1 deletion(-) - -diff --git a/daemon/remote.c b/daemon/remote.c -index 0112a32..253a4c3 100644 ---- a/daemon/remote.c -+++ b/daemon/remote.c -@@ -1013,6 +1013,41 @@ remoteRelayDomainEventTunable(virConnectPtr conn, - } - - -+static int -+remoteRelayDomainEventAgentLifecycle(virConnectPtr conn, -+ virDomainPtr dom, -+ int state, -+ int reason, -+ void *opaque) -+{ -+ daemonClientEventCallbackPtr callback = opaque; -+ remote_domain_event_callback_agent_lifecycle_msg data; -+ -+ if (callback->callbackID < 0 || -+ !remoteRelayDomainEventCheckACL(callback->client, conn, dom)) -+ return -1; -+ -+ VIR_DEBUG("Relaying domain agent lifecycle event %s %d, callback %d, " -+ " state %d, reason %d", -+ dom->name, dom->id, callback->callbackID, state, reason); -+ -+ /* build return data */ -+ memset(&data, 0, sizeof(data)); -+ data.callbackID = callback->callbackID; -+ make_nonnull_domain(&data.dom, dom); -+ -+ data.state = state; -+ data.reason = reason; -+ -+ remoteDispatchObjectEventSend(callback->client, remoteProgram, -+ REMOTE_PROC_DOMAIN_EVENT_CALLBACK_AGENT_LIFECYCLE, -+ (xdrproc_t)xdr_remote_domain_event_callback_agent_lifecycle_msg, -+ &data); -+ -+ return 0; -+} -+ -+ - static virConnectDomainEventGenericCallback domainEventCallbacks[] = { - VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventLifecycle), - VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventReboot), -@@ -1032,6 +1067,7 @@ static virConnectDomainEventGenericCallback domainEventCallbacks[] = { - VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventDeviceRemoved), - VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventBlockJob2), - VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventTunable), -+ VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventAgentLifecycle), - }; - - verify(ARRAY_CARDINALITY(domainEventCallbacks) == VIR_DOMAIN_EVENT_ID_LAST); -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 3ca935e..9099cc4 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -5318,6 +5318,45 @@ typedef void (*virConnectDomainEventTunableCallback)(virConnectPtr conn, - int nparams, - void *opaque); - -+typedef enum { -+ VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED = 1, /* agent connected */ -+ VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED = 2, /* agent disconnected */ -+ -+# ifdef VIR_ENUM_SENTINELS -+ VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_LAST -+# endif -+} virConnectDomainEventAgentLifecycleState; -+ -+typedef enum { -+ VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN = 0, /* unknown state change reason */ -+ VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED = 1, /* state changed due to domain start */ -+ VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL = 2, /* channel state changed */ -+ -+# ifdef VIR_ENUM_SENTINELS -+ VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_LAST -+# endif -+} virConnectDomainEventAgentLifecycleReason; -+ -+/** -+ * virConnectDomainEventAgentLifecycleCallback: -+ * @conn: connection object -+ * @dom: domain on which the event occurred -+ * @state: new state of the guest agent, one of virConnectDomainEventAgentLifecycleState -+ * @reason: reason for state change; one of virConnectDomainEventAgentLifecycleReason -+ * @opaque: application specified data -+ * -+ * This callback occurs when libvirt detects a change in the state of a guest -+ * agent. -+ * -+ * The callback signature to use when registering for an event of type -+ * VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE with virConnectDomainEventRegisterAny() -+ */ -+typedef void (*virConnectDomainEventAgentLifecycleCallback)(virConnectPtr conn, -+ virDomainPtr dom, -+ int state, -+ int reason, -+ void *opaque); -+ - - /** - * VIR_DOMAIN_EVENT_CALLBACK: -@@ -5354,6 +5393,7 @@ typedef enum { - VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED = 15, /* virConnectDomainEventDeviceRemovedCallback */ - VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 = 16, /* virConnectDomainEventBlockJobCallback */ - VIR_DOMAIN_EVENT_ID_TUNABLE = 17, /* virConnectDomainEventTunableCallback */ -+ VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE = 18,/* virConnectDomainEventAgentLifecycleCallback */ - - #ifdef VIR_ENUM_SENTINELS - VIR_DOMAIN_EVENT_ID_LAST -diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c -index 3504b34..d1042bf 100644 ---- a/src/conf/domain_event.c -+++ b/src/conf/domain_event.c -@@ -54,6 +54,7 @@ static virClassPtr virDomainEventDeviceRemovedClass; - static virClassPtr virDomainEventPMClass; - static virClassPtr virDomainQemuMonitorEventClass; - static virClassPtr virDomainEventTunableClass; -+static virClassPtr virDomainEventAgentLifecycleClass; - - - static void virDomainEventDispose(void *obj); -@@ -70,6 +71,7 @@ static void virDomainEventDeviceRemovedDispose(void *obj); - static void virDomainEventPMDispose(void *obj); - static void virDomainQemuMonitorEventDispose(void *obj); - static void virDomainEventTunableDispose(void *obj); -+static void virDomainEventAgentLifecycleDispose(void *obj); - - static void - virDomainEventDispatchDefaultFunc(virConnectPtr conn, -@@ -215,6 +217,15 @@ struct _virDomainEventTunable { - typedef struct _virDomainEventTunable virDomainEventTunable; - typedef virDomainEventTunable *virDomainEventTunablePtr; - -+struct _virDomainEventAgentLifecycle { -+ virDomainEvent parent; -+ -+ int state; -+ int reason; -+}; -+typedef struct _virDomainEventAgentLifecycle virDomainEventAgentLifecycle; -+typedef virDomainEventAgentLifecycle *virDomainEventAgentLifecyclePtr; -+ - - static int - virDomainEventsOnceInit(void) -@@ -303,6 +314,12 @@ virDomainEventsOnceInit(void) - sizeof(virDomainEventTunable), - virDomainEventTunableDispose))) - return -1; -+ if (!(virDomainEventAgentLifecycleClass = -+ virClassNew(virDomainEventClass, -+ "virDomainEventAgentLifecycle", -+ sizeof(virDomainEventAgentLifecycle), -+ virDomainEventAgentLifecycleDispose))) -+ return -1; - return 0; - } - -@@ -447,6 +464,13 @@ virDomainEventTunableDispose(void *obj) - virTypedParamsFree(event->params, event->nparams); - } - -+static void -+virDomainEventAgentLifecycleDispose(void *obj) -+{ -+ virDomainEventAgentLifecyclePtr event = obj; -+ VIR_DEBUG("obj=%p", event); -+}; -+ - - static void * - virDomainEventNew(virClassPtr klass, -@@ -1202,6 +1226,49 @@ virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, - devAlias); - } - -+ -+static virObjectEventPtr -+virDomainEventAgentLifecycleNew(int id, -+ const char *name, -+ const unsigned char *uuid, -+ int state, -+ int reason) -+{ -+ virDomainEventAgentLifecyclePtr ev; -+ -+ if (virDomainEventsInitialize() < 0) -+ return NULL; -+ -+ if (!(ev = virDomainEventNew(virDomainEventAgentLifecycleClass, -+ VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE, -+ id, name, uuid))) -+ return NULL; -+ -+ ev->state = state; -+ ev->reason = reason; -+ -+ return (virObjectEventPtr)ev; -+} -+ -+virObjectEventPtr -+virDomainEventAgentLifecycleNewFromObj(virDomainObjPtr obj, -+ int state, -+ int reason) -+{ -+ return virDomainEventAgentLifecycleNew(obj->def->id, obj->def->name, -+ obj->def->uuid, state, reason); -+} -+ -+virObjectEventPtr -+virDomainEventAgentLifecycleNewFromDom(virDomainPtr dom, -+ int state, -+ int reason) -+{ -+ return virDomainEventAgentLifecycleNew(dom->id, dom->name, dom->uuid, -+ state, reason); -+} -+ -+ - /* This function consumes the params so caller don't have to care about - * freeing it even if error occurs. The reason is to not have to do deep - * copy of params. -@@ -1459,6 +1526,17 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, - goto cleanup; - } - -+ case VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE: -+ { -+ virDomainEventAgentLifecyclePtr agentLifecycleEvent; -+ agentLifecycleEvent = (virDomainEventAgentLifecyclePtr)event; -+ ((virConnectDomainEventAgentLifecycleCallback)cb)(conn, dom, -+ agentLifecycleEvent->state, -+ agentLifecycleEvent->reason, -+ cbopaque); -+ goto cleanup; -+ } -+ - case VIR_DOMAIN_EVENT_ID_LAST: - break; - } -diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h -index dc0109c..534ff9e 100644 ---- a/src/conf/domain_event.h -+++ b/src/conf/domain_event.h -@@ -193,6 +193,15 @@ virDomainEventTunableNewFromDom(virDomainPtr dom, - virTypedParameterPtr params, - int nparams); - -+virObjectEventPtr -+virDomainEventAgentLifecycleNewFromObj(virDomainObjPtr obj, -+ int state, -+ int reason); -+ -+virObjectEventPtr -+virDomainEventAgentLifecycleNewFromDom(virDomainPtr dom, -+ int state, -+ int reason); - - int - virDomainEventStateRegister(virConnectPtr conn, -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index 15843f8..6353d9c 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -435,6 +435,8 @@ virDomainXMLOptionNew; - - - # conf/domain_event.h -+virDomainEventAgentLifecycleNewFromDom; -+virDomainEventAgentLifecycleNewFromObj; - virDomainEventBalloonChangeNewFromDom; - virDomainEventBalloonChangeNewFromObj; - virDomainEventBlockJob2NewFromDom; -diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c -index 6f7c894..59d4def 100644 ---- a/src/remote/remote_driver.c -+++ b/src/remote/remote_driver.c -@@ -331,6 +331,11 @@ remoteDomainBuildEventCallbackTunable(virNetClientProgramPtr prog, - void *evdata, void *opaque); - - static void -+remoteDomainBuildEventCallbackAgentLifecycle(virNetClientProgramPtr prog, -+ virNetClientPtr client, -+ void *evdata, void *opaque); -+ -+static void - remoteNetworkBuildEventLifecycle(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, - virNetClientPtr client ATTRIBUTE_UNUSED, - void *evdata, void *opaque); -@@ -485,6 +490,10 @@ static virNetClientProgramEvent remoteEvents[] = { - remoteDomainBuildEventCallbackTunable, - sizeof(remote_domain_event_callback_tunable_msg), - (xdrproc_t)xdr_remote_domain_event_callback_tunable_msg }, -+ { REMOTE_PROC_DOMAIN_EVENT_CALLBACK_AGENT_LIFECYCLE, -+ remoteDomainBuildEventCallbackAgentLifecycle, -+ sizeof(remote_domain_event_callback_agent_lifecycle_msg), -+ (xdrproc_t)xdr_remote_domain_event_callback_agent_lifecycle_msg }, - }; - - -@@ -5542,6 +5551,28 @@ remoteDomainBuildEventCallbackTunable(virNetClientProgramPtr prog ATTRIBUTE_UNUS - - - static void -+remoteDomainBuildEventCallbackAgentLifecycle(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, -+ virNetClientPtr client ATTRIBUTE_UNUSED, -+ void *evdata, void *opaque) -+{ -+ virConnectPtr conn = opaque; -+ remote_domain_event_callback_agent_lifecycle_msg *msg = evdata; -+ struct private_data *priv = conn->privateData; -+ virDomainPtr dom; -+ virObjectEventPtr event = NULL; -+ -+ if (!(dom = get_nonnull_domain(conn, msg->dom))) -+ return; -+ -+ event = virDomainEventAgentLifecycleNewFromDom(dom, msg->state, -+ msg->reason); -+ -+ virDomainFree(dom); -+ -+ remoteEventQueue(priv, event, msg->callbackID); -+} -+ -+static void - remoteNetworkBuildEventLifecycle(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, - virNetClientPtr client ATTRIBUTE_UNUSED, - void *evdata, void *opaque) -diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x -index ee195c4..82f3902 100644 ---- a/src/remote/remote_protocol.x -+++ b/src/remote/remote_protocol.x -@@ -3086,6 +3086,14 @@ struct remote_connect_get_all_domain_stats_args { - unsigned int flags; - }; - -+struct remote_domain_event_callback_agent_lifecycle_msg { -+ int callbackID; -+ remote_nonnull_domain dom; -+ -+ int state; -+ int reason; -+}; -+ - struct remote_connect_get_all_domain_stats_ret { - remote_domain_stats_record retStats; - }; -@@ -5472,5 +5480,11 @@ enum remote_procedure { - * @generate: both - * @acl: none - */ -- REMOTE_PROC_DOMAIN_EVENT_CALLBACK_TUNABLE = 346 -+ REMOTE_PROC_DOMAIN_EVENT_CALLBACK_TUNABLE = 346, -+ -+ /** -+ * @generate: both -+ * @acl: none -+ */ -+ REMOTE_PROC_DOMAIN_EVENT_CALLBACK_AGENT_LIFECYCLE = 348 - }; -diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs -index 9d6d104..22097c4 100644 ---- a/src/remote_protocol-structs -+++ b/src/remote_protocol-structs -@@ -2547,6 +2547,12 @@ struct remote_connect_get_all_domain_stats_args { - u_int stats; - u_int flags; - }; -+struct remote_domain_event_callback_agent_lifecycle_msg { -+ int callbackID; -+ remote_nonnull_domain dom; -+ int state; -+ int reason; -+}; - struct remote_connect_get_all_domain_stats_ret { - struct { - u_int retStats_len; -@@ -2899,4 +2905,5 @@ enum remote_procedure { - REMOTE_PROC_DOMAIN_OPEN_GRAPHICS_FD = 343, - REMOTE_PROC_CONNECT_GET_ALL_DOMAIN_STATS = 344, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_TUNABLE = 346, -+ REMOTE_PROC_DOMAIN_EVENT_CALLBACK_AGENT_LIFECYCLE = 348, - }; -diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c -index 68c28fa..28f5319 100644 ---- a/tools/virsh-domain.c -+++ b/tools/virsh-domain.c -@@ -11276,6 +11276,43 @@ vshEventTunablePrint(virConnectPtr conn ATTRIBUTE_UNUSED, - vshEventDone(data->ctl); - } - -+VIR_ENUM_DECL(vshEventAgentLifecycleState) -+VIR_ENUM_IMPL(vshEventAgentLifecycleState, -+ VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_LAST, -+ N_("unknown"), -+ N_("connected"), -+ N_("disconnected")) -+ -+VIR_ENUM_DECL(vshEventAgentLifecycleReason) -+VIR_ENUM_IMPL(vshEventAgentLifecycleReason, -+ VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_LAST, -+ N_("unknown"), -+ N_("domain started"), -+ N_("channel event")) -+ -+#define UNKNOWNSTR(str) (str ? str : N_("unsupported value")) -+static void -+vshEventAgentLifecyclePrint(virConnectPtr conn ATTRIBUTE_UNUSED, -+ virDomainPtr dom, -+ int state, -+ int reason, -+ void *opaque) -+{ -+ vshDomEventData *data = opaque; -+ -+ if (!data->loop && *data->count) -+ return; -+ vshPrint(data->ctl, -+ _("event 'agent-lifecycle' for domain %s: state: '%s' reason: '%s'\n"), -+ virDomainGetName(dom), -+ UNKNOWNSTR(vshEventAgentLifecycleStateTypeToString(state)), -+ UNKNOWNSTR(vshEventAgentLifecycleReasonTypeToString(reason))); -+ -+ (*data->count)++; -+ if (!data->loop) -+ vshEventDone(data->ctl); -+} -+ - static vshEventCallback vshEventCallbacks[] = { - { "lifecycle", - VIR_DOMAIN_EVENT_CALLBACK(vshEventLifecyclePrint), }, -@@ -11311,6 +11348,8 @@ static vshEventCallback vshEventCallbacks[] = { - VIR_DOMAIN_EVENT_CALLBACK(vshEventBlockJobPrint), }, - { "tunable", - VIR_DOMAIN_EVENT_CALLBACK(vshEventTunablePrint), }, -+ { "agent-lifecycle", -+ VIR_DOMAIN_EVENT_CALLBACK(vshEventAgentLifecyclePrint), }, - }; - verify(VIR_DOMAIN_EVENT_ID_LAST == ARRAY_CARDINALITY(vshEventCallbacks)); - --- -2.1.3 - diff --git a/SOURCES/libvirt-event-introduce-new-event-for-tunable-values.patch b/SOURCES/libvirt-event-introduce-new-event-for-tunable-values.patch deleted file mode 100644 index 30dbf1f..0000000 --- a/SOURCES/libvirt-event-introduce-new-event-for-tunable-values.patch +++ /dev/null @@ -1,517 +0,0 @@ -From c4dcb385ad24712b6bd474d0ac0fec22f1978657 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pavel Hrdina -Date: Fri, 26 Sep 2014 12:43:55 +0200 -Subject: [PATCH] event: introduce new event for tunable values - -This new event will use typedParameters to expose what has been actually -updated and the reason is that we can in the future extend any tunable -values or add new tunable values. With typedParameters we don't have to -worry about creating some other events, we will just use this universal -event to inform user about updates. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit e426718129a91f80cfbe7261196da6945376db5c) - -Conflicts: - src/remote/remote_protocol.x: Context as 1069e3b9 is not - backported yet. - src/remote_protocol-structs: Context as 1069e3b9 is not - backported yet. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1115898 -Signed-off-by: Jiri Denemark ---- - daemon/remote.c | 45 +++++++++++++++++++++ - include/libvirt/libvirt.h.in | 22 +++++++++++ - src/conf/domain_event.c | 93 ++++++++++++++++++++++++++++++++++++++++++++ - src/conf/domain_event.h | 9 +++++ - src/libvirt_private.syms | 2 + - src/remote/remote_driver.c | 42 ++++++++++++++++++++ - src/remote/remote_protocol.x | 17 +++++++- - src/remote_protocol-structs | 9 +++++ - tools/virsh-domain.c | 33 ++++++++++++++++ - 9 files changed, 271 insertions(+), 1 deletion(-) - -diff --git a/daemon/remote.c b/daemon/remote.c -index 89714ca..fc43c69 100644 ---- a/daemon/remote.c -+++ b/daemon/remote.c -@@ -111,6 +111,13 @@ remoteDeserializeTypedParameters(remote_typed_param *args_params_val, - int *nparams); - - static int -+remoteSerializeTypedParameters(virTypedParameterPtr params, -+ int nparams, -+ remote_typed_param **ret_params_val, -+ u_int *ret_params_len, -+ unsigned int flags); -+ -+static int - remoteSerializeDomainDiskErrors(virDomainDiskErrorPtr errors, - int nerrors, - remote_domain_disk_error **ret_errors_val, -@@ -969,6 +976,43 @@ remoteRelayDomainEventBlockJob2(virConnectPtr conn, - } - - -+static int -+remoteRelayDomainEventTunable(virConnectPtr conn, -+ virDomainPtr dom, -+ virTypedParameterPtr params, -+ int nparams, -+ void *opaque) -+{ -+ daemonClientEventCallbackPtr callback = opaque; -+ remote_domain_event_callback_tunable_msg data; -+ -+ if (callback->callbackID < 0 || -+ !remoteRelayDomainEventCheckACL(callback->client, conn, dom)) -+ return -1; -+ -+ VIR_DEBUG("Relaying domain tunable event %s %d, callback %d", -+ dom->name, dom->id, callback->callbackID); -+ -+ /* build return data */ -+ memset(&data, 0, sizeof(data)); -+ data.callbackID = callback->callbackID; -+ make_nonnull_domain(&data.dom, dom); -+ -+ if (remoteSerializeTypedParameters(params, nparams, -+ &data.params.params_val, -+ &data.params.params_len, -+ VIR_TYPED_PARAM_STRING_OKAY) < 0) -+ return -1; -+ -+ remoteDispatchObjectEventSend(callback->client, remoteProgram, -+ REMOTE_PROC_DOMAIN_EVENT_CALLBACK_TUNABLE, -+ (xdrproc_t)xdr_remote_domain_event_callback_tunable_msg, -+ &data); -+ -+ return 0; -+} -+ -+ - static virConnectDomainEventGenericCallback domainEventCallbacks[] = { - VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventLifecycle), - VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventReboot), -@@ -987,6 +1031,7 @@ static virConnectDomainEventGenericCallback domainEventCallbacks[] = { - VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventPMSuspendDisk), - VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventDeviceRemoved), - VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventBlockJob2), -+ VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventTunable), - }; - - verify(ARRAY_CARDINALITY(domainEventCallbacks) == VIR_DOMAIN_EVENT_ID_LAST); -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 0b40727..56c665c 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -5167,6 +5167,27 @@ typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn, - const char *devAlias, - void *opaque); - -+/** -+ * virConnectDomainEventTunableCallback: -+ * @conn: connection object -+ * @dom: domain on which the event occurred -+ * @params: changed tunable values stored as array of virTypedParameter -+ * @nparams: size of the array -+ * @opaque: application specified data -+ * -+ * This callback occurs when tunable values are updated. The params must not -+ * be freed in the callback handler as it's done internally after the callback -+ * handler is executed. -+ * -+ * The callback signature to use when registering for an event of type -+ * VIR_DOMAIN_EVENT_ID_TUNABLE with virConnectDomainEventRegisterAny() -+ */ -+typedef void (*virConnectDomainEventTunableCallback)(virConnectPtr conn, -+ virDomainPtr dom, -+ virTypedParameterPtr params, -+ int nparams, -+ void *opaque); -+ - - /** - * VIR_DOMAIN_EVENT_CALLBACK: -@@ -5202,6 +5223,7 @@ typedef enum { - VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK = 14, /* virConnectDomainEventPMSuspendDiskCallback */ - VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED = 15, /* virConnectDomainEventDeviceRemovedCallback */ - VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 = 16, /* virConnectDomainEventBlockJobCallback */ -+ VIR_DOMAIN_EVENT_ID_TUNABLE = 17, /* virConnectDomainEventTunableCallback */ - - #ifdef VIR_ENUM_SENTINELS - VIR_DOMAIN_EVENT_ID_LAST -diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c -index 73ae289..bf187cd 100644 ---- a/src/conf/domain_event.c -+++ b/src/conf/domain_event.c -@@ -34,6 +34,7 @@ - #include "viralloc.h" - #include "virerror.h" - #include "virstring.h" -+#include "virtypedparam.h" - - #define VIR_FROM_THIS VIR_FROM_NONE - -@@ -52,6 +53,7 @@ static virClassPtr virDomainEventBalloonChangeClass; - static virClassPtr virDomainEventDeviceRemovedClass; - static virClassPtr virDomainEventPMClass; - static virClassPtr virDomainQemuMonitorEventClass; -+static virClassPtr virDomainEventTunableClass; - - - static void virDomainEventDispose(void *obj); -@@ -67,6 +69,7 @@ static void virDomainEventBalloonChangeDispose(void *obj); - static void virDomainEventDeviceRemovedDispose(void *obj); - static void virDomainEventPMDispose(void *obj); - static void virDomainQemuMonitorEventDispose(void *obj); -+static void virDomainEventTunableDispose(void *obj); - - static void - virDomainEventDispatchDefaultFunc(virConnectPtr conn, -@@ -203,6 +206,15 @@ struct _virDomainQemuMonitorEvent { - typedef struct _virDomainQemuMonitorEvent virDomainQemuMonitorEvent; - typedef virDomainQemuMonitorEvent *virDomainQemuMonitorEventPtr; - -+struct _virDomainEventTunable { -+ virDomainEvent parent; -+ -+ virTypedParameterPtr params; -+ int nparams; -+}; -+typedef struct _virDomainEventTunable virDomainEventTunable; -+typedef virDomainEventTunable *virDomainEventTunablePtr; -+ - - static int - virDomainEventsOnceInit(void) -@@ -285,6 +297,12 @@ virDomainEventsOnceInit(void) - sizeof(virDomainQemuMonitorEvent), - virDomainQemuMonitorEventDispose))) - return -1; -+ if (!(virDomainEventTunableClass = -+ virClassNew(virDomainEventClass, -+ "virDomainEventTunable", -+ sizeof(virDomainEventTunable), -+ virDomainEventTunableDispose))) -+ return -1; - return 0; - } - -@@ -420,6 +438,15 @@ virDomainQemuMonitorEventDispose(void *obj) - VIR_FREE(event->details); - } - -+static void -+virDomainEventTunableDispose(void *obj) -+{ -+ virDomainEventTunablePtr event = obj; -+ VIR_DEBUG("obj=%p", event); -+ -+ virTypedParamsFree(event->params, event->nparams); -+} -+ - - static void * - virDomainEventNew(virClassPtr klass, -@@ -1175,6 +1202,61 @@ virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, - devAlias); - } - -+/* This function consumes the params so caller don't have to care about -+ * freeing it even if error occurs. The reason is to not have to do deep -+ * copy of params. -+ */ -+static virObjectEventPtr -+virDomainEventTunableNew(int id, -+ const char *name, -+ unsigned char *uuid, -+ virTypedParameterPtr params, -+ int nparams) -+{ -+ virDomainEventTunablePtr ev; -+ -+ if (virDomainEventsInitialize() < 0) -+ goto error; -+ -+ if (!(ev = virDomainEventNew(virDomainEventTunableClass, -+ VIR_DOMAIN_EVENT_ID_TUNABLE, -+ id, name, uuid))) -+ goto error; -+ -+ ev->params = params; -+ ev->nparams = nparams; -+ -+ return (virObjectEventPtr)ev; -+ -+ error: -+ virTypedParamsFree(params, nparams); -+ return NULL; -+} -+ -+virObjectEventPtr -+virDomainEventTunableNewFromObj(virDomainObjPtr obj, -+ virTypedParameterPtr params, -+ int nparams) -+{ -+ return virDomainEventTunableNew(obj->def->id, -+ obj->def->name, -+ obj->def->uuid, -+ params, -+ nparams); -+} -+ -+virObjectEventPtr -+virDomainEventTunableNewFromDom(virDomainPtr dom, -+ virTypedParameterPtr params, -+ int nparams) -+{ -+ return virDomainEventTunableNew(dom->id, -+ dom->name, -+ dom->uuid, -+ params, -+ nparams); -+} -+ - - static void - virDomainEventDispatchDefaultFunc(virConnectPtr conn, -@@ -1366,6 +1448,17 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, - goto cleanup; - } - -+ case VIR_DOMAIN_EVENT_ID_TUNABLE: -+ { -+ virDomainEventTunablePtr tunableEvent; -+ tunableEvent = (virDomainEventTunablePtr)event; -+ ((virConnectDomainEventTunableCallback)cb)(conn, dom, -+ tunableEvent->params, -+ tunableEvent->nparams, -+ cbopaque); -+ goto cleanup; -+ } -+ - case VIR_DOMAIN_EVENT_ID_LAST: - break; - } -diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h -index a3330ca..dc0109c 100644 ---- a/src/conf/domain_event.h -+++ b/src/conf/domain_event.h -@@ -184,6 +184,15 @@ virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj, - virObjectEventPtr - virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, - const char *devAlias); -+virObjectEventPtr -+virDomainEventTunableNewFromObj(virDomainObjPtr obj, -+ virTypedParameterPtr params, -+ int nparams); -+virObjectEventPtr -+virDomainEventTunableNewFromDom(virDomainPtr dom, -+ virTypedParameterPtr params, -+ int nparams); -+ - - int - virDomainEventStateRegister(virConnectPtr conn, -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index ab81ba2..138d84f 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -472,6 +472,8 @@ virDomainEventStateRegister; - virDomainEventStateRegisterID; - virDomainEventTrayChangeNewFromDom; - virDomainEventTrayChangeNewFromObj; -+virDomainEventTunableNewFromDom; -+virDomainEventTunableNewFromObj; - virDomainEventWatchdogNewFromDom; - virDomainEventWatchdogNewFromObj; - virDomainQemuMonitorEventNew; -diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c -index 8bc4baa..6cf1aae 100644 ---- a/src/remote/remote_driver.c -+++ b/src/remote/remote_driver.c -@@ -326,6 +326,11 @@ remoteDomainBuildEventBlockJob2(virNetClientProgramPtr prog, - void *evdata, void *opaque); - - static void -+remoteDomainBuildEventCallbackTunable(virNetClientProgramPtr prog, -+ virNetClientPtr client, -+ void *evdata, void *opaque); -+ -+static void - remoteNetworkBuildEventLifecycle(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, - virNetClientPtr client ATTRIBUTE_UNUSED, - void *evdata, void *opaque); -@@ -476,6 +481,10 @@ static virNetClientProgramEvent remoteEvents[] = { - remoteDomainBuildEventBlockJob2, - sizeof(remote_domain_event_block_job_2_msg), - (xdrproc_t)xdr_remote_domain_event_block_job_2_msg }, -+ { REMOTE_PROC_DOMAIN_EVENT_CALLBACK_TUNABLE, -+ remoteDomainBuildEventCallbackTunable, -+ sizeof(remote_domain_event_callback_tunable_msg), -+ (xdrproc_t)xdr_remote_domain_event_callback_tunable_msg }, - }; - - -@@ -5500,6 +5509,39 @@ remoteDomainBuildEventCallbackDeviceRemoved(virNetClientProgramPtr prog ATTRIBUT - - - static void -+remoteDomainBuildEventCallbackTunable(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, -+ virNetClientPtr client ATTRIBUTE_UNUSED, -+ void *evdata, void *opaque) -+{ -+ virConnectPtr conn = opaque; -+ remote_domain_event_callback_tunable_msg *msg = evdata; -+ struct private_data *priv = conn->privateData; -+ virDomainPtr dom; -+ virTypedParameterPtr params = NULL; -+ int nparams = 0; -+ virObjectEventPtr event = NULL; -+ -+ if (remoteDeserializeTypedParameters(msg->params.params_val, -+ msg->params.params_len, -+ REMOTE_DOMAIN_EVENT_TUNABLE_MAX, -+ ¶ms, &nparams) < 0) -+ return; -+ -+ dom = get_nonnull_domain(conn, msg->dom); -+ if (!dom) { -+ virTypedParamsFree(params, nparams); -+ return; -+ } -+ -+ event = virDomainEventTunableNewFromDom(dom, params, nparams); -+ -+ virDomainFree(dom); -+ -+ remoteEventQueue(priv, event, msg->callbackID); -+} -+ -+ -+static void - remoteNetworkBuildEventLifecycle(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, - virNetClientPtr client ATTRIBUTE_UNUSED, - void *evdata, void *opaque) -diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x -index 8fc552f..e7ee2e8 100644 ---- a/src/remote/remote_protocol.x -+++ b/src/remote/remote_protocol.x -@@ -244,6 +244,9 @@ const REMOTE_NETWORK_DHCP_LEASES_MAX = 65536; - /* Upper limit on count of parameters returned via bulk stats API */ - const REMOTE_CONNECT_GET_ALL_DOMAIN_STATS_MAX = 4096; - -+/* Upper limit of message size for tunable event. */ -+const REMOTE_DOMAIN_EVENT_TUNABLE_MAX = 8388608; -+ - /* UUID. VIR_UUID_BUFLEN definition comes from libvirt.h */ - typedef opaque remote_uuid[VIR_UUID_BUFLEN]; - -@@ -2980,6 +2983,12 @@ struct remote_domain_event_block_job_2_msg { - int status; - }; - -+struct remote_domain_event_callback_tunable_msg { -+ int callbackID; -+ remote_nonnull_domain dom; -+ remote_typed_param params; -+}; -+ - struct remote_connect_get_cpu_model_names_args { - remote_nonnull_string arch; - int need_results; -@@ -5456,5 +5465,11 @@ enum remote_procedure { - * @acl: connect:search_domains - * @aclfilter: domain:read - */ -- REMOTE_PROC_CONNECT_GET_ALL_DOMAIN_STATS = 344 -+ REMOTE_PROC_CONNECT_GET_ALL_DOMAIN_STATS = 344, -+ -+ /** -+ * @generate: both -+ * @acl: none -+ */ -+ REMOTE_PROC_DOMAIN_EVENT_CALLBACK_TUNABLE = 346 - }; -diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs -index 899f1cc..9d6d104 100644 ---- a/src/remote_protocol-structs -+++ b/src/remote_protocol-structs -@@ -2435,6 +2435,14 @@ struct remote_domain_event_block_job_2_msg { - int type; - int status; - }; -+struct remote_domain_event_callback_tunable_msg { -+ int callbackID; -+ remote_nonnull_domain dom; -+ struct { -+ u_int params_len; -+ remote_typed_param * params_val; -+ } params; -+}; - struct remote_connect_get_cpu_model_names_args { - remote_nonnull_string arch; - int need_results; -@@ -2890,4 +2898,5 @@ enum remote_procedure { - REMOTE_PROC_CONNECT_GET_DOMAIN_CAPABILITIES = 342, - REMOTE_PROC_DOMAIN_OPEN_GRAPHICS_FD = 343, - REMOTE_PROC_CONNECT_GET_ALL_DOMAIN_STATS = 344, -+ REMOTE_PROC_DOMAIN_EVENT_CALLBACK_TUNABLE = 346, - }; -diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c -index 23395e5..f182dd0 100644 ---- a/tools/virsh-domain.c -+++ b/tools/virsh-domain.c -@@ -11245,6 +11245,37 @@ vshEventDeviceRemovedPrint(virConnectPtr conn ATTRIBUTE_UNUSED, - vshEventDone(data->ctl); - } - -+static void -+vshEventTunablePrint(virConnectPtr conn ATTRIBUTE_UNUSED, -+ virDomainPtr dom, -+ virTypedParameterPtr params, -+ int nparams, -+ void *opaque) -+{ -+ vshDomEventData *data = opaque; -+ size_t i; -+ char *value = NULL; -+ -+ if (!data->loop && *data->count) -+ return; -+ -+ vshPrint(data->ctl, -+ _("event 'tunable' for domain %s:\n"), -+ virDomainGetName(dom)); -+ -+ for (i = 0; i < nparams; i++) { -+ value = virTypedParameterToString(¶ms[i]); -+ if (value) { -+ vshPrint(data->ctl, _("\t%s: %s\n"), params[i].field, value); -+ VIR_FREE(value); -+ } -+ } -+ -+ (*data->count)++; -+ if (!data->loop) -+ vshEventDone(data->ctl); -+} -+ - static vshEventCallback vshEventCallbacks[] = { - { "lifecycle", - VIR_DOMAIN_EVENT_CALLBACK(vshEventLifecyclePrint), }, -@@ -11278,6 +11309,8 @@ static vshEventCallback vshEventCallbacks[] = { - VIR_DOMAIN_EVENT_CALLBACK(vshEventDeviceRemovedPrint), }, - { "block-job-2", - VIR_DOMAIN_EVENT_CALLBACK(vshEventBlockJobPrint), }, -+ { "tunable", -+ VIR_DOMAIN_EVENT_CALLBACK(vshEventTunablePrint), }, - }; - verify(VIR_DOMAIN_EVENT_ID_LAST == ARRAY_CARDINALITY(vshEventCallbacks)); - --- -2.1.1 - diff --git a/SOURCES/libvirt-event_example-cleanup-example-code-for-tunable-event.patch b/SOURCES/libvirt-event_example-cleanup-example-code-for-tunable-event.patch deleted file mode 100644 index 0927b28..0000000 --- a/SOURCES/libvirt-event_example-cleanup-example-code-for-tunable-event.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 3e96914925112a76ee1071696d70ae4be8281682 Mon Sep 17 00:00:00 2001 -Message-Id: <3e96914925112a76ee1071696d70ae4be8281682@dist-git> -From: Pavel Hrdina -Date: Fri, 26 Sep 2014 12:43:59 +0200 -Subject: [PATCH] event_example: cleanup example code for tunable event - -Signed-off-by: Pavel Hrdina -(cherry picked from commit f06a6257d5c2c29aff5140c38583a7fcd07d2b93) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1115898 -Signed-off-by: Jiri Denemark ---- - examples/object-events/event-test.c | 15 ++++----------- - 1 file changed, 4 insertions(+), 11 deletions(-) - -diff --git a/examples/object-events/event-test.c b/examples/object-events/event-test.c -index faf0cf2..0c6faf4 100644 ---- a/examples/object-events/event-test.c -+++ b/examples/object-events/event-test.c -@@ -476,15 +476,6 @@ myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED, - printf("%s EVENT: Domain %s(%d) tunable updated:\n", - __func__, virDomainGetName(dom), virDomainGetID(dom)); - --#ifdef WIN32 --/* MinGW doesn't know the lld/llu so we have to use I64f/I64u instead. */ --# define LLD_FORMAT "%I64d" --# define LLU_FORMAT "%I64u" --#else /* WIN32 */ --# define LLD_FORMAT "%lld" --# define LLU_FORMAT "%llu" --#endif /* WIN32 */ -- - for (i = 0; i < nparams; i++) { - switch (params[i].type) { - case VIR_TYPED_PARAM_INT: -@@ -494,10 +485,12 @@ myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED, - printf("\t%s: %u\n", params[i].field, params[i].value.ui); - break; - case VIR_TYPED_PARAM_LLONG: -- printf("\t%s: " LLD_FORMAT "\n", params[i].field, params[i].value.l); -+ printf("\t%s: %" PRId64 "\n", params[i].field, -+ (int64_t) params[i].value.l); - break; - case VIR_TYPED_PARAM_ULLONG: -- printf("\t%s: " LLU_FORMAT "\n", params[i].field, params[i].value.ul); -+ printf("\t%s: %" PRIu64 "\n", params[i].field, -+ (uint64_t) params[i].value.ul); - break; - case VIR_TYPED_PARAM_DOUBLE: - printf("\t%s: %g\n", params[i].field, params[i].value.d); --- -2.1.1 - diff --git a/SOURCES/libvirt-examples-Add-example-polkit-ACL-rules.patch b/SOURCES/libvirt-examples-Add-example-polkit-ACL-rules.patch new file mode 100644 index 0000000..324ac4e --- /dev/null +++ b/SOURCES/libvirt-examples-Add-example-polkit-ACL-rules.patch @@ -0,0 +1,230 @@ +From 80ea7f1e17cc676c591988de47396dd24d390631 Mon Sep 17 00:00:00 2001 +Message-Id: <80ea7f1e17cc676c591988de47396dd24d390631@dist-git> +From: Jiri Denemark +Date: Tue, 4 Aug 2015 14:05:52 +0200 +Subject: [PATCH] examples: Add example polkit ACL rules + +Creating ACL rules is not exactly easy and existing examples are pretty +simple. This patch adds a somewhat complex example which defines several +roles. Admins can do everything, operators can do basic operations +on any domain and several groups of users who act as operators but only +on a limited set of domains. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 29b5167417483ef80f6c3fce12811b59a1e2bd55) + +https://bugzilla.redhat.com/show_bug.cgi?id=1115289 + +Signed-off-by: Jiri Denemark +--- + Makefile.am | 2 +- + configure.ac | 1 + + docs/aclpolkit.html.in | 6 ++ + examples/polkit/Makefile.am | 17 +++++ + examples/polkit/libvirt-acl.rules | 130 ++++++++++++++++++++++++++++++++++++++ + libvirt.spec.in | 3 + + 6 files changed, 158 insertions(+), 1 deletion(-) + create mode 100644 examples/polkit/Makefile.am + create mode 100644 examples/polkit/libvirt-acl.rules + +diff --git a/Makefile.am b/Makefile.am +index 91b943b..d338d5a 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -23,7 +23,7 @@ SUBDIRS = . gnulib/lib include src daemon tools docs gnulib/tests \ + tests po examples/object-events examples/hellolibvirt \ + examples/dominfo examples/domsuspend examples/apparmor \ + examples/xml/nwfilter examples/openauth examples/systemtap \ +- tools/wireshark examples/dommigrate \ ++ tools/wireshark examples/dommigrate examples/polkit \ + examples/lxcconvert examples/domtop + + ACLOCAL_AMFLAGS = -I m4 +diff --git a/configure.ac b/configure.ac +index f3ae6ca..b28d990 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2811,6 +2811,7 @@ AC_CONFIG_FILES([\ + examples/systemtap/Makefile \ + examples/xml/nwfilter/Makefile \ + examples/lxcconvert/Makefile \ ++ examples/polkit/Makefile \ + tools/wireshark/Makefile \ + tools/wireshark/src/Makefile]) + AC_OUTPUT +diff --git a/docs/aclpolkit.html.in b/docs/aclpolkit.html.in +index e5a9b16..dae0814 100644 +--- a/docs/aclpolkit.html.in ++++ b/docs/aclpolkit.html.in +@@ -348,6 +348,12 @@ + lookup method. +

+ ++

++ See ++ source code ++ for a more complex example. ++

++ +

Example: restricting ability to connect to drivers

+ +

+diff --git a/examples/polkit/Makefile.am b/examples/polkit/Makefile.am +new file mode 100644 +index 0000000..4d213e8 +--- /dev/null ++++ b/examples/polkit/Makefile.am +@@ -0,0 +1,17 @@ ++## Copyright (C) 2015 Red Hat, Inc. ++## ++## This library is free software; you can redistribute it and/or ++## modify it under the terms of the GNU Lesser General Public ++## License as published by the Free Software Foundation; either ++## version 2.1 of the License, or (at your option) any later version. ++## ++## This library is distributed in the hope that it will be useful, ++## but WITHOUT ANY WARRANTY; without even the implied warranty of ++## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++## Lesser General Public License for more details. ++## ++## You should have received a copy of the GNU Lesser General Public ++## License along with this library. If not, see ++## . ++ ++EXTRA_DIST = libvirt-acl.rules +diff --git a/examples/polkit/libvirt-acl.rules b/examples/polkit/libvirt-acl.rules +new file mode 100644 +index 0000000..dd68365 +--- /dev/null ++++ b/examples/polkit/libvirt-acl.rules +@@ -0,0 +1,130 @@ ++/* ++ * This example defines two groups of roles any user/group can be assigned to. ++ * An "admin" role which grants full access to all APIs on all objects to its ++ * members, and other roles which allows their members to all APIs defined in ++ * restrictedActions on domains matching a regular expressions assigned to ++ * each role. (Jump below the Role class definition to see them.) Users who ++ * belong to an "operator" role can act on any domain (matching ".*" RE), ++ * while members of "userA", "userB", and "userC" roles are limited by more ++ * specific REs. ++ * ++ * A virtualization host admin would define domains with names prefixed by ++ * customer names and create a separate role for each customer restricting ++ * its members to manage only domains with the corresponding prefix. ++ */ ++ ++function Role(name) { ++ this.name = name; ++ ++ this.users = []; ++ this.groups = []; ++ ++ this.check = function(subject, api, domain) { ++ var validUser = false ++ ++ if (this.users.indexOf(subject.user) >= 0) { ++ validUser = true; ++ } else { ++ for (var i = 0; i < subject.groups.length; i++) { ++ if (this.groups.indexOf(subject.groups[i]) >= 0) { ++ validUser = true; ++ break; ++ } ++ } ++ } ++ ++ if (validUser && ++ (this.name == "admin" || ++ !domain || ++ (this.domains && domain.match(this.domains)))) { ++ var msg = "Access granted: " + ++ "user = " + subject.user + ++ ", groups = [" + subject.groups + "]" + ++ ", role = " + this.name + ++ ", api = " + api; ++ if (domain) ++ msg += ", domain = " + domain; ++ polkit.log(msg); ++ return true ++ } ++ ++ return false; ++ }; ++} ++ ++ ++/* Basic operations and monitoring on a limited set of domains. */ ++var userA = new Role("userA"); ++userA.domains = /^a/; ++userA.users = ["userA1", "userA2", "userA3", "multiUser"]; ++userA.groups = ["groupA1", "groupA2"]; ++ ++var userB = new Role("userB"); ++userB.domains = /^b/; ++userB.users = ["userB1", "userB2", "userB3", "multiUser"]; ++userB.groups = ["groupB1", "groupB2", "multiGroup"]; ++ ++var userC = new Role("userC"); ++userC.domains = /^c/; ++userC.users = ["userC1", "userC2", "userC3"]; ++userC.groups = ["groupC1", "groupC2", "multiGroup"]; ++ ++/* Same as users but on any domain. */ ++var operator = new Role("operator"); ++operator.domains = /.*/; ++operator.users = ["powerUser1", "powerUser2"]; ++operator.groups = ["powerGroup1", "powerGroup2", "powerGroup3"]; ++ ++var users = [operator, userA, userB, userC]; ++ ++/* Full access. */ ++var admin = new Role("admin"); ++admin.users = ["adminUser1"]; ++admin.groups = ["adminGroup1"]; ++ ++ ++restrictedActions = [ ++ "domain.core-dump", ++ "domain.fs-freeze", ++ "domain.fs-trim", ++ "domain.getattr", ++ "domain.hibernate", ++ "domain.init-control", ++ "domain.inject-nmi", ++ "domain.open-device", ++ "domain.open-graphics", ++ "domain.pm-control", ++ "domain.read", ++ "domain.reset", ++ "domain.save", ++ "domain.screenshot", ++ "domain.send-input", ++ "domain.send-signal", ++ "domain.set-password", ++ "domain.set-time", ++ "domain.snapshot", ++ "domain.start", ++ "domain.stop", ++ "domain.suspend" ++]; ++ ++polkit.addRule(function(action, subject) { ++ if (action.id.indexOf("org.libvirt.api.") != 0) ++ return polkit.Result.NOT_HANDLED; ++ ++ var api = action.id.replace("org.libvirt.api.", ""); ++ var domain = action.lookup("domain_name"); ++ ++ if (admin.check(subject, api, domain)) ++ return polkit.Result.YES; ++ ++ if (restrictedActions.indexOf(api) < 0) ++ return polkit.Result.NOT_HANDLED; ++ ++ for (var i = 0; i < users.length; i++) { ++ if (users[i].check(subject, api, domain)) ++ return polkit.Result.YES; ++ } ++ ++ return polkit.Result.NO; ++}); diff --git a/SOURCES/libvirt-examples-Add-support-for-the-guest-agent-lifecycle-event.patch b/SOURCES/libvirt-examples-Add-support-for-the-guest-agent-lifecycle-event.patch deleted file mode 100644 index 57937db..0000000 --- a/SOURCES/libvirt-examples-Add-support-for-the-guest-agent-lifecycle-event.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 5c899f2d34886652affe2bdd360d7286ab5804cb Mon Sep 17 00:00:00 2001 -Message-Id: <5c899f2d34886652affe2bdd360d7286ab5804cb@dist-git> -From: Peter Krempa -Date: Mon, 24 Nov 2014 17:51:19 +0100 -Subject: [PATCH] examples: Add support for the guest agent lifecycle event - -https://bugzilla.redhat.com/show_bug.cgi?id=1146944 - -Add code to support the event in the object-event example. - -(cherry picked from commit 4ca2744e8b8dcb3e05b332b6419c85b34697ab42) - -Signed-off-by: Jiri Denemark ---- - examples/object-events/event-test.c | 67 ++++++++++++++++++++++++++++++++++++- - 1 file changed, 66 insertions(+), 1 deletion(-) - -diff --git a/examples/object-events/event-test.c b/examples/object-events/event-test.c -index 0c6faf4..d94babd 100644 ---- a/examples/object-events/event-test.c -+++ b/examples/object-events/event-test.c -@@ -244,6 +244,47 @@ networkEventToString(int event) - return ret; - } - -+static const char * -+guestAgentLifecycleEventStateToString(int event) -+{ -+ const char *ret = ""; -+ -+ switch ((virConnectDomainEventAgentLifecycleState) event) { -+ case VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED: -+ ret = "Disconnected"; -+ break; -+ -+ case VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED: -+ ret = "Connected"; -+ break; -+ } -+ -+ return ret; -+} -+ -+static const char * -+guestAgentLifecycleEventReasonToString(int event) -+{ -+ const char *ret = ""; -+ -+ switch ((virConnectDomainEventAgentLifecycleReason) event) { -+ case VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN: -+ ret = "Unknown"; -+ break; -+ -+ case VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED: -+ ret = "Domain started"; -+ break; -+ -+ case VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL: -+ ret = "Channel event"; -+ break; -+ } -+ -+ return ret; -+} -+ -+ - static int myDomainEventCallback1(virConnectPtr conn ATTRIBUTE_UNUSED, - virDomainPtr dom, - int event, -@@ -509,6 +550,21 @@ myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED, - return 0; - } - -+static int -+myDomainEventAgentLifecycleCallback(virConnectPtr conn ATTRIBUTE_UNUSED, -+ virDomainPtr dom, -+ int state, -+ int reason, -+ void *opaque ATTRIBUTE_UNUSED) -+{ -+ printf("%s EVENT: Domain %s(%d) guest agent state changed: %s reason: %s\n", -+ __func__, virDomainGetName(dom), virDomainGetID(dom), -+ guestAgentLifecycleEventStateToString(state), -+ guestAgentLifecycleEventReasonToString(reason)); -+ -+ return 0; -+} -+ - static void myFreeFunc(void *opaque) - { - char *str = opaque; -@@ -551,6 +607,7 @@ int main(int argc, char **argv) - int callback15ret = -1; - int callback16ret = -1; - int callback17ret = -1; -+ int callback18ret = -1; - struct sigaction action_stop; - - memset(&action_stop, 0, sizeof(action_stop)); -@@ -674,6 +731,11 @@ int main(int argc, char **argv) - VIR_DOMAIN_EVENT_ID_TUNABLE, - VIR_DOMAIN_EVENT_CALLBACK(myDomainEventTunableCallback), - strdup("tunable"), myFreeFunc); -+ callback18ret = virConnectDomainEventRegisterAny(dconn, -+ NULL, -+ VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE, -+ VIR_DOMAIN_EVENT_CALLBACK(myDomainEventAgentLifecycleCallback), -+ strdup("guest agent lifecycle"), myFreeFunc); - - if ((callback1ret != -1) && - (callback2ret != -1) && -@@ -690,7 +752,8 @@ int main(int argc, char **argv) - (callback14ret != -1) && - (callback15ret != -1) && - (callback16ret != -1) && -- (callback17ret != -1)) { -+ (callback17ret != -1) && -+ (callback18ret != -1)) { - if (virConnectSetKeepAlive(dconn, 5, 3) < 0) { - virErrorPtr err = virGetLastError(); - fprintf(stderr, "Failed to start keepalive protocol: %s\n", -@@ -723,6 +786,8 @@ int main(int argc, char **argv) - virConnectDomainEventDeregisterAny(dconn, callback15ret); - virConnectNetworkEventDeregisterAny(dconn, callback16ret); - virConnectDomainEventDeregisterAny(dconn, callback17ret); -+ virConnectDomainEventDeregisterAny(dconn, callback18ret); -+ - if (callback8ret != -1) - virConnectDomainEventDeregisterAny(dconn, callback8ret); - } --- -2.1.3 - diff --git a/SOURCES/libvirt-formatdomain-Update-loader-example-to-match-the-rest.patch b/SOURCES/libvirt-formatdomain-Update-loader-example-to-match-the-rest.patch deleted file mode 100644 index aa88a03..0000000 --- a/SOURCES/libvirt-formatdomain-Update-loader-example-to-match-the-rest.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 41e7c244a705ba252c69576011f76f40188b6541 Mon Sep 17 00:00:00 2001 -Message-Id: <41e7c244a705ba252c69576011f76f40188b6541@dist-git> -From: Michal Privoznik -Date: Thu, 18 Sep 2014 11:45:36 +0200 -Subject: [PATCH] formatdomain: Update example to match the rest - -https://bugzilla.redhat.com/show_bug.cgi?id=1026772 - -At the beginning when I was inventing attributes and - I've introduced this @readonly attribute to the loader -element. It accepted values 'on' and 'off'. However, later, during the -review process, that has changed to 'yes' and 'no', but the example -XML snippet wasn't updated, so while the description is correct, the -example isn't. - -Reported-by: Laszlo Ersek -Signed-off-by: Michal Privoznik -(cherry picked from commit dcf7d0423c1ad79e45df4ddd1cb619603cf221e7) -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index a3ab5cf..b947848 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -102,7 +102,7 @@ - ... - <os> - <type>hvm</type> -- <loader readonly='on' type='rom'>/usr/lib/xen/boot/hvmloader</loader> -+ <loader readonly='yes' type='rom'>/usr/lib/xen/boot/hvmloader</loader> - <nvram template='/usr/share/OVMF/OVMF_VARS.fd'>/var/lib/libvirt/nvram/guest_VARS.fd</nvram> - <boot dev='hd'/> - <boot dev='cdrom'/> --- -2.1.0 - diff --git a/SOURCES/libvirt-getstats-add-block.n.path-stat.patch b/SOURCES/libvirt-getstats-add-block.n.path-stat.patch deleted file mode 100644 index d55142b..0000000 --- a/SOURCES/libvirt-getstats-add-block.n.path-stat.patch +++ /dev/null @@ -1,113 +0,0 @@ -From fce8dc52172734630bd5d274dd4bdf9845948f92 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Eric Blake -Date: Wed, 17 Dec 2014 03:09:02 -0700 -Subject: [PATCH] getstats: add block.n.path stat - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -I'm about to make block stats optionally more complex to cover -backing chains, where block.count will no longer equal the number -of for a domain. For these reasons, it is nicer if the -statistics output includes the source path (for local files). -This patch doesn't add anything for network disks, although we -may decide to add that later. - -With this patch, I now see the following for the same domain as -in the previous patch (one qcow2 file, and an empty cdrom drive): -$ virsh domstats --block foo -Domain: 'foo' - block.count=2 - block.0.name=hda - block.0.path=/var/lib/libvirt/images/foo.qcow2 - block.1.name=hdc - -* src/libvirt-domain.c (virConnectGetAllDomainStats): Document -new field. -* tools/virsh.pod (domstats): Document new field. -* src/qemu/qemu_driver.c (qemuDomainGetStatsBlock): Return the new -stat for local files/block devices. -(QEMU_ADD_NAME_PARAM): Add parameter. -(qemuDomainGetStatsInterface): Update caller. - -Signed-off-by: Eric Blake -(cherry picked from commit 7b499262cb6d2bc2361bc4cd3742c0cea331666f) - -Conflicts: - src/libvirt-domain.c - file split from libvirt.c -Signed-off-by: Jiri Denemark ---- - src/libvirt.c | 3 +++ - src/qemu/qemu_driver.c | 11 +++++++---- - tools/virsh.pod | 2 ++ - 3 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/src/libvirt.c b/src/libvirt.c -index 1097693..2885965 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21603,6 +21603,9 @@ virConnectGetDomainCapabilities(virConnectPtr conn, - * "block..name" - name of the block device as string. - * matches the target name (vda/sda/hda) of the - * block device. -+ * "block..path" - string describing the source of block device , -+ * if it is a file or block device (omitted for network -+ * sources and drives with no media inserted). - * "block..rd.reqs" - number of read requests as unsigned long long. - * "block..rd.bytes" - number of read bytes as unsigned long long. - * "block..rd.times" - total time (ns) spent on reads as -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index f0935d6..03b62d8 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17898,11 +17898,11 @@ do { \ - goto cleanup; \ - } while (0) - --#define QEMU_ADD_NAME_PARAM(record, maxparams, type, num, name) \ -+#define QEMU_ADD_NAME_PARAM(record, maxparams, type, subtype, num, name) \ - do { \ - char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; \ - snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, \ -- "%s.%zu.name", type, num); \ -+ "%s.%zu.%s", type, num, subtype); \ - if (virTypedParamsAddString(&(record)->params, \ - &(record)->nparams, \ - maxparams, \ -@@ -17948,7 +17948,7 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - memset(&tmp, 0, sizeof(tmp)); - - QEMU_ADD_NAME_PARAM(record, maxparams, -- "net", i, dom->def->nets[i]->ifname); -+ "net", "name", i, dom->def->nets[i]->ifname); - - if (virNetInterfaceStats(dom->def->nets[i]->ifname, &tmp) < 0) { - virResetLastError(); -@@ -18041,7 +18041,10 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - qemuBlockStats *entry; - virDomainDiskDefPtr disk = dom->def->disks[i]; - -- QEMU_ADD_NAME_PARAM(record, maxparams, "block", i, disk->dst); -+ QEMU_ADD_NAME_PARAM(record, maxparams, "block", "name", i, disk->dst); -+ if (virStorageSourceIsLocalStorage(disk->src) && disk->src->path) -+ QEMU_ADD_NAME_PARAM(record, maxparams, "block", "path", -+ i, disk->src->path); - - if (abbreviated || !disk->info.alias || - !(entry = virHashLookup(stats, disk->info.alias))) { -diff --git a/tools/virsh.pod b/tools/virsh.pod -index d88fa9f..beef855 100644 ---- a/tools/virsh.pod -+++ b/tools/virsh.pod -@@ -871,6 +871,8 @@ I<--interface> returns: - I<--block> returns: - "block.count" - number of block devices on this domain, - "block..name" - name of the target of the block device , -+"block..path" - file source of block device , if it is a -+local file or block device, - "block..rd.reqs" - number of read requests, - "block..rd.bytes" - number of read bytes, - "block..rd.times" - total time (ns) spent on reads, --- -2.2.0 - diff --git a/SOURCES/libvirt-getstats-add-new-flag-for-block-backing-chain.patch b/SOURCES/libvirt-getstats-add-new-flag-for-block-backing-chain.patch deleted file mode 100644 index d51cb89..0000000 --- a/SOURCES/libvirt-getstats-add-new-flag-for-block-backing-chain.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 1ee014e89e853b83dc0d384e67f4d073034b4995 Mon Sep 17 00:00:00 2001 -Message-Id: <1ee014e89e853b83dc0d384e67f4d073034b4995@dist-git> -From: Eric Blake -Date: Wed, 17 Dec 2014 03:09:07 -0700 -Subject: [PATCH] getstats: add new flag for block backing chain - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -This patch introduces access to allocation information about -a backing chain of a live domain. While querying storage -volumes for read-only disks could provide some of the details, -we do NOT want to read() a file while qemu is writing it. -Also, there is one case where we have to rely on qemu: when -doing a block commit into a backing file, where that file is -stored in qcow2 format on a host block device, we want to know -the current highest write offset into that image, in order to -know if the disk must be resized larger. qemu-img does not -(currently) show this information, and none of the earlier -block APIs were extensible enough to expose it. But -virDomainListGetStats is perfect for the job! - -We don't need a new group of statistics, as the existing block -group is sufficient. On the other hand, as existing libvirt -releases already report 1:1 mapping of block.count to -devices, changing the array size could confuse older clients; -and even with newer clients, the time and memory taken to -report additional statistics is not always necessary (backing -files are generally read-only except for block-commit, so while -read statistics may change, sizing statistics will not). So -the choice here is to add a new flag that only newer callers -will pass, when they are prepared for the additional information. - -This patch introduces the new API, but it will take more -patches to get it implemented for qemu. - -* include/libvirt/libvirt-domain.h -(VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING): New flag. -* src/libvirt-domain.c (virConnectGetAllDomainStats): Document it, -and add a new field when it is in use. -* tools/virsh-domain-monitor.c (cmdDomstats): Use new flag. -* tools/virsh.pod (domstats): Document it. - -Signed-off-by: Eric Blake -(cherry picked from commit 4bffafb2eb076255dbd7e0d96f2b33a4fea0650e) - -Conflicts: - include/libvirt/libvirt-domain.h - file split from libvirt.h.in - src/libvirt-domain.c - file split from libvirt.c -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 1 + - src/libvirt.c | 15 ++++++++++++--- - tools/virsh-domain-monitor.c | 7 +++++++ - tools/virsh.pod | 15 +++++++++++---- - 4 files changed, 31 insertions(+), 7 deletions(-) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 9099cc4..94de8a6 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -2533,6 +2533,7 @@ typedef enum { - VIR_CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF = VIR_CONNECT_LIST_DOMAINS_SHUTOFF, - VIR_CONNECT_GET_ALL_DOMAINS_STATS_OTHER = VIR_CONNECT_LIST_DOMAINS_OTHER, - -+ VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING = 1 << 30, /* include backing chain for block stats */ - VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS = 1 << 31, /* enforce requested stats */ - } virConnectGetAllDomainStatsFlags; - -diff --git a/src/libvirt.c b/src/libvirt.c -index 2885965..5315881 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21596,13 +21596,22 @@ virConnectGetDomainCapabilities(virConnectPtr conn, - * "net..tx.errs" - transmission errors as unsigned long long. - * "net..tx.drop" - transmit packets dropped as unsigned long long. - * -- * VIR_DOMAIN_STATS_BLOCK: Return block devices statistics. -+ * VIR_DOMAIN_STATS_BLOCK: Return block devices statistics. By default, -+ * this information is limited to the active layer of each of the -+ * domain (where block.count is equal to the number of disks), but adding -+ * VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING to @flags will expand the -+ * array to cover backing chains (block.count corresponds to the number -+ * of host resources used together to provide the guest disks). - * The typed parameter keys are in this format: -- * "block.count" - number of block devices on this domain -+ * "block.count" - number of block devices in the subsequent list, - * as unsigned int. - * "block..name" - name of the block device as string. - * matches the target name (vda/sda/hda) of the -- * block device. -+ * block device. If the backing chain is listed, -+ * this name is the same for all host resources tied -+ * to the same guest device. -+ * "block..backingIndex" - unsigned int giving the index, -+ * only used when backing images are listed. - * "block..path" - string describing the source of block device , - * if it is a file or block device (omitted for network - * sources and drives with no media inserted). -diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c -index d013ca8..5c758cd 100644 ---- a/tools/virsh-domain-monitor.c -+++ b/tools/virsh-domain-monitor.c -@@ -2032,6 +2032,10 @@ static const vshCmdOptDef opts_domstats[] = { - .type = VSH_OT_BOOL, - .help = N_("enforce requested stats parameters"), - }, -+ {.name = "backing", -+ .type = VSH_OT_BOOL, -+ .help = N_("add backing chain information to block stats"), -+ }, - {.name = "domain", - .type = VSH_OT_ARGV, - .flags = VSH_OFLAG_NONE, -@@ -2125,6 +2129,9 @@ cmdDomstats(vshControl *ctl, const vshCmd *cmd) - if (vshCommandOptBool(cmd, "enforce")) - flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS; - -+ if (vshCommandOptBool(cmd, "backing")) -+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING; -+ - if (vshCommandOptBool(cmd, "domain")) { - if (VIR_ALLOC_N(domlist, 1) < 0) - goto cleanup; -diff --git a/tools/virsh.pod b/tools/virsh.pod -index beef855..c5b176a 100644 ---- a/tools/virsh.pod -+++ b/tools/virsh.pod -@@ -813,7 +813,7 @@ that require a block device name (such as I or - I for disk snapshots) will accept either target - or unique source names printed by this command. - --=item B [I<--raw>] [I<--enforce>] [I<--state>] -+=item B [I<--raw>] [I<--enforce>] [I<--backing>] [I<--state>] - [I<--cpu-total>] [I<--balloon>] [I<--vcpu>] [I<--interface>] [I<--block>] - [[I<--list-active>] [I<--list-inactive>] [I<--list-persistent>] - [I<--list-transient>] [I<--list-running>] [I<--list-paused>] -@@ -868,9 +868,16 @@ I<--interface> returns: - "net..tx.errs" - number of transmission errors, - "net..tx.drop" - number of transmit packets dropped - --I<--block> returns: --"block.count" - number of block devices on this domain, --"block..name" - name of the target of the block device , -+I<--block> returns information about disks associated with each -+domain. Using the I<--backing> flag extends this information to -+cover all resources in the backing chain, rather than the default -+of limiting information to the active layer for each guest disk. -+Information listed includes: -+"block.count" - number of block devices being listed, -+"block..name" - name of the target of the block device (the -+same name for multiple entries if I<--backing> is present), -+"block..backingIndex" - when I<--backing> is present, matches up -+with the index listed in domain XML for backing files, - "block..path" - file source of block device , if it is a - local file or block device, - "block..rd.reqs" - number of read requests, --- -2.2.0 - diff --git a/SOURCES/libvirt-getstats-avoid-memory-leak-on-OOM.patch b/SOURCES/libvirt-getstats-avoid-memory-leak-on-OOM.patch deleted file mode 100644 index 1d43bc8..0000000 --- a/SOURCES/libvirt-getstats-avoid-memory-leak-on-OOM.patch +++ /dev/null @@ -1,67 +0,0 @@ -From d5ce6b8bd0ae390ceb6311030d41889b7e6cd9f7 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Eric Blake -Date: Wed, 17 Dec 2014 03:08:59 -0700 -Subject: [PATCH] getstats: avoid memory leak on OOM - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -qemuDomainGetStatsBlock() could leak a stats hash table if it -encountered OOM while populating the virTypedParameters. -Oddly, the fix doesn't even touch qemuDomainGetStatsBlock :) - -* src/qemu/qemu_driver.c (QEMU_ADD_COUNT_PARAM) -(QEMU_ADD_NAME_PARAM): Don't return early. -(qemuDomainGetStatsInterface): Adjust caller. - -Signed-off-by: Eric Blake -(cherry picked from commit 2f61602edbc96309116d7c8eff61e6a37ff4d253) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 4498194..33a93f1 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17895,7 +17895,7 @@ do { \ - maxparams, \ - param_name, \ - count) < 0) \ -- return -1; \ -+ goto cleanup; \ - } while (0) - - #define QEMU_ADD_NAME_PARAM(record, maxparams, type, num, name) \ -@@ -17908,7 +17908,7 @@ do { \ - maxparams, \ - param_name, \ - name) < 0) \ -- return -1; \ -+ goto cleanup; \ - } while (0) - - #define QEMU_ADD_NET_PARAM(record, maxparams, num, name, value) \ -@@ -17933,6 +17933,7 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - { - size_t i; - struct _virDomainInterfaceStats tmp; -+ int ret = -1; - - if (!virDomainObjIsActive(dom)) - return 0; -@@ -17972,7 +17973,9 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - "tx.drop", tmp.tx_drop); - } - -- return 0; -+ ret = 0; -+ cleanup: -+ return ret; - } - - #undef QEMU_ADD_NET_PARAM --- -2.2.0 - diff --git a/SOURCES/libvirt-getstats-crawl-backing-chain-for-qemu.patch b/SOURCES/libvirt-getstats-crawl-backing-chain-for-qemu.patch deleted file mode 100644 index 5fce433..0000000 --- a/SOURCES/libvirt-getstats-crawl-backing-chain-for-qemu.patch +++ /dev/null @@ -1,263 +0,0 @@ -From 6d5a89f712623c56228aa50e211b58dabf881cc5 Mon Sep 17 00:00:00 2001 -Message-Id: <6d5a89f712623c56228aa50e211b58dabf881cc5@dist-git> -From: Eric Blake -Date: Wed, 17 Dec 2014 03:09:09 -0700 -Subject: [PATCH] getstats: crawl backing chain for qemu - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -Wire up backing chain recursion. For the first time, it is now -possible to get libvirt to expose that qemu tracks read statistics -on backing files, as well as report maximum extent written on a -backing file during a block-commit operation. - -For a running domain, where one of the two images has a backing -file, I see the traditional output: - -$ virsh domstats --block testvm2 -Domain: 'testvm2' - block.count=2 - block.0.name=vda - block.0.path=/tmp/wrapper.qcow2 - block.0.rd.reqs=1 - block.0.rd.bytes=512 - block.0.rd.times=28858 - block.0.wr.reqs=0 - block.0.wr.bytes=0 - block.0.wr.times=0 - block.0.fl.reqs=0 - block.0.fl.times=0 - block.0.allocation=0 - block.0.capacity=1310720000 - block.0.physical=200704 - block.1.name=vdb - block.1.path=/dev/sda7 - block.1.rd.reqs=0 - block.1.rd.bytes=0 - block.1.rd.times=0 - block.1.wr.reqs=0 - block.1.wr.bytes=0 - block.1.wr.times=0 - block.1.fl.reqs=0 - block.1.fl.times=0 - block.1.allocation=0 - block.1.capacity=1310720000 - -vs. the new output: - -$ virsh domstats --block --backing testvm2 -Domain: 'testvm2' - block.count=3 - block.0.name=vda - block.0.path=/tmp/wrapper.qcow2 - block.0.rd.reqs=1 - block.0.rd.bytes=512 - block.0.rd.times=28858 - block.0.wr.reqs=0 - block.0.wr.bytes=0 - block.0.wr.times=0 - block.0.fl.reqs=0 - block.0.fl.times=0 - block.0.allocation=0 - block.0.capacity=1310720000 - block.0.physical=200704 - block.1.name=vda - block.1.path=/dev/sda6 - block.1.backingIndex=1 - block.1.rd.reqs=0 - block.1.rd.bytes=0 - block.1.rd.times=0 - block.1.wr.reqs=0 - block.1.wr.bytes=0 - block.1.wr.times=0 - block.1.fl.reqs=0 - block.1.fl.times=0 - block.1.allocation=327680 - block.1.capacity=786432000 - block.2.name=vdb - block.2.path=/dev/sda7 - block.2.rd.reqs=0 - block.2.rd.bytes=0 - block.2.rd.times=0 - block.2.wr.reqs=0 - block.2.wr.bytes=0 - block.2.wr.times=0 - block.2.fl.reqs=0 - block.2.fl.times=0 - block.2.allocation=0 - block.2.capacity=1310720000 - -I may later do a patch that trims the output to avoid 0 stats, -particularly for backing files (which are more likely to have -0 stats, at least for write statistics when no block-commit -is performed). Also, I still plan to expose physical size -information (qemu doesn't expose it yet, so it requires a stat, -and for block devices, a further open/seek operation). But -this patch is good enough without worrying about that yet. - -* src/qemu/qemu_driver.c (QEMU_DOMAIN_STATS_BACKING): New internal -enum bit. -(qemuConnectGetAllDomainStats): Recognize new user flag, and pass -details to... -(qemuDomainGetStatsBlock): ...here, where we can do longer recursion. -(qemuDomainGetStatsOneBlock): Output new field. - -Signed-off-by: Eric Blake -(cherry picked from commit 3937ef9cf4ff9d6d5aba8b76d9db5e44ae15a2aa) - -Conflicts: - src/qemu/qemu_driver.c -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 61 ++++++++++++++++++++++++++++++++++++++++---------- - 1 file changed, 49 insertions(+), 12 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index a2535f4..77f8cac 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17732,8 +17732,10 @@ qemuDomainGetStatsState(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - - - typedef enum { -- QEMU_DOMAIN_STATS_HAVE_JOB = (1 << 0), /* job is entered, monitor can be -- accessed */ -+ QEMU_DOMAIN_STATS_HAVE_JOB = 1 << 0, /* job is entered, monitor can be -+ accessed */ -+ QEMU_DOMAIN_STATS_BACKING = 1 << 1, /* include backing chain in -+ block stats */ - } qemuDomainStatsFlags; - - -@@ -17980,6 +17982,19 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - - #undef QEMU_ADD_NET_PARAM - -+#define QEMU_ADD_BLOCK_PARAM_UI(record, maxparams, num, name, value) \ -+ do { \ -+ char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; \ -+ snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, \ -+ "block.%zu.%s", num, name); \ -+ if (virTypedParamsAddUInt(&(record)->params, \ -+ &(record)->nparams, \ -+ maxparams, \ -+ param_name, \ -+ value) < 0) \ -+ goto cleanup; \ -+ } while (0) -+ - /* expects a LL, but typed parameter must be ULL */ - #define QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, num, name, value) \ - do { \ -@@ -18017,20 +18032,27 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - virDomainDiskDefPtr disk, - virStorageSourcePtr src, - size_t block_idx, -+ unsigned int backing_idx, - bool abbreviated, - virHashTablePtr stats) - { - qemuBlockStats *entry; - int ret = -1; -+ char *alias = NULL; -+ -+ if (disk->info.alias) -+ alias = qemuDomainStorageAlias(disk->info.alias, backing_idx); - - QEMU_ADD_NAME_PARAM(record, maxparams, "block", "name", block_idx, - disk->dst); - if (virStorageSourceIsLocalStorage(src) && src->path) - QEMU_ADD_NAME_PARAM(record, maxparams, "block", "path", - block_idx, src->path); -+ if (backing_idx) -+ QEMU_ADD_BLOCK_PARAM_UI(record, maxparams, block_idx, "backingIndex", -+ backing_idx); - -- if (abbreviated || !disk->info.alias || -- !(entry = virHashLookup(stats, disk->info.alias))) { -+ if (abbreviated || !alias || !(entry = virHashLookup(stats, alias))) { - /* FIXME: we could still look up sizing by sharing code - * with qemuDomainGetBlockInfo */ - ret = 0; -@@ -18066,6 +18088,7 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - - ret = 0; - cleanup: -+ VIR_FREE(alias); - return ret; - } - -@@ -18084,14 +18107,17 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - qemuDomainObjPrivatePtr priv = dom->privateData; - bool abbreviated = false; - int count_index = -1; -+ size_t visited = 0; -+ bool visitBacking = !!(privflags & QEMU_DOMAIN_STATS_BACKING); - - if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom)) { - abbreviated = true; /* it's ok, just go ahead silently */ - } else { - qemuDomainObjEnterMonitor(driver, dom); -- rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats, false); -+ rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats, -+ visitBacking); - ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats, -- false)); -+ visitBacking)); - qemuDomainObjExitMonitor(driver, dom); - - if (rc < 0) { -@@ -18108,14 +18134,21 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - - for (i = 0; i < dom->def->ndisks; i++) { - virDomainDiskDefPtr disk = dom->def->disks[i]; -+ virStorageSourcePtr src = disk->src; -+ unsigned int backing_idx = 0; - -- if (qemuDomainGetStatsOneBlock(driver, NULL, dom, record, maxparams, -- disk, disk->src, i, abbreviated, -- stats) < 0) -- goto cleanup; -+ while (src && (backing_idx == 0 || visitBacking)) { -+ if (qemuDomainGetStatsOneBlock(driver, NULL, dom, record, maxparams, -+ disk, src, visited, backing_idx, -+ abbreviated, stats) < 0) -+ goto cleanup; -+ visited++; -+ backing_idx++; -+ src = src->backingStore; -+ } - } - -- record->params[count_index].value.ui = i; -+ record->params[count_index].value.ui = visited; - ret = 0; - - cleanup: -@@ -18258,11 +18291,13 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, - unsigned int domflags = 0; - - if (ndoms) -- virCheckFlags(VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, -1); -+ virCheckFlags(VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING | -+ VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, -1); - else - virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE | - VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT | - VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE | -+ VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING | - VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, -1); - - if (virConnectGetAllDomainStatsEnsureACL(conn) < 0) -@@ -18312,6 +18347,8 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, - domflags |= QEMU_DOMAIN_STATS_HAVE_JOB; - /* else: without a job it's still possible to gather some data */ - -+ if (flags & VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING) -+ domflags |= QEMU_DOMAIN_STATS_BACKING; - if (qemuDomainGetStats(conn, dom, stats, &tmp, domflags) < 0) - goto endjob; - --- -2.2.0 - diff --git a/SOURCES/libvirt-getstats-improve-documentation.patch b/SOURCES/libvirt-getstats-improve-documentation.patch deleted file mode 100644 index db14593..0000000 --- a/SOURCES/libvirt-getstats-improve-documentation.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 1f5ab1ab07d8e2ddf08dec964c401c49cc5d32c9 Mon Sep 17 00:00:00 2001 -Message-Id: <1f5ab1ab07d8e2ddf08dec964c401c49cc5d32c9@dist-git> -From: Eric Blake -Date: Wed, 17 Dec 2014 03:09:00 -0700 -Subject: [PATCH] getstats: improve documentation - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -At least with 'virsh domstats --block' on an offline domain, we -currently output no stats even though we recognize the stat -category. Although a later patch will improve this situation, -it is better to document that this is expected behavior. - -Also, while the current implementation rejects filtering flags -for virDomainListGetStats, this limitation may be lifted in the -future and we do not enforce it at the API level. - -* src/libvirt-domain.c (virConnectGetAllDomainStats): Document -that recognized stats might not be reported. -(virDomainListGetStats): Likewise, and tweak filtering documentation. - -Signed-off-by: Eric Blake -(cherry picked from commit f301fe77c63b29b90ad478e328fb20394251f6a6) - -Conflicts: - src/libvirt-domain.c - file split from libvirt.c -Signed-off-by: Jiri Denemark ---- - src/libvirt.c | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/src/libvirt.c b/src/libvirt.c -index b593c9b..1097693 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21633,7 +21633,11 @@ virConnectGetDomainCapabilities(virConnectPtr conn, - * - * Specifying VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS as @flags makes - * the function return error in case some of the stat types in @stats were -- * not recognized by the daemon. -+ * not recognized by the daemon. However, even with this flag, a hypervisor -+ * may omit individual fields within a known group if the information is not -+ * available; as an extreme example, a supported group may produce zero -+ * fields for offline domains if the statistics are meaningful only for a -+ * running domain. - * - * Similarly to virConnectListAllDomains, @flags can contain various flags to - * filter the list of domains to provide stats for. -@@ -21713,9 +21717,13 @@ virConnectGetAllDomainStats(virConnectPtr conn, - * - * Specifying VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS as @flags makes - * the function return error in case some of the stat types in @stats were -- * not recognized by the daemon. -+ * not recognized by the daemon. However, even with this flag, a hypervisor -+ * may omit individual fields within a known group if the information is not -+ * available; as an extreme example, a supported group may produce zero -+ * fields for offline domains if the statistics are meaningful only for a -+ * running domain. - * -- * Note that any of the domain list filtering flags in @flags will be rejected -+ * Note that any of the domain list filtering flags in @flags may be rejected - * by this function. - * - * Returns the count of returned statistics structures on success, -1 on error. --- -2.2.0 - diff --git a/SOURCES/libvirt-getstats-perform-recursion-in-monitor-collection.patch b/SOURCES/libvirt-getstats-perform-recursion-in-monitor-collection.patch deleted file mode 100644 index 45c0407..0000000 --- a/SOURCES/libvirt-getstats-perform-recursion-in-monitor-collection.patch +++ /dev/null @@ -1,191 +0,0 @@ -From 7245a00d5adcdd74eb8a5051de2a1d52a4107ae8 Mon Sep 17 00:00:00 2001 -Message-Id: <7245a00d5adcdd74eb8a5051de2a1d52a4107ae8@dist-git> -From: Eric Blake -Date: Wed, 17 Dec 2014 03:09:05 -0700 -Subject: [PATCH] getstats: perform recursion in monitor collection - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -When requested in a later patch, the QMP command results are now -examined recursively. As qemu_driver will eventually have to -read items out of the hash table as stored by this patch, the -computation of backing alias string is done in a shared location. - -* src/qemu/qemu_domain.h (qemuDomainStorageAlias): New prototype. -* src/qemu/qemu_domain.c (qemuDomainStorageAlias): Implement it. -* src/qemu/qemu_monitor_json.c -(qemuMonitorJSONGetOneBlockStatsInfo) -(qemuMonitorJSONBlockStatsUpdateCapacityOne): Perform recursion. -(qemuMonitorJSONGetAllBlockStatsInfo) -(qemuMonitorJSONBlockStatsUpdateCapacity): Update callers. - -Signed-off-by: Eric Blake -(cherry picked from commit b1802714dab51bd5f0214a4d93a2c0b635bc5f14) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 16 +++++++++++++++ - src/qemu/qemu_domain.h | 1 + - src/qemu/qemu_monitor_json.c | 48 ++++++++++++++++++++++++++++++++------------ - 3 files changed, 52 insertions(+), 13 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 01fa3ac..58fcd75 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -2707,6 +2707,22 @@ qemuDomainStorageFileInit(virQEMUDriverPtr driver, - } - - -+char * -+qemuDomainStorageAlias(const char *device, int depth) -+{ -+ char *alias; -+ -+ if (STRPREFIX(device, QEMU_DRIVE_HOST_PREFIX)) -+ device += strlen(QEMU_DRIVE_HOST_PREFIX); -+ -+ if (!depth) -+ ignore_value(VIR_STRDUP(alias, device)); -+ else -+ ignore_value(virAsprintf(&alias, "%s.%d", device, depth)); -+ return alias; -+} -+ -+ - int - qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, - virDomainObjPtr vm, -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index ebb282a..9c94a65 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -376,6 +376,7 @@ int qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, - int qemuDomainStorageFileInit(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src); -+char *qemuDomainStorageAlias(const char *device, int depth); - - int qemuDomainCleanupAdd(virDomainObjPtr vm, - qemuDomainCleanupCallback cb); -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 7088409..97151dc 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -1839,13 +1839,18 @@ qemuMonitorJSONDevGetBlockExtent(virJSONValuePtr dev, - static int - qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr dev, - const char *dev_name, -+ int depth, - virHashTablePtr hash, -- bool backingChain ATTRIBUTE_UNUSED) -+ bool backingChain) - { - qemuBlockStatsPtr bstats = NULL; - virJSONValuePtr stats; - int ret = -1; -+ char *entry_name = qemuDomainStorageAlias(dev_name, depth); -+ virJSONValuePtr backing; - -+ if (!entry_name) -+ goto cleanup; - if (VIR_ALLOC(bstats) < 0) - goto cleanup; - -@@ -1921,12 +1926,20 @@ qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr dev, - /* it's ok to not have this information here. Just skip silently. */ - qemuMonitorJSONDevGetBlockExtent(dev, &bstats->wr_highest_offset); - -- if (virHashAddEntry(hash, dev_name, bstats) < 0) -+ if (virHashAddEntry(hash, entry_name, bstats) < 0) - goto cleanup; - bstats = NULL; -+ -+ if (backingChain && -+ (backing = virJSONValueObjectGet(dev, "backing")) && -+ qemuMonitorJSONGetOneBlockStatsInfo(backing, dev_name, depth + 1, -+ hash, true) < 0) -+ goto cleanup; -+ - ret = 0; - cleanup: - VIR_FREE(bstats); -+ VIR_FREE(entry_name); - return ret; - } - -@@ -1981,10 +1994,7 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - goto cleanup; - } - -- if (STRPREFIX(dev_name, QEMU_DRIVE_HOST_PREFIX)) -- dev_name += strlen(QEMU_DRIVE_HOST_PREFIX); -- -- if (qemuMonitorJSONGetOneBlockStatsInfo(dev, dev_name, hash, -+ if (qemuMonitorJSONGetOneBlockStatsInfo(dev, dev_name, 0, hash, - backingChain) < 0) - goto cleanup; - -@@ -2005,17 +2015,20 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - static int - qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image, - const char *dev_name, -+ int depth, - virHashTablePtr stats, -- bool backingChain ATTRIBUTE_UNUSED) -+ bool backingChain) - { - qemuBlockStatsPtr bstats; - int ret = -1; -+ char *entry_name = qemuDomainStorageAlias(dev_name, depth); -+ virJSONValuePtr backing; - -- if (!(bstats = virHashLookup(stats, dev_name))) { -+ if (!(bstats = virHashLookup(stats, entry_name))) { - if (VIR_ALLOC(bstats) < 0) - goto cleanup; - -- if (virHashAddEntry(stats, dev_name, bstats) < 0) { -+ if (virHashAddEntry(stats, entry_name, bstats) < 0) { - VIR_FREE(bstats); - goto cleanup; - } -@@ -2032,7 +2045,18 @@ qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image, - if (virJSONValueObjectGetNumberUlong(image, "actual-size", - &bstats->physical) < 0) - bstats->physical = bstats->capacity; -+ -+ if (backingChain && -+ (backing = virJSONValueObjectGet(image, "backing-image"))) { -+ ret = qemuMonitorJSONBlockStatsUpdateCapacityOne(backing, -+ dev_name, -+ depth + 1, -+ stats, -+ true); -+ } -+ - cleanup: -+ VIR_FREE(entry_name); - return ret; - } - -@@ -2085,15 +2109,13 @@ qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, - goto cleanup; - } - -- if (STRPREFIX(dev_name, QEMU_DRIVE_HOST_PREFIX)) -- dev_name += strlen(QEMU_DRIVE_HOST_PREFIX); -- - /* drive may be empty */ - if (!(inserted = virJSONValueObjectGet(dev, "inserted")) || - !(image = virJSONValueObjectGet(inserted, "image"))) - continue; - -- if (qemuMonitorJSONBlockStatsUpdateCapacityOne(image, dev_name, stats, -+ if (qemuMonitorJSONBlockStatsUpdateCapacityOne(image, dev_name, 0, -+ stats, - backingChain) < 0) - goto cleanup; - } --- -2.2.0 - diff --git a/SOURCES/libvirt-getstats-prepare-for-dynamic-block.count-stat.patch b/SOURCES/libvirt-getstats-prepare-for-dynamic-block.count-stat.patch deleted file mode 100644 index e796619..0000000 --- a/SOURCES/libvirt-getstats-prepare-for-dynamic-block.count-stat.patch +++ /dev/null @@ -1,65 +0,0 @@ -From d2d674cf41b0560e187cb836b81e3c5f9684c29c Mon Sep 17 00:00:00 2001 -Message-Id: -From: Eric Blake -Date: Wed, 17 Dec 2014 03:09:06 -0700 -Subject: [PATCH] getstats: prepare for dynamic block.count stat - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -A coming patch will make it optionally possible to list backing -chain block stats; in this mode of operation, block.counts is no -longer the number of in the domain, but the number of -blocks in the array being reported. We still want block.count -listed first, but rather than iterate the tree twice (once to -count, and once to list stats), it's easier to just touch things -up after the fact. - -* src/qemu/qemu_driver.c (qemuDomainGetStatsBlock): Compute count -after the fact. - -Signed-off-by: Eric Blake -(cherry picked from commit 14ef1f62e3429face36ac1e6f5665e97e53a328d) - -Conflicts: - src/qemu/qemu_driver.c - no offline stats (commit 596a137) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 8376486..6be180e 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -18020,6 +18020,7 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - virHashTablePtr stats = NULL; - qemuDomainObjPrivatePtr priv = dom->privateData; - bool abbreviated = false; -+ int count_index = -1; - - if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom)) { - abbreviated = true; /* it's ok, just go ahead silently */ -@@ -18036,7 +18037,11 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - } - } - -- QEMU_ADD_COUNT_PARAM(record, maxparams, "block", dom->def->ndisks); -+ /* When listing backing chains, it's easier to fix up the count -+ * after the iteration than it is to iterate twice; but we still -+ * want count listed first. */ -+ count_index = record->nparams; -+ QEMU_ADD_COUNT_PARAM(record, maxparams, "block", 0); - - for (i = 0; i < dom->def->ndisks; i++) { - qemuBlockStats *entry; -@@ -18083,6 +18088,7 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - - } - -+ record->params[count_index].value.ui = i; - ret = 0; - - cleanup: --- -2.2.0 - diff --git a/SOURCES/libvirt-getstats-prepare-monitor-collection-for-recursion.patch b/SOURCES/libvirt-getstats-prepare-monitor-collection-for-recursion.patch deleted file mode 100644 index b0a3e66..0000000 --- a/SOURCES/libvirt-getstats-prepare-monitor-collection-for-recursion.patch +++ /dev/null @@ -1,484 +0,0 @@ -From d86dcee6e419259d365eaaa69a4d71c48491e95f Mon Sep 17 00:00:00 2001 -Message-Id: -From: Eric Blake -Date: Wed, 17 Dec 2014 03:09:04 -0700 -Subject: [PATCH] getstats: prepare monitor collection for recursion - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -A future patch will allow recursion into backing chains when -collecting block stats. This patch should not change behavior, -but merely moves out the common code that will be reused once -recursion is enabled, and adds the parameter that will turn on -recursion. - -* src/qemu/qemu_monitor.h (qemuMonitorGetAllBlockStatsInfo) -(qemuMonitorBlockStatsUpdateCapacity): Add recursion parameter, -although it is ignored for now. -* src/qemu/qemu_monitor.h (qemuMonitorGetAllBlockStatsInfo) -(qemuMonitorBlockStatsUpdateCapacity): Likewise. -* src/qemu/qemu_monitor_json.h -(qemuMonitorJSONGetAllBlockStatsInfo) -(qemuMonitorJSONBlockStatsUpdateCapacity): Likewise. -* src/qemu/qemu_monitor_json.c -(qemuMonitorJSONGetAllBlockStatsInfo) -(qemuMonitorJSONBlockStatsUpdateCapacity): Add parameter, and -split... -(qemuMonitorJSONGetOneBlockStatsInfo) -(qemuMonitorJSONBlockStatsUpdateCapacityOne): ...into helpers. -(qemuMonitorJSONGetBlockStatsInfo): Update caller. -* src/qemu/qemu_driver.c (qemuDomainGetStatsBlock): Update caller. -* src/qemu/qemu_migration.c (qemuMigrationCookieAddNBD): Likewise. - -Signed-off-by: Eric Blake -(cherry picked from commit 7b11f5e5547ded860692caa2cefae1a856920336) - -Conflicts: - src/qemu/qemu_migration.c - no disk precreation (commit e1466dc) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 5 +- - src/qemu/qemu_monitor.c | 24 ++-- - src/qemu/qemu_monitor.h | 6 +- - src/qemu/qemu_monitor_json.c | 257 +++++++++++++++++++++++++------------------ - src/qemu/qemu_monitor_json.h | 6 +- - 5 files changed, 173 insertions(+), 125 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 03b62d8..8376486 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -18025,8 +18025,9 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - abbreviated = true; /* it's ok, just go ahead silently */ - } else { - qemuDomainObjEnterMonitor(driver, dom); -- rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats); -- ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats)); -+ rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats, false); -+ ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats, -+ false)); - qemuDomainObjExitMonitor(driver, dom); - - if (rc < 0) { -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 38399ba..f797f4f 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -1787,16 +1787,16 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon, - return ret; - } - --/* Fills the first 'nstats' block stats. 'stats' must be an array. -- * Returns <0 on error, otherwise the number of block stats retrieved. -- * if 'dev_name' is != NULL, look for this device only and skip -- * any other. In that case return value cannot be greater than 1. -+ -+/* Creates a hash table in 'ret_stats' with all block stats. -+ * Returns <0 on error, 0 on success. - */ - int - qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, -- virHashTablePtr *ret_stats) -+ virHashTablePtr *ret_stats, -+ bool backingChain) - { -- VIR_DEBUG("mon=%p ret_stats=%p", mon, ret_stats); -+ VIR_DEBUG("mon=%p ret_stats=%p, backing=%d", mon, ret_stats, backingChain); - - if (!mon->json) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -1804,15 +1804,17 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, - return -1; - } - -- return qemuMonitorJSONGetAllBlockStatsInfo(mon, ret_stats); -+ return qemuMonitorJSONGetAllBlockStatsInfo(mon, ret_stats, backingChain); - } - - - /* Updates "stats" to fill virtual and physical size of the image */ --int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, -- virHashTablePtr stats) -+int -+qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, -+ virHashTablePtr stats, -+ bool backingChain) - { -- VIR_DEBUG("mon=%p, stats=%p", mon, stats); -+ VIR_DEBUG("mon=%p, stats=%p, backing=%d", mon, stats, backingChain); - - if (!mon->json) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -@@ -1820,7 +1822,7 @@ int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, - return -1; - } - -- return qemuMonitorJSONBlockStatsUpdateCapacity(mon, stats); -+ return qemuMonitorJSONBlockStatsUpdateCapacity(mon, stats, backingChain); - } - - -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index d1dc242..b08d74d 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -382,11 +382,13 @@ struct _qemuBlockStats { - }; - - int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, -- virHashTablePtr *ret_stats) -+ virHashTablePtr *ret_stats, -+ bool backingChain) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - - int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, -- virHashTablePtr stats) -+ virHashTablePtr stats, -+ bool backingChain) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - - int qemuMonitorGetBlockStatsParamsNumber(qemuMonitorPtr mon, -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 3cf67aa..7088409 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -1770,7 +1770,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - if (flush_total_times) - *flush_total_times = -1; - -- if (qemuMonitorJSONGetAllBlockStatsInfo(mon, &blockstats) < 0) -+ if (qemuMonitorJSONGetAllBlockStatsInfo(mon, &blockstats, false) < 0) - goto cleanup; - - if (!(stats = virHashLookup(blockstats, dev_name))) { -@@ -1836,16 +1836,112 @@ qemuMonitorJSONDevGetBlockExtent(virJSONValuePtr dev, - } - - --int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, -- virHashTablePtr *ret_stats) -+static int -+qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr dev, -+ const char *dev_name, -+ virHashTablePtr hash, -+ bool backingChain ATTRIBUTE_UNUSED) - { -- int ret = -1; -- int rc; -- size_t i; -- virJSONValuePtr cmd; -- virJSONValuePtr reply = NULL; -- virJSONValuePtr devices; - qemuBlockStatsPtr bstats = NULL; -+ virJSONValuePtr stats; -+ int ret = -1; -+ -+ if (VIR_ALLOC(bstats) < 0) -+ goto cleanup; -+ -+ if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL || -+ stats->type != VIR_JSON_TYPE_OBJECT) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("blockstats stats entry was not " -+ "in expected format")); -+ goto cleanup; -+ } -+ -+ if (virJSONValueObjectGetNumberLong(stats, "rd_bytes", -+ &bstats->rd_bytes) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("cannot read %s statistic"), -+ "rd_bytes"); -+ goto cleanup; -+ } -+ if (virJSONValueObjectGetNumberLong(stats, "rd_operations", -+ &bstats->rd_req) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("cannot read %s statistic"), -+ "rd_operations"); -+ goto cleanup; -+ } -+ if (virJSONValueObjectHasKey(stats, "rd_total_time_ns") && -+ (virJSONValueObjectGetNumberLong(stats, "rd_total_time_ns", -+ &bstats->rd_total_times) < 0)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("cannot read %s statistic"), -+ "rd_total_time_ns"); -+ goto cleanup; -+ } -+ if (virJSONValueObjectGetNumberLong(stats, "wr_bytes", -+ &bstats->wr_bytes) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("cannot read %s statistic"), -+ "wr_bytes"); -+ goto cleanup; -+ } -+ if (virJSONValueObjectGetNumberLong(stats, "wr_operations", -+ &bstats->wr_req) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("cannot read %s statistic"), -+ "wr_operations"); -+ goto cleanup; -+ } -+ if (virJSONValueObjectHasKey(stats, "wr_total_time_ns") && -+ (virJSONValueObjectGetNumberLong(stats, "wr_total_time_ns", -+ &bstats->wr_total_times) < 0)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("cannot read %s statistic"), -+ "wr_total_time_ns"); -+ goto cleanup; -+ } -+ if (virJSONValueObjectHasKey(stats, "flush_operations") && -+ (virJSONValueObjectGetNumberLong(stats, "flush_operations", -+ &bstats->flush_req) < 0)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("cannot read %s statistic"), -+ "flush_operations"); -+ goto cleanup; -+ } -+ if (virJSONValueObjectHasKey(stats, "flush_total_time_ns") && -+ (virJSONValueObjectGetNumberLong(stats, "flush_total_time_ns", -+ &bstats->flush_total_times) < 0)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("cannot read %s statistic"), -+ "flush_total_time_ns"); -+ goto cleanup; -+ } -+ -+ /* it's ok to not have this information here. Just skip silently. */ -+ qemuMonitorJSONDevGetBlockExtent(dev, &bstats->wr_highest_offset); -+ -+ if (virHashAddEntry(hash, dev_name, bstats) < 0) -+ goto cleanup; -+ bstats = NULL; -+ ret = 0; -+ cleanup: -+ VIR_FREE(bstats); -+ return ret; -+} -+ -+ -+int -+qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, -+ virHashTablePtr *ret_stats, -+ bool backingChain) -+{ -+ int ret = -1; -+ int rc; -+ size_t i; -+ virJSONValuePtr cmd; -+ virJSONValuePtr reply = NULL; -+ virJSONValuePtr devices; - virHashTablePtr hash = NULL; - - if (!(cmd = qemuMonitorJSONMakeCommand("query-blockstats", NULL))) -@@ -1869,12 +1965,8 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - - for (i = 0; i < virJSONValueArraySize(devices); i++) { - virJSONValuePtr dev = virJSONValueArrayGet(devices, i); -- virJSONValuePtr stats; - const char *dev_name; - -- if (VIR_ALLOC(bstats) < 0) -- goto cleanup; -- - if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats device entry was not " -@@ -1892,81 +1984,10 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - if (STRPREFIX(dev_name, QEMU_DRIVE_HOST_PREFIX)) - dev_name += strlen(QEMU_DRIVE_HOST_PREFIX); - -- if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL || -- stats->type != VIR_JSON_TYPE_OBJECT) { -- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("blockstats stats entry was not " -- "in expected format")); -+ if (qemuMonitorJSONGetOneBlockStatsInfo(dev, dev_name, hash, -+ backingChain) < 0) - goto cleanup; -- } - -- if (virJSONValueObjectGetNumberLong(stats, "rd_bytes", -- &bstats->rd_bytes) < 0) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("cannot read %s statistic"), -- "rd_bytes"); -- goto cleanup; -- } -- if (virJSONValueObjectGetNumberLong(stats, "rd_operations", -- &bstats->rd_req) < 0) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("cannot read %s statistic"), -- "rd_operations"); -- goto cleanup; -- } -- if (virJSONValueObjectHasKey(stats, "rd_total_time_ns") && -- (virJSONValueObjectGetNumberLong(stats, "rd_total_time_ns", -- &bstats->rd_total_times) < 0)) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("cannot read %s statistic"), -- "rd_total_time_ns"); -- goto cleanup; -- } -- if (virJSONValueObjectGetNumberLong(stats, "wr_bytes", -- &bstats->wr_bytes) < 0) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("cannot read %s statistic"), -- "wr_bytes"); -- goto cleanup; -- } -- if (virJSONValueObjectGetNumberLong(stats, "wr_operations", -- &bstats->wr_req) < 0) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("cannot read %s statistic"), -- "wr_operations"); -- goto cleanup; -- } -- if (virJSONValueObjectHasKey(stats, "wr_total_time_ns") && -- (virJSONValueObjectGetNumberLong(stats, "wr_total_time_ns", -- &bstats->wr_total_times) < 0)) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("cannot read %s statistic"), -- "wr_total_time_ns"); -- goto cleanup; -- } -- if (virJSONValueObjectHasKey(stats, "flush_operations") && -- (virJSONValueObjectGetNumberLong(stats, "flush_operations", -- &bstats->flush_req) < 0)) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("cannot read %s statistic"), -- "flush_operations"); -- goto cleanup; -- } -- if (virJSONValueObjectHasKey(stats, "flush_total_time_ns") && -- (virJSONValueObjectGetNumberLong(stats, "flush_total_time_ns", -- &bstats->flush_total_times) < 0)) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("cannot read %s statistic"), -- "flush_total_time_ns"); -- goto cleanup; -- } -- -- /* it's ok to not have this information here. Just skip silently. */ -- qemuMonitorJSONDevGetBlockExtent(dev, &bstats->wr_highest_offset); -- -- if (virHashAddEntry(hash, dev_name, bstats) < 0) -- goto cleanup; -- bstats = NULL; - } - - *ret_stats = hash; -@@ -1974,7 +1995,6 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - ret = 0; - - cleanup: -- VIR_FREE(bstats); - virHashFree(hash); - virJSONValueFree(cmd); - virJSONValueFree(reply); -@@ -1982,8 +2002,45 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - } - - --int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, -- virHashTablePtr stats) -+static int -+qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image, -+ const char *dev_name, -+ virHashTablePtr stats, -+ bool backingChain ATTRIBUTE_UNUSED) -+{ -+ qemuBlockStatsPtr bstats; -+ int ret = -1; -+ -+ if (!(bstats = virHashLookup(stats, dev_name))) { -+ if (VIR_ALLOC(bstats) < 0) -+ goto cleanup; -+ -+ if (virHashAddEntry(stats, dev_name, bstats) < 0) { -+ VIR_FREE(bstats); -+ goto cleanup; -+ } -+ } -+ -+ /* After this point, we ignore failures; the stats were -+ * zero-initialized when created which is a sane fallback. */ -+ ret = 0; -+ if (virJSONValueObjectGetNumberUlong(image, "virtual-size", -+ &bstats->capacity) < 0) -+ goto cleanup; -+ -+ /* if actual-size is missing, image is not thin provisioned */ -+ if (virJSONValueObjectGetNumberUlong(image, "actual-size", -+ &bstats->physical) < 0) -+ bstats->physical = bstats->capacity; -+ cleanup: -+ return ret; -+} -+ -+ -+int -+qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, -+ virHashTablePtr stats, -+ bool backingChain) - { - int ret = -1; - int rc; -@@ -2012,7 +2069,6 @@ int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, - virJSONValuePtr dev = virJSONValueArrayGet(devices, i); - virJSONValuePtr inserted; - virJSONValuePtr image; -- qemuBlockStatsPtr bstats; - const char *dev_name; - - if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { -@@ -2037,24 +2093,9 @@ int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, - !(image = virJSONValueObjectGet(inserted, "image"))) - continue; - -- if (!(bstats = virHashLookup(stats, dev_name))) { -- if (VIR_ALLOC(bstats) < 0) -- goto cleanup; -- -- if (virHashAddEntry(stats, dev_name, bstats) < 0) { -- VIR_FREE(bstats); -- goto cleanup; -- } -- } -- -- if (virJSONValueObjectGetNumberUlong(image, "virtual-size", -- &bstats->capacity) < 0) -- continue; -- -- /* if actual-size is missing, image is not thin provisioned */ -- if (virJSONValueObjectGetNumberUlong(image, "actual-size", -- &bstats->physical) < 0) -- bstats->physical = bstats->capacity; -+ if (qemuMonitorJSONBlockStatsUpdateCapacityOne(image, dev_name, stats, -+ backingChain) < 0) -+ goto cleanup; - } - - ret = 0; -diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index 17f9718..d039991 100644 ---- a/src/qemu/qemu_monitor_json.h -+++ b/src/qemu/qemu_monitor_json.h -@@ -80,9 +80,11 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - long long *flush_total_times, - long long *errs); - int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, -- virHashTablePtr *ret_stats); -+ virHashTablePtr *ret_stats, -+ bool backingChain); - int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, -- virHashTablePtr stats); -+ virHashTablePtr stats, -+ bool backingChain); - int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon, - int *nparams); - int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon, --- -2.2.0 - diff --git a/SOURCES/libvirt-getstats-split-block-stats-reporting-for-easier-recursion.patch b/SOURCES/libvirt-getstats-split-block-stats-reporting-for-easier-recursion.patch deleted file mode 100644 index c539975..0000000 --- a/SOURCES/libvirt-getstats-split-block-stats-reporting-for-easier-recursion.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 248157defba2872ca75f3055d518e956daa33697 Mon Sep 17 00:00:00 2001 -Message-Id: <248157defba2872ca75f3055d518e956daa33697@dist-git> -From: Eric Blake -Date: Wed, 17 Dec 2014 03:09:08 -0700 -Subject: [PATCH] getstats: split block stats reporting for easier recursion - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -In order to report stats on backing chains, we need to separate -the output of stats for one block from how we traverse blocks. - -* src/qemu/qemu_driver.c (qemuDomainGetStatsBlock): Split... -(qemuDomainGetStatsOneBlock): ...into new helper. - -Signed-off-by: Eric Blake -(cherry picked from commit c2d380bff8f1bad8e6df047c34ab1a4f8f623e3e) - -Conflicts: - src/qemu/qemu_driver.c - no offline stats (commit 596a137) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 107 +++++++++++++++++++++++++++++++------------------ - 1 file changed, 67 insertions(+), 40 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 6be180e..a2535f4 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -18007,6 +18007,69 @@ do { \ - goto cleanup; \ - } while (0) - -+ -+static int -+qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, -+ virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, -+ virDomainObjPtr dom ATTRIBUTE_UNUSED, -+ virDomainStatsRecordPtr record, -+ int *maxparams, -+ virDomainDiskDefPtr disk, -+ virStorageSourcePtr src, -+ size_t block_idx, -+ bool abbreviated, -+ virHashTablePtr stats) -+{ -+ qemuBlockStats *entry; -+ int ret = -1; -+ -+ QEMU_ADD_NAME_PARAM(record, maxparams, "block", "name", block_idx, -+ disk->dst); -+ if (virStorageSourceIsLocalStorage(src) && src->path) -+ QEMU_ADD_NAME_PARAM(record, maxparams, "block", "path", -+ block_idx, src->path); -+ -+ if (abbreviated || !disk->info.alias || -+ !(entry = virHashLookup(stats, disk->info.alias))) { -+ /* FIXME: we could still look up sizing by sharing code -+ * with qemuDomainGetBlockInfo */ -+ ret = 0; -+ goto cleanup; -+ } -+ -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, -+ "rd.reqs", entry->rd_req); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, -+ "rd.bytes", entry->rd_bytes); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, -+ "rd.times", entry->rd_total_times); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, -+ "wr.reqs", entry->wr_req); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, -+ "wr.bytes", entry->wr_bytes); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, -+ "wr.times", entry->wr_total_times); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, -+ "fl.reqs", entry->flush_req); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, -+ "fl.times", entry->flush_total_times); -+ -+ QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, -+ "allocation", entry->wr_highest_offset); -+ -+ if (entry->capacity) -+ QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, -+ "capacity", entry->capacity); -+ if (entry->physical) -+ QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, -+ "physical", entry->physical); -+ -+ ret = 0; -+ cleanup: -+ return ret; -+} -+ -+ - static int - qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - virDomainObjPtr dom, -@@ -18044,48 +18107,12 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - QEMU_ADD_COUNT_PARAM(record, maxparams, "block", 0); - - for (i = 0; i < dom->def->ndisks; i++) { -- qemuBlockStats *entry; - virDomainDiskDefPtr disk = dom->def->disks[i]; - -- QEMU_ADD_NAME_PARAM(record, maxparams, "block", "name", i, disk->dst); -- if (virStorageSourceIsLocalStorage(disk->src) && disk->src->path) -- QEMU_ADD_NAME_PARAM(record, maxparams, "block", "path", -- i, disk->src->path); -- -- if (abbreviated || !disk->info.alias || -- !(entry = virHashLookup(stats, disk->info.alias))) { -- /* FIXME: we could still look up sizing by sharing code -- * with qemuDomainGetBlockInfo */ -- continue; -- } -- -- QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "rd.reqs", entry->rd_req); -- QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "rd.bytes", entry->rd_bytes); -- QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "rd.times", entry->rd_total_times); -- QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "wr.reqs", entry->wr_req); -- QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "wr.bytes", entry->wr_bytes); -- QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "wr.times", entry->wr_total_times); -- QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "fl.reqs", entry->flush_req); -- QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "fl.times", entry->flush_total_times); -- -- QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, i, -- "allocation", entry->wr_highest_offset); -- -- if (entry->capacity) -- QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, i, -- "capacity", entry->capacity); -- if (entry->physical) -- QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, i, -- "physical", entry->physical); -- -+ if (qemuDomainGetStatsOneBlock(driver, NULL, dom, record, maxparams, -+ disk, disk->src, i, abbreviated, -+ stats) < 0) -+ goto cleanup; - } - - record->params[count_index].value.ui = i; --- -2.2.0 - diff --git a/SOURCES/libvirt-getstats-start-giving-offline-block-stats.patch b/SOURCES/libvirt-getstats-start-giving-offline-block-stats.patch deleted file mode 100644 index dcd4c6a..0000000 --- a/SOURCES/libvirt-getstats-start-giving-offline-block-stats.patch +++ /dev/null @@ -1,86 +0,0 @@ -From b80814d0e06895d7dce41eb3c65b88fa4ee604b1 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Eric Blake -Date: Wed, 17 Dec 2014 03:09:01 -0700 -Subject: [PATCH] getstats: start giving offline block stats - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -I noticed that for an offline domain, 'virsh domstats --block $dom' -was producing just the domain name, with no stats. But the older -'virsh domblkinfo' works just fine on offline domains. This patch -starts to get us closer, by at least reporting the disk names for -an offline domain. - -With this patch, I now see the following for an offline domain -with one qcow2 disk and an empty cdrom drive: -$ virsh domstats --block foo -Domain: 'foo' - block.count=2 - block.0.name=hda - block.1.name=hdc - -* src/qemu/qemu_driver.c (qemuDomainGetStatsBlock): Don't short-circuit -output of block name. - -Signed-off-by: Eric Blake -(cherry picked from commit 56b21dfe0c12867fa1dc3715145a61017e6928f1) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 30 +++++++++++++++++------------- - 1 file changed, 17 insertions(+), 13 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 33a93f1..f0935d6 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -18019,19 +18019,20 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - int rc; - virHashTablePtr stats = NULL; - qemuDomainObjPrivatePtr priv = dom->privateData; -+ bool abbreviated = false; - -- if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom)) -- return 0; /* it's ok, just go ahead silently */ -+ if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom)) { -+ abbreviated = true; /* it's ok, just go ahead silently */ -+ } else { -+ qemuDomainObjEnterMonitor(driver, dom); -+ rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats); -+ ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats)); -+ qemuDomainObjExitMonitor(driver, dom); - -- qemuDomainObjEnterMonitor(driver, dom); -- rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats); -- ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats)); -- qemuDomainObjExitMonitor(driver, dom); -- -- if (rc < 0) { -- virResetLastError(); -- ret = 0; /* still ok, again go ahead silently */ -- goto cleanup; -+ if (rc < 0) { -+ virResetLastError(); -+ abbreviated = true; /* still ok, again go ahead silently */ -+ } - } - - QEMU_ADD_COUNT_PARAM(record, maxparams, "block", dom->def->ndisks); -@@ -18042,9 +18043,12 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - - QEMU_ADD_NAME_PARAM(record, maxparams, "block", i, disk->dst); - -- if (!disk->info.alias || -- !(entry = virHashLookup(stats, disk->info.alias))) -+ if (abbreviated || !disk->info.alias || -+ !(entry = virHashLookup(stats, disk->info.alias))) { -+ /* FIXME: we could still look up sizing by sharing code -+ * with qemuDomainGetBlockInfo */ - continue; -+ } - - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, - "rd.reqs", entry->rd_req); --- -2.2.0 - diff --git a/SOURCES/libvirt-hostdev-Add-rawio-attribute-to-_virDomainHostdevSubsysSCSI.patch b/SOURCES/libvirt-hostdev-Add-rawio-attribute-to-_virDomainHostdevSubsysSCSI.patch deleted file mode 100644 index bcbd18c..0000000 --- a/SOURCES/libvirt-hostdev-Add-rawio-attribute-to-_virDomainHostdevSubsysSCSI.patch +++ /dev/null @@ -1,227 +0,0 @@ -From 5cb75e163743eddefdc5ea8cc63763918b8da51a Mon Sep 17 00:00:00 2001 -Message-Id: <5cb75e163743eddefdc5ea8cc63763918b8da51a@dist-git> -From: John Ferlan -Date: Fri, 26 Sep 2014 11:27:12 +0200 -Subject: [PATCH] hostdev: Add "rawio" attribute to _virDomainHostdevSubsysSCSI - -https://bugzilla.redhat.com/show_bug.cgi?id=1103739 - -Add the 'rawio' attribute to match _virDomainDiskDef and process the -hostdev XML similarly to the disk XML for a lun which supports/requires rawio - -(cherry picked from commit 58abf1bb36ee89e9de39ab09995006fd1d461665) - -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 12 ++++++-- - docs/schemas/domaincommon.rng | 12 ++++++-- - src/conf/domain_conf.c | 24 +++++++++++++++ - src/conf/domain_conf.h | 1 + - .../qemuxml2argv-hostdev-scsi-rawio.xml | 35 ++++++++++++++++++++++ - tests/qemuxml2xmltest.c | 1 + - 6 files changed, 79 insertions(+), 6 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 830bfa2..ee00eca 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -1815,7 +1815,7 @@ -

rawio attribute - since 0.9.10
-
-- Indicates whether the disk is needs rawio capability; valid -+ Indicates whether the disk needs rawio capability. Valid - settings are "yes" or "no" (default is "no"). If any one disk - in a domain has rawio='yes', rawio capability will be enabled - for all disks in the domain (because, in the case of QEMU, this -@@ -2925,7 +2925,7 @@ -
-   ...
-   <devices>
--    <hostdev mode='subsystem' type='scsi'>
-+    <hostdev mode='subsystem' type='scsi' sgio='filtered' rawio='yes'>
-       <source>
-         <adapter name='scsi_host0'/>
-         <address type='scsi' bus='0' target='0' unit='0'/>
-@@ -2984,7 +2984,13 @@
-             (since 1.0.6) attribute indicates
-             whether the kernel will filter unprivileged SG_IO commands for
-             the disk, valid settings are "filtered" or "unfiltered".
--            The default is "filtered".
-+            The default is "filtered". The optional rawio
-+            (since 1.2.9) attribute indicates
-+            whether the lun needs the rawio capability. Valid settings are
-+            "yes" or "no". See the rawio description within the
-+            disk section.
-+            If a disk lun in the domain already has the rawio capability,
-+            then this setting not required.
-           
- - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index ccfb511..e561486 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -1252,9 +1252,7 @@ - - - -- -- -- -+ - - - -@@ -3641,6 +3639,9 @@ - - - -+ -+ -+ - - - -@@ -5001,4 +5002,9 @@ - - - -+ -+ -+ -+ -+ - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 4e80467..40626b8 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -4501,6 +4501,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, - xmlNodePtr sourcenode; - char *managed = NULL; - char *sgio = NULL; -+ char *rawio = NULL; - char *backendStr = NULL; - int backend; - int ret = -1; -@@ -4518,6 +4519,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, - } - - sgio = virXMLPropString(node, "sgio"); -+ rawio = virXMLPropString(node, "rawio"); - - /* @type is passed in from the caller rather than read from the - * xml document, because it is specified in different places for -@@ -4569,6 +4571,21 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, - } - } - -+ if (rawio) { -+ if (def->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("rawio is only supported for scsi host device")); -+ goto error; -+ } -+ -+ if ((scsisrc->rawio = virTristateBoolTypeFromString(rawio)) <= 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("unknown hostdev rawio setting '%s'"), -+ rawio); -+ goto error; -+ } -+ } -+ - switch (def->source.subsys.type) { - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: - if (virDomainHostdevSubsysPCIDefParseXML(sourcenode, def, flags) < 0) -@@ -4608,6 +4625,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, - error: - VIR_FREE(managed); - VIR_FREE(sgio); -+ VIR_FREE(rawio); - VIR_FREE(backendStr); - return ret; - } -@@ -17975,6 +17993,12 @@ virDomainHostdevDefFormat(virBufferPtr buf, - scsisrc->sgio) - virBufferAsprintf(buf, " sgio='%s'", - virDomainDeviceSGIOTypeToString(scsisrc->sgio)); -+ -+ if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI && -+ scsisrc->rawio) { -+ virBufferAsprintf(buf, " rawio='%s'", -+ virTristateBoolTypeToString(scsisrc->rawio)); -+ } - } - virBufferAddLit(buf, ">\n"); - virBufferAdjustIndent(buf, 2); -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 39f1948..b981020 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -439,6 +439,7 @@ typedef virDomainHostdevSubsysSCSI *virDomainHostdevSubsysSCSIPtr; - struct _virDomainHostdevSubsysSCSI { - int protocol; /* enum virDomainHostdevSCSIProtocolType */ - int sgio; /* enum virDomainDeviceSGIO */ -+ int rawio; /* enum virTristateBool */ - union { - virDomainHostdevSubsysSCSIHost host; - virDomainHostdevSubsysSCSIiSCSI iscsi; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml -new file mode 100644 -index 0000000..69fdde3 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml -@@ -0,0 +1,35 @@ -+ -+ QEMUGuest2 -+ c7a5fdbd-edaf-9466-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -+ -+
-+ -+
-+ -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index ee05212..6e71cb2 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -369,6 +369,7 @@ mymain(void) - DO_TEST("disk-copy_on_read"); - DO_TEST("hostdev-scsi-shareable"); - DO_TEST("hostdev-scsi-sgio"); -+ DO_TEST("hostdev-scsi-rawio"); - - DO_TEST_DIFFERENT("hostdev-scsi-autogen-address"); - --- -2.1.1 - diff --git a/SOURCES/libvirt-hostdev-skip-ACS-check-when-using-VFIO-for-device-assignment.patch b/SOURCES/libvirt-hostdev-skip-ACS-check-when-using-VFIO-for-device-assignment.patch new file mode 100644 index 0000000..f571576 --- /dev/null +++ b/SOURCES/libvirt-hostdev-skip-ACS-check-when-using-VFIO-for-device-assignment.patch @@ -0,0 +1,53 @@ +From 5bbe76ba6427b8c4ab500b1404275c298dd1abb4 Mon Sep 17 00:00:00 2001 +Message-Id: <5bbe76ba6427b8c4ab500b1404275c298dd1abb4@dist-git> +From: Laine Stump +Date: Wed, 2 Sep 2015 15:55:24 -0400 +Subject: [PATCH] hostdev: skip ACS check when using VFIO for device assignment + +The ACS checks are meaningless when using the more modern VFIO driver +for device assignment since VFIO has its own more complete and exact +checks, but I didn't realize that when I added support for VFIO. This +patch eliminates the ACS check when preparing PCI devices for +assignment if VFIO is being used. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1256486 + +(cherry picked from commit 108d591b1144bc6cb5d1199f6fc23ee972b76e86) + +Signed-off-by: Jiri Denemark +--- + src/util/virhostdev.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c +index 529753c..0bc5120 100644 +--- a/src/util/virhostdev.c ++++ b/src/util/virhostdev.c +@@ -1,6 +1,6 @@ + /* virhostdev.c: hostdev management + * +- * Copyright (C) 2006-2007, 2009-2013 Red Hat, Inc. ++ * Copyright (C) 2006-2007, 2009-2015 Red Hat, Inc. + * Copyright (C) 2006 Daniel P. Berrange + * Copyright (C) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. + * +@@ -230,7 +230,6 @@ virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs) + virObjectUnref(list); + return NULL; + } +- + if (virPCIDeviceListAdd(list, dev) < 0) { + virPCIDeviceFree(dev); + virObjectUnref(list); +@@ -579,7 +578,7 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr, + struct virHostdevIsPCINodeDeviceUsedData data = {hostdev_mgr, dom_name, + usesVfio}; + +- if (!virPCIDeviceIsAssignable(dev, strict_acs_check)) { ++ if (!usesVfio && !virPCIDeviceIsAssignable(dev, strict_acs_check)) { + virReportError(VIR_ERR_OPERATION_INVALID, + _("PCI device %s is not assignable"), + virPCIDeviceGetName(dev)); +-- +2.5.1 + diff --git a/SOURCES/libvirt-hotplug-Check-for-alias-in-chrdev-detach.patch b/SOURCES/libvirt-hotplug-Check-for-alias-in-chrdev-detach.patch deleted file mode 100644 index 48b8864..0000000 --- a/SOURCES/libvirt-hotplug-Check-for-alias-in-chrdev-detach.patch +++ /dev/null @@ -1,38 +0,0 @@ -From de1a3fee51c281ff94db6aaffcb0cd57d09b326e Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Tue, 28 Oct 2014 22:28:47 -0400 -Subject: [PATCH] hotplug: Check for alias in chrdev detach - -https://bugzilla.redhat.com/show_bug.cgi?id=1141621 - -If the QEMU_CAPS_DEVICE is set, then ensure the chr device alias has -been properly set before making the calls to detach the device - -(cherry picked from commit 4d8a4165a797a3c8a3dc46ceba28796f24e8ea78) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - 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 a7b0ec7..f1735d7 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -3706,6 +3706,12 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, - return ret; - } - -+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) && -+ !tmpChr->info.alias) { -+ if (qemuAssignDeviceChrAlias(vmdef, tmpChr, -1) < 0) -+ return ret; -+ } -+ - if (qemuBuildChrDeviceStr(&devstr, vm->def, chr, priv->qemuCaps) < 0) - return ret; - --- -2.1.3 - diff --git a/SOURCES/libvirt-hotplug-Check-for-alias-in-controller-detach.patch b/SOURCES/libvirt-hotplug-Check-for-alias-in-controller-detach.patch deleted file mode 100644 index 037a6a2..0000000 --- a/SOURCES/libvirt-hotplug-Check-for-alias-in-controller-detach.patch +++ /dev/null @@ -1,36 +0,0 @@ -From aeeb94885f4ba16eef7694b561341d2b9959bb2a Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Tue, 28 Oct 2014 22:28:44 -0400 -Subject: [PATCH] hotplug: Check for alias in controller detach - -https://bugzilla.redhat.com/show_bug.cgi?id=1141621 - -In qemuDomainDetachControllerDevice if the info.alias already exists -a call to qemuAssignDeviceControllerAlias would overwrite the existing -so avoid this possibility. - -(cherry picked from commit 65be7572d2ef0228b111c2a1bbc90ee95179b706) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index e5e5180..e7aa2f0 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -3236,7 +3236,8 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver, - goto cleanup; - } - -- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { -+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) && -+ !detach->info.alias) { - if (qemuAssignDeviceControllerAlias(detach) < 0) - goto cleanup; - } --- -2.1.3 - diff --git a/SOURCES/libvirt-hotplug-Check-for-alias-in-disk-detach.patch b/SOURCES/libvirt-hotplug-Check-for-alias-in-disk-detach.patch deleted file mode 100644 index 43a19ce..0000000 --- a/SOURCES/libvirt-hotplug-Check-for-alias-in-disk-detach.patch +++ /dev/null @@ -1,38 +0,0 @@ -From cb0430d18f4c17369642a099ce865947c16c2d46 Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Tue, 28 Oct 2014 22:28:45 -0400 -Subject: [PATCH] hotplug: Check for alias in disk detach - -https://bugzilla.redhat.com/show_bug.cgi?id=1141621 - -If the QEMU_CAPS_DEVICE is set, then ensure the disk device alias has -been properly set in prior to making the calls to detach the device. - -(cherry picked from commit 5d02a9a0c5b0d033cf1a68c004bf3cb290666fa8) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - 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 e7aa2f0..246b4b9 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -3008,6 +3008,12 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver, - } - } - -+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) && -+ !detach->info.alias) { -+ if (qemuAssignDeviceDiskAlias(vm->def, detach, priv->qemuCaps) < 0) -+ goto cleanup; -+ } -+ - qemuDomainMarkDeviceForRemoval(vm, &detach->info); - - qemuDomainObjEnterMonitor(driver, vm); --- -2.1.3 - diff --git a/SOURCES/libvirt-hotplug-Check-for-alias-in-hostdev-detach.patch b/SOURCES/libvirt-hotplug-Check-for-alias-in-hostdev-detach.patch deleted file mode 100644 index 3d2eb3d..0000000 --- a/SOURCES/libvirt-hotplug-Check-for-alias-in-hostdev-detach.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 9f11a5b2ac9dd7f4470d13ecfd3d4d298a72ecf6 Mon Sep 17 00:00:00 2001 -Message-Id: <9f11a5b2ac9dd7f4470d13ecfd3d4d298a72ecf6@dist-git> -From: John Ferlan -Date: Tue, 28 Oct 2014 22:28:46 -0400 -Subject: [PATCH] hotplug: Check for alias in hostdev detach - -https://bugzilla.redhat.com/show_bug.cgi?id=1141621 - -If the QEMU_CAPS_DEVICE is set, then ensure the host device alias has -been properly set before making the calls to detach the device - -(cherry picked from commit 9de26f27cfa6a32ce9a23e30a58991432bdcbee5) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 246b4b9..a7b0ec7 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -3381,8 +3381,15 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr detach) - { -+ qemuDomainObjPrivatePtr priv = vm->privateData; - int ret = -1; - -+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) && -+ !detach->info->alias) { -+ if (qemuAssignDeviceHostdevAlias(vm->def, detach, -1) < 0) -+ return -1; -+ } -+ - switch (detach->source.subsys.type) { - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: - ret = qemuDomainDetachHostPCIDevice(driver, vm, detach); --- -2.1.3 - diff --git a/SOURCES/libvirt-hotplug-Check-for-alias-in-net-detach.patch b/SOURCES/libvirt-hotplug-Check-for-alias-in-net-detach.patch deleted file mode 100644 index 980f901..0000000 --- a/SOURCES/libvirt-hotplug-Check-for-alias-in-net-detach.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0d9504047c2f88a6c6ab176784840170a1ef0707 Mon Sep 17 00:00:00 2001 -Message-Id: <0d9504047c2f88a6c6ab176784840170a1ef0707@dist-git> -From: John Ferlan -Date: Tue, 28 Oct 2014 22:28:48 -0400 -Subject: [PATCH] hotplug: Check for alias in net detach - -https://bugzilla.redhat.com/show_bug.cgi?id=1141621 - -If the QEMU_CAPS_DEVICE is set, then ensure the host device alias has -been properly set before making the calls to detach the device - -(cherry picked from commit 96af61ddc1d1297200a497eb73628f0c3b0e3ad3) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - 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 f1735d7..fd4a8f2 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -3540,6 +3540,12 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver, - } - } - -+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) && -+ !detach->info.alias) { -+ if (qemuAssignDeviceNetAlias(vm->def, detach, -1) < 0) -+ goto cleanup; -+ } -+ - qemuDomainMarkDeviceForRemoval(vm, &detach->info); - - qemuDomainObjEnterMonitor(driver, vm); --- -2.1.3 - diff --git a/SOURCES/libvirt-hotplug-fix-char-device-detach.patch b/SOURCES/libvirt-hotplug-fix-char-device-detach.patch deleted file mode 100644 index 2542cc1..0000000 --- a/SOURCES/libvirt-hotplug-fix-char-device-detach.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 4289ddc2407cd074f68d29fd4620fd84f2d6b10d Mon Sep 17 00:00:00 2001 -Message-Id: <4289ddc2407cd074f68d29fd4620fd84f2d6b10d@dist-git> -From: Pavel Hrdina -Date: Mon, 3 Nov 2014 09:29:13 -0500 -Subject: [PATCH] hotplug: fix char device detach - -https://bugzilla.redhat.com/show_bug.cgi?id=1141621 - -Hotplugging and hotunplugging char devices is only supported through -'-device' and the check for device capability should be independently. - -Coverity also complains about 'tmpChr->info.alias' could be NULL and we -are dereferencing it but it somehow only in this case don't recognize -that the value is set by 'qemuAssignDeviceChrAlias' so it's clearly -false positive. Add sa_assert to make coverity happy. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit e7e05801e5e81bd80ea7dd9f0e0ae37f43ec49ad) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index fd4a8f2..54febb3 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -3712,12 +3712,17 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, - return ret; - } - -- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) && -- !tmpChr->info.alias) { -- if (qemuAssignDeviceChrAlias(vmdef, tmpChr, -1) < 0) -- return ret; -+ if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { -+ virReportError(VIR_ERR_OPERATION_INVALID, "%s", -+ _("qemu does not support -device")); -+ return ret; - } - -+ if (!tmpChr->info.alias && qemuAssignDeviceChrAlias(vmdef, tmpChr, -1) < 0) -+ return ret; -+ -+ sa_assert(tmpChr->info.alias); -+ - if (qemuBuildChrDeviceStr(&devstr, vm->def, chr, priv->qemuCaps) < 0) - return ret; - --- -2.1.3 - diff --git a/SOURCES/libvirt-hotplug-only-add-a-chardev-to-vmdef-after-monitor-call.patch b/SOURCES/libvirt-hotplug-only-add-a-chardev-to-vmdef-after-monitor-call.patch deleted file mode 100644 index 4d1287f..0000000 --- a/SOURCES/libvirt-hotplug-only-add-a-chardev-to-vmdef-after-monitor-call.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 7854f0d28b2bd526ae27777aa6c97f0ab3443523 Mon Sep 17 00:00:00 2001 -Message-Id: <7854f0d28b2bd526ae27777aa6c97f0ab3443523@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Wed, 28 Jan 2015 12:25:12 +0100 -Subject: [PATCH] hotplug: only add a chardev to vmdef after monitor call -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1195155 - -This way the device is in vmdef only if ret = 0 and the caller -(qemuDomainAttachDeviceFlags) does not free it. - -Otherwise it might get double freed by qemuProcessStop -and qemuDomainAttachDeviceFlags if the domain crashed -in monitor after we've added it to vm->def. - -(cherry picked from commit 21e0e8866e341da74e296ca3cf2d97812e847a66) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 34 +++++++++++----------------------- - 1 file changed, 11 insertions(+), 23 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 00ce77f..89757bc 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -1510,59 +1510,47 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver, - virDomainDefPtr vmdef = vm->def; - char *devstr = NULL; - char *charAlias = NULL; -- bool need_remove = false; - - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("qemu does not support -device")); -- return ret; -+ goto cleanup; - } - - if (qemuAssignDeviceChrAlias(vmdef, chr, -1) < 0) -- return ret; -+ goto cleanup; - - if (qemuBuildChrDeviceStr(&devstr, vm->def, chr, priv->qemuCaps) < 0) -- return ret; -+ goto cleanup; - - if (virAsprintf(&charAlias, "char%s", chr->info.alias) < 0) - goto cleanup; - -- if (qemuDomainChrInsert(vmdef, chr) < 0) -+ if (qemuDomainChrPreInsert(vmdef, chr) < 0) - goto cleanup; -- need_remove = true; - - qemuDomainObjEnterMonitor(driver, vm); - if (qemuMonitorAttachCharDev(priv->mon, charAlias, &chr->source) < 0) { -- if (qemuDomainObjExitMonitor(driver, vm) < 0) { -- need_remove = false; -- ret = -1; -- goto cleanup; -- } -+ ignore_value(qemuDomainObjExitMonitor(driver, vm)); - goto audit; - } - - if (devstr && qemuMonitorAddDevice(priv->mon, devstr) < 0) { - /* detach associated chardev on error */ - qemuMonitorDetachCharDev(priv->mon, charAlias); -- if (qemuDomainObjExitMonitor(driver, vm) < 0) { -- need_remove = false; -- ret = -1; -- goto cleanup; -- } -+ ignore_value(qemuDomainObjExitMonitor(driver, vm)); - goto audit; - } -- if (qemuDomainObjExitMonitor(driver, vm) < 0) { -- need_remove = false; -- ret = -1; -- goto cleanup; -- } -+ if (qemuDomainObjExitMonitor(driver, vm) < 0) -+ goto audit; - -+ qemuDomainChrInsertPreAlloced(vm->def, chr); - ret = 0; - audit: - virDomainAuditChardev(vm, NULL, chr, "attach", ret == 0); - cleanup: -- if (ret < 0 && need_remove) -- qemuDomainChrRemove(vmdef, chr); -+ if (ret < 0 && virDomainObjIsActive(vm)) -+ qemuDomainChrInsertPreAllocCleanup(vm->def, chr); - VIR_FREE(charAlias); - VIR_FREE(devstr); - return ret; --- -2.3.0 - diff --git a/SOURCES/libvirt-internal-add-macro-to-round-value-to-the-next-closest-power-of-2.patch b/SOURCES/libvirt-internal-add-macro-to-round-value-to-the-next-closest-power-of-2.patch deleted file mode 100644 index 87899c3..0000000 --- a/SOURCES/libvirt-internal-add-macro-to-round-value-to-the-next-closest-power-of-2.patch +++ /dev/null @@ -1,183 +0,0 @@ -From b5bba7ab59381434ebf03bedd9ff4b22696b7384 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pavel Hrdina -Date: Tue, 25 Nov 2014 10:52:58 +0100 -Subject: [PATCH] internal: add macro to round value to the next closest power - of 2 - -There are two special cases, if the input number is 0 or the number is -larger then 2^31 (for 32bit unsigned int). For the special cases the -return value is 0 because they cannot be rounded. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit ff28ebf13622ec3667f63fc0c0c22698331ced4b) - -I had to add the gnulib function 'count_leading_zeros' manually because -we don't update the gnulib downstream. - -Conflicts: - bootstrap.conf - removed count-leading-zeros as we don't update - the gnulib - src/util/virutil.h - add count_leading_zeros by hand from gnulib - module - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/internal.h | 6 +++++ - src/util/virutil.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ - tests/utiltest.c | 39 +++++++++++++++++++++++++++++++++ - 3 files changed, 109 insertions(+) - -diff --git a/src/internal.h b/src/internal.h -index f6a88b2..09d8277 100644 ---- a/src/internal.h -+++ b/src/internal.h -@@ -382,6 +382,12 @@ - /* round up value to the closest multiple of size */ - # define VIR_ROUND_UP(value, size) (VIR_DIV_UP(value, size) * (size)) - -+/* Round up to the next closest power of 2. It will return rounded number or 0 -+ * for 0 or number more than 2^31 (for 32bit unsigned int). */ -+# define VIR_ROUND_UP_POWER_OF_TWO(value) \ -+ ((value) > 0 && (value) <= 1U << (sizeof(unsigned int) * 8 - 1) ? \ -+ 1U << (sizeof(unsigned int) * 8 - count_leading_zeros((value) - 1)) : 0) -+ - - /* Specific error values for use in forwarding programs such as - * virt-login-shell; these values match what GNU env does. */ -diff --git a/src/util/virutil.h b/src/util/virutil.h -index 105c519..ae49aef 100644 ---- a/src/util/virutil.h -+++ b/src/util/virutil.h -@@ -244,4 +244,68 @@ VIR_ENUM_DECL(virTristateSwitch) - - unsigned int virGetListenFDs(void); - -+/* Borrow the code to count-leading-zeroes from gnulib LGPLv2+ -+ * count-leading-zeroes.h. */ -+ -+/* Assuming the GCC builtin is BUILTIN and the MSC builtin is MSC_BUILTIN, -+ expand to code that computes the number of leading zeros of the local -+ variable 'x' of type TYPE (an unsigned integer type) and return it -+ from the current function. */ -+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -+# define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \ -+ return x ? BUILTIN (x) : CHAR_BIT * sizeof x; -+#elif _MSC_VER -+# pragma intrinsic _BitReverse -+# pragma intrinsic _BitReverse64 -+# define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \ -+ do \ -+ { \ -+ unsigned long result; \ -+ return MSC_BUILTIN (&result, x) ? result : CHAR_BIT * sizeof x; \ -+ } \ -+ while (0) -+#else -+# define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \ -+ do \ -+ { \ -+ int count; \ -+ unsigned int leading_32; \ -+ if (! x) \ -+ return CHAR_BIT * sizeof x; \ -+ for (count = 0; \ -+ (leading_32 = ((x >> (sizeof (TYPE) * CHAR_BIT - 32)) \ -+ & 0xffffffffU), \ -+ count < CHAR_BIT * sizeof x - 32 && !leading_32); \ -+ count += 32) \ -+ x = x << 31 << 1; \ -+ return count + count_leading_zeros_32 (leading_32); \ -+ } \ -+ while (0) -+ -+/* Compute and return the number of leading zeros in X, -+ where 0 < X < 2**32. */ -+static inline int -+count_leading_zeros_32 (unsigned int x) -+{ -+ /* http://graphics.stanford.edu/~seander/bithacks.html */ -+ static const char de_Bruijn_lookup[32] = { -+ 31, 22, 30, 21, 18, 10, 29, 2, 20, 17, 15, 13, 9, 6, 28, 1, -+ 23, 19, 11, 3, 16, 14, 7, 24, 12, 4, 8, 25, 5, 26, 27, 0 -+ }; -+ -+ x |= x >> 1; -+ x |= x >> 2; -+ x |= x >> 4; -+ x |= x >> 8; -+ x |= x >> 16; -+ return de_Bruijn_lookup[((x * 0x07c4acddU) & 0xffffffffU) >> 27]; -+} -+#endif -+/* Compute and return the number of leading zeros in X. */ -+static inline int -+count_leading_zeros (unsigned int x) -+{ -+ COUNT_LEADING_ZEROS (__builtin_clz, _BitScanReverse, unsigned int); -+} -+ - #endif /* __VIR_UTIL_H__ */ -diff --git a/tests/utiltest.c b/tests/utiltest.c -index 89e82aa..8274ed0 100644 ---- a/tests/utiltest.c -+++ b/tests/utiltest.c -@@ -144,6 +144,44 @@ testParseVersionString(const void *data ATTRIBUTE_UNUSED) - - - -+struct testRoundData { -+ unsigned int input; -+ unsigned int output; -+}; -+ -+static struct testRoundData roundData[] = { -+ { 0, 0 }, -+ { 1, 1 }, -+ { 1000, 1024 }, -+ { 1024, 1024 }, -+ { 1025, 2048 }, -+ { UINT_MAX, 0 }, -+}; -+ -+static int -+testRoundValueToPowerOfTwo(const void *data ATTRIBUTE_UNUSED) -+{ -+ unsigned int result; -+ size_t i; -+ -+ for (i = 0; i < ARRAY_CARDINALITY(roundData); i++) { -+ result = VIR_ROUND_UP_POWER_OF_TWO(roundData[i].input); -+ if (roundData[i].output != result) { -+ if (virTestGetDebug() > 0) { -+ fprintf(stderr, "\nInput number [%u]\n", roundData[i].input); -+ fprintf(stderr, "Expected number [%u]\n", roundData[i].output); -+ fprintf(stderr, "Actual number [%u]\n", result); -+ } -+ -+ return -1; -+ } -+ } -+ -+ return 0; -+} -+ -+ -+ - - static int - mymain(void) -@@ -163,6 +201,7 @@ mymain(void) - DO_TEST(IndexToDiskName); - DO_TEST(DiskNameToIndex); - DO_TEST(ParseVersionString); -+ DO_TEST(RoundValueToPowerOfTwo); - - return result == 0 ? EXIT_SUCCESS : EXIT_FAILURE; - } --- -2.1.3 - diff --git a/SOURCES/libvirt-lib-De-duplicate-stats-group-documentation-for-all-stats-functions.patch b/SOURCES/libvirt-lib-De-duplicate-stats-group-documentation-for-all-stats-functions.patch deleted file mode 100644 index 474fd2c..0000000 --- a/SOURCES/libvirt-lib-De-duplicate-stats-group-documentation-for-all-stats-functions.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b6aae3a914d9841ed97d3ea6ab9322c40ea5c684 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Wed, 1 Oct 2014 11:20:18 +0200 -Subject: [PATCH] lib: De-duplicate stats group documentation for all stats - functions - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -State that full stats for the stats groups are available in the -virConnectGetAllDomainStats documentation section rather than -duplicating the docs. - -(cherry picked from commit b7dd3d9b46d3f0cbc22a637e30d932f94dc44a11) - -Signed-off-by: Jiri Denemark ---- - src/libvirt.c | 10 ++-------- - 1 file changed, 2 insertions(+), 8 deletions(-) - -diff --git a/src/libvirt.c b/src/libvirt.c -index f62ecf7..d6aee93 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21693,14 +21693,8 @@ virConnectGetAllDomainStats(virConnectPtr conn, - * followed by a group specific description of the statistic value. - * - * The statistic groups are enabled using the @stats parameter which is a -- * binary-OR of enum virDomainStatsTypes. The following groups are available -- * (although not necessarily implemented for each hypervisor): -- * -- * VIR_DOMAIN_STATS_STATE: Return domain state and reason for entering that -- * state. The typed parameter keys are in this format: -- * "state.state" - state of the VM, returned as int from virDomainState enum -- * "state.reason" - reason for entering given state, returned as int from -- * virDomain*Reason enum corresponding to given state. -+ * binary-OR of enum virDomainStatsTypes. The stats groups are documented -+ * in virConnectGetAllDomainStats. - * - * Using 0 for @stats returns all stats groups supported by the given - * hypervisor. --- -2.1.2 - diff --git a/SOURCES/libvirt-lib-Document-that-virConnectGetAllDomainStats-may-omit-some-stats-fields.patch b/SOURCES/libvirt-lib-Document-that-virConnectGetAllDomainStats-may-omit-some-stats-fields.patch deleted file mode 100644 index 4a2b49e..0000000 --- a/SOURCES/libvirt-lib-Document-that-virConnectGetAllDomainStats-may-omit-some-stats-fields.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 88213ead58c8367ca3fa921c3a154e846fade51c Mon Sep 17 00:00:00 2001 -Message-Id: <88213ead58c8367ca3fa921c3a154e846fade51c@dist-git> -From: Peter Krempa -Date: Wed, 1 Oct 2014 11:20:19 +0200 -Subject: [PATCH] lib: Document that virConnectGetAllDomainStats may omit some - stats fields - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -Add a note to make the users aware that some stats groups or fields may -be missing in certain cases. - -(cherry picked from commit a6500ee4f2f0db3fb8c408075b7dbcd77f7669d2) - -Signed-off-by: Jiri Denemark ---- - src/libvirt.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/libvirt.c b/src/libvirt.c -index d6aee93..af89aa2 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21616,6 +21616,11 @@ virConnectGetDomainCapabilities(virConnectPtr conn, - * "block..errors" - Xen only: the 'oo_req' value as - * unsigned long long. - * -+ * Note that entire stats groups or individual stat fields may be missing from -+ * the output in case they are not supported by the given hypervisor, are not -+ * applicable for the current state of the guest domain, or their retrieval -+ * was not successful. -+ * - * Using 0 for @stats returns all stats groups supported by the given - * hypervisor. - * --- -2.1.2 - diff --git a/SOURCES/libvirt-logical-Add-type-snapshot-to-lvcreate-command.patch b/SOURCES/libvirt-logical-Add-type-snapshot-to-lvcreate-command.patch deleted file mode 100644 index 9c8c50f..0000000 --- a/SOURCES/libvirt-logical-Add-type-snapshot-to-lvcreate-command.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 66cee818fd9a9651cbaf2421068e8dae2a5b92b2 Mon Sep 17 00:00:00 2001 -Message-Id: <66cee818fd9a9651cbaf2421068e8dae2a5b92b2@dist-git> -From: John Ferlan -Date: Wed, 17 Dec 2014 06:31:21 -0500 -Subject: [PATCH] logical: Add "--type snapshot" to lvcreate command - -https://bugzilla.redhat.com/show_bug.cgi?id=1166592 - -A recent lvm change has resulted in a change for the "default" type of -logical volume created when the "--virtualsize" or "--V" is supplied on -the command line (e.g. when the allocation and capacity values of a to -be created volume differ). It seems that at the very least the following -change adjusts the default type: - -https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=e0164f21 - -and the following may also have some impact. - -https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=87fc3b71 - -When using the virsh vol-create-as or vol-create xmlfile commands, the -result is that libvirt will now create a "thin logical volume" and a -"thin logical volume pool" rather than just a "thin snapshot logical -volume". For example the following sequence: - - # lvcreate --name test -L 2M -V 5M lvm_test - Rounding up size to full physical extent 4.00 MiB - Rounding up size to full physical extent 8.00 MiB - Logical volume "test" created. - # lvs lvm_test - LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert - lvol1 lvm_test twi-a-tz-- 4.00m 0.00 0.98 - test lvm_test Vwi-a-tz-- 8.00m lvol1 0.00 - -compared to the former code which had the following: - - LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert - test LVM_Test swi-a-s--- 4.00m [test_vorigin] 0.00 - -Since libvirt doesn't know how to parse the thin logical volume -and pool, it will fail to find the newly created volume and pool -even though it exists in the volume group. - -It cannot find since the command used to find/parse returns a thin volume -'test' with no associated device, for example the output is: - - lvol1##UgUwkp-fTFP-C0rc-ufue-xrYh-dkPr-FGPFPx#lvol1_tdata(0)#thin-pool#1#4194304#4194304#4194304#twi-a-tz-- - test##NcaIoH-4YWJ-QKu3-sJc3-EOcS-goff-cThLIL##thin#0#8388608#4194304#8388608#Vwi-a-tz-- - -as compared to the former which had the following: - - test#[test_vorigin]#Dt5Of3-4WE6-buvw-CWJ4-XOiz-ywOU-YULYw6#/dev/sda3(1300)#linear#1#4194304#4194304#4194304#swi-a-s--- - -While it's possible to generate code to handle the new thin lv and pool, this -patch will add a "--type snapshot" onto the lvcreate command libvirt uses -in order to "for now" be able to continue to utilize the thin snapshots - -(cherry picked from commit cafb934db850944e3b3cf4e3f6c4e28df4610b81) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/storage/storage_backend_logical.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c -index 4959985..8aa68a6 100644 ---- a/src/storage/storage_backend_logical.c -+++ b/src/storage/storage_backend_logical.c -@@ -758,6 +758,7 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn, - virCommandAddArgFormat(cmd, "%lluK", - VIR_DIV_UP(vol->target.allocation - ? vol->target.allocation : 1, 1024)); -+ virCommandAddArgList(cmd, "--type", "snapshot", NULL); - virCommandAddArg(cmd, "--virtualsize"); - vol->target.sparse = true; - } --- -2.2.0 - diff --git a/SOURCES/libvirt-lxc-Resolve-Coverity-FORWARD_NULL.patch b/SOURCES/libvirt-lxc-Resolve-Coverity-FORWARD_NULL.patch deleted file mode 100644 index 8f1b64e..0000000 --- a/SOURCES/libvirt-lxc-Resolve-Coverity-FORWARD_NULL.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 670f47b3b50915fbd772134e0d278956f92d2815 Mon Sep 17 00:00:00 2001 -Message-Id: <670f47b3b50915fbd772134e0d278956f92d2815@dist-git> -From: John Ferlan -Date: Mon, 15 Sep 2014 15:13:49 -0400 -Subject: [PATCH] lxc: Resolve Coverity FORWARD_NULL - -https://bugzilla.redhat.com/show_bug.cgi?id=1141209 - -If we jump to cleanup before allocating 'result', then the call to -virBlkioDeviceArrayClear() could dereference result - -Signed-off-by: John Ferlan -(cherry picked from commit 0311be9435087984c495243fbb378b7533beb99e) -Signed-off-by: Jiri Denemark ---- - src/lxc/lxc_driver.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c -index 66d708a..bdfad9e 100644 ---- a/src/lxc/lxc_driver.c -+++ b/src/lxc/lxc_driver.c -@@ -2222,8 +2222,10 @@ lxcDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - _("unable to parse blkio device '%s' '%s'"), - type, blkioDeviceStr); - cleanup: -- virBlkioDeviceArrayClear(result, ndevices); -- VIR_FREE(result); -+ if (result) { -+ virBlkioDeviceArrayClear(result, ndevices); -+ VIR_FREE(result); -+ } - return -1; - } - --- -2.1.0 - diff --git a/SOURCES/libvirt-lxc-Sync-BlkioDevice-values-when-setting-them-in-cgroups.patch b/SOURCES/libvirt-lxc-Sync-BlkioDevice-values-when-setting-them-in-cgroups.patch new file mode 100644 index 0000000..2c1c404 --- /dev/null +++ b/SOURCES/libvirt-lxc-Sync-BlkioDevice-values-when-setting-them-in-cgroups.patch @@ -0,0 +1,137 @@ +From 5055589798e9317ae3d9772d5a774c2578c89a3d Mon Sep 17 00:00:00 2001 +Message-Id: <5055589798e9317ae3d9772d5a774c2578c89a3d@dist-git> +From: Martin Kletzander +Date: Tue, 18 Aug 2015 17:28:01 -0700 +Subject: [PATCH] lxc: Sync BlkioDevice values when setting them in cgroups + +https://bugzilla.redhat.com/show_bug.cgi?id=1165580 + +The problem here is that there are some values that kernel accepts, but +does not set them, for example 18446744073709551615 which acts the same +way as zero. Let's do the same thing we do with other tuning options +and re-read them right after they are set in order to keep our internal +structures up-to-date. + +Signed-off-by: Martin Kletzander +(cherry picked from commit 4563c59b5b40f40f90c0579f5e2fcdd29c414265) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/lxc/lxc_cgroup.c | 20 +++++++++++++++----- + src/lxc/lxc_driver.c | 25 ++++++++++++++++++++----- + 2 files changed, 35 insertions(+), 10 deletions(-) + +diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c +index e9caa3e..ad254e4 100644 +--- a/src/lxc/lxc_cgroup.c ++++ b/src/lxc/lxc_cgroup.c +@@ -117,27 +117,37 @@ static int virLXCCgroupSetupBlkioTune(virDomainDefPtr def, + + if (dev->weight && + (virCgroupSetBlkioDeviceWeight(cgroup, dev->path, +- dev->weight) < 0)) ++ dev->weight) < 0 || ++ virCgroupGetBlkioDeviceWeight(cgroup, dev->path, ++ &dev->weight) < 0)) + return -1; + + if (dev->riops && + (virCgroupSetBlkioDeviceReadIops(cgroup, dev->path, +- dev->riops) < 0)) ++ dev->riops) < 0 || ++ virCgroupGetBlkioDeviceReadIops(cgroup, dev->path, ++ &dev->riops) < 0)) + return -1; + + if (dev->wiops && + (virCgroupSetBlkioDeviceWriteIops(cgroup, dev->path, +- dev->wiops) < 0)) ++ dev->wiops) < 0 || ++ virCgroupGetBlkioDeviceWriteIops(cgroup, dev->path, ++ &dev->wiops) < 0)) + return -1; + + if (dev->rbps && + (virCgroupSetBlkioDeviceReadBps(cgroup, dev->path, +- dev->rbps) < 0)) ++ dev->rbps) < 0 || ++ virCgroupGetBlkioDeviceReadBps(cgroup, dev->path, ++ &dev->rbps) < 0)) + return -1; + + if (dev->wbps && + (virCgroupSetBlkioDeviceWriteBps(cgroup, dev->path, +- dev->wbps) < 0)) ++ dev->wbps) < 0 || ++ virCgroupGetBlkioDeviceWriteBps(cgroup, dev->path, ++ &dev->wbps) < 0)) + return -1; + } + } +diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c +index d8d5119..1a7cc78 100644 +--- a/src/lxc/lxc_driver.c ++++ b/src/lxc/lxc_driver.c +@@ -2603,7 +2603,10 @@ lxcDomainSetBlkioParameters(virDomainPtr dom, + for (j = 0; j < ndevices; j++) { + if (virCgroupSetBlkioDeviceWeight(priv->cgroup, + devices[j].path, +- devices[j].weight) < 0) { ++ devices[j].weight) < 0 || ++ virCgroupGetBlkioDeviceWeight(priv->cgroup, ++ devices[j].path, ++ &devices[j].weight) < 0) { + ret = -1; + break; + } +@@ -2612,7 +2615,10 @@ lxcDomainSetBlkioParameters(virDomainPtr dom, + for (j = 0; j < ndevices; j++) { + if (virCgroupSetBlkioDeviceReadIops(priv->cgroup, + devices[j].path, +- devices[j].riops) < 0) { ++ devices[j].riops) < 0 || ++ virCgroupGetBlkioDeviceReadIops(priv->cgroup, ++ devices[j].path, ++ &devices[j].riops) < 0) { + ret = -1; + break; + } +@@ -2621,7 +2627,10 @@ lxcDomainSetBlkioParameters(virDomainPtr dom, + for (j = 0; j < ndevices; j++) { + if (virCgroupSetBlkioDeviceWriteIops(priv->cgroup, + devices[j].path, +- devices[j].wiops) < 0) { ++ devices[j].wiops) < 0 || ++ virCgroupGetBlkioDeviceWriteIops(priv->cgroup, ++ devices[j].path, ++ &devices[j].wiops) < 0) { + ret = -1; + break; + } +@@ -2630,7 +2639,10 @@ lxcDomainSetBlkioParameters(virDomainPtr dom, + for (j = 0; j < ndevices; j++) { + if (virCgroupSetBlkioDeviceReadBps(priv->cgroup, + devices[j].path, +- devices[j].rbps) < 0) { ++ devices[j].rbps) < 0 || ++ virCgroupGetBlkioDeviceReadBps(priv->cgroup, ++ devices[j].path, ++ &devices[j].rbps) < 0) { + ret = -1; + break; + } +@@ -2639,7 +2651,10 @@ lxcDomainSetBlkioParameters(virDomainPtr dom, + for (j = 0; j < ndevices; j++) { + if (virCgroupSetBlkioDeviceWriteBps(priv->cgroup, + devices[j].path, +- devices[j].wbps) < 0) { ++ devices[j].wbps) < 0 || ++ virCgroupGetBlkioDeviceWriteBps(priv->cgroup, ++ devices[j].path, ++ &devices[j].wbps) < 0) { + ret = -1; + break; + } +-- +2.5.1 + diff --git a/SOURCES/libvirt-lxc-don-t-setup-cpuset.mems-if-memory-mode-in-numatune-is-not-strict.patch b/SOURCES/libvirt-lxc-don-t-setup-cpuset.mems-if-memory-mode-in-numatune-is-not-strict.patch deleted file mode 100644 index 1d4aad4..0000000 --- a/SOURCES/libvirt-lxc-don-t-setup-cpuset.mems-if-memory-mode-in-numatune-is-not-strict.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 50407fa2b06aafa4b271ad3a1c3497dc6e21ee94 Mon Sep 17 00:00:00 2001 -Message-Id: <50407fa2b06aafa4b271ad3a1c3497dc6e21ee94@dist-git> -From: Wang Rui -Date: Tue, 27 Jan 2015 11:40:09 +0100 -Subject: [PATCH] lxc: don't setup cpuset.mems if memory mode in numatune is - not 'strict' - -https://bugzilla.redhat.com/show_bug.cgi?id=1186094 - -If the memory mode in numatune is not 'strict', we should not setup -cpuset.mems. Before commit 1a7be8c600905aa07ac2d78293336ba8523ad48e -we have checked the memory mode in virDomainNumatuneGetNodeset. This -patch adds the check as before. - -Signed-off-by: Wang Rui -(cherry picked from commit 8a3844f8189af257ff3f5aa298eda55b73f2a4d3) -Signed-off-by: Jiri Denemark ---- - src/lxc/lxc_cgroup.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c -index f9af31c..eb67191 100644 ---- a/src/lxc/lxc_cgroup.c -+++ b/src/lxc/lxc_cgroup.c -@@ -79,6 +79,10 @@ static int virLXCCgroupSetupCpusetTune(virDomainDefPtr def, - goto cleanup; - } - -+ if (virDomainNumatuneGetMode(def->numatune, -1) != -+ VIR_DOMAIN_NUMATUNE_MEM_STRICT) -+ goto cleanup; -+ - if (virDomainNumatuneMaybeFormatNodeset(def->numatune, nodemask, - &mask, -1) < 0) - goto cleanup; --- -2.2.2 - diff --git a/SOURCES/libvirt-lxc-improve-error-message-for-invalid-blkiotune-settings.patch b/SOURCES/libvirt-lxc-improve-error-message-for-invalid-blkiotune-settings.patch deleted file mode 100644 index 97ceecd..0000000 --- a/SOURCES/libvirt-lxc-improve-error-message-for-invalid-blkiotune-settings.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 0ccf240a71f05f4eed9335d960a0026e607747ea Mon Sep 17 00:00:00 2001 -Message-Id: <0ccf240a71f05f4eed9335d960a0026e607747ea@dist-git> -From: Martin Kletzander -Date: Tue, 4 Nov 2014 11:00:50 +0100 -Subject: [PATCH] lxc: improve error message for invalid blkiotune settings - -Before: - $ virsh blkiotune dummy --device-read-bytes-sec /dev/sda,-1 - error: Unable to change blkio parameters - error: invalid argument: unable to parse blkio device - 'device_read_bytes_sec' '/dev/sda,-1' - -After: - $ virsh blkiotune dummy --device-read-bytes-sec /dev/sda,-1 - error: Unable to change blkio parameters - error: invalid argument: invalid value '-1' for parameter - 'device_read_bytes_sec' of device '/dev/sda' - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1131306 - -Signed-off-by: Martin Kletzander -(cherry picked from commit b3880bbe97bd0881d7860cff25c1409e74f2e9ab) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/lxc/lxc_driver.c | 29 +++++++++++++++++++---------- - 1 file changed, 19 insertions(+), 10 deletions(-) - -diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c -index bdfad9e..cd8f828 100644 ---- a/src/lxc/lxc_driver.c -+++ b/src/lxc/lxc_driver.c -@@ -2158,7 +2158,7 @@ lxcDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - /* A valid string must have even number of fields, hence an odd - * number of commas. */ - if (!(nsep & 1)) -- goto error; -+ goto parse_error; - - ndevices = (nsep + 1) / 2; - -@@ -2173,7 +2173,7 @@ lxcDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - /* device path */ - p = strchr(p, ','); - if (!p) -- goto error; -+ goto parse_error; - - if (VIR_STRNDUP(result[i].path, temp, p - temp) < 0) - goto cleanup; -@@ -2183,21 +2183,23 @@ lxcDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - - if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT)) { - if (virStrToLong_uip(temp, &p, 10, &result[i].weight) < 0) -- goto error; -+ goto number_error; - } else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS)) { - if (virStrToLong_uip(temp, &p, 10, &result[i].riops) < 0) -- goto error; -+ goto number_error; - } else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS)) { - if (virStrToLong_uip(temp, &p, 10, &result[i].wiops) < 0) -- goto error; -+ goto number_error; - } else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_READ_BPS)) { - if (virStrToLong_ullp(temp, &p, 10, &result[i].rbps) < 0) -- goto error; -+ goto number_error; - } else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS)) { - if (virStrToLong_ullp(temp, &p, 10, &result[i].wbps) < 0) -- goto error; -+ goto number_error; - } else { -- goto error; -+ virReportError(VIR_ERR_INVALID_ARG, -+ _("unknown parameter '%s'"), type); -+ goto cleanup; - } - - i++; -@@ -2205,7 +2207,7 @@ lxcDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - if (*p == '\0') - break; - else if (*p != ',') -- goto error; -+ goto parse_error; - temp = p + 1; - } - -@@ -2217,10 +2219,17 @@ lxcDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - - return 0; - -- error: -+ parse_error: - virReportError(VIR_ERR_INVALID_ARG, - _("unable to parse blkio device '%s' '%s'"), - type, blkioDeviceStr); -+ goto cleanup; -+ -+ number_error: -+ virReportError(VIR_ERR_INVALID_ARG, -+ _("invalid value '%s' for parameter '%s' of device '%s'"), -+ temp, type, result[i].path); -+ - cleanup: - if (result) { - virBlkioDeviceArrayClear(result, ndevices); --- -2.1.3 - diff --git a/SOURCES/libvirt-man-virsh-Add-docs-for-supported-stats-groups.patch b/SOURCES/libvirt-man-virsh-Add-docs-for-supported-stats-groups.patch deleted file mode 100644 index 3e19fb7..0000000 --- a/SOURCES/libvirt-man-virsh-Add-docs-for-supported-stats-groups.patch +++ /dev/null @@ -1,77 +0,0 @@ -From cc1fed5d5f7a1fa007ff889bf895aa66653a88ea Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Wed, 1 Oct 2014 11:20:20 +0200 -Subject: [PATCH] man: virsh: Add docs for supported stats groups - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -Document the fields returned. - -(cherry picked from commit 74cf34bc94c5147b217a86f7f0c2686dc86b62bb) - -Signed-off-by: Jiri Denemark ---- - tools/virsh.pod | 46 ++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 46 insertions(+) - -diff --git a/tools/virsh.pod b/tools/virsh.pod -index ea96d64..7d4e497 100644 ---- a/tools/virsh.pod -+++ b/tools/virsh.pod -@@ -835,6 +835,52 @@ default all supported statistics groups are returned. Supported - statistics groups flags are: I<--state>, I<--cpu-total>, I<--balloon>, - I<--vcpu>, I<--interface>, I<--block>. - -+When selecting the I<--state> group the following fields are returned: -+"state.state" - state of the VM, returned as number from virDomainState enum, -+"state.reason" - reason for entering given state, returned as int from, -+virDomain*Reason enum corresponding to given state. -+ -+I<--cpu-total> returns: -+"cpu.time" - total cpu time spent for this domain in nanoseconds, -+"cpu.user" - user cpu time spent in nanoseconds, -+"cpu.system" - system cpu time spent in nanoseconds -+ -+I<--balloon> returns: -+"balloon.current" - the memory in kiB currently used, -+"balloon.maximum" - the maximum memory in kiB allowed -+ -+I<--vcpu> returns: -+"vcpu.current" - current number of online virtual CPUs, -+"vcpu.maximum" - maximum number of online virtual CPUs, -+"vcpu..state" - state of the virtual CPU , as number -+from virVcpuState enum, -+"vcpu..time" - virtual cpu time spent by virtual CPU -+ -+I<--interface> returns: -+"net.count" - number of network interfaces on this domain, -+"net..name" - name of the interface , -+"net..rx.bytes" - number of bytes received, -+"net..rx.pkts" - number of packets received, -+"net..rx.errs" - number of receive errors, -+"net..rx.drop" - number of receive packets dropped, -+"net..tx.bytes" - number of bytes transmitted, -+"net..tx.pkts" - number of packets transmitted, -+"net..tx.errs" - number of transmission errors, -+"net..tx.drop" - number of transmit packets dropped, -+ -+I returns: -+"block.count" - number of block devices on this domain, -+"block..name" - name of the target of the block device , -+"block..rd.reqs" - number of read requests, -+"block..rd.bytes" - number of read bytes, -+"block..rd.times" - total time (ns) spent on reads, -+"block..wr.reqs" - number of write requests, -+"block..wr.bytes" - number of written bytes, -+"block..wr.times" - total time (ns) spent on writes, -+"block..fl.reqs" - total flush requests, -+"block..fl.times" - total time (ns) spent on cache flushing, -+"block..errors" - Xen only: the 'oo_req' value, -+ - Selecting a specific statistics groups doesn't guarantee that the - daemon supports the selected group of stats. Flag I<--enforce> - forces the command to fail if the daemon doesn't support the --- -2.1.2 - diff --git a/SOURCES/libvirt-minor-shmem-clean-ups.patch b/SOURCES/libvirt-minor-shmem-clean-ups.patch deleted file mode 100644 index 7ad8cbd..0000000 --- a/SOURCES/libvirt-minor-shmem-clean-ups.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 2236118c82469a2a65df37194a0fbc681d7bb366 Mon Sep 17 00:00:00 2001 -Message-Id: <2236118c82469a2a65df37194a0fbc681d7bb366@dist-git> -From: Martin Kletzander -Date: Sat, 4 Oct 2014 10:53:20 +0200 -Subject: [PATCH] minor shmem clean-ups - -https://bugzilla.redhat.com/show_bug.cgi?id=1126991 - -Signed-off-by: Martin Kletzander -(cherry picked from commit 34f514778ba55a0031ea21d6b3006317c1f607b5) -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 2 +- - src/conf/domain_conf.c | 5 ++--- - src/qemu/qemu_command.c | 5 ++--- - 3 files changed, 5 insertions(+), 7 deletions(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index dac81ab..e00fe47 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -5587,7 +5587,7 @@ qemu-kvm -net nic,model=? /dev/null -

- A shared memory device allows to share a memory region between - different virtual machines and the host. -- Since 1.2.9, QEMU and KVM only -+ Since 1.2.10, QEMU and KVM only -

- -
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index d61358b..b109330 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -17552,7 +17552,7 @@ virDomainShmemDefFormat(virBufferPtr buf,
-                         virDomainShmemDefPtr def,
-                         unsigned int flags)
- {
--    virBufferAsprintf(buf, "name);
-+    virBufferEscapeString(buf, "name);
- 
-     if (!def->size &&
-         !def->server.enabled &&
-@@ -17567,8 +17567,7 @@ virDomainShmemDefFormat(virBufferPtr buf,
-     virBufferAdjustIndent(buf, 2);
- 
-     if (def->size)
--        virBufferAsprintf(buf, "%llu\n",
--                          VIR_DIV_UP(def->size, 1024 * 1024));
-+        virBufferAsprintf(buf, "%llu\n", def->size >> 20);
- 
-     if (def->server.enabled) {
-         virBufferAddLit(buf, "size & (shmem->size - 1)) {
-@@ -7531,8 +7531,7 @@ qemuBuildShmemDevCmd(virCommandPtr cmd,
-                            _("shmem size must be at least 1 MiB"));
-             goto error;
-         }
--        virBufferAsprintf(&buf, ",size=%llum",
--                          VIR_DIV_UP(shmem->size, 1024 * 1024));
-+        virBufferAsprintf(&buf, ",size=%llum", shmem->size >> 20);
-     }
- 
-     if (!shmem->server.enabled) {
--- 
-2.1.2
-
diff --git a/SOURCES/libvirt-monitor-detect-that-eject-fails-because-the-tray-is-locked.patch b/SOURCES/libvirt-monitor-detect-that-eject-fails-because-the-tray-is-locked.patch
new file mode 100644
index 0000000..6ec930a
--- /dev/null
+++ b/SOURCES/libvirt-monitor-detect-that-eject-fails-because-the-tray-is-locked.patch
@@ -0,0 +1,92 @@
+From 0ef69d9942be58851bdbfca900274aa24c871812 Mon Sep 17 00:00:00 2001
+Message-Id: <0ef69d9942be58851bdbfca900274aa24c871812@dist-git>
+From: Pavel Hrdina 
+Date: Fri, 10 Jul 2015 12:39:31 +0200
+Subject: [PATCH] monitor: detect that eject fails because the tray is locked
+
+Modify the eject monitor functions to parse the return code and detect,
+whether the error contains "is locked" to report this type of failure to
+upper layers.
+
+Signed-off-by: Pavel Hrdina 
+(cherry picked from commit 256496e1499fcc7b20a51919eb4471987a36dbab)
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1147471
+
+Signed-off-by: Pavel Hrdina 
+Signed-off-by: Jiri Denemark 
+---
+ src/qemu/qemu_monitor_json.c | 14 ++++++++++++++
+ src/qemu/qemu_monitor_text.c | 10 ++++++++++
+ 2 files changed, 24 insertions(+)
+
+diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
+index 4323c2a..4040ff0 100644
+--- a/src/qemu/qemu_monitor_json.c
++++ b/src/qemu/qemu_monitor_json.c
+@@ -44,6 +44,7 @@
+ #include "virprobe.h"
+ #include "virstring.h"
+ #include "cpu/cpu_x86.h"
++#include "c-strcasestr.h"
+ 
+ #ifdef WITH_DTRACE_PROBES
+ # include "libvirt_qemu_probes.h"
+@@ -2209,6 +2210,14 @@ int qemuMonitorJSONSetCPU(qemuMonitorPtr mon,
+ }
+ 
+ 
++/**
++ * Run QMP command to eject a media from ejectable device.
++ *
++ * Returns:
++ *      -2 on error, when the tray is locked
++ *      -1 on all other errors
++ *      0 on success
++ */
+ int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
+                               const char *dev_name,
+                               bool force)
+@@ -2227,6 +2236,11 @@ int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
+     if (ret == 0)
+         ret = qemuMonitorJSONCheckError(cmd, reply);
+ 
++    VIR_DEBUG("%s", virJSONValueToString(reply, false));
++
++    if (ret < 0 && c_strcasestr(virJSONValueToString(reply, false), "is locked"))
++        ret = -2;
++
+     virJSONValueFree(cmd);
+     virJSONValueFree(reply);
+     return ret;
+diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
+index 2e77534..2aa0460 100644
+--- a/src/qemu/qemu_monitor_text.c
++++ b/src/qemu/qemu_monitor_text.c
+@@ -1169,6 +1169,14 @@ int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, bool online)
+ }
+ 
+ 
++/**
++ * Run HMP command to eject a media from ejectable device.
++ *
++ * Returns:
++ *      -2 on error, when the tray is locked
++ *      -1 on all other errors
++ *      0 on success
++ */
+ int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
+                               const char *dev_name,
+                               bool force)
+@@ -1187,6 +1195,8 @@ int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
+      * device not found, device is locked ...
+      * No message is printed on success it seems */
+     if (c_strcasestr(reply, "device ")) {
++        if (c_strcasestr(reply, "is locked"))
++            ret = -2;
+         virReportError(VIR_ERR_OPERATION_FAILED,
+                        _("could not eject media on %s: %s"), dev_name, reply);
+         goto cleanup;
+-- 
+2.4.5
+
diff --git a/SOURCES/libvirt-network-Add-another-collision-check-into-networkCheckRouteCollision.patch b/SOURCES/libvirt-network-Add-another-collision-check-into-networkCheckRouteCollision.patch
new file mode 100644
index 0000000..15e40eb
--- /dev/null
+++ b/SOURCES/libvirt-network-Add-another-collision-check-into-networkCheckRouteCollision.patch
@@ -0,0 +1,73 @@
+From 83e667d206d16867cfc640b118a37e46d1ef897d Mon Sep 17 00:00:00 2001
+Message-Id: <83e667d206d16867cfc640b118a37e46d1ef897d@dist-git>
+From: Martin Kletzander 
+Date: Thu, 6 Aug 2015 13:10:24 +0200
+Subject: [PATCH] network: Add another collision check into
+ networkCheckRouteCollision
+
+The comment above that function says: "This function can be a lot more
+exhaustive, ...", so let's be.
+
+Check for collisions between routes in the system and static routes
+being added explicitly from the  element of the network XML.
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1094205
+
+Signed-off-by: Martin Kletzander 
+(cherry picked from commit 0e3ad241f3f421c23bbe2cbe11a70f8e9184dc65)
+Signed-off-by: Martin Kletzander 
+Signed-off-by: Jiri Denemark 
+---
+ src/network/bridge_driver_linux.c | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+diff --git a/src/network/bridge_driver_linux.c b/src/network/bridge_driver_linux.c
+index e394daf..bd7508c 100644
+--- a/src/network/bridge_driver_linux.c
++++ b/src/network/bridge_driver_linux.c
+@@ -69,6 +69,7 @@ int networkCheckRouteCollision(virNetworkDefPtr def)
+         char iface[17], dest[128], mask[128];
+         unsigned int addr_val, mask_val;
+         virNetworkIpDefPtr ipdef;
++        virNetworkRouteDefPtr routedef;
+         int num;
+         size_t i;
+ 
+@@ -123,6 +124,34 @@ int networkCheckRouteCollision(virNetworkDefPtr def)
+                 goto out;
+             }
+         }
++
++        for (i = 0;
++             (routedef = virNetworkDefGetRouteByIndex(def, AF_INET, i));
++             i++) {
++
++            virSocketAddr r_mask, r_addr;
++            virSocketAddrPtr tmp_addr = virNetworkRouteDefGetAddress(routedef);
++            int r_prefix = virNetworkRouteDefGetPrefix(routedef);
++
++            if (!tmp_addr ||
++                virSocketAddrMaskByPrefix(tmp_addr, r_prefix, &r_addr) < 0 ||
++                virSocketAddrPrefixToNetmask(r_prefix, &r_mask, AF_INET) < 0)
++                continue;
++
++            if ((r_addr.data.inet4.sin_addr.s_addr == addr_val) &&
++                (r_mask.data.inet4.sin_addr.s_addr == mask_val)) {
++                char *addr_str = virSocketAddrFormat(&r_addr);
++                if (!addr_str)
++                    virResetLastError();
++                virReportError(VIR_ERR_INTERNAL_ERROR,
++                               _("Route address '%s' conflicts "
++                                 "with IP address for '%s'"),
++                               NULLSTR(addr_str), iface);
++                VIR_FREE(addr_str);
++                ret = -1;
++                goto out;
++            }
++        }
+     }
+ 
+  out:
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-network-Bring-netdevs-online-later.patch b/SOURCES/libvirt-network-Bring-netdevs-online-later.patch
deleted file mode 100644
index e247876..0000000
--- a/SOURCES/libvirt-network-Bring-netdevs-online-later.patch
+++ /dev/null
@@ -1,303 +0,0 @@
-From 2d14de522db3d5735e02f76e9204e550363a37ea Mon Sep 17 00:00:00 2001
-Message-Id: <2d14de522db3d5735e02f76e9204e550363a37ea@dist-git>
-From: Matthew Rosato 
-Date: Sun, 14 Dec 2014 23:44:49 -0500
-Subject: [PATCH] network: Bring netdevs online later
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1081461
-
-Currently, MAC registration occurs during device creation, which is
-early enough that, during live migration, you end up with duplicate
-MAC addresses on still-running source and target devices, even though
-the target device isn't actually being used yet.
-This patch proposes to defer MAC registration until right before
-the guest can actually use the device -- In other words, right
-before starting guest CPUs.
-
-Signed-off-by: Matthew Rosato 
-Signed-off-by: Laine Stump 
-(cherry picked from commit 82977058f5b1d143a355079900029e9cbfee2fe4)
-
-Conflicts:
-	src/lxc/lxc_process.c
-          - bandwidth removed from function arglist upstream
-	src/qemu/qemu_hotplug.c
-          - context upstream different due to centralized handling
-            of bandwidth setting.
-Signed-off-by: Jiri Denemark 
----
- src/Makefile.am             |   3 +-
- src/lxc/lxc_process.c       |   4 +-
- src/qemu/qemu_hotplug.c     |   5 +++
- src/qemu/qemu_interface.c   | 100 ++++++++++++++++++++++++++++++++++++++++++++
- src/qemu/qemu_interface.h   |  32 ++++++++++++++
- src/qemu/qemu_process.c     |   7 ++++
- src/util/virnetdevmacvlan.c |   8 ++--
- src/util/virnetdevmacvlan.h |   2 +
- 8 files changed, 156 insertions(+), 5 deletions(-)
- create mode 100644 src/qemu/qemu_interface.c
- create mode 100644 src/qemu/qemu_interface.h
-
-diff --git a/src/Makefile.am b/src/Makefile.am
-index fa741a8..035120e 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -703,7 +703,8 @@ QEMU_DRIVER_SOURCES =							\
- 		qemu/qemu_monitor_text.h				\
- 		qemu/qemu_monitor_json.c				\
- 		qemu/qemu_monitor_json.h				\
--		qemu/qemu_driver.c qemu/qemu_driver.h
-+		qemu/qemu_driver.c qemu/qemu_driver.h	\
-+		qemu/qemu_interface.c qemu/qemu_interface.h
- 
- XENAPI_DRIVER_SOURCES =						\
- 		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
-diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
-index 6c83fdb..3b294fe 100644
---- a/src/lxc/lxc_process.c
-+++ b/src/lxc/lxc_process.c
-@@ -300,6 +300,7 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
-     virNetDevBandwidthPtr bw;
-     virNetDevVPortProfilePtr prof;
-     virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
-+    unsigned int macvlan_create_flags = VIR_NETDEV_MACVLAN_CREATE_IFUP;
- 
-     /* XXX how todo bandwidth controls ?
-      * Since the 'net-ifname' is about to be moved to a different
-@@ -336,7 +337,8 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
-             &res_ifname,
-             VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
-             cfg->stateDir,
--            virDomainNetGetActualBandwidth(net), 0) < 0)
-+            virDomainNetGetActualBandwidth(net),
-+            macvlan_create_flags) < 0)
-         goto cleanup;
- 
-     ret = res_ifname;
-diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
-index 54febb3..aaa7e21 100644
---- a/src/qemu/qemu_hotplug.c
-+++ b/src/qemu/qemu_hotplug.c
-@@ -30,6 +30,7 @@
- #include "qemu_domain.h"
- #include "qemu_command.h"
- #include "qemu_hostdev.h"
-+#include "qemu_interface.h"
- #include "domain_audit.h"
- #include "domain_nwfilter.h"
- #include "virlog.h"
-@@ -948,6 +949,10 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
-             goto cleanup;
-     }
- 
-+    /* Set device online immediately */
-+    if (qemuInterfaceStartDevice(net) < 0)
-+       goto cleanup;
-+
-     for (i = 0; i < tapfdSize; i++) {
-         if (virSecurityManagerSetTapFDLabel(driver->securityManager,
-                                             vm->def, tapfd[i]) < 0)
-diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
-new file mode 100644
-index 0000000..b0f0c5d
---- /dev/null
-+++ b/src/qemu/qemu_interface.c
-@@ -0,0 +1,100 @@
-+/*
-+ * qemu_interface.c: QEMU interface management
-+ *
-+ * Copyright IBM Corp. 2014
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2.1 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library.  If not, see
-+ * .
-+ *
-+ * Authors:
-+ *     Matthew J. Rosato 
-+ */
-+
-+#include 
-+
-+#include "qemu_interface.h"
-+#include "virnetdev.h"
-+#include "virnetdevtap.h"
-+#include "virnetdevmacvlan.h"
-+#include "virnetdevvportprofile.h"
-+
-+/**
-+ * qemuInterfaceStartDevice:
-+ * @net: net device to start
-+ *
-+ * Based upon the type of device provided, perform the appropriate
-+ * work to completely activate the device and make it reachable from
-+ * the rest of the network.
-+ */
-+int
-+qemuInterfaceStartDevice(virDomainNetDefPtr net)
-+{
-+    int ret = -1;
-+
-+    switch (virDomainNetGetActualType(net)) {
-+    case VIR_DOMAIN_NET_TYPE_BRIDGE:
-+    case VIR_DOMAIN_NET_TYPE_NETWORK:
-+        break;
-+    case VIR_DOMAIN_NET_TYPE_DIRECT:
-+        /* macvtap devices share their MAC address with the guest
-+         * domain, and if they are set online prior to the domain CPUs
-+         * being started, the host may send out traffic from this
-+         * device that could confuse other entities on the network (in
-+         * particular, if this new domain is the destination of a
-+         * migration, and the source domain is still running, another
-+         * host may mistakenly direct traffic for the guest to the
-+         * destination domain rather than source domain). To prevent
-+         * this, we create the macvtap device with IFF_UP false
-+         * (i.e. "offline") then wait to bring it online until just as
-+         * we are starting the domain CPUs.
-+         */
-+        if (virNetDevSetOnline(net->ifname, true) < 0)
-+            goto cleanup;
-+        break;
-+
-+    case VIR_DOMAIN_NET_TYPE_USER:
-+    case VIR_DOMAIN_NET_TYPE_ETHERNET:
-+    case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
-+    case VIR_DOMAIN_NET_TYPE_SERVER:
-+    case VIR_DOMAIN_NET_TYPE_CLIENT:
-+    case VIR_DOMAIN_NET_TYPE_MCAST:
-+    case VIR_DOMAIN_NET_TYPE_INTERNAL:
-+    case VIR_DOMAIN_NET_TYPE_HOSTDEV:
-+    case VIR_DOMAIN_NET_TYPE_LAST:
-+        /* these types all require no action */
-+        break;
-+    }
-+
-+    ret = 0;
-+ cleanup:
-+    return ret;
-+}
-+
-+/**
-+ * qemuInterfaceStartDevices:
-+ * @def: domain definition
-+ *
-+ * Set all ifaces associated with this domain to the online state.
-+ */
-+int
-+qemuInterfaceStartDevices(virDomainDefPtr def)
-+{
-+    size_t i;
-+
-+    for (i = 0; i < def->nnets; i++) {
-+        if (qemuInterfaceStartDevice(def->nets[i]) < 0)
-+            return -1;
-+    }
-+    return 0;
-+}
-diff --git a/src/qemu/qemu_interface.h b/src/qemu/qemu_interface.h
-new file mode 100644
-index 0000000..d040f52
---- /dev/null
-+++ b/src/qemu/qemu_interface.h
-@@ -0,0 +1,32 @@
-+/*
-+ * qemu_interface.h: QEMU interface management
-+ *
-+ * Copyright IBM Corp. 2014
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2.1 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library.  If not, see
-+ * .
-+ *
-+ * Authors:
-+ *     Matthew J. Rosato 
-+ */
-+
-+#ifndef __QEMU_INTERFACE_H__
-+# define __QEMU_INTERFACE_H__
-+
-+# include "domain_conf.h"
-+
-+int qemuInterfaceStartDevice(virDomainNetDefPtr net);
-+int qemuInterfaceStartDevices(virDomainDefPtr def);
-+
-+#endif /* __QEMU_INTERFACE_H__ */
-diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
-index 3d275a3..dd74432 100644
---- a/src/qemu/qemu_process.c
-+++ b/src/qemu/qemu_process.c
-@@ -42,6 +42,7 @@
- #include "qemu_hostdev.h"
- #include "qemu_hotplug.h"
- #include "qemu_migration.h"
-+#include "qemu_interface.h"
- 
- #include "cpu/cpu.h"
- #include "datatypes.h"
-@@ -3112,6 +3113,12 @@ qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
-     qemuDomainObjPrivatePtr priv = vm->privateData;
-     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
- 
-+    /* Bring up netdevs before starting CPUs */
-+    if (reason != VIR_DOMAIN_RUNNING_UNPAUSED &&
-+        reason != VIR_DOMAIN_RUNNING_SAVE_CANCELED &&
-+        qemuInterfaceStartDevices(vm->def) < 0)
-+       goto cleanup;
-+
-     VIR_DEBUG("Using lock state '%s'", NULLSTR(priv->lockState));
-     if (virDomainLockProcessResume(driver->lockManager, cfg->uri,
-                                    vm, priv->lockState) < 0) {
-diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
-index 50aabc5..9f4c2a7 100644
---- a/src/util/virnetdevmacvlan.c
-+++ b/src/util/virnetdevmacvlan.c
-@@ -903,9 +903,11 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
-         goto link_del_exit;
-     }
- 
--    if (virNetDevSetOnline(cr_ifname, true) < 0) {
--        rc = -1;
--        goto disassociate_exit;
-+    if (flags & VIR_NETDEV_MACVLAN_CREATE_IFUP) {
-+        if (virNetDevSetOnline(cr_ifname, true) < 0) {
-+            rc = -1;
-+            goto disassociate_exit;
-+        }
-     }
- 
-     if (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) {
-diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h
-index 41aa4e2..41b4014 100644
---- a/src/util/virnetdevmacvlan.h
-+++ b/src/util/virnetdevmacvlan.h
-@@ -44,6 +44,8 @@ typedef enum {
-    VIR_NETDEV_MACVLAN_CREATE_NONE     = 0,
-    /* Create with a tap device */
-    VIR_NETDEV_MACVLAN_CREATE_WITH_TAP = 1 << 0,
-+   /* Bring the interface up */
-+   VIR_NETDEV_MACVLAN_CREATE_IFUP     = 1 << 1,
- } virNetDevMacVLanCreateFlags;
- 
- int virNetDevMacVLanCreate(const char *ifname,
--- 
-2.2.0
-
diff --git a/SOURCES/libvirt-network-Fix-upgrade-from-libvirt-older-than-1.2.4.patch b/SOURCES/libvirt-network-Fix-upgrade-from-libvirt-older-than-1.2.4.patch
deleted file mode 100644
index 2267834..0000000
--- a/SOURCES/libvirt-network-Fix-upgrade-from-libvirt-older-than-1.2.4.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 7567a5cad149ac0ea17e0bfc32f07ada642cd921 Mon Sep 17 00:00:00 2001
-Message-Id: <7567a5cad149ac0ea17e0bfc32f07ada642cd921@dist-git>
-From: Jiri Denemark 
-Date: Wed, 26 Nov 2014 16:24:27 +0100
-Subject: [PATCH] network: Fix upgrade from libvirt older than 1.2.4
-
-Starting from libvirt-1.2.4, network state XML files moved to another
-directory (see commit b9e95491) and libvirt automatically migrates the
-network state files to a new location. However, the code used
-dirent.d_type which is not supported by all filesystems. Thus, when
-libvirt was upgraded on a host which used such filesystem, network state
-XMLs were not properly moved and running networks disappeared from
-libvirt.
-
-This patch falls back to lstat() whenever dirent.d_type is DT_UNKNOWN to
-fix this issue.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1167145
-Signed-off-by: Jiri Denemark 
-(cherry picked from commit dabb23e6d95dc7d81e7fb2a3f6c942167f4c45af)
-Signed-off-by: Jiri Denemark 
----
- src/network/bridge_driver.c | 23 +++++++++++++++++++++--
- 1 file changed, 21 insertions(+), 2 deletions(-)
-
-diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
-index 9746099..488409d 100644
---- a/src/network/bridge_driver.c
-+++ b/src/network/bridge_driver.c
-@@ -508,15 +508,34 @@ networkMigrateStateFiles(virNetworkDriverStatePtr driver)
-     }
- 
-     while ((direrr = virDirRead(dir, &entry, oldStateDir)) > 0) {
-+        if (entry->d_type != DT_UNKNOWN &&
-+            entry->d_type != DT_REG)
-+            continue;
- 
--        if (entry->d_type != DT_REG ||
--            STREQ(entry->d_name, ".") ||
-+        if (STREQ(entry->d_name, ".") ||
-             STREQ(entry->d_name, ".."))
-             continue;
- 
-         if (virAsprintf(&oldPath, "%s/%s",
-                         oldStateDir, entry->d_name) < 0)
-             goto cleanup;
-+
-+        if (entry->d_type == DT_UNKNOWN) {
-+            struct stat st;
-+
-+            if (lstat(oldPath, &st) < 0) {
-+                virReportSystemError(errno,
-+                                     _("failed to stat network status file '%s'"),
-+                                     oldPath);
-+                goto cleanup;
-+            }
-+
-+            if (!S_ISREG(st.st_mode)) {
-+                VIR_FREE(oldPath);
-+                continue;
-+            }
-+        }
-+
-         if (virFileReadAll(oldPath, 1024*1024, &contents) < 0)
-             goto cleanup;
- 
--- 
-2.1.3
-
diff --git a/SOURCES/libvirt-network-fix-call-virNetworkEventLifecycleNew-when-networkStartNetwork-fail.patch b/SOURCES/libvirt-network-fix-call-virNetworkEventLifecycleNew-when-networkStartNetwork-fail.patch
deleted file mode 100644
index a8d3032..0000000
--- a/SOURCES/libvirt-network-fix-call-virNetworkEventLifecycleNew-when-networkStartNetwork-fail.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 08d3c335c6fd055aab8536a8bf4dbc1d69975007 Mon Sep 17 00:00:00 2001
-Message-Id: <08d3c335c6fd055aab8536a8bf4dbc1d69975007@dist-git>
-From: Luyao Huang 
-Date: Wed, 12 Nov 2014 09:05:32 +0100
-Subject: [PATCH] network: fix call virNetworkEventLifecycleNew when
- networkStartNetwork fail
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When start a network fail, libvirt still call virNetworkEventLifecycleNew
-to send a event.
-
-Signed-off-by: Luyao Huang 
-(cherry picked from commit 45d9ea5cddad5ed151db15362a881b730b8c88f1)
-Signed-off-by: Ján Tomko 
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1162915
-Signed-off-by: Jiri Denemark 
----
- src/network/bridge_driver.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
-index d33de2f..9746099 100644
---- a/src/network/bridge_driver.c
-+++ b/src/network/bridge_driver.c
-@@ -3253,7 +3253,8 @@ static int networkCreate(virNetworkPtr net)
-     if (virNetworkCreateEnsureACL(net->conn, network->def) < 0)
-         goto cleanup;
- 
--    ret = networkStartNetwork(driver, network);
-+    if ((ret = networkStartNetwork(driver, network)) < 0)
-+        goto cleanup;
- 
-     event = virNetworkEventLifecycleNew(network->def->name,
-                                         network->def->uuid,
--- 
-2.1.3
-
diff --git a/SOURCES/libvirt-network-save-bridge-name-in-ActualNetDef-when-actualType-network-too.patch b/SOURCES/libvirt-network-save-bridge-name-in-ActualNetDef-when-actualType-network-too.patch
deleted file mode 100644
index fe0abe5..0000000
--- a/SOURCES/libvirt-network-save-bridge-name-in-ActualNetDef-when-actualType-network-too.patch
+++ /dev/null
@@ -1,253 +0,0 @@
-From c4ffd622f1463a4a6000e2b61c2a43ec91b74668 Mon Sep 17 00:00:00 2001
-Message-Id: 
-From: Laine Stump 
-Date: Mon, 15 Dec 2014 10:51:28 -0500
-Subject: [PATCH] network: save bridge name in ActualNetDef when
- actualType==network too
-
-This is part of the fix for:
-
-  https://bugzilla.redhat.com/show_bug.cgi?id=1099210
-
-When the actualType of a virDomainNetDef is "network", it means that
-we are connecting to a libvirt-managed network (routed, natted, or
-isolated) which does use a bridge device (created by libvirt). In the
-past we have required drivers such as qemu to call the public API to
-retrieve the bridge name in this case (even though it is available in
-the NetDef's ActualNetDef if the actualType is "bridge" (i.e., an
-externally-created bridge that isn't managed by libvirt). There is no
-real reason for this difference, and as a matter of fact it
-complicates things for qemu. Also, there is another bridge-related
-attribute (macTableManager) that will need to be available in both
-cases, so this makes things consistent.
-
-In order to avoid problems when restarting libvirtd after an update
-from an older version that *doesn't* store the network's bridgename in
-the ActualNetDef, we also need to put it in place during
-networkNotifyActualDevice() (this function is run for each interface
-of each domain whenever libvirtd is restarted).
-
-Along with making the bridge name available in the internal object, it
-is also now reported in the  element of the  state
-XML (or the  subelement in the internally-stored format).
-
-The one oddity about this change is that usually there is a separate
-union for every different "type" in a higher level object (e.g. in the
-case of a virDomainNetDef there are separate "network" and "bridge"
-members of the union that pivots on the type), but in this case
-network and bridge types both have exactly the same attributes, so the
-"bridge" member is used for both type==network and type==bridge.
-
-(cherry picked from commit a3609121799d44898a3e0d0bf92b755e55e7b418)
-
-Conflicts:
-	src/conf/domain_conf.c - brackets had been removed upstream
-
-Signed-off-by: Jiri Denemark 
----
- src/conf/domain_conf.c      | 103 +++++++++++++++++++++++---------------------
- src/network/bridge_driver.c |  20 +++++++++
- 2 files changed, 73 insertions(+), 50 deletions(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 20ae4e7..4cbc431 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -1364,6 +1364,7 @@ virDomainActualNetDefFree(virDomainActualNetDefPtr def)
- 
-     switch (def->type) {
-     case VIR_DOMAIN_NET_TYPE_BRIDGE:
-+    case VIR_DOMAIN_NET_TYPE_NETWORK:
-         VIR_FREE(def->data.bridge.brname);
-         break;
-     case VIR_DOMAIN_NET_TYPE_DIRECT:
-@@ -6945,9 +6946,12 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
-             goto error;
-         }
-         VIR_FREE(class_id);
--    } else if (actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE) {
-+    }
-+    if (actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE ||
-+        actual->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
-         char *brname = virXPathString("string(./source/@bridge)", ctxt);
--        if (!brname) {
-+
-+        if (!brname && actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE) {
-             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                            _("Missing  element with bridge name in "
-                              "interface's  element"));
-@@ -16733,60 +16737,59 @@ virDomainHostdevDefFormatCaps(virBufferPtr buf,
- static int
- virDomainActualNetDefContentsFormat(virBufferPtr buf,
-                                     virDomainNetDefPtr def,
--                                    const char *typeStr,
-                                     bool inSubelement,
-                                     unsigned int flags)
- {
--    const char *mode;
-+    int actualType = virDomainNetGetActualType(def);
- 
--    switch (virDomainNetGetActualType(def)) {
--    case VIR_DOMAIN_NET_TYPE_BRIDGE:
--        virBufferEscapeString(buf, "\n",
--                              virDomainNetGetActualBridgeName(def));
--        break;
--
--    case VIR_DOMAIN_NET_TYPE_DIRECT:
--        virBufferAddLit(buf, "\n", mode);
--        break;
--
--    case VIR_DOMAIN_NET_TYPE_HOSTDEV:
-+    if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
-         if (virDomainHostdevDefFormatSubsys(buf, virDomainNetGetActualHostdev(def),
-                                             flags, true) < 0) {
-             return -1;
-         }
--        break;
--
--    case VIR_DOMAIN_NET_TYPE_NETWORK:
--        if (!inSubelement) {
--            /* the  element isn't included in 
--             * (i.e. when we're putting our output into a subelement
--             * rather than inline) because the main element has the
--             * same info already. If we're outputting inline, though,
--             * we *do* need to output , because the caller
--             * won't have done it.
-+    } else {
-+        virBufferAddLit(buf, "type == VIR_DOMAIN_NET_TYPE_NETWORK && !inSubelement) {
-+            /* When we're putting our output into the 
-+             * subelement rather than the main , the
-+             * network name isn't included in the  because the
-+             * main interface element's  has the same info
-+             * already. If we've been called to output directly into
-+             * the main element's  though (the case here -
-+             * "!inSubElement"), we *do* need to output the network
-+             * name, because the caller won't have done it).
-              */
--            virBufferEscapeString(buf, "\n",
--                                  def->data.network.name);
-+            virBufferEscapeString(buf, " network='%s'", def->data.network.name);
-         }
--        if (def->data.network.actual && def->data.network.actual->class_id)
--            virBufferAsprintf(buf, "\n",
--                              def->data.network.actual->class_id);
--        break;
--    default:
--        virReportError(VIR_ERR_INTERNAL_ERROR,
--                       _("unexpected actual net type %s"), typeStr);
--        return -1;
-+        if (actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
-+            actualType == VIR_DOMAIN_NET_TYPE_NETWORK) {
-+            /* actualType == NETWORK includes the name of the bridge
-+             * that is used by the network, whether we are
-+             * "inSubElement" or not.
-+             */
-+            virBufferEscapeString(buf, " bridge='%s'",
-+                                  virDomainNetGetActualBridgeName(def));
-+        } else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
-+            const char *mode;
-+
-+            virBufferEscapeString(buf, " dev='%s'",
-+                                  virDomainNetGetActualDirectDev(def));
-+            mode = virNetDevMacVLanModeTypeToString(virDomainNetGetActualDirectMode(def));
-+            if (!mode) {
-+                virReportError(VIR_ERR_INTERNAL_ERROR,
-+                               _("unexpected source mode %d"),
-+                               virDomainNetGetActualDirectMode(def));
-+                return -1;
-+            }
-+            virBufferAsprintf(buf, " mode='%s'", mode);
-+        }
-+
-+        virBufferAddLit(buf, "/>\n");
-+    }
-+    if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT &&
-+        def->data.network.actual && def->data.network.actual->class_id) {
-+        virBufferAsprintf(buf, "\n",
-+                          def->data.network.actual->class_id);
-     }
- 
-     if (virNetDevVlanFormat(virDomainNetGetActualVlan(def), buf) < 0)
-@@ -16834,7 +16837,7 @@ virDomainActualNetDefFormat(virBufferPtr buf,
-     virBufferAddLit(buf, ">\n");
- 
-     virBufferAdjustIndent(buf, 2);
--    if (virDomainActualNetDefContentsFormat(buf, def, typeStr, true, flags) < 0)
-+    if (virDomainActualNetDefContentsFormat(buf, def, true, flags) < 0)
-        return -1;
-     virBufferAdjustIndent(buf, -2);
-     virBufferAddLit(buf, "\n");
-@@ -17005,7 +17008,7 @@ virDomainNetDefFormat(virBufferPtr buf,
-          * the standard place...  (this is for public reporting of
-          * interface status)
-          */
--        if (virDomainActualNetDefContentsFormat(buf, def, typeStr, false, flags) < 0)
-+        if (virDomainActualNetDefContentsFormat(buf, def, false, flags) < 0)
-             return -1;
-     } else {
-         /* ...but if we've asked for the inactive XML (rather than
-@@ -20375,9 +20378,9 @@ virDomainNetGetActualBridgeName(virDomainNetDefPtr iface)
-         return iface->data.bridge.brname;
-     if (iface->type == VIR_DOMAIN_NET_TYPE_NETWORK &&
-         iface->data.network.actual &&
--        iface->data.network.actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE) {
-+        (iface->data.network.actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE ||
-+         iface->data.network.actual->type == VIR_DOMAIN_NET_TYPE_NETWORK))
-         return iface->data.network.actual->data.bridge.brname;
--    }
-     return NULL;
- }
- 
-diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
-index 488409d..236095f 100644
---- a/src/network/bridge_driver.c
-+++ b/src/network/bridge_driver.c
-@@ -3833,6 +3833,15 @@ networkAllocateActualDevice(virDomainDefPtr dom,
-          */
-         iface->data.network.actual->type = VIR_DOMAIN_NET_TYPE_NETWORK;
- 
-+        /* we also store the bridge device
-+         * in iface->data.network.actual->data.bridge for later use
-+         * after the domain's tap device is created (to attach to the
-+         * bridge and set flood/learning mode on the tap device)
-+         */
-+        if (VIR_STRDUP(iface->data.network.actual->data.bridge.brname,
-+                       netdef->bridge) < 0)
-+            goto error;
-+
-         if (networkPlugBandwidth(network, iface) < 0)
-             goto error;
- 
-@@ -4171,6 +4180,17 @@ networkNotifyActualDevice(virDomainDefPtr dom,
-     }
-     netdef = network->def;
- 
-+    /* if we're restarting libvirtd after an upgrade from a version
-+     * that didn't save bridge name in actualNetDef for
-+     * actualType==network, we need to copy it in so that it will be
-+     * available in all cases
-+     */
-+    if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK &&
-+        !iface->data.network.actual->data.bridge.brname &&
-+        (VIR_STRDUP(iface->data.network.actual->data.bridge.brname,
-+                    netdef->bridge) < 0))
-+            goto error;
-+
-     if (!iface->data.network.actual ||
-         (actualType != VIR_DOMAIN_NET_TYPE_DIRECT &&
-          actualType != VIR_DOMAIN_NET_TYPE_HOSTDEV)) {
--- 
-2.2.0
-
diff --git a/SOURCES/libvirt-network-set-interface-actual-trustGuestRxFilters-from-network-portgroup.patch b/SOURCES/libvirt-network-set-interface-actual-trustGuestRxFilters-from-network-portgroup.patch
deleted file mode 100644
index 90b570d..0000000
--- a/SOURCES/libvirt-network-set-interface-actual-trustGuestRxFilters-from-network-portgroup.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 883907eca7decfe43366e58864751e32c1d27eba Mon Sep 17 00:00:00 2001
-Message-Id: <883907eca7decfe43366e58864751e32c1d27eba@dist-git>
-From: Laine Stump 
-Date: Mon, 3 Nov 2014 10:00:16 -0500
-Subject: [PATCH] network: set interface actual trustGuestRxFilters from
- network/portgroup
-
-https://bugzilla.redhat.com/show_bug.cgi?id=848199
-
-As is done with other items such as vlan, virtualport, and bandwidth,
-set the actual trustGuestRxFilters value to be used by a domain
-interface according to a merge of the same attribute in the interface,
-portgroup, and network in use. the interface setting always takes
-precedence (if specified), followed by portgroup, and finally the
-setting in the network is used if it's not specified in the interface
-or portgroup.
-
-(cherry picked from commit cfddf59cee42a74f327b358a78c9663cd21364f0)
-
-Signed-off-by: Jiri Denemark 
----
- src/network/bridge_driver.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
-index b77dc76..d33de2f 100644
---- a/src/network/bridge_driver.c
-+++ b/src/network/bridge_driver.c
-@@ -3794,6 +3794,16 @@ networkAllocateActualDevice(virDomainDefPtr dom,
-     if (vlan && virNetDevVlanCopy(&iface->data.network.actual->vlan, vlan) < 0)
-         goto error;
- 
-+    if (iface->trustGuestRxFilters)
-+       iface->data.network.actual->trustGuestRxFilters
-+          = iface->trustGuestRxFilters;
-+    else if (portgroup && portgroup->trustGuestRxFilters)
-+       iface->data.network.actual->trustGuestRxFilters
-+          = portgroup->trustGuestRxFilters;
-+    else if (netdef->trustGuestRxFilters)
-+       iface->data.network.actual->trustGuestRxFilters
-+          = netdef->trustGuestRxFilters;
-+
-     if ((netdef->forward.type == VIR_NETWORK_FORWARD_NONE) ||
-         (netdef->forward.type == VIR_NETWORK_FORWARD_NAT) ||
-         (netdef->forward.type == VIR_NETWORK_FORWARD_ROUTE)) {
--- 
-2.1.3
-
diff --git a/SOURCES/libvirt-network-setup-bridge-devices-for-macTableManager-libvirt.patch b/SOURCES/libvirt-network-setup-bridge-devices-for-macTableManager-libvirt.patch
deleted file mode 100644
index 62a72ec..0000000
--- a/SOURCES/libvirt-network-setup-bridge-devices-for-macTableManager-libvirt.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-From c245c3ae639f702cfc1f8cdb0b0272600bc4ad1e Mon Sep 17 00:00:00 2001
-Message-Id: 
-From: Laine Stump 
-Date: Mon, 15 Dec 2014 10:51:30 -0500
-Subject: [PATCH] network: setup bridge devices for macTableManager='libvirt'
-
-This is part of the fix for:
-
-  https://bugzilla.redhat.com/show_bug.cgi?id=1099210
-
-When the bridge device for a network has macTableManager='libvirt' the
-intent is that all kernel management of the bridge's MAC table
-(Forwarding Database, or fdb, in the case of a Linux Host Bridge) be
-disabled, with libvirt handling updates to the table instead. The
-setup required for the bridge itself is:
-
-1) set the "vlan_filtering" property of the bridge device to 1.
-
-2) If the bridge has a "Dummy" tap device used to set a fixed MAC
-address on the bridge (which is always the case for a bridge created
-by libvirt, and never the case for a bridge created by the host system
-network config), turn off learning and unicast_flood on this tap (this
-is needed even though this tap is never IFF_UP, because the kernel
-ignores the IFF_UP flag of devices when using their settings to
-automatically decide whether or not to turn off promiscuous mode for
-any attached device).
-
-(1) is done both for libvirt-created/managed bridges, and for bridges
-that are created by the host system config, while (2) is done only for
-bridges created by libvirt (i.e. for forward modes of nat, routed, and
-isolated bridges)
-
-There is no attempt to turn vlan_filtering off when destroying the
-network because in the case of a libvirt-created bridge, the bridge is
-about to be destroyed anyway, and in the case of a system bridge, if
-the other devices attached to the bridge could operate properly before
-destroying libvirt's network object, they will continue to operate
-properly (this is similar to the way that libvirt will enable
-ip_forwarding whenever a routed/natted network is started, but will
-never attempt to disable it if they are stopped).
-
-(cherry picked from commit 8a144c90457a8699fb35fbefe8974a2530980eaa)
-
-Signed-off-by: Jiri Denemark 
----
- src/network/bridge_driver.c | 54 +++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 54 insertions(+)
-
-diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
-index 361029f..3e3e4de 100644
---- a/src/network/bridge_driver.c
-+++ b/src/network/bridge_driver.c
-@@ -1928,6 +1928,29 @@ networkAddAddrToBridge(virNetworkObjPtr network,
-     return 0;
- }
- 
-+
-+static int
-+networkStartHandleMACTableManagerMode(virNetworkObjPtr network,
-+                                      const char *macTapIfName)
-+{
-+    const char *brname = network->def->bridge;
-+
-+    if (brname &&
-+        network->def->macTableManager
-+        == VIR_NETWORK_BRIDGE_MAC_TABLE_MANAGER_LIBVIRT) {
-+        if (virNetDevBridgeSetVlanFiltering(brname, true) < 0)
-+            return -1;
-+        if (macTapIfName) {
-+            if (virNetDevBridgePortSetLearning(brname, macTapIfName, false) < 0)
-+                return -1;
-+            if (virNetDevBridgePortSetUnicastFlood(brname, macTapIfName, false) < 0)
-+                return -1;
-+        }
-+    }
-+    return 0;
-+}
-+
-+
- /* add an IP (static) route to a bridge */
- static int
- networkAddRouteToBridge(virNetworkObjPtr network,
-@@ -2056,6 +2079,9 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
-         }
-     }
- 
-+    if (networkStartHandleMACTableManagerMode(network, macTapIfName) < 0)
-+        goto err2;
-+
-     /* Bring up the bridge interface */
-     if (virNetDevSetOnline(network->def->bridge, 1) < 0)
-         goto err2;
-@@ -2201,6 +2227,27 @@ static int networkShutdownNetworkVirtual(virNetworkDriverStatePtr driver ATTRIBU
- }
- 
- 
-+static int
-+networkStartNetworkBridge(virNetworkObjPtr network)
-+{
-+    /* put anything here that needs to be done each time a network of
-+     * type BRIDGE, is started. On failure, undo anything you've done,
-+     * and return -1. On success return 0.
-+     */
-+    return networkStartHandleMACTableManagerMode(network, NULL);
-+}
-+
-+static int
-+networkShutdownNetworkBridge(virNetworkObjPtr network ATTRIBUTE_UNUSED)
-+{
-+    /* put anything here that needs to be done each time a network of
-+     * type BRIDGE is shutdown. On failure, undo anything you've done,
-+     * and return -1. On success return 0.
-+     */
-+    return 0;
-+}
-+
-+
- /* networkCreateInterfacePool:
-  * @netdef: the original NetDef from the network
-  *
-@@ -2367,6 +2414,10 @@ networkStartNetwork(virNetworkDriverStatePtr driver,
-         break;
- 
-     case VIR_NETWORK_FORWARD_BRIDGE:
-+       if (networkStartNetworkBridge(network) < 0)
-+          goto cleanup;
-+       break;
-+
-     case VIR_NETWORK_FORWARD_PRIVATE:
-     case VIR_NETWORK_FORWARD_VEPA:
-     case VIR_NETWORK_FORWARD_PASSTHROUGH:
-@@ -2434,6 +2485,9 @@ static int networkShutdownNetwork(virNetworkDriverStatePtr driver,
-         break;
- 
-     case VIR_NETWORK_FORWARD_BRIDGE:
-+        ret = networkShutdownNetworkBridge(network);
-+        break;
-+
-     case VIR_NETWORK_FORWARD_PRIVATE:
-     case VIR_NETWORK_FORWARD_VEPA:
-     case VIR_NETWORK_FORWARD_PASSTHROUGH:
--- 
-2.2.0
-
diff --git a/SOURCES/libvirt-network-store-network-macTableManager-setting-in-NetDef-actual-object.patch b/SOURCES/libvirt-network-store-network-macTableManager-setting-in-NetDef-actual-object.patch
deleted file mode 100644
index bfad64d..0000000
--- a/SOURCES/libvirt-network-store-network-macTableManager-setting-in-NetDef-actual-object.patch
+++ /dev/null
@@ -1,188 +0,0 @@
-From 2970e543f7d9446229332966a266103dbdbefdc6 Mon Sep 17 00:00:00 2001
-Message-Id: <2970e543f7d9446229332966a266103dbdbefdc6@dist-git>
-From: Laine Stump 
-Date: Mon, 15 Dec 2014 10:51:29 -0500
-Subject: [PATCH] network: store network macTableManager setting in NetDef
- actual object
-
-This is part of the fix for:
-
-  https://bugzilla.redhat.com/show_bug.cgi?id=1099210
-
-At the time that the network driver allocates a connection to a
-network, the tap device that will be used hasn't yet been created -
-that will be done later by qemu (or lxc or whoever) - but if the
-network has macTableManager='libvirt', then when we do get around to
-creating the tap device, we will need to add an entry for it to the
-network bridge's fdb (forwarding database) *and* turn off learning and
-unicast_flood for that tap device in the bridge's sysfs settings. This
-means that qemu needs to know both the bridge name as well as the
-setting of macTableManager, so we either need to create a new API to
-retrieve that info, or just pass it back in the ActualNetDef that is
-created during networkAllocateActualDevice. We choose the latter
-method, since it's already done for the bridge device, and it has the
-side effect of making the information available in domain status.
-
-(NB: in the future, I think that the tap device should actually be
-created by networkAllocateActualDevice(), as that will solve several
-other problems, but that is a battle for another day, and this
-information will still be useful outside the network driver)
-
-(cherry picked from commit 33f4a8bc038bf05ece1ed42e9bf77fba780d0cb1)
-
-Signed-off-by: Jiri Denemark 
----
- src/conf/domain_conf.c      | 30 ++++++++++++++++++++++++++++++
- src/conf/domain_conf.h      |  2 ++
- src/libvirt_private.syms    |  1 +
- src/network/bridge_driver.c |  6 +++++-
- 4 files changed, 38 insertions(+), 1 deletion(-)
-
-diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
-index 4cbc431..8c161b5 100644
---- a/src/conf/domain_conf.c
-+++ b/src/conf/domain_conf.c
-@@ -51,6 +51,7 @@
- #include "netdev_bandwidth_conf.h"
- #include "netdev_vlan_conf.h"
- #include "device_conf.h"
-+#include "network_conf.h"
- #include "virtpm.h"
- #include "virstring.h"
- 
-@@ -6842,6 +6843,7 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
-     char *mode = NULL;
-     char *addrtype = NULL;
-     char *trustGuestRxFilters = NULL;
-+    char *macTableManager = NULL;
- 
-     if (VIR_ALLOC(actual) < 0)
-         return -1;
-@@ -6958,6 +6960,16 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
-             goto error;
-         }
-         actual->data.bridge.brname = brname;
-+        macTableManager = virXPathString("string(./source/@macTableManager)", ctxt);
-+        if (macTableManager &&
-+            (actual->data.bridge.macTableManager
-+             = virNetworkBridgeMACTableManagerTypeFromString(macTableManager)) <= 0) {
-+            virReportError(VIR_ERR_XML_ERROR,
-+                           _("Invalid macTableManager setting '%s' "
-+                             "in domain interface's  element"),
-+                           macTableManager);
-+            goto error;
-+        }
-     }
- 
-     bandwidth_node = virXPathNode("./bandwidth", ctxt);
-@@ -6978,6 +6990,7 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
-     VIR_FREE(mode);
-     VIR_FREE(addrtype);
-     VIR_FREE(trustGuestRxFilters);
-+    VIR_FREE(macTableManager);
-     virDomainActualNetDefFree(actual);
- 
-     ctxt->node = save_ctxt;
-@@ -16763,12 +16776,18 @@ virDomainActualNetDefContentsFormat(virBufferPtr buf,
-         }
-         if (actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
-             actualType == VIR_DOMAIN_NET_TYPE_NETWORK) {
-+            int macTableManager = virDomainNetGetActualBridgeMACTableManager(def);
-+
-             /* actualType == NETWORK includes the name of the bridge
-              * that is used by the network, whether we are
-              * "inSubElement" or not.
-              */
-             virBufferEscapeString(buf, " bridge='%s'",
-                                   virDomainNetGetActualBridgeName(def));
-+            if (macTableManager) {
-+                virBufferAsprintf(buf, " macTableManager='%s'",
-+                                  virNetworkBridgeMACTableManagerTypeToString(macTableManager));
-+            }
-         } else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
-             const char *mode;
- 
-@@ -20384,6 +20403,17 @@ virDomainNetGetActualBridgeName(virDomainNetDefPtr iface)
-     return NULL;
- }
- 
-+int
-+virDomainNetGetActualBridgeMACTableManager(virDomainNetDefPtr iface)
-+{
-+    if (iface->type == VIR_DOMAIN_NET_TYPE_NETWORK &&
-+        iface->data.network.actual &&
-+        (iface->data.network.actual->type == VIR_DOMAIN_NET_TYPE_BRIDGE ||
-+         iface->data.network.actual->type == VIR_DOMAIN_NET_TYPE_NETWORK))
-+        return iface->data.network.actual->data.bridge.macTableManager;
-+    return 0;
-+}
-+
- const char *
- virDomainNetGetActualDirectDev(virDomainNetDefPtr iface)
- {
-diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
-index 01d5aeb..b912845 100644
---- a/src/conf/domain_conf.h
-+++ b/src/conf/domain_conf.h
-@@ -874,6 +874,7 @@ struct _virDomainActualNetDef {
-     union {
-         struct {
-             char *brname;
-+            int macTableManager; /* enum virNetworkBridgeMACTableManagerType */
-         } bridge;
-         struct {
-             char *linkdev;
-@@ -2496,6 +2497,7 @@ int virDomainGraphicsListenSetNetwork(virDomainGraphicsDefPtr def,
- 
- int virDomainNetGetActualType(virDomainNetDefPtr iface);
- const char *virDomainNetGetActualBridgeName(virDomainNetDefPtr iface);
-+int virDomainNetGetActualBridgeMACTableManager(virDomainNetDefPtr iface);
- const char *virDomainNetGetActualDirectDev(virDomainNetDefPtr iface);
- int virDomainNetGetActualDirectMode(virDomainNetDefPtr iface);
- virDomainHostdevDefPtr virDomainNetGetActualHostdev(virDomainNetDefPtr iface);
-diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
-index e4da444..cf3c842 100644
---- a/src/libvirt_private.syms
-+++ b/src/libvirt_private.syms
-@@ -326,6 +326,7 @@ virDomainNetFind;
- virDomainNetFindIdx;
- virDomainNetGenerateMAC;
- virDomainNetGetActualBandwidth;
-+virDomainNetGetActualBridgeMACTableManager;
- virDomainNetGetActualBridgeName;
- virDomainNetGetActualDirectDev;
- virDomainNetGetActualDirectMode;
-diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
-index 236095f..361029f 100644
---- a/src/network/bridge_driver.c
-+++ b/src/network/bridge_driver.c
-@@ -3833,7 +3833,7 @@ networkAllocateActualDevice(virDomainDefPtr dom,
-          */
-         iface->data.network.actual->type = VIR_DOMAIN_NET_TYPE_NETWORK;
- 
--        /* we also store the bridge device
-+        /* we also store the bridge device and macTableManager settings
-          * in iface->data.network.actual->data.bridge for later use
-          * after the domain's tap device is created (to attach to the
-          * bridge and set flood/learning mode on the tap device)
-@@ -3841,6 +3841,8 @@ networkAllocateActualDevice(virDomainDefPtr dom,
-         if (VIR_STRDUP(iface->data.network.actual->data.bridge.brname,
-                        netdef->bridge) < 0)
-             goto error;
-+        iface->data.network.actual->data.bridge.macTableManager
-+           = netdef->macTableManager;
- 
-         if (networkPlugBandwidth(network, iface) < 0)
-             goto error;
-@@ -3856,6 +3858,8 @@ networkAllocateActualDevice(virDomainDefPtr dom,
-         if (VIR_STRDUP(iface->data.network.actual->data.bridge.brname,
-                        netdef->bridge) < 0)
-             goto error;
-+        iface->data.network.actual->data.bridge.macTableManager
-+           = netdef->macTableManager;
- 
-         /* merge virtualports from interface, network, and portgroup to
-          * arrive at actual virtualport to use
--- 
-2.2.0
-
diff --git a/SOURCES/libvirt-network-validate-network-NAT-range.patch b/SOURCES/libvirt-network-validate-network-NAT-range.patch
new file mode 100644
index 0000000..27128b5
--- /dev/null
+++ b/SOURCES/libvirt-network-validate-network-NAT-range.patch
@@ -0,0 +1,400 @@
+From b65e25e3132c9b5b0942b138231440bc8d4dd873 Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Laine Stump 
+Date: Mon, 10 Aug 2015 13:43:38 -0400
+Subject: [PATCH] network: validate network NAT range
+
+This patch modifies virSocketAddrGetRange() to function properly when
+the containing network/prefix of the address range isn't known, for
+example in the case of the NAT range of a virtual network (since it is
+a range of addresses on the *host*, not within the network itself). We
+then take advantage of this new functionality to validate the NAT
+range of a virtual network.
+
+Extra test cases are also added to verify that virSocketAddrGetRange()
+works properly in both positive and negative cases when the network
+pointer is NULL.
+
+This is the *real* fix for:
+
+https://bugzilla.redhat.com/show_bug.cgi?id=985653
+
+Commits 1e334a and 48e8b9 had earlier been pushed as fixes for that
+bug, but I had neglected to read the report carefully, so instead of
+fixing validation for the NAT range, I had fixed validation for the
+DHCP range. sigh.
+
+(cherry picked from commit a6f9af8292b6462e509892b3a16acbcaaef61e4e)
+
+Signed-off-by: Jiri Denemark 
+---
+ src/conf/network_conf.c  |   4 ++
+ src/util/virsocketaddr.c | 184 ++++++++++++++++++++++++-----------------------
+ tests/sockettest.c       |  46 +++++++++++-
+ 3 files changed, 144 insertions(+), 90 deletions(-)
+
+diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
+index 0ebb373..b03c2fd 100644
+--- a/src/conf/network_conf.c
++++ b/src/conf/network_conf.c
+@@ -1729,6 +1729,10 @@ virNetworkForwardNatDefParseXML(const char *networkName,
+         goto cleanup;
+     }
+ 
++    /* verify that start <= end */
++    if (virSocketAddrGetRange(&def->addr.start, &def->addr.end, NULL, 0) < 0)
++        goto cleanup;
++
+     /* ports for SNAT and MASQUERADE */
+     nNatPorts = virXPathNodeSet("./port", ctxt, &natPortNodes);
+     if (nNatPorts < 0) {
+diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c
+index 81539b3..900aa5b 100644
+--- a/src/util/virsocketaddr.c
++++ b/src/util/virsocketaddr.c
+@@ -628,126 +628,136 @@ virSocketAddrGetRange(virSocketAddrPtr start, virSocketAddrPtr end,
+     virSocketAddr netmask;
+     char *startStr = NULL, *endStr = NULL, *netStr = NULL;
+ 
+-    if (start == NULL || end == NULL || network == NULL) {
++    if (start == NULL || end == NULL) {
+         virReportError(VIR_ERR_INTERNAL_ERROR,
+-                       _("NULL argument - %p %p %p"), start, end, network);
++                       _("NULL argument - %p %p"), start, end);
+         goto error;
+     }
+ 
+     startStr = virSocketAddrFormat(start);
+     endStr = virSocketAddrFormat(end);
+-    netStr = virSocketAddrFormat(network);
+-    if (!(startStr && endStr && netStr))
++    if (!startStr || !endStr)
+         goto error; /*error already reported */
+ 
+-    if (VIR_SOCKET_ADDR_FAMILY(start) != VIR_SOCKET_ADDR_FAMILY(end) ||
+-        VIR_SOCKET_ADDR_FAMILY(start) != VIR_SOCKET_ADDR_FAMILY(network)) {
++    if (VIR_SOCKET_ADDR_FAMILY(start) != VIR_SOCKET_ADDR_FAMILY(end)) {
+         virReportError(VIR_ERR_INTERNAL_ERROR,
+-                       _("mismatch of address family in "
+-                         "range %s - %s for network %s"),
+-                       startStr, endStr, netStr);
++                       _("mismatch of address family in range %s - %s"),
++                       startStr, endStr);
+         goto error;
+     }
+ 
+-    if (prefix < 0 ||
+-        virSocketAddrPrefixToNetmask(prefix, &netmask,
+-                                     VIR_SOCKET_ADDR_FAMILY(network)) < 0) {
+-        virReportError(VIR_ERR_INTERNAL_ERROR,
+-                       _("bad prefix %d for network %s when "
+-                         " checking range %s - %s"),
+-                       prefix, netStr, startStr, endStr);
+-        goto error;
+-    }
++    if (network) {
++        /* some checks can only be done if we have details of the
++         * network the range should be within
++         */
++        if (!(netStr = virSocketAddrFormat(network)))
++            goto error;
+ 
+-    /* both start and end of range need to be in the same network as
+-     * "network"
+-     */
+-    if (virSocketAddrCheckNetmask(start, network, &netmask) <= 0 ||
+-        virSocketAddrCheckNetmask(end, network, &netmask) <= 0) {
+-        virReportError(VIR_ERR_INTERNAL_ERROR,
+-                       _("range %s - %s is not entirely within "
+-                         "network %s/%d"),
+-                       startStr, endStr, netStr, prefix);
+-        goto error;
++        if (VIR_SOCKET_ADDR_FAMILY(start) != VIR_SOCKET_ADDR_FAMILY(network)) {
++            virReportError(VIR_ERR_INTERNAL_ERROR,
++                           _("mismatch of address family in "
++                             "range %s - %s for network %s"),
++                           startStr, endStr, netStr);
++            goto error;
++        }
++
++        if (prefix < 0 ||
++            virSocketAddrPrefixToNetmask(prefix, &netmask,
++                                         VIR_SOCKET_ADDR_FAMILY(network)) < 0) {
++            virReportError(VIR_ERR_INTERNAL_ERROR,
++                           _("bad prefix %d for network %s when "
++                             " checking range %s - %s"),
++                           prefix, netStr, startStr, endStr);
++            goto error;
++        }
++
++        /* both start and end of range need to be within network */
++        if (virSocketAddrCheckNetmask(start, network, &netmask) <= 0 ||
++            virSocketAddrCheckNetmask(end, network, &netmask) <= 0) {
++            virReportError(VIR_ERR_INTERNAL_ERROR,
++                           _("range %s - %s is not entirely within "
++                             "network %s/%d"),
++                           startStr, endStr, netStr, prefix);
++            goto error;
++        }
++
++        if (VIR_SOCKET_ADDR_IS_FAMILY(start, AF_INET)) {
++            virSocketAddr netaddr, broadcast;
++
++            if (virSocketAddrBroadcast(network, &netmask, &broadcast) < 0 ||
++                virSocketAddrMask(network, &netmask, &netaddr) < 0) {
++                virReportError(VIR_ERR_INTERNAL_ERROR,
++                               _("failed to construct broadcast or network "
++                                 "address for network %s/%d"),
++                               netStr, prefix);
++                goto error;
++            }
++
++            /* Don't allow the start of the range to be the network
++             * address (usually "...0") or the end of the range to be the
++             * broadcast address (usually "...255"). (the opposite also
++             * isn't allowed, but checking for that is implicit in all the
++             * other combined checks) (IPv6 doesn't have broadcast and
++             * network addresses, so this check is only done for IPv4)
++             */
++            if (virSocketAddrEqual(start, &netaddr)) {
++                virReportError(VIR_ERR_INTERNAL_ERROR,
++                               _("start of range %s - %s in network %s/%d "
++                                 "is the network address"),
++                               startStr, endStr, netStr, prefix);
++                goto error;
++            }
++
++            if (virSocketAddrEqual(end, &broadcast)) {
++                virReportError(VIR_ERR_INTERNAL_ERROR,
++                               _("end of range %s - %s in network %s/%d "
++                                 "is the broadcast address"),
++                               startStr, endStr, netStr, prefix);
++                goto error;
++            }
++        }
+     }
+ 
+     if (VIR_SOCKET_ADDR_IS_FAMILY(start, AF_INET)) {
+         virSocketAddrIPv4 t1, t2;
+-        virSocketAddr netaddr, broadcast;
+ 
+-        if (virSocketAddrBroadcast(network, &netmask, &broadcast) < 0 ||
+-            virSocketAddrMask(network, &netmask, &netaddr) < 0) {
+-            virReportError(VIR_ERR_INTERNAL_ERROR,
+-                           _("failed to construct broadcast or network "
+-                             "address for network %s/%d"),
+-                           netStr, prefix);
+-            goto error;
+-        }
+-
+-        /* Don't allow the start of the range to be the network
+-         * address (usually "...0") or the end of the range to be the
+-         * broadcast address (usually "...255"). (the opposite also
+-         * isn't allowed, but checking for that is implicit in all the
+-         * other combined checks) (IPv6 doesn't have broadcast and
+-         * network addresses, so this check is only done for IPv4)
+-         */
+-        if (virSocketAddrEqual(start, &netaddr)) {
+-            virReportError(VIR_ERR_INTERNAL_ERROR,
+-                           _("start of range %s - %s in network %s/%d "
+-                             "is the network address"),
+-                           startStr, endStr, netStr, prefix);
+-            goto error;
+-        }
+-
+-        if (virSocketAddrEqual(end, &broadcast)) {
+-            virReportError(VIR_ERR_INTERNAL_ERROR,
+-                           _("end of range %s - %s in network %s/%d "
+-                             "is the broadcast address"),
+-                           startStr, endStr, netStr, prefix);
+-            goto error;
+-        }
+-
+-        if ((virSocketAddrGetIPv4Addr(start, &t1) < 0) ||
+-            (virSocketAddrGetIPv4Addr(end, &t2) < 0)) {
++        if (virSocketAddrGetIPv4Addr(start, &t1) < 0 ||
++            virSocketAddrGetIPv4Addr(end, &t2) < 0) {
+             virReportError(VIR_ERR_INTERNAL_ERROR,
+                            _("failed to get IPv4 address "
+-                             "for start or end of range %s - %s "
+-                             "in network %s/%d"),
+-                           startStr, endStr, netStr, prefix);
++                             "for start or end of range %s - %s"),
++                           startStr, endStr);
+             goto error;
+         }
+ 
+-        /* legacy check that everything except the last two bytes are
+-         * the same
++        /* legacy check that everything except the last two bytes
++         * are the same
+          */
+         for (i = 0; i < 2; i++) {
+             if (t1[i] != t2[i]) {
+             virReportError(VIR_ERR_INTERNAL_ERROR,
+-                           _("range %s - %s is too large (> 65535) "
+-                             "in network %s/%d"),
+-                           startStr, endStr, netStr, prefix);
++                           _("range %s - %s is too large (> 65535)"),
++                           startStr, endStr);
+             goto error;
+             }
+         }
+         ret = (t2[2] - t1[2]) * 256 + (t2[3] - t1[3]);
+         if (ret < 0) {
+             virReportError(VIR_ERR_INTERNAL_ERROR,
+-                           _("range %s - %s is reversed "
+-                             "in network %s/%d"),
+-                           startStr, endStr, netStr, prefix);
++                           _("range %s - %s is reversed "),
++                           startStr, endStr);
+             goto error;
+         }
+         ret++;
+     } else if (VIR_SOCKET_ADDR_IS_FAMILY(start, AF_INET6)) {
+         virSocketAddrIPv6 t1, t2;
+ 
+-        if ((virSocketAddrGetIPv6Addr(start, &t1) < 0) ||
+-            (virSocketAddrGetIPv6Addr(end, &t2) < 0)) {
++        if (virSocketAddrGetIPv6Addr(start, &t1) < 0 ||
++            virSocketAddrGetIPv6Addr(end, &t2) < 0) {
+             virReportError(VIR_ERR_INTERNAL_ERROR,
+                            _("failed to get IPv6 address "
+-                             "for start or end of range %s - %s "
+-                             "in network %s/%d"),
+-                           startStr, endStr, netStr, prefix);
++                             "for start or end of range %s - %s"),
++                           startStr, endStr);
+             goto error;
+         }
+ 
+@@ -757,29 +767,27 @@ virSocketAddrGetRange(virSocketAddrPtr start, virSocketAddrPtr end,
+         for (i = 0; i < 7; i++) {
+             if (t1[i] != t2[i]) {
+                 virReportError(VIR_ERR_INTERNAL_ERROR,
+-                               _("range %s - %s is too large (> 65535) "
+-                                 "in network %s/%d"),
+-                               startStr, endStr, netStr, prefix);
++                               _("range %s - %s is too large (> 65535)"),
++                               startStr, endStr);
+                 goto error;
+             }
+         }
+         ret = t2[7] - t1[7];
+         if (ret < 0) {
+             virReportError(VIR_ERR_INTERNAL_ERROR,
+-                           _("range %s - %s start larger than end "
+-                             "in network %s/%d"),
+-                           startStr, endStr, netStr, prefix);
++                           _("range %s - %s start larger than end"),
++                           startStr, endStr);
+             goto error;
+         }
+         ret++;
+     } else {
+         virReportError(VIR_ERR_INTERNAL_ERROR,
+                        _("unsupported address family "
+-                         "for range %s - %s "
+-                         "in network %s/%d, must be ipv4 or ipv6"),
+-                       startStr, endStr, netStr, prefix);
++                         "for range %s - %s, must be ipv4 or ipv6"),
++                       startStr, endStr);
+         goto error;
+     }
++
+  cleanup:
+     VIR_FREE(startStr);
+     VIR_FREE(endStr);
+diff --git a/tests/sockettest.c b/tests/sockettest.c
+index 292edb6..8f46218 100644
+--- a/tests/sockettest.c
++++ b/tests/sockettest.c
+@@ -98,10 +98,11 @@ testRange(const char *saddrstr, const char *eaddrstr,
+         return -1;
+     if (virSocketAddrParse(&eaddr, eaddrstr, AF_UNSPEC) < 0)
+         return -1;
+-    if (virSocketAddrParse(&netaddr, netstr, AF_UNSPEC) < 0)
++    if (netstr && virSocketAddrParse(&netaddr, netstr, AF_UNSPEC) < 0)
+         return -1;
+ 
+-    int gotsize = virSocketAddrGetRange(&saddr, &eaddr, &netaddr, prefix);
++    int gotsize = virSocketAddrGetRange(&saddr, &eaddr,
++                                        netstr ? &netaddr : NULL, prefix);
+     VIR_DEBUG("Size want %d vs got %d", size, gotsize);
+     if (pass) {
+         /* fail if virSocketAddrGetRange returns failure, or unexpected size */
+@@ -311,6 +312,15 @@ mymain(void)
+             ret = -1;                                                   \
+     } while (0)
+ 
++#define DO_TEST_RANGE_SIMPLE(saddr, eaddr, size, pass)                  \
++    do {                                                                \
++        struct testRangeData data                                       \
++           = { saddr, eaddr, NULL, 0, size, pass };                     \
++        if (virtTestRun("Test range " saddr " -> " eaddr "size " #size, \
++                        testRangeHelper, &data) < 0)                    \
++            ret = -1;                                                   \
++    } while (0)
++
+ #define DO_TEST_NETMASK(addr1, addr2, netmask, pass)                    \
+     do {                                                                \
+         struct testNetmaskData data = { addr1, addr2, netmask, pass };  \
+@@ -373,23 +383,55 @@ mymain(void)
+     DO_TEST_PARSE_AND_FORMAT("::1", AF_UNIX, false);
+     DO_TEST_PARSE_AND_FORMAT("::ffff", AF_UNSPEC, true);
+ 
++    /* tests that specify a network that should contain the range */
+     DO_TEST_RANGE("192.168.122.1", "192.168.122.1", "192.168.122.1", 24, 1, true);
+     DO_TEST_RANGE("192.168.122.1", "192.168.122.20", "192.168.122.22", 24, 20, true);
++    /* start of range is "network address" */
+     DO_TEST_RANGE("192.168.122.0", "192.168.122.254", "192.168.122.1", 24, -1, false);
++    /* end of range is "broadcast address" */
+     DO_TEST_RANGE("192.168.122.1", "192.168.122.255", "192.168.122.1", 24, -1, false);
+     DO_TEST_RANGE("192.168.122.0", "192.168.122.255", "192.168.122.1", 16, 256, true);
++    /* range is reversed */
+     DO_TEST_RANGE("192.168.122.20", "192.168.122.1", "192.168.122.1", 24, -1, false);
++    /* start address outside network */
+     DO_TEST_RANGE("10.0.0.1", "192.168.122.20", "192.168.122.1", 24, -1, false);
++    /* end address outside network and range reversed */
+     DO_TEST_RANGE("192.168.122.20", "10.0.0.1", "192.168.122.1", 24, -1, false);
++    /* entire range outside network */
+     DO_TEST_RANGE("172.16.0.50", "172.16.0.254", "1.2.3.4", 8, -1, false);
++    /* end address outside network */
+     DO_TEST_RANGE("192.168.122.1", "192.168.123.20", "192.168.122.22", 24, -1, false);
+     DO_TEST_RANGE("192.168.122.1", "192.168.123.20", "192.168.122.22", 23, 276, true);
+ 
+     DO_TEST_RANGE("2000::1", "2000::1", "2000::1", 64, 1, true);
+     DO_TEST_RANGE("2000::1", "2000::2", "2000::1", 64, 2, true);
++    /* range reversed */
+     DO_TEST_RANGE("2000::2", "2000::1", "2000::1", 64, -1, false);
++    /* range too large (> 65536) */
+     DO_TEST_RANGE("2000::1", "9001::1", "2000::1", 64, -1, false);
+ 
++    /* tests that *don't* specify a containing network
++     * (so fewer things can be checked)
++     */
++    DO_TEST_RANGE_SIMPLE("192.168.122.1", "192.168.122.1", 1, true);
++    DO_TEST_RANGE_SIMPLE("192.168.122.1", "192.168.122.20", 20, true);
++    DO_TEST_RANGE_SIMPLE("192.168.122.0", "192.168.122.255", 256, true);
++    /* range is reversed */
++    DO_TEST_RANGE_SIMPLE("192.168.122.20", "192.168.122.1", -1, false);
++    /* range too large (> 65536) */
++    DO_TEST_RANGE_SIMPLE("10.0.0.1", "192.168.122.20", -1, false);
++    /* range reversed */
++    DO_TEST_RANGE_SIMPLE("192.168.122.20", "10.0.0.1", -1, false);
++    DO_TEST_RANGE_SIMPLE("172.16.0.50", "172.16.0.254", 205, true);
++    DO_TEST_RANGE_SIMPLE("192.168.122.1", "192.168.123.20", 276, true);
++
++    DO_TEST_RANGE_SIMPLE("2000::1", "2000::1", 1, true);
++    DO_TEST_RANGE_SIMPLE("2000::1", "2000::2", 2, true);
++    /* range reversed */
++    DO_TEST_RANGE_SIMPLE("2000::2", "2000::1", -1, false);
++    /* range too large (> 65536) */
++    DO_TEST_RANGE_SIMPLE("2000::1", "9001::1", -1, false);
++
+     DO_TEST_NETMASK("192.168.122.1", "192.168.122.2",
+                     "255.255.255.0", true);
+     DO_TEST_NETMASK("192.168.122.1", "192.168.122.4",
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-network-verify-proper-address-family-in-updates-to-host-and-range.patch b/SOURCES/libvirt-network-verify-proper-address-family-in-updates-to-host-and-range.patch
new file mode 100644
index 0000000..4d125f7
--- /dev/null
+++ b/SOURCES/libvirt-network-verify-proper-address-family-in-updates-to-host-and-range.patch
@@ -0,0 +1,77 @@
+From 7e53d60afb8509a57caea28c95aa61a694bd29f8 Mon Sep 17 00:00:00 2001
+Message-Id: <7e53d60afb8509a57caea28c95aa61a694bd29f8@dist-git>
+From: Laine Stump 
+Date: Mon, 10 Aug 2015 02:46:45 -0400
+Subject: [PATCH] network: verify proper address family in updates to 
+ and 
+
+By specifying parentIndex in a call to virNetworkUpdate(), it was
+possible to direct libvirt to add a dhcp range or static host of a
+non-matching address family to the  element of an . For
+example, given:
+
+ 
+ 
+
+you could provide a static host entry with an IPv4 address, and
+specify that it be added to the 2nd  element (index 1):
+
+  virsh net-update default add ip-dhcp-host --parent-index 1 \
+  ''
+
+This would be happily added with no error (and no concern of any
+possible future consequences).
+
+This patch checks that any dhcp range or host element being added to a
+network ip's  subelement has addresses of the same family as the
+ip element they are being added to.
+
+This resolves:
+
+  https://bugzilla.redhat.com/show_bug.cgi?id=1184736
+
+(cherry picked from commit 6a21bc119e37bafcbe5cfd13e57080d651296b43)
+
+Signed-off-by: Jiri Denemark 
+---
+ src/conf/network_conf.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
+index 72006e9..0ebb373 100644
+--- a/src/conf/network_conf.c
++++ b/src/conf/network_conf.c
+@@ -3498,6 +3498,15 @@ virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def,
+                                       &host, partialOkay) < 0)
+         goto cleanup;
+ 
++    if (!partialOkay &&
++        VIR_SOCKET_ADDR_FAMILY(&ipdef->address)
++        != VIR_SOCKET_ADDR_FAMILY(&host.ip)) {
++        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
++                       _("the address family of a host entry IP must match "
++                         "the address family of the dhcp element's parent"));
++        goto cleanup;
++    }
++
+     if (command == VIR_NETWORK_UPDATE_COMMAND_MODIFY) {
+ 
+         /* search for the entry with this (ip|mac|name),
+@@ -3635,6 +3644,14 @@ virNetworkDefUpdateIPDHCPRange(virNetworkDefPtr def,
+     if (virSocketAddrRangeParseXML(def->name, ipdef, ctxt->node, &range) < 0)
+         goto cleanup;
+ 
++    if (VIR_SOCKET_ADDR_FAMILY(&ipdef->address)
++        != VIR_SOCKET_ADDR_FAMILY(&range.start)) {
++        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
++                       _("the address family of a dhcp range must match "
++                         "the address family of the dhcp element's parent"));
++        goto cleanup;
++    }
++
+     /* check if an entry with same name/address/ip already exists */
+     for (i = 0; i < ipdef->nranges; i++) {
+         if (virSocketAddrEqual(&range.start, &ipdef->ranges[i].start) &&
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeGetFreePages-Push-forgotten-change.patch b/SOURCES/libvirt-nodeGetFreePages-Push-forgotten-change.patch
deleted file mode 100644
index df116a1..0000000
--- a/SOURCES/libvirt-nodeGetFreePages-Push-forgotten-change.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 35482a3eec708b45498b575d6bc5c6a556962acf Mon Sep 17 00:00:00 2001
-Message-Id: <35482a3eec708b45498b575d6bc5c6a556962acf@dist-git>
-From: Michal Privoznik 
-Date: Wed, 15 Oct 2014 12:11:14 +0200
-Subject: [PATCH] nodeGetFreePages: Push forgotten change
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1145048
-
-In the previous patch I've changed the for loop bounds but forgot
-to 'git add' changes that adapt the rest of the code.
-
-Signed-off-by: Michal Privoznik 
-(cherry picked from commit 4aa8a68faa86d6e1c6ecaeabcec487ee30eff813)
-Signed-off-by: Jiri Denemark 
----
- src/nodeinfo.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/nodeinfo.c b/src/nodeinfo.c
-index dfde085..34d27a6 100644
---- a/src/nodeinfo.c
-+++ b/src/nodeinfo.c
-@@ -2045,7 +2045,7 @@ nodeGetFreePages(unsigned int npages,
-         goto cleanup;
-     }
- 
--    lastCell = MIN(lastCell, startCell + cellCount);
-+    lastCell = MIN(lastCell, startCell + (int) cellCount - 1);
- 
-     for (cell = startCell; cell <= lastCell; cell++) {
-         for (i = 0; i < npages; i++) {
--- 
-2.1.3
-
diff --git a/SOURCES/libvirt-nodeinfo-Add-nodeGetPresentCPUBitmap-to-libvirt_private.syms.patch b/SOURCES/libvirt-nodeinfo-Add-nodeGetPresentCPUBitmap-to-libvirt_private.syms.patch
new file mode 100644
index 0000000..bbed284
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Add-nodeGetPresentCPUBitmap-to-libvirt_private.syms.patch
@@ -0,0 +1,32 @@
+From dafa1c8ce652b0c3bbac5fc7d294e09900e21040 Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:20 +0200
+Subject: [PATCH] nodeinfo: Add nodeGetPresentCPUBitmap() to
+ libvirt_private.syms
+
+(cherry picked from commit c30ae1864f7b542c3bf765f9b5988f5298dadc9b)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/libvirt_private.syms | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index 1a03268..e92d2d0 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -1007,6 +1007,7 @@ nodeGetInfo;
+ nodeGetMemory;
+ nodeGetMemoryParameters;
+ nodeGetMemoryStats;
++nodeGetPresentCPUBitmap;
+ nodeSetMemoryParameters;
+ 
+ 
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Add-old-kernel-compatibility-to-nodeGetPresentCPUBitmap.patch b/SOURCES/libvirt-nodeinfo-Add-old-kernel-compatibility-to-nodeGetPresentCPUBitmap.patch
new file mode 100644
index 0000000..635193c
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Add-old-kernel-compatibility-to-nodeGetPresentCPUBitmap.patch
@@ -0,0 +1,115 @@
+From 77f24a2e6276d06d1da1f6d9223b5b15e6ab04ac Mon Sep 17 00:00:00 2001
+Message-Id: <77f24a2e6276d06d1da1f6d9223b5b15e6ab04ac@dist-git>
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:25 +0200
+Subject: [PATCH] nodeinfo: Add old kernel compatibility to
+ nodeGetPresentCPUBitmap()
+
+If the cpu/present file is not available, we assume that the kernel
+is too old to support non-consecutive CPU ids and return a bitmap
+with all the bits set to represent this fact. This assumption is
+already exploited in nodeGetCPUCount().
+
+This means users of this API can expect the information to always
+be available unless an error has occurred, and no longer need to
+treat the NULL return value as a special case.
+
+The error message has been updated as well.
+
+(cherry picked from commit 37f73e4ad5b049edbd92951330db2c071ca93b87)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 43 +++++++++++++++++++++++++++++--------------
+ 1 file changed, 29 insertions(+), 14 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index a7a5d98..ceb517a 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -441,6 +441,8 @@ virNodeParseNode(const char *sysfs_prefix,
+     }
+ 
+     present_cpumap = nodeGetPresentCPUBitmap(sysfs_prefix);
++    if (!present_cpumap)
++        goto cleanup;
+ 
+     /* enumerate sockets in the node */
+     CPU_ZERO(&sock_map);
+@@ -448,7 +450,7 @@ virNodeParseNode(const char *sysfs_prefix,
+         if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
+             continue;
+ 
+-        if (present_cpumap && !(virBitmapIsBitSet(present_cpumap, cpu)))
++        if (!virBitmapIsBitSet(present_cpumap, cpu))
+             continue;
+ 
+         if ((online = virNodeGetCpuValue(node, cpu, "online", 1)) < 0)
+@@ -484,7 +486,7 @@ virNodeParseNode(const char *sysfs_prefix,
+         if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
+             continue;
+ 
+-        if (present_cpumap && !(virBitmapIsBitSet(present_cpumap, cpu)))
++        if (!virBitmapIsBitSet(present_cpumap, cpu))
+             continue;
+ 
+         if ((online = virNodeGetCpuValue(node, cpu, "online", 1)) < 0)
+@@ -1284,27 +1286,40 @@ nodeGetCPUCount(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+ }
+ 
+ virBitmapPtr
+-nodeGetPresentCPUBitmap(const char *sysfs_prefix)
++nodeGetPresentCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+ {
+-    int max_present;
+ #ifdef __linux__
++    virBitmapPtr present_cpus = NULL;
+     char *present_path = NULL;
+-    virBitmapPtr bitmap = NULL;
+-#endif
++    int npresent_cpus;
+ 
+-    if ((max_present = nodeGetCPUCount(sysfs_prefix)) < 0)
+-        return NULL;
++    if ((npresent_cpus = nodeGetCPUCount(sysfs_prefix)) < 0)
++        goto cleanup;
+ 
+-#ifdef __linux__
+     if (!(present_path = linuxGetCPUPresentPath(sysfs_prefix)))
+-        return NULL;
+-    if (virFileExists(present_path))
+-        bitmap = linuxParseCPUmap(max_present, present_path);
++        goto cleanup;
++
++    /* If the cpu/present file is available, parse it and exit */
++    if (virFileExists(present_path)) {
++        present_cpus = linuxParseCPUmap(npresent_cpus, present_path);
++        goto cleanup;
++    }
++
++    /* If the file is not available, we can assume that the kernel is
++     * too old to support non-consecutive CPU ids and just mark all
++     * possible CPUs as present */
++    if (!(present_cpus = virBitmapNew(npresent_cpus)))
++        goto cleanup;
++
++    virBitmapSetAll(present_cpus);
++
++ cleanup:
+     VIR_FREE(present_path);
+-    return bitmap;
++
++    return present_cpus;
+ #endif
+     virReportError(VIR_ERR_NO_SUPPORT, "%s",
+-                   _("non-continuous host cpu numbers not implemented on this platform"));
++                   _("node present CPU map not implemented on this platform"));
+     return NULL;
+ }
+ 
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeCapsInitNUMA.patch b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeCapsInitNUMA.patch
new file mode 100644
index 0000000..c5e9c22
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeCapsInitNUMA.patch
@@ -0,0 +1,270 @@
+From 2260b45485085ceacb2d07554165289b275b816b Mon Sep 17 00:00:00 2001
+Message-Id: <2260b45485085ceacb2d07554165289b275b816b@dist-git>
+From: John Ferlan 
+Date: Wed, 5 Aug 2015 18:18:13 +0200
+Subject: [PATCH] nodeinfo: Add sysfs_prefix to nodeCapsInitNUMA
+
+Add the sysfs_prefix argument to the call to allow for setting the
+path for tests to something other than SYSFS_CPU_PATH which is a
+derivative of SYSFS_SYSTEM_PATH
+
+Use cpupath for nodeCapsInitNUMAFake and remove SYSFS_CPU_PATH
+
+(cherry picked from commit b97b30480d0fc529a9ea27b1c8b3cb0b120ea1e3)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/lxc/lxc_conf.c           |  2 +-
+ src/nodeinfo.c               | 35 +++++++++++++++++++++++------------
+ src/nodeinfo.h               |  2 +-
+ src/openvz/openvz_conf.c     |  2 +-
+ src/phyp/phyp_driver.c       |  2 +-
+ src/qemu/qemu_capabilities.c |  2 +-
+ src/uml/uml_conf.c           |  2 +-
+ src/vbox/vbox_common.c       |  2 +-
+ src/vmware/vmware_conf.c     |  2 +-
+ src/vz/vz_driver.c           |  2 +-
+ 10 files changed, 32 insertions(+), 21 deletions(-)
+
+diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c
+index c393cb5..b689b92 100644
+--- a/src/lxc/lxc_conf.c
++++ b/src/lxc/lxc_conf.c
+@@ -77,7 +77,7 @@ virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver)
+      * unexpected failures. We don't want to break the lxc
+      * driver in this scenario, so log errors & carry on
+      */
+-    if (nodeCapsInitNUMA(caps) < 0) {
++    if (nodeCapsInitNUMA(NULL, caps) < 0) {
+         virCapabilitiesFreeNUMAInfo(caps);
+         VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
+     }
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 2d715fd..a71d05e 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -283,7 +283,6 @@ freebsdNodeGetMemoryStats(virNodeMemoryStatsPtr params,
+ #ifdef __linux__
+ # define CPUINFO_PATH "/proc/cpuinfo"
+ # define SYSFS_SYSTEM_PATH "/sys/devices/system"
+-# define SYSFS_CPU_PATH SYSFS_SYSTEM_PATH"/cpu"
+ # define PROCSTAT_PATH "/proc/stat"
+ # define MEMINFO_PATH "/proc/meminfo"
+ # define SYSFS_MEMORY_SHARED_PATH "/sys/kernel/mm/ksm"
+@@ -1660,7 +1659,9 @@ nodeGetCPUMap(const char *sysfs_prefix,
+ }
+ 
+ static int
+-nodeCapsInitNUMAFake(virCapsPtr caps ATTRIBUTE_UNUSED)
++nodeCapsInitNUMAFake(const char *prefix,
++                     const char *cpupath ATTRIBUTE_UNUSED,
++                     virCapsPtr caps ATTRIBUTE_UNUSED)
+ {
+     virNodeInfo nodeinfo;
+     virCapsHostNUMACellCPUPtr cpus;
+@@ -1669,7 +1670,7 @@ nodeCapsInitNUMAFake(virCapsPtr caps ATTRIBUTE_UNUSED)
+     int id, cid;
+     int onlinecpus ATTRIBUTE_UNUSED;
+ 
+-    if (nodeGetInfo(NULL, &nodeinfo) < 0)
++    if (nodeGetInfo(prefix, &nodeinfo) < 0)
+         return -1;
+ 
+     ncpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
+@@ -1683,7 +1684,7 @@ nodeCapsInitNUMAFake(virCapsPtr caps ATTRIBUTE_UNUSED)
+         for (c = 0; c < nodeinfo.cores; c++) {
+             for (t = 0; t < nodeinfo.threads; t++) {
+ #ifdef __linux__
+-                if (virNodeGetCpuValue(SYSFS_CPU_PATH, id, "online", 1)) {
++                if (virNodeGetCpuValue(cpupath, id, "online", 1)) {
+ #endif
+                     cpus[cid].id = id;
+                     cpus[cid].socket_id = s;
+@@ -1810,26 +1811,27 @@ nodeGetMemoryFake(unsigned long long *mem,
+ 
+ /* returns 1 on success, 0 if the detection failed and -1 on hard error */
+ static int
+-virNodeCapsFillCPUInfo(int cpu_id ATTRIBUTE_UNUSED,
++virNodeCapsFillCPUInfo(const char *cpupath ATTRIBUTE_UNUSED,
++                       int cpu_id ATTRIBUTE_UNUSED,
+                        virCapsHostNUMACellCPUPtr cpu ATTRIBUTE_UNUSED)
+ {
+ #ifdef __linux__
+     int tmp;
+     cpu->id = cpu_id;
+ 
+-    if ((tmp = virNodeGetCpuValue(SYSFS_CPU_PATH, cpu_id,
++    if ((tmp = virNodeGetCpuValue(cpupath, cpu_id,
+                                   "topology/physical_package_id", -1)) < 0)
+         return 0;
+ 
+     cpu->socket_id = tmp;
+ 
+-    if ((tmp = virNodeGetCpuValue(SYSFS_CPU_PATH, cpu_id,
++    if ((tmp = virNodeGetCpuValue(cpupath, cpu_id,
+                                   "topology/core_id", -1)) < 0)
+         return 0;
+ 
+     cpu->core_id = tmp;
+ 
+-    if (!(cpu->siblings = virNodeGetSiblingsList(SYSFS_CPU_PATH, cpu_id)))
++    if (!(cpu->siblings = virNodeGetSiblingsList(cpupath, cpu_id)))
+         return -1;
+ 
+     return 0;
+@@ -1917,8 +1919,11 @@ virNodeCapsGetPagesInfo(int node,
+ }
+ 
+ int
+-nodeCapsInitNUMA(virCapsPtr caps)
++nodeCapsInitNUMA(const char *sysfs_prefix,
++                 virCapsPtr caps)
+ {
++    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
++    char *cpupath;
+     int n;
+     unsigned long long memory;
+     virCapsHostNUMACellCPUPtr cpus = NULL;
+@@ -1933,8 +1938,13 @@ nodeCapsInitNUMA(virCapsPtr caps)
+     bool topology_failed = false;
+     int max_node;
+ 
+-    if (!virNumaIsAvailable())
+-        return nodeCapsInitNUMAFake(caps);
++    if (virAsprintf(&cpupath, "%s/cpu", prefix) < 0)
++        return -1;
++
++    if (!virNumaIsAvailable()) {
++        ret = nodeCapsInitNUMAFake(prefix, cpupath, caps);
++        goto cleanup;
++    }
+ 
+     if ((max_node = virNumaGetMaxNode()) < 0)
+         goto cleanup;
+@@ -1955,7 +1965,7 @@ nodeCapsInitNUMA(virCapsPtr caps)
+ 
+         for (i = 0; i < virBitmapSize(cpumap); i++) {
+             if (virBitmapIsBitSet(cpumap, i)) {
+-                if (virNodeCapsFillCPUInfo(i, cpus + cpu++) < 0) {
++                if (virNodeCapsFillCPUInfo(cpupath, i, cpus + cpu++) < 0) {
+                     topology_failed = true;
+                     virResetLastError();
+                 }
+@@ -1995,6 +2005,7 @@ nodeCapsInitNUMA(virCapsPtr caps)
+     VIR_FREE(cpus);
+     VIR_FREE(siblings);
+     VIR_FREE(pageinfo);
++    VIR_FREE(cpupath);
+     return ret;
+ }
+ 
+diff --git a/src/nodeinfo.h b/src/nodeinfo.h
+index ec53769..b28aaab 100644
+--- a/src/nodeinfo.h
++++ b/src/nodeinfo.h
+@@ -27,7 +27,7 @@
+ # include "capabilities.h"
+ 
+ int nodeGetInfo(const char *sysfs_prefix, virNodeInfoPtr nodeinfo);
+-int nodeCapsInitNUMA(virCapsPtr caps);
++int nodeCapsInitNUMA(const char *sysfs_prefix, virCapsPtr caps);
+ 
+ int nodeGetCPUStats(int cpuNum,
+                     virNodeCPUStatsPtr params,
+diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
+index a4c5c31..db0a9a7 100644
+--- a/src/openvz/openvz_conf.c
++++ b/src/openvz/openvz_conf.c
+@@ -175,7 +175,7 @@ virCapsPtr openvzCapsInit(void)
+                                    false, false)) == NULL)
+         goto no_memory;
+ 
+-    if (nodeCapsInitNUMA(caps) < 0)
++    if (nodeCapsInitNUMA(NULL, caps) < 0)
+         goto no_memory;
+ 
+     if ((guest = virCapabilitiesAddGuest(caps,
+diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
+index ec0fde3..54dec70 100644
+--- a/src/phyp/phyp_driver.c
++++ b/src/phyp/phyp_driver.c
+@@ -335,7 +335,7 @@ phypCapsInit(void)
+      * unexpected failures. We don't want to break the QEMU
+      * driver in this scenario, so log errors & carry on
+      */
+-    if (nodeCapsInitNUMA(caps) < 0) {
++    if (nodeCapsInitNUMA(NULL, caps) < 0) {
+         virCapabilitiesFreeNUMAInfo(caps);
+         VIR_WARN
+             ("Failed to query host NUMA topology, disabling NUMA capabilities");
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index 39954bc..be5384f 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -1024,7 +1024,7 @@ virCapsPtr virQEMUCapsInit(virQEMUCapsCachePtr cache)
+      * unexpected failures. We don't want to break the QEMU
+      * driver in this scenario, so log errors & carry on
+      */
+-    if (nodeCapsInitNUMA(caps) < 0) {
++    if (nodeCapsInitNUMA(NULL, caps) < 0) {
+         virCapabilitiesFreeNUMAInfo(caps);
+         VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
+     }
+diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
+index 86fbecc..90deb2a 100644
+--- a/src/uml/uml_conf.c
++++ b/src/uml/uml_conf.c
+@@ -65,7 +65,7 @@ virCapsPtr umlCapsInit(void)
+      * unexpected failures. We don't want to break the QEMU
+      * driver in this scenario, so log errors & carry on
+      */
+-    if (nodeCapsInitNUMA(caps) < 0) {
++    if (nodeCapsInitNUMA(NULL, caps) < 0) {
+         virCapabilitiesFreeNUMAInfo(caps);
+         VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
+     }
+diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
+index 5615df5..91a61f8 100644
+--- a/src/vbox/vbox_common.c
++++ b/src/vbox/vbox_common.c
+@@ -318,7 +318,7 @@ static virCapsPtr vboxCapsInit(void)
+                                    false, false)) == NULL)
+         goto no_memory;
+ 
+-    if (nodeCapsInitNUMA(caps) < 0)
++    if (nodeCapsInitNUMA(NULL, caps) < 0)
+         goto no_memory;
+ 
+     if ((guest = virCapabilitiesAddGuest(caps,
+diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
+index 5b249f8..21cf333 100644
+--- a/src/vmware/vmware_conf.c
++++ b/src/vmware/vmware_conf.c
+@@ -68,7 +68,7 @@ vmwareCapsInit(void)
+                                    false, false)) == NULL)
+         goto error;
+ 
+-    if (nodeCapsInitNUMA(caps) < 0)
++    if (nodeCapsInitNUMA(NULL, caps) < 0)
+         goto error;
+ 
+     /* i686 guests are always supported */
+diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
+index 61d0d62..06d9d03 100644
+--- a/src/vz/vz_driver.c
++++ b/src/vz/vz_driver.c
+@@ -91,7 +91,7 @@ vzBuildCapabilities(void)
+                                    false, false)) == NULL)
+         return NULL;
+ 
+-    if (nodeCapsInitNUMA(caps) < 0)
++    if (nodeCapsInitNUMA(NULL, caps) < 0)
+         goto error;
+ 
+     if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetCPUBitmap.patch b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetCPUBitmap.patch
new file mode 100644
index 0000000..3772309
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetCPUBitmap.patch
@@ -0,0 +1,101 @@
+From 007cca58b412fbc476d6bebed0f1fbc7e9fa194e Mon Sep 17 00:00:00 2001
+Message-Id: <007cca58b412fbc476d6bebed0f1fbc7e9fa194e@dist-git>
+From: John Ferlan 
+Date: Wed, 5 Aug 2015 18:18:10 +0200
+Subject: [PATCH] nodeinfo: Add sysfs_prefix to nodeGetCPUBitmap
+
+Add the sysfs_prefix argument to the call to allow for setting the
+path for tests to something other than SYSFS_SYSTEM_PATH.
+
+(cherry picked from commit f220a3e5a883035d609f81d481bf52bb1c0b4974)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 24 ++++++++++++++++--------
+ src/nodeinfo.h |  2 +-
+ 2 files changed, 17 insertions(+), 9 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 34de720..75e0a02 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -1275,29 +1275,35 @@ nodeGetPresentCPUBitmap(const char *sysfs_prefix)
+ }
+ 
+ virBitmapPtr
+-nodeGetCPUBitmap(int *max_id ATTRIBUTE_UNUSED)
++nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
++                 int *max_id ATTRIBUTE_UNUSED)
+ {
+ #ifdef __linux__
++    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
++    char *online_path = NULL;
+     virBitmapPtr cpumap;
+     int present;
+ 
+-    present = nodeGetCPUCount(NULL);
++    present = nodeGetCPUCount(prefix);
+     if (present < 0)
+         return NULL;
+ 
+-    if (virFileExists(SYSFS_SYSTEM_PATH "/cpu/online")) {
+-        cpumap = linuxParseCPUmap(present, SYSFS_SYSTEM_PATH "/cpu/online");
++    if (virAsprintf(&online_path, "%s/cpu/online", prefix) < 0)
++        return NULL;
++    if (virFileExists(online_path)) {
++        cpumap = linuxParseCPUmap(present, online_path);
+     } else {
+         size_t i;
+ 
+         cpumap = virBitmapNew(present);
+         if (!cpumap)
+-            return NULL;
++            goto cleanup;
+         for (i = 0; i < present; i++) {
+-            int online = virNodeGetCpuValue(SYSFS_SYSTEM_PATH, i, "online", 1);
++            int online = virNodeGetCpuValue(prefix, i, "online", 1);
+             if (online < 0) {
+                 virBitmapFree(cpumap);
+-                return NULL;
++                cpumap = NULL;
++                goto cleanup;
+             }
+             if (online)
+                 ignore_value(virBitmapSetBit(cpumap, i));
+@@ -1305,6 +1311,8 @@ nodeGetCPUBitmap(int *max_id ATTRIBUTE_UNUSED)
+     }
+     if (max_id && cpumap)
+         *max_id = present;
++ cleanup:
++    VIR_FREE(online_path);
+     return cpumap;
+ #else
+     virReportError(VIR_ERR_NO_SUPPORT, "%s",
+@@ -1630,7 +1638,7 @@ nodeGetCPUMap(unsigned char **cpumap,
+     if (!cpumap && !online)
+         return nodeGetCPUCount(NULL);
+ 
+-    if (!(cpus = nodeGetCPUBitmap(&maxpresent)))
++    if (!(cpus = nodeGetCPUBitmap(NULL, &maxpresent)))
+         goto cleanup;
+ 
+     if (cpumap && virBitmapToData(cpus, cpumap, &dummy) < 0)
+diff --git a/src/nodeinfo.h b/src/nodeinfo.h
+index 3ef206b..439ef35 100644
+--- a/src/nodeinfo.h
++++ b/src/nodeinfo.h
+@@ -44,7 +44,7 @@ int nodeGetMemory(unsigned long long *mem,
+                   unsigned long long *freeMem);
+ 
+ virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix);
+-virBitmapPtr nodeGetCPUBitmap(int *max_id);
++virBitmapPtr nodeGetCPUBitmap(const char *sysfs_prefix, int *max_id);
+ int nodeGetCPUCount(const char *sysfs_prefix);
+ 
+ int nodeGetMemoryParameters(virTypedParameterPtr params,
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetCPUCount.patch b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetCPUCount.patch
new file mode 100644
index 0000000..885c78c
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetCPUCount.patch
@@ -0,0 +1,197 @@
+From 8fd08f800670d5e6ca2e1013d6ffbbf210b5aff4 Mon Sep 17 00:00:00 2001
+Message-Id: <8fd08f800670d5e6ca2e1013d6ffbbf210b5aff4@dist-git>
+From: John Ferlan 
+Date: Wed, 5 Aug 2015 18:18:08 +0200
+Subject: [PATCH] nodeinfo: Add sysfs_prefix to nodeGetCPUCount
+
+Add the sysfs_prefix argument to the call to allow for setting the
+path for tests to something other than SYSFS_SYSTEM_PATH.
+
+(cherry picked from commit f1a43a0f91d80ccbbd9e084de17673e48c2e60f4)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/lxc/lxc_controller.c |  2 +-
+ src/nodeinfo.c           | 20 +++++++++++++-------
+ src/nodeinfo.h           |  2 +-
+ src/qemu/qemu_driver.c   |  6 +++---
+ src/qemu/qemu_process.c  |  2 +-
+ src/vz/vz_sdk.c          |  2 +-
+ tests/vircgrouptest.c    |  4 ++--
+ 7 files changed, 22 insertions(+), 16 deletions(-)
+
+diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
+index 828b8a8..27e2e3a 100644
+--- a/src/lxc/lxc_controller.c
++++ b/src/lxc/lxc_controller.c
+@@ -705,7 +705,7 @@ static int virLXCControllerSetupCpuAffinity(virLXCControllerPtr ctrl)
+ 
+     /* setaffinity fails if you set bits for CPUs which
+      * aren't present, so we have to limit ourselves */
+-    if ((hostcpus = nodeGetCPUCount()) < 0)
++    if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+         return -1;
+ 
+     if (maxcpu > hostcpus)
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index f3e3108..409f922 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -1195,7 +1195,7 @@ int nodeGetMemoryStats(int cellNum ATTRIBUTE_UNUSED,
+ }
+ 
+ int
+-nodeGetCPUCount(void)
++nodeGetCPUCount(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+ {
+ #if defined(__linux__)
+     /* To support older kernels that lack cpu/present, such as 2.6.18
+@@ -1204,21 +1204,27 @@ nodeGetCPUCount(void)
+      * will be consecutive.
+      */
+     char *present_path = NULL;
++    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     char *cpupath = NULL;
+     int ncpu = -1;
+ 
+-    if (!(present_path = linuxGetCPUPresentPath(NULL)))
++    if (!(present_path = linuxGetCPUPresentPath(prefix)))
+         return -1;
+ 
+     if (virFileExists(present_path)) {
+         ncpu = linuxParseCPUmax(present_path);
+-    } else if (virFileExists(SYSFS_SYSTEM_PATH "/cpu/cpu0")) {
++        goto cleanup;
++    }
++
++    if (virAsprintf(&cpupath, "%s/cpu/cpu0", prefix) < 0)
++        goto cleanup;
++    if (virFileExists(cpupath)) {
+         ncpu = 0;
+         do {
+             ncpu++;
+             VIR_FREE(cpupath);
+             if (virAsprintf(&cpupath, "%s/cpu/cpu%d",
+-                            SYSFS_SYSTEM_PATH, ncpu) < 0) {
++                            prefix, ncpu) < 0) {
+                 ncpu = -1;
+                 goto cleanup;
+             }
+@@ -1251,7 +1257,7 @@ nodeGetPresentCPUBitmap(void)
+     virBitmapPtr bitmap = NULL;
+ #endif
+ 
+-    if ((max_present = nodeGetCPUCount()) < 0)
++    if ((max_present = nodeGetCPUCount(NULL)) < 0)
+         return NULL;
+ 
+ #ifdef __linux__
+@@ -1274,7 +1280,7 @@ nodeGetCPUBitmap(int *max_id ATTRIBUTE_UNUSED)
+     virBitmapPtr cpumap;
+     int present;
+ 
+-    present = nodeGetCPUCount();
++    present = nodeGetCPUCount(NULL);
+     if (present < 0)
+         return NULL;
+ 
+@@ -1621,7 +1627,7 @@ nodeGetCPUMap(unsigned char **cpumap,
+     virCheckFlags(0, -1);
+ 
+     if (!cpumap && !online)
+-        return nodeGetCPUCount();
++        return nodeGetCPUCount(NULL);
+ 
+     if (!(cpus = nodeGetCPUBitmap(&maxpresent)))
+         goto cleanup;
+diff --git a/src/nodeinfo.h b/src/nodeinfo.h
+index 047bd5c..4f9699e 100644
+--- a/src/nodeinfo.h
++++ b/src/nodeinfo.h
+@@ -45,7 +45,7 @@ int nodeGetMemory(unsigned long long *mem,
+ 
+ virBitmapPtr nodeGetPresentCPUBitmap(void);
+ virBitmapPtr nodeGetCPUBitmap(int *max_id);
+-int nodeGetCPUCount(void);
++int nodeGetCPUCount(const char *sysfs_prefix);
+ 
+ int nodeGetMemoryParameters(virTypedParameterPtr params,
+                             int *nparams,
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index 8f5e4fb..e30a02d 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -5253,7 +5253,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
+     if (!(def = virDomainObjGetOneDef(vm, flags)))
+         goto cleanup;
+ 
+-    if ((hostcpus = nodeGetCPUCount()) < 0)
++    if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+         goto cleanup;
+ 
+     if (!(allcpumap = virBitmapNew(hostcpus)))
+@@ -5441,7 +5441,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
+     if (!(def = virDomainObjGetOneDef(vm, flags)))
+         goto cleanup;
+ 
+-    if ((hostcpus = nodeGetCPUCount()) < 0)
++    if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+         goto cleanup;
+ 
+     if (def->cputune.emulatorpin) {
+@@ -5684,7 +5684,7 @@ qemuDomainGetIOThreadsConfig(virDomainDefPtr targetDef,
+     if (targetDef->iothreads == 0)
+         return 0;
+ 
+-    if ((hostcpus = nodeGetCPUCount()) < 0)
++    if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+         goto cleanup;
+ 
+     if (VIR_ALLOC_N(info_ret, targetDef->iothreads) < 0)
+diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
+index f41fd9d..e1c7f0b 100644
+--- a/src/qemu/qemu_process.c
++++ b/src/qemu/qemu_process.c
+@@ -2408,7 +2408,7 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
+ 
+             /* setaffinity fails if you set bits for CPUs which
+              * aren't present, so we have to limit ourselves */
+-            if ((hostcpus = nodeGetCPUCount()) < 0)
++            if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+                 goto cleanup;
+ 
+             if (hostcpus > QEMUD_CPUMASK_LEN)
+diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
+index f27098c..a584940 100644
+--- a/src/vz/vz_sdk.c
++++ b/src/vz/vz_sdk.c
+@@ -1141,7 +1141,7 @@ prlsdkConvertCpuInfo(PRL_HANDLE sdkdom,
+     PRL_RESULT pret;
+     int ret = -1;
+ 
+-    if ((hostcpus = nodeGetCPUCount()) < 0)
++    if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+         goto cleanup;
+ 
+     /* get number of CPUs */
+diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c
+index dddf33a..7a87640 100644
+--- a/tests/vircgrouptest.c
++++ b/tests/vircgrouptest.c
+@@ -649,8 +649,8 @@ static int testCgroupGetPercpuStats(const void *args ATTRIBUTE_UNUSED)
+         goto cleanup;
+     }
+ 
+-    if (nodeGetCPUCount() != EXPECTED_NCPUS) {
+-        fprintf(stderr, "Unexpected: nodeGetCPUCount() yields: %d\n", nodeGetCPUCount());
++    if (nodeGetCPUCount(NULL) != EXPECTED_NCPUS) {
++        fprintf(stderr, "Unexpected: nodeGetCPUCount() yields: %d\n", nodeGetCPUCount(NULL));
+         goto cleanup;
+     }
+ 
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetCPUMap.patch b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetCPUMap.patch
new file mode 100644
index 0000000..5a41d48
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetCPUMap.patch
@@ -0,0 +1,151 @@
+From 397e67c0f6ee09387ac871c7f3ac1fa9ba697287 Mon Sep 17 00:00:00 2001
+Message-Id: <397e67c0f6ee09387ac871c7f3ac1fa9ba697287@dist-git>
+From: John Ferlan 
+Date: Wed, 5 Aug 2015 18:18:11 +0200
+Subject: [PATCH] nodeinfo: Add sysfs_prefix to nodeGetCPUMap
+
+Add the sysfs_prefix argument to the call to allow for setting the
+path for tests to something other than SYSFS_SYSTEM_PATH.
+
+(cherry picked from commit f1c6179f0d44a04abb2f7c2e58f2ef3dad2892b8)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/bhyve/bhyve_driver.c   | 2 +-
+ src/lxc/lxc_driver.c       | 2 +-
+ src/nodeinfo.c             | 8 +++++---
+ src/nodeinfo.h             | 3 ++-
+ src/openvz/openvz_driver.c | 2 +-
+ src/qemu/qemu_driver.c     | 2 +-
+ src/uml/uml_driver.c       | 2 +-
+ src/vz/vz_driver.c         | 2 +-
+ 8 files changed, 13 insertions(+), 10 deletions(-)
+
+diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
+index dc76cf7..68dff6c 100644
+--- a/src/bhyve/bhyve_driver.c
++++ b/src/bhyve/bhyve_driver.c
+@@ -1299,7 +1299,7 @@ bhyveNodeGetCPUMap(virConnectPtr conn,
+     if (virNodeGetCPUMapEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetCPUMap(cpumap, online, flags);
++    return nodeGetCPUMap(NULL, cpumap, online, flags);
+ }
+ 
+ static int
+diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
+index 5ecfc7a..44a138b 100644
+--- a/src/lxc/lxc_driver.c
++++ b/src/lxc/lxc_driver.c
+@@ -5551,7 +5551,7 @@ lxcNodeGetCPUMap(virConnectPtr conn,
+     if (virNodeGetCPUMapEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetCPUMap(cpumap, online, flags);
++    return nodeGetCPUMap(NULL, cpumap, online, flags);
+ }
+ 
+ 
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 75e0a02..bf4f751 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -1624,10 +1624,12 @@ nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
+ }
+ 
+ int
+-nodeGetCPUMap(unsigned char **cpumap,
++nodeGetCPUMap(const char *sysfs_prefix,
++              unsigned char **cpumap,
+               unsigned int *online,
+               unsigned int flags)
+ {
++    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     virBitmapPtr cpus = NULL;
+     int maxpresent;
+     int ret = -1;
+@@ -1636,9 +1638,9 @@ nodeGetCPUMap(unsigned char **cpumap,
+     virCheckFlags(0, -1);
+ 
+     if (!cpumap && !online)
+-        return nodeGetCPUCount(NULL);
++        return nodeGetCPUCount(prefix);
+ 
+-    if (!(cpus = nodeGetCPUBitmap(NULL, &maxpresent)))
++    if (!(cpus = nodeGetCPUBitmap(prefix, &maxpresent)))
+         goto cleanup;
+ 
+     if (cpumap && virBitmapToData(cpus, cpumap, &dummy) < 0)
+diff --git a/src/nodeinfo.h b/src/nodeinfo.h
+index 439ef35..9e6904f 100644
+--- a/src/nodeinfo.h
++++ b/src/nodeinfo.h
+@@ -55,7 +55,8 @@ int nodeSetMemoryParameters(virTypedParameterPtr params,
+                             int nparams,
+                             unsigned int flags);
+ 
+-int nodeGetCPUMap(unsigned char **cpumap,
++int nodeGetCPUMap(const char *sysfs_prefix,
++                  unsigned char **cpumap,
+                   unsigned int *online,
+                   unsigned int flags);
+ 
+diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
+index d1a327c..fc6f101 100644
+--- a/src/openvz/openvz_driver.c
++++ b/src/openvz/openvz_driver.c
+@@ -2207,7 +2207,7 @@ openvzNodeGetCPUMap(virConnectPtr conn ATTRIBUTE_UNUSED,
+                     unsigned int *online,
+                     unsigned int flags)
+ {
+-    return nodeGetCPUMap(cpumap, online, flags);
++    return nodeGetCPUMap(NULL, cpumap, online, flags);
+ }
+ 
+ 
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index e30a02d..6036363 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -18586,7 +18586,7 @@ qemuNodeGetCPUMap(virConnectPtr conn,
+     if (virNodeGetCPUMapEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetCPUMap(cpumap, online, flags);
++    return nodeGetCPUMap(NULL, cpumap, online, flags);
+ }
+ 
+ 
+diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
+index 7a95458..99162f7 100644
+--- a/src/uml/uml_driver.c
++++ b/src/uml/uml_driver.c
+@@ -2877,7 +2877,7 @@ umlNodeGetCPUMap(virConnectPtr conn,
+     if (virNodeGetCPUMapEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetCPUMap(cpumap, online, flags);
++    return nodeGetCPUMap(NULL, cpumap, online, flags);
+ }
+ 
+ 
+diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
+index 47c5023..a98d65b 100644
+--- a/src/vz/vz_driver.c
++++ b/src/vz/vz_driver.c
+@@ -884,7 +884,7 @@ vzNodeGetCPUMap(virConnectPtr conn ATTRIBUTE_UNUSED,
+                 unsigned int *online,
+                 unsigned int flags)
+ {
+-    return nodeGetCPUMap(cpumap, online, flags);
++    return nodeGetCPUMap(NULL, cpumap, online, flags);
+ }
+ 
+ static int
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetInfo.patch b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetInfo.patch
new file mode 100644
index 0000000..898e8bc
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetInfo.patch
@@ -0,0 +1,226 @@
+From 242c0464ea05a4c8e3ca02e79251e40de28b14eb Mon Sep 17 00:00:00 2001
+Message-Id: <242c0464ea05a4c8e3ca02e79251e40de28b14eb@dist-git>
+From: John Ferlan 
+Date: Wed, 5 Aug 2015 18:18:12 +0200
+Subject: [PATCH] nodeinfo: Add sysfs_prefix to nodeGetInfo
+
+Add the sysfs_prefix argument to the call to allow for setting the
+path for tests to something other than SYSFS_SYSTEM_PATH.
+
+(cherry picked from commit 29e4f2243fb59a3b1fcbd69ee329e38f09960266)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/bhyve/bhyve_capabilities.c | 2 +-
+ src/bhyve/bhyve_driver.c       | 2 +-
+ src/lxc/lxc_driver.c           | 2 +-
+ src/nodeinfo.c                 | 9 ++++++---
+ src/nodeinfo.h                 | 2 +-
+ src/openvz/openvz_conf.c       | 2 +-
+ src/openvz/openvz_driver.c     | 2 +-
+ src/qemu/qemu_capabilities.c   | 2 +-
+ src/qemu/qemu_driver.c         | 2 +-
+ src/uml/uml_driver.c           | 2 +-
+ src/vbox/vbox_common.c         | 2 +-
+ src/vz/vz_driver.c             | 4 ++--
+ 12 files changed, 18 insertions(+), 15 deletions(-)
+
+diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c
+index e6d5518..3a55879 100644
+--- a/src/bhyve/bhyve_capabilities.c
++++ b/src/bhyve/bhyve_capabilities.c
+@@ -51,7 +51,7 @@ virBhyveCapsInitCPU(virCapsPtr caps,
+ 
+     cpu->arch = arch;
+ 
+-    if (nodeGetInfo(&nodeinfo))
++    if (nodeGetInfo(NULL, &nodeinfo))
+         goto error;
+ 
+     cpu->type = VIR_CPU_TYPE_HOST;
+diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
+index 68dff6c..ba411a0 100644
+--- a/src/bhyve/bhyve_driver.c
++++ b/src/bhyve/bhyve_driver.c
+@@ -1131,7 +1131,7 @@ bhyveNodeGetInfo(virConnectPtr conn,
+     if (virNodeGetInfoEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetInfo(nodeinfo);
++    return nodeGetInfo(NULL, nodeinfo);
+ }
+ 
+ static int
+diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
+index 44a138b..1206074 100644
+--- a/src/lxc/lxc_driver.c
++++ b/src/lxc/lxc_driver.c
+@@ -5398,7 +5398,7 @@ lxcNodeGetInfo(virConnectPtr conn,
+     if (virNodeGetInfoEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetInfo(nodeinfo);
++    return nodeGetInfo(NULL, nodeinfo);
+ }
+ 
+ 
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index bf4f751..2d715fd 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -1034,7 +1034,8 @@ virNodeGetSiblingsList(const char *dir, int cpu_id)
+ }
+ #endif
+ 
+-int nodeGetInfo(virNodeInfoPtr nodeinfo)
++int nodeGetInfo(const char *sysfs_prefix ATTRIBUTE_UNUSED,
++                virNodeInfoPtr nodeinfo)
+ {
+     virArch hostarch = virArchFromHost();
+ 
+@@ -1046,14 +1047,16 @@ int nodeGetInfo(virNodeInfoPtr nodeinfo)
+ #ifdef __linux__
+     {
+     int ret = -1;
++    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     FILE *cpuinfo = fopen(CPUINFO_PATH, "r");
++
+     if (!cpuinfo) {
+         virReportSystemError(errno,
+                              _("cannot open %s"), CPUINFO_PATH);
+         return -1;
+     }
+ 
+-    ret = linuxNodeInfoCPUPopulate(cpuinfo, SYSFS_SYSTEM_PATH,
++    ret = linuxNodeInfoCPUPopulate(cpuinfo, prefix,
+                                    hostarch, nodeinfo);
+     if (ret < 0)
+         goto cleanup;
+@@ -1666,7 +1669,7 @@ nodeCapsInitNUMAFake(virCapsPtr caps ATTRIBUTE_UNUSED)
+     int id, cid;
+     int onlinecpus ATTRIBUTE_UNUSED;
+ 
+-    if (nodeGetInfo(&nodeinfo) < 0)
++    if (nodeGetInfo(NULL, &nodeinfo) < 0)
+         return -1;
+ 
+     ncpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
+diff --git a/src/nodeinfo.h b/src/nodeinfo.h
+index 9e6904f..ec53769 100644
+--- a/src/nodeinfo.h
++++ b/src/nodeinfo.h
+@@ -26,7 +26,7 @@
+ 
+ # include "capabilities.h"
+ 
+-int nodeGetInfo(virNodeInfoPtr nodeinfo);
++int nodeGetInfo(const char *sysfs_prefix, virNodeInfoPtr nodeinfo);
+ int nodeCapsInitNUMA(virCapsPtr caps);
+ 
+ int nodeGetCPUStats(int cpuNum,
+diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
+index 49d78c6..a4c5c31 100644
+--- a/src/openvz/openvz_conf.c
++++ b/src/openvz/openvz_conf.c
+@@ -637,7 +637,7 @@ openvzGetNodeCPUs(void)
+ {
+     virNodeInfo nodeinfo;
+ 
+-    if (nodeGetInfo(&nodeinfo) < 0)
++    if (nodeGetInfo(NULL, &nodeinfo) < 0)
+         return 0;
+ 
+     return nodeinfo.cpus;
+diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
+index fc6f101..280b998 100644
+--- a/src/openvz/openvz_driver.c
++++ b/src/openvz/openvz_driver.c
+@@ -2155,7 +2155,7 @@ static int
+ openvzNodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED,
+                   virNodeInfoPtr nodeinfo)
+ {
+-    return nodeGetInfo(nodeinfo);
++    return nodeGetInfo(NULL, nodeinfo);
+ }
+ 
+ 
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index b4a6961..39954bc 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -961,7 +961,7 @@ virQEMUCapsInitCPU(virCapsPtr caps,
+ 
+     cpu->arch = arch;
+ 
+-    if (nodeGetInfo(&nodeinfo))
++    if (nodeGetInfo(NULL, &nodeinfo))
+         goto error;
+ 
+     cpu->type = VIR_CPU_TYPE_HOST;
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index 6036363..17593b9 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -18491,7 +18491,7 @@ qemuNodeGetInfo(virConnectPtr conn,
+     if (virNodeGetInfoEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetInfo(nodeinfo);
++    return nodeGetInfo(NULL, nodeinfo);
+ }
+ 
+ 
+diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
+index 99162f7..8606616 100644
+--- a/src/uml/uml_driver.c
++++ b/src/uml/uml_driver.c
+@@ -2782,7 +2782,7 @@ umlNodeGetInfo(virConnectPtr conn,
+     if (virNodeGetInfoEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetInfo(nodeinfo);
++    return nodeGetInfo(NULL, nodeinfo);
+ }
+ 
+ 
+diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
+index 813a171..5615df5 100644
+--- a/src/vbox/vbox_common.c
++++ b/src/vbox/vbox_common.c
+@@ -7537,7 +7537,7 @@ static int
+ vboxNodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED,
+                 virNodeInfoPtr nodeinfo)
+ {
+-    return nodeGetInfo(nodeinfo);
++    return nodeGetInfo(NULL, nodeinfo);
+ }
+ 
+ static int
+diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
+index a98d65b..61d0d62 100644
+--- a/src/vz/vz_driver.c
++++ b/src/vz/vz_driver.c
+@@ -148,7 +148,7 @@ vzBuildCapabilities(void)
+                                       NULL, NULL, 0, NULL) == NULL)
+         goto error;
+ 
+-    if (nodeGetInfo(&nodeinfo))
++    if (nodeGetInfo(NULL, &nodeinfo))
+         goto error;
+ 
+     if (VIR_ALLOC(cpu) < 0)
+@@ -781,7 +781,7 @@ static int
+ vzNodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED,
+               virNodeInfoPtr nodeinfo)
+ {
+-    return nodeGetInfo(nodeinfo);
++    return nodeGetInfo(NULL, nodeinfo);
+ }
+ 
+ static int vzConnectIsEncrypted(virConnectPtr conn ATTRIBUTE_UNUSED)
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetMemoryStats.patch b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetMemoryStats.patch
new file mode 100644
index 0000000..ef5a2a9
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetMemoryStats.patch
@@ -0,0 +1,138 @@
+From 69397bf8901e911a4e288bba84896a18b2604dd1 Mon Sep 17 00:00:00 2001
+Message-Id: <69397bf8901e911a4e288bba84896a18b2604dd1@dist-git>
+From: John Ferlan 
+Date: Wed, 5 Aug 2015 18:18:14 +0200
+Subject: [PATCH] nodeinfo: Add sysfs_prefix to nodeGetMemoryStats
+
+Add the sysfs_prefix argument to the call to allow for setting the
+path for tests to something other than SYSFS_SYSTEM_PATH.
+
+(cherry picked from commit c71f0654fc8ed9e69b75b24eac83a3369e4e64b3)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/bhyve/bhyve_driver.c   | 2 +-
+ src/lxc/lxc_driver.c       | 2 +-
+ src/nodeinfo.c             | 6 ++++--
+ src/nodeinfo.h             | 3 ++-
+ src/openvz/openvz_driver.c | 2 +-
+ src/qemu/qemu_driver.c     | 2 +-
+ src/uml/uml_driver.c       | 2 +-
+ 7 files changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
+index ba411a0..85b7c8f 100644
+--- a/src/bhyve/bhyve_driver.c
++++ b/src/bhyve/bhyve_driver.c
+@@ -1121,7 +1121,7 @@ bhyveNodeGetMemoryStats(virConnectPtr conn,
+     if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetMemoryStats(cellNum, params, nparams, flags);
++    return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ }
+ 
+ static int
+diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
+index 1206074..d8d5119 100644
+--- a/src/lxc/lxc_driver.c
++++ b/src/lxc/lxc_driver.c
+@@ -5484,7 +5484,7 @@ lxcNodeGetMemoryStats(virConnectPtr conn,
+     if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetMemoryStats(cellNum, params, nparams, flags);
++    return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ }
+ 
+ 
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index a71d05e..ca9cb3a 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -1141,7 +1141,8 @@ int nodeGetCPUStats(int cpuNum ATTRIBUTE_UNUSED,
+ #endif
+ }
+ 
+-int nodeGetMemoryStats(int cellNum ATTRIBUTE_UNUSED,
++int nodeGetMemoryStats(const char *sysfs_prefix ATTRIBUTE_UNUSED,
++                       int cellNum ATTRIBUTE_UNUSED,
+                        virNodeMemoryStatsPtr params ATTRIBUTE_UNUSED,
+                        int *nparams ATTRIBUTE_UNUSED,
+                        unsigned int flags)
+@@ -1151,6 +1152,7 @@ int nodeGetMemoryStats(int cellNum ATTRIBUTE_UNUSED,
+ #ifdef __linux__
+     {
+         int ret;
++        const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+         char *meminfo_path = NULL;
+         FILE *meminfo;
+         int max_node;
+@@ -1170,7 +1172,7 @@ int nodeGetMemoryStats(int cellNum ATTRIBUTE_UNUSED,
+             }
+ 
+             if (virAsprintf(&meminfo_path, "%s/node/node%d/meminfo",
+-                            SYSFS_SYSTEM_PATH, cellNum) < 0)
++                            prefix, cellNum) < 0)
+                 return -1;
+         }
+         meminfo = fopen(meminfo_path, "r");
+diff --git a/src/nodeinfo.h b/src/nodeinfo.h
+index b28aaab..4f983c2 100644
+--- a/src/nodeinfo.h
++++ b/src/nodeinfo.h
+@@ -33,7 +33,8 @@ int nodeGetCPUStats(int cpuNum,
+                     virNodeCPUStatsPtr params,
+                     int *nparams,
+                     unsigned int flags);
+-int nodeGetMemoryStats(int cellNum,
++int nodeGetMemoryStats(const char *sysfs_prefix,
++                       int cellNum,
+                        virNodeMemoryStatsPtr params,
+                        int *nparams,
+                        unsigned int flags);
+diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
+index 280b998..fc8db7e 100644
+--- a/src/openvz/openvz_driver.c
++++ b/src/openvz/openvz_driver.c
+@@ -2177,7 +2177,7 @@ openvzNodeGetMemoryStats(virConnectPtr conn ATTRIBUTE_UNUSED,
+                          int *nparams,
+                          unsigned int flags)
+ {
+-    return nodeGetMemoryStats(cellNum, params, nparams, flags);
++    return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ }
+ 
+ 
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index 17593b9..6b715bf 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -18519,7 +18519,7 @@ qemuNodeGetMemoryStats(virConnectPtr conn,
+     if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetMemoryStats(cellNum, params, nparams, flags);
++    return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ }
+ 
+ 
+diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
+index 8606616..c3c5fa7 100644
+--- a/src/uml/uml_driver.c
++++ b/src/uml/uml_driver.c
+@@ -2810,7 +2810,7 @@ umlNodeGetMemoryStats(virConnectPtr conn,
+     if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
+         return -1;
+ 
+-    return nodeGetMemoryStats(cellNum, params, nparams, flags);
++    return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ }
+ 
+ 
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetPresentCPUBitmap.patch b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetPresentCPUBitmap.patch
new file mode 100644
index 0000000..7b72653
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Add-sysfs_prefix-to-nodeGetPresentCPUBitmap.patch
@@ -0,0 +1,78 @@
+From ffadd3f17a8d1f970bcfe31cebd08a11da9fb5ef Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: John Ferlan 
+Date: Wed, 5 Aug 2015 18:18:09 +0200
+Subject: [PATCH] nodeinfo: Add sysfs_prefix to nodeGetPresentCPUBitmap
+
+Add the sysfs_prefix argument to the call to allow for setting the
+path for tests to something other than SYSFS_SYSTEM_PATH.
+
+(cherry picked from commit 51281dcb9032610983c19dd98295a0aa8e5c40d6)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c       | 7 ++++---
+ src/nodeinfo.h       | 2 +-
+ src/util/vircgroup.c | 2 +-
+ 3 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 409f922..34de720 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -1249,19 +1249,20 @@ nodeGetCPUCount(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+ }
+ 
+ virBitmapPtr
+-nodeGetPresentCPUBitmap(void)
++nodeGetPresentCPUBitmap(const char *sysfs_prefix)
+ {
+     int max_present;
+ #ifdef __linux__
+     char *present_path = NULL;
+     virBitmapPtr bitmap = NULL;
+ #endif
++    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+ 
+-    if ((max_present = nodeGetCPUCount(NULL)) < 0)
++    if ((max_present = nodeGetCPUCount(prefix)) < 0)
+         return NULL;
+ 
+ #ifdef __linux__
+-    if (!(present_path = linuxGetCPUPresentPath(NULL)))
++    if (!(present_path = linuxGetCPUPresentPath(prefix)))
+         return NULL;
+     if (virFileExists(present_path))
+         bitmap = linuxParseCPUmap(max_present, present_path);
+diff --git a/src/nodeinfo.h b/src/nodeinfo.h
+index 4f9699e..3ef206b 100644
+--- a/src/nodeinfo.h
++++ b/src/nodeinfo.h
+@@ -43,7 +43,7 @@ int nodeGetCellsFreeMemory(unsigned long long *freeMems,
+ int nodeGetMemory(unsigned long long *mem,
+                   unsigned long long *freeMem);
+ 
+-virBitmapPtr nodeGetPresentCPUBitmap(void);
++virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix);
+ virBitmapPtr nodeGetCPUBitmap(int *max_id);
+ int nodeGetCPUCount(const char *sysfs_prefix);
+ 
+diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
+index 29b2ab9..0599ba5 100644
+--- a/src/util/vircgroup.c
++++ b/src/util/vircgroup.c
+@@ -3037,7 +3037,7 @@ virCgroupGetPercpuStats(virCgroupPtr group,
+     }
+ 
+     /* To parse account file, we need to know how many cpus are present.  */
+-    if (!(cpumap = nodeGetPresentCPUBitmap()))
++    if (!(cpumap = nodeGetPresentCPUBitmap(NULL)))
+         return rv;
+ 
+     total_cpus = virBitmapSize(cpumap);
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Calculate-present-and-online-CPUs-only-once.patch b/SOURCES/libvirt-nodeinfo-Calculate-present-and-online-CPUs-only-once.patch
new file mode 100644
index 0000000..e24f908
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Calculate-present-and-online-CPUs-only-once.patch
@@ -0,0 +1,149 @@
+From ada52f5411197e518765aa5e09d41fc7a4550861 Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:31 +0200
+Subject: [PATCH] nodeinfo: Calculate present and online CPUs only once
+
+Move the calls to the respective functions from virNodeParseNode(),
+which is executed once for every NUMA node, to
+linuxNodeInfoCPUPopulate(), which is executed just once per host.
+
+(cherry picked from commit 6395ec1cf029cfc0be371eea66da7bc379c31c69)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 46 ++++++++++++++++++++++++++--------------------
+ 1 file changed, 26 insertions(+), 20 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 2328a86..6c8849d 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -390,12 +390,14 @@ virNodeParseSocket(const char *dir,
+ /* parses a node entry, returning number of processors in the node and
+  * filling arguments */
+ static int
+-ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
++ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5)
+ ATTRIBUTE_NONNULL(6) ATTRIBUTE_NONNULL(7)
+-virNodeParseNode(const char *sysfs_prefix,
+-                 const char *node,
++ATTRIBUTE_NONNULL(8)
++virNodeParseNode(const char *node,
+                  virArch arch,
++                 virBitmapPtr present_cpus_map,
++                 virBitmapPtr online_cpus_map,
+                  int *sockets,
+                  int *cores,
+                  int *threads,
+@@ -408,12 +410,10 @@ virNodeParseNode(const char *sysfs_prefix,
+     int processors = 0;
+     DIR *cpudir = NULL;
+     struct dirent *cpudirent = NULL;
+-    virBitmapPtr present_cpumap = NULL;
+-    virBitmapPtr online_cpus_map = NULL;
+     virBitmapPtr node_cpus_map = NULL;
+     virBitmapPtr sockets_map = NULL;
+     virBitmapPtr *cores_maps = NULL;
+-    int npresent_cpus;
++    int npresent_cpus = virBitmapSize(present_cpus_map);
+     int sock_max = 0;
+     int sock;
+     int core;
+@@ -431,15 +431,6 @@ virNodeParseNode(const char *sysfs_prefix,
+         goto cleanup;
+     }
+ 
+-    present_cpumap = nodeGetPresentCPUBitmap(sysfs_prefix);
+-    if (!present_cpumap)
+-        goto cleanup;
+-    online_cpus_map = nodeGetOnlineCPUBitmap(sysfs_prefix);
+-    if (!online_cpus_map)
+-        goto cleanup;
+-
+-    npresent_cpus = virBitmapSize(present_cpumap);
+-
+     /* Keep track of the CPUs that belong to the current node */
+     if (!(node_cpus_map = virBitmapNew(npresent_cpus)))
+         goto cleanup;
+@@ -452,7 +443,7 @@ virNodeParseNode(const char *sysfs_prefix,
+         if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
+             continue;
+ 
+-        if (!virBitmapIsBitSet(present_cpumap, cpu))
++        if (!virBitmapIsBitSet(present_cpus_map, cpu))
+             continue;
+ 
+         /* Mark this CPU as part of the current node */
+@@ -565,8 +556,6 @@ virNodeParseNode(const char *sysfs_prefix,
+     VIR_FREE(cores_maps);
+     virBitmapFree(sockets_map);
+     virBitmapFree(node_cpus_map);
+-    virBitmapFree(online_cpus_map);
+-    virBitmapFree(present_cpumap);
+ 
+     return ret;
+ }
+@@ -578,6 +567,8 @@ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+                          virNodeInfoPtr nodeinfo)
+ {
+     const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
++    virBitmapPtr present_cpus_map = NULL;
++    virBitmapPtr online_cpus_map = NULL;
+     char line[1024];
+     DIR *nodedir = NULL;
+     struct dirent *nodedirent = NULL;
+@@ -669,6 +660,15 @@ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+         }
+     }
+ 
++    /* Get information about what CPUs are present in the host and what
++     * CPUs are online, so that we don't have to so for each node */
++    present_cpus_map = nodeGetPresentCPUBitmap(sysfs_prefix);
++    if (!present_cpus_map)
++        goto cleanup;
++    online_cpus_map = nodeGetOnlineCPUBitmap(sysfs_prefix);
++    if (!online_cpus_map)
++        goto cleanup;
++
+     /* OK, we've parsed clock speed out of /proc/cpuinfo. Get the
+      * core, node, socket, thread and topology information from /sys
+      */
+@@ -690,7 +690,9 @@ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+                         prefix, nodedirent->d_name) < 0)
+             goto cleanup;
+ 
+-        if ((cpus = virNodeParseNode(sysfs_prefix, sysfs_cpudir, arch,
++        if ((cpus = virNodeParseNode(sysfs_cpudir, arch,
++                                     present_cpus_map,
++                                     online_cpus_map,
+                                      &socks, &cores,
+                                      &threads, &offline)) < 0)
+             goto cleanup;
+@@ -721,7 +723,9 @@ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+     if (virAsprintf(&sysfs_cpudir, "%s/cpu", prefix) < 0)
+         goto cleanup;
+ 
+-    if ((cpus = virNodeParseNode(sysfs_prefix, sysfs_cpudir, arch,
++    if ((cpus = virNodeParseNode(sysfs_cpudir, arch,
++                                 present_cpus_map,
++                                 online_cpus_map,
+                                  &socks, &cores,
+                                  &threads, &offline)) < 0)
+         goto cleanup;
+@@ -775,6 +779,8 @@ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+         ret = -1;
+     }
+ 
++    virBitmapFree(present_cpus_map);
++    virBitmapFree(online_cpus_map);
+     VIR_FREE(sysfs_nodedir);
+     VIR_FREE(sysfs_cpudir);
+     return ret;
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Check-for-errors-when-reading-core_id.patch b/SOURCES/libvirt-nodeinfo-Check-for-errors-when-reading-core_id.patch
new file mode 100644
index 0000000..c50c65b
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Check-for-errors-when-reading-core_id.patch
@@ -0,0 +1,34 @@
+From 79b6cde136f9f067bfc2ef2477525218f2c4ca19 Mon Sep 17 00:00:00 2001
+Message-Id: <79b6cde136f9f067bfc2ef2477525218f2c4ca19@dist-git>
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:32 +0200
+Subject: [PATCH] nodeinfo: Check for errors when reading core_id
+
+(cherry picked from commit f86c45ca0c10c84c954ed201531ab31129d9c9c3)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 6c8849d..8b56376 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -511,7 +511,9 @@ virNodeParseNode(const char *node,
+             /* logical cpu is equivalent to a core on s390 */
+             core = cpu;
+         } else {
+-            core = virNodeGetCpuValue(node, cpu, "topology/core_id", 0);
++            if ((core = virNodeGetCpuValue(node, cpu,
++                                           "topology/core_id", 0)) < 0)
++                goto cleanup;
+         }
+         if (core > ID_MAX) {
+             virReportError(VIR_ERR_INTERNAL_ERROR,
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Fix-build-failure-when-KVM-headers-are-not-available.patch b/SOURCES/libvirt-nodeinfo-Fix-build-failure-when-KVM-headers-are-not-available.patch
new file mode 100644
index 0000000..d0ecdbc
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Fix-build-failure-when-KVM-headers-are-not-available.patch
@@ -0,0 +1,69 @@
+From 1693e23be444bd7adf9d65062cddb906855bbf24 Mon Sep 17 00:00:00 2001
+Message-Id: <1693e23be444bd7adf9d65062cddb906855bbf24@dist-git>
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:40 +0200
+Subject: [PATCH] nodeinfo: Fix build failure when KVM headers are not
+ available
+
+Compiler error:
+
+  ../../src/nodeinfo.c: In function 'nodeGetThreadsPerSubcore':
+  ../../src/nodeinfo.c:2393: error: label 'out' defined but not used [-Wunused-label]
+  ../../src/nodeinfo.c:2352: error: unused parameter 'arch' [-Wunused-parameter]
+
+(cherry picked from commit 88c4c32af17adfc21b810b62b71de8b2d245fef9)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index ec78f65..d662be5 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -2340,6 +2340,8 @@ nodeAllocPages(unsigned int npages,
+     return ret;
+ }
+ 
++#if HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT)
++
+ /* Get the number of threads per subcore.
+  *
+  * This will be 2, 4 or 8 on POWER hosts, depending on the current
+@@ -2351,8 +2353,6 @@ int
+ nodeGetThreadsPerSubcore(virArch arch)
+ {
+     int threads_per_subcore = 0;
+-
+-#if HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT)
+     const char *kvmpath = "/dev/kvm";
+     int kvmfd;
+ 
+@@ -2387,8 +2387,19 @@ nodeGetThreadsPerSubcore(virArch arch)
+ 
+         VIR_FORCE_CLOSE(kvmfd);
+     }
+-#endif /* HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) */
+ 
+  out:
+     return threads_per_subcore;
+ }
++
++#else
++
++/* Fallback for nodeGetThreadsPerSubcore() used when KVM headers
++ * are not available on the system */
++int
++nodeGetThreadsPerSubcore(virArch arch ATTRIBUTE_UNUSED)
++{
++    return 0;
++}
++
++#endif /* HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) */
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Fix-nodeGetCPUBitmap-s-fallback-code-path.patch b/SOURCES/libvirt-nodeinfo-Fix-nodeGetCPUBitmap-s-fallback-code-path.patch
new file mode 100644
index 0000000..704fe68
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Fix-nodeGetCPUBitmap-s-fallback-code-path.patch
@@ -0,0 +1,60 @@
+From 44e605079ad64ead62dc949c9cd81326f10d3711 Mon Sep 17 00:00:00 2001
+Message-Id: <44e605079ad64ead62dc949c9cd81326f10d3711@dist-git>
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:21 +0200
+Subject: [PATCH] nodeinfo: Fix nodeGetCPUBitmap()'s fallback code path
+
+During the recent refactoring/cleanups, a bug has been introduced
+that caused all CPUs to be reported as online unless the sysfs
+cpu/present file was available.
+
+This commit fixes the fallback code path by building the directory
+path passed to virNodeGetCpuValue() correctly.
+
+(cherry picked from commit 2a6801892ac962d8176f764edde219ae00cb7f3a)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index c874fa6..105d7ab 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -1300,6 +1300,7 @@ nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+ #ifdef __linux__
+     const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     char *online_path = NULL;
++    char *cpudir = NULL;
+     virBitmapPtr cpumap;
+     int present;
+ 
+@@ -1317,8 +1318,12 @@ nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+         cpumap = virBitmapNew(present);
+         if (!cpumap)
+             goto cleanup;
++
++        if (virAsprintf(&cpudir, "%s/cpu", prefix) < 0)
++            goto cleanup;
++
+         for (i = 0; i < present; i++) {
+-            int online = virNodeGetCpuValue(prefix, i, "online", 1);
++            int online = virNodeGetCpuValue(cpudir, i, "online", 1);
+             if (online < 0) {
+                 virBitmapFree(cpumap);
+                 cpumap = NULL;
+@@ -1332,6 +1337,7 @@ nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+         *max_id = present;
+  cleanup:
+     VIR_FREE(online_path);
++    VIR_FREE(cpudir);
+     return cpumap;
+ #else
+     virReportError(VIR_ERR_NO_SUPPORT, "%s",
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Fix-output-on-PPC64-KVM-hosts.patch b/SOURCES/libvirt-nodeinfo-Fix-output-on-PPC64-KVM-hosts.patch
new file mode 100644
index 0000000..9260d4b
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Fix-output-on-PPC64-KVM-hosts.patch
@@ -0,0 +1,304 @@
+From f5b7d2d701f347b9b4e13d008de476e37c82c8cb Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Shivaprasad G Bhat 
+Date: Wed, 5 Aug 2015 18:18:35 +0200
+Subject: [PATCH] nodeinfo: Fix output on PPC64 KVM hosts
+
+The nodeinfo is reporting incorrect number of cpus and incorrect host
+topology on PPC64 KVM hosts. The KVM hypervisor on PPC64 needs only
+the primary thread in a core to be online, and the secondaries offlined.
+While scheduling a guest in, the kvm scheduler wakes up the secondaries to
+run in guest context.
+
+The host scheduling of the guests happen at the core level(as only primary
+thread is online). The kvm scheduler exploits as many threads of the core
+as needed by guest. Further, starting POWER8, the processor allows splitting
+a physical core into multiple subcores with 2 or 4 threads each. Again, only
+the primary thread in a subcore is online in the host. The KVM-PPC
+scheduler allows guests to exploit all the offline threads in the subcore,
+by bringing them online when needed.
+(Kernel patches on split-core http://www.spinics.net/lists/kvm-ppc/msg09121.html)
+
+Recently with dynamic micro-threading changes in ppc-kvm, makes sure
+to utilize all the offline cpus across guests, and across guests with
+different cpu topologies.
+(https://www.mail-archive.com/kvm@vger.kernel.org/msg115978.html)
+
+Since the offline cpus are brought online in the guest context, it is safe
+to count them as online. Nodeinfo today discounts these offline cpus from
+cpu count/topology calclulation, and the nodeinfo output is not of any help
+and the host appears overcommited when it is actually not.
+
+The patch carefully counts those offline threads whose primary threads are
+online. The host topology displayed by the nodeinfo is also fixed when the
+host is in valid kvm state.
+
+Signed-off-by: Shivaprasad G Bhat 
+Signed-off-by: Andrea Bolognani 
+(cherry picked from commit 014208c4d028d2a632cdfe89d361fca8811899b6)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/libvirt_private.syms |   1 +
+ src/nodeinfo.c           | 153 +++++++++++++++++++++++++++++++++++++++++++++--
+ src/nodeinfo.h           |   1 +
+ 3 files changed, 151 insertions(+), 4 deletions(-)
+
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index 1363c92..a6b523a 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -1008,6 +1008,7 @@ nodeGetMemoryParameters;
+ nodeGetMemoryStats;
+ nodeGetOnlineCPUBitmap;
+ nodeGetPresentCPUBitmap;
++nodeGetThreadsPerSubcore;
+ nodeSetMemoryParameters;
+ 
+ 
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 8b56376..ec78f65 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -31,6 +31,12 @@
+ #include 
+ #include 
+ #include "conf/domain_conf.h"
++#include 
++#include 
++
++#if HAVE_LINUX_KVM_H
++# include 
++#endif
+ 
+ #if defined(__FreeBSD__) || defined(__APPLE__)
+ # include 
+@@ -391,13 +397,14 @@ virNodeParseSocket(const char *dir,
+  * filling arguments */
+ static int
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
+-ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5)
+-ATTRIBUTE_NONNULL(6) ATTRIBUTE_NONNULL(7)
+-ATTRIBUTE_NONNULL(8)
++ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(6)
++ATTRIBUTE_NONNULL(7) ATTRIBUTE_NONNULL(8)
++ATTRIBUTE_NONNULL(9)
+ virNodeParseNode(const char *node,
+                  virArch arch,
+                  virBitmapPtr present_cpus_map,
+                  virBitmapPtr online_cpus_map,
++                 int threads_per_subcore,
+                  int *sockets,
+                  int *cores,
+                  int *threads,
+@@ -491,7 +498,18 @@ virNodeParseNode(const char *node,
+             continue;
+ 
+         if (!virBitmapIsBitSet(online_cpus_map, cpu)) {
+-            (*offline)++;
++            if (threads_per_subcore > 0 &&
++                cpu % threads_per_subcore != 0 &&
++                virBitmapIsBitSet(online_cpus_map,
++                                  cpu - (cpu % threads_per_subcore))) {
++                /* Secondary offline threads are counted as online when
++                 * subcores are in use and the corresponding primary
++                 * thread is online */
++                processors++;
++            } else {
++                /* But they are counted as offline otherwise */
++                (*offline)++;
++            }
+             continue;
+         }
+ 
+@@ -544,6 +562,12 @@ virNodeParseNode(const char *node,
+             *cores = core;
+     }
+ 
++    if (threads_per_subcore > 0) {
++        /* The thread count ignores offline threads, which means that only
++         * only primary threads have been considered so far. If subcores
++         * are in use, we need to also account for secondary threads */
++        *threads *= threads_per_subcore;
++    }
+     ret = processors;
+ 
+  cleanup:
+@@ -562,6 +586,41 @@ virNodeParseNode(const char *node,
+     return ret;
+ }
+ 
++/* Check whether the host subcore configuration is valid.
++ *
++ * A valid configuration is one where no secondary thread is online;
++ * the primary thread in a subcore is always the first one */
++static bool
++nodeHasValidSubcoreConfiguration(const char *sysfs_prefix,
++                                 int threads_per_subcore)
++{
++    virBitmapPtr online_cpus = NULL;
++    int cpu = -1;
++    bool ret = false;
++
++    /* No point in checking if subcores are not in use */
++    if (threads_per_subcore <= 0)
++        goto cleanup;
++
++    if (!(online_cpus = nodeGetOnlineCPUBitmap(sysfs_prefix)))
++        goto cleanup;
++
++    while ((cpu = virBitmapNextSetBit(online_cpus, cpu)) >= 0) {
++
++        /* A single online secondary thread is enough to
++         * make the configuration invalid */
++        if (cpu % threads_per_subcore != 0)
++            goto cleanup;
++    }
++
++    ret = true;
++
++ cleanup:
++    virBitmapFree(online_cpus);
++
++    return ret;
++}
++
+ int
+ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+                          FILE *cpuinfo,
+@@ -575,6 +634,7 @@ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+     DIR *nodedir = NULL;
+     struct dirent *nodedirent = NULL;
+     int cpus, cores, socks, threads, offline = 0;
++    int threads_per_subcore = 0;
+     unsigned int node;
+     int ret = -1;
+     char *sysfs_nodedir = NULL;
+@@ -682,6 +742,36 @@ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+         goto fallback;
+     }
+ 
++    /* PPC-KVM needs the secondary threads of a core to be offline on the
++     * host. The kvm scheduler brings the secondary threads online in the
++     * guest context. Moreover, P8 processor has split-core capability
++     * where, there can be 1,2 or 4 subcores per core. The primaries of the
++     * subcores alone will be online on the host for a subcore in the
++     * host. Even though the actual threads per core for P8 processor is 8,
++     * depending on the subcores_per_core = 1, 2 or 4, the threads per
++     * subcore will vary accordingly to 8, 4 and 2 repectively.
++     * So, On host threads_per_core what is arrived at from sysfs in the
++     * current logic is actually the subcores_per_core. Threads per subcore
++     * can only be obtained from the kvm device. For example, on P8 wih 1
++     * core having 8 threads, sub_cores_percore=4, the threads 0,2,4 & 6
++     * will be online. The sysfs reflects this and in the current logic
++     * variable 'threads' will be 4 which is nothing but subcores_per_core.
++     * If the user tampers the cpu online/offline states using chcpu or other
++     * means, then it is an unsupported configuration for kvm.
++     * The code below tries to keep in mind
++     *  - when the libvirtd is run inside a KVM guest or Phyp based guest.
++     *  - Or on the kvm host where user manually tampers the cpu states to
++     *    offline/online randomly.
++     * On hosts other than POWER this will be 0, in which case a simpler
++     * thread-counting logic will be used  */
++    if ((threads_per_subcore = nodeGetThreadsPerSubcore(arch)) < 0)
++        goto cleanup;
++
++    /* If the subcore configuration is not valid, just pretend subcores
++     * are not in use and count threads one by one */
++    if (!nodeHasValidSubcoreConfiguration(sysfs_prefix, threads_per_subcore))
++        threads_per_subcore = 0;
++
+     while ((direrr = virDirRead(nodedir, &nodedirent, sysfs_nodedir)) > 0) {
+         if (sscanf(nodedirent->d_name, "node%u", &node) != 1)
+             continue;
+@@ -695,6 +785,7 @@ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+         if ((cpus = virNodeParseNode(sysfs_cpudir, arch,
+                                      present_cpus_map,
+                                      online_cpus_map,
++                                     threads_per_subcore,
+                                      &socks, &cores,
+                                      &threads, &offline)) < 0)
+             goto cleanup;
+@@ -728,6 +819,7 @@ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+     if ((cpus = virNodeParseNode(sysfs_cpudir, arch,
+                                  present_cpus_map,
+                                  online_cpus_map,
++                                 threads_per_subcore,
+                                  &socks, &cores,
+                                  &threads, &offline)) < 0)
+         goto cleanup;
+@@ -2247,3 +2339,56 @@ nodeAllocPages(unsigned int npages,
+  cleanup:
+     return ret;
+ }
++
++/* Get the number of threads per subcore.
++ *
++ * This will be 2, 4 or 8 on POWER hosts, depending on the current
++ * micro-threading configuration, and 0 everywhere else.
++ *
++ * Returns the number of threads per subcore if subcores are in use, zero
++ * if subcores are not in use, and a negative value on error */
++int
++nodeGetThreadsPerSubcore(virArch arch)
++{
++    int threads_per_subcore = 0;
++
++#if HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT)
++    const char *kvmpath = "/dev/kvm";
++    int kvmfd;
++
++    if (ARCH_IS_PPC64(arch)) {
++
++        /* It's okay if /dev/kvm doesn't exist, because
++         *   a. we might be running in a guest
++         *   b. the kvm module might not be installed or enabled
++         * In either case, falling back to the subcore-unaware thread
++         * counting logic is the right thing to do */
++        if (!virFileExists(kvmpath))
++            goto out;
++
++        if ((kvmfd = open(kvmpath, O_RDONLY)) < 0) {
++            /* This can happen when running as a regular user if
++             * permissions are tight enough, in which case erroring out
++             * is better than silently falling back and reporting
++             * different nodeinfo depending on the user */
++            virReportSystemError(errno,
++                                 _("Failed to open '%s'"),
++                                 kvmpath);
++            threads_per_subcore = -1;
++            goto out;
++        }
++
++        /* For Phyp and KVM based guests the ioctl for KVM_CAP_PPC_SMT
++         * returns zero and both primary and secondary threads will be
++         * online */
++        threads_per_subcore = ioctl(kvmfd,
++                                    KVM_CHECK_EXTENSION,
++                                    KVM_CAP_PPC_SMT);
++
++        VIR_FORCE_CLOSE(kvmfd);
++    }
++#endif /* HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) */
++
++ out:
++    return threads_per_subcore;
++}
+diff --git a/src/nodeinfo.h b/src/nodeinfo.h
+index 1810c1c..ac96dca 100644
+--- a/src/nodeinfo.h
++++ b/src/nodeinfo.h
+@@ -47,6 +47,7 @@ int nodeGetMemory(unsigned long long *mem,
+ virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix);
+ virBitmapPtr nodeGetOnlineCPUBitmap(const char *sysfs_prefix);
+ int nodeGetCPUCount(const char *sysfs_prefix);
++int nodeGetThreadsPerSubcore(virArch arch);
+ 
+ int nodeGetMemoryParameters(virTypedParameterPtr params,
+                             int *nparams,
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Formatting-changes.patch b/SOURCES/libvirt-nodeinfo-Formatting-changes.patch
new file mode 100644
index 0000000..6e94b2d
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Formatting-changes.patch
@@ -0,0 +1,94 @@
+From 276ade698758d0fe906f48b525fc803e6a072458 Mon Sep 17 00:00:00 2001
+Message-Id: <276ade698758d0fe906f48b525fc803e6a072458@dist-git>
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:18 +0200
+Subject: [PATCH] nodeinfo: Formatting changes
+
+(cherry picked from commit aa6c3fee866312ad02f675cd69b82ada7d1e0dfd)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 36 ++++++++++++++++++++----------------
+ 1 file changed, 20 insertions(+), 16 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 60dfc8b..c874fa6 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -208,7 +208,7 @@ freebsdNodeGetCPUStats(int cpuNum,
+ 
+ static int
+ freebsdNodeGetMemoryStats(virNodeMemoryStatsPtr params,
+-                               int *nparams)
++                          int *nparams)
+ {
+     size_t i, j = 0;
+     unsigned long pagesize = getpagesize() >> 10;
+@@ -552,10 +552,11 @@ virNodeParseNode(const char *sysfs_prefix,
+     return ret;
+ }
+ 
+-int linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
+-                             FILE *cpuinfo,
+-                             virArch arch,
+-                             virNodeInfoPtr nodeinfo)
++int
++linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
++                         FILE *cpuinfo,
++                         virArch arch,
++                         virNodeInfoPtr nodeinfo)
+ {
+     const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     char line[1024];
+@@ -1046,8 +1047,9 @@ virNodeGetSiblingsList(const char *dir, int cpu_id)
+ }
+ #endif
+ 
+-int nodeGetInfo(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+-                virNodeInfoPtr nodeinfo)
++int
++nodeGetInfo(const char *sysfs_prefix ATTRIBUTE_UNUSED,
++            virNodeInfoPtr nodeinfo)
+ {
+     virArch hostarch = virArchFromHost();
+ 
+@@ -1123,10 +1125,11 @@ int nodeGetInfo(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+ #endif
+ }
+ 
+-int nodeGetCPUStats(int cpuNum ATTRIBUTE_UNUSED,
+-                    virNodeCPUStatsPtr params ATTRIBUTE_UNUSED,
+-                    int *nparams ATTRIBUTE_UNUSED,
+-                    unsigned int flags)
++int
++nodeGetCPUStats(int cpuNum ATTRIBUTE_UNUSED,
++                virNodeCPUStatsPtr params ATTRIBUTE_UNUSED,
++                int *nparams ATTRIBUTE_UNUSED,
++                unsigned int flags)
+ {
+     virCheckFlags(0, -1);
+ 
+@@ -1153,11 +1156,12 @@ int nodeGetCPUStats(int cpuNum ATTRIBUTE_UNUSED,
+ #endif
+ }
+ 
+-int nodeGetMemoryStats(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+-                       int cellNum ATTRIBUTE_UNUSED,
+-                       virNodeMemoryStatsPtr params ATTRIBUTE_UNUSED,
+-                       int *nparams ATTRIBUTE_UNUSED,
+-                       unsigned int flags)
++int
++nodeGetMemoryStats(const char *sysfs_prefix ATTRIBUTE_UNUSED,
++                   int cellNum ATTRIBUTE_UNUSED,
++                   virNodeMemoryStatsPtr params ATTRIBUTE_UNUSED,
++                   int *nparams ATTRIBUTE_UNUSED,
++                   unsigned int flags)
+ {
+     virCheckFlags(0, -1);
+ 
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Introduce-linuxGetCPUGlobalPath.patch b/SOURCES/libvirt-nodeinfo-Introduce-linuxGetCPUGlobalPath.patch
new file mode 100644
index 0000000..7138124
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Introduce-linuxGetCPUGlobalPath.patch
@@ -0,0 +1,53 @@
+From a2dd895c863e4921fcc7e5b1939f8ca2526768c0 Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:22 +0200
+Subject: [PATCH] nodeinfo: Introduce linuxGetCPUGlobalPath()
+
+This is just a more generic version of linuxGetCPUPresentPath(),
+which is now implemented by calling the new function appropriately.
+
+(cherry picked from commit bd87f07c25bcdeaa48219deb7dbd94b5fcd6ca3c)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 105d7ab..b09a4fd 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -958,16 +958,24 @@ linuxNodeGetMemoryStats(FILE *meminfo,
+ }
+ 
+ static char *
+-linuxGetCPUPresentPath(const char *sysfs_prefix)
++linuxGetCPUGlobalPath(const char *sysfs_prefix,
++                      const char *file)
+ {
+     const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     char *path = NULL;
+ 
+-    if (virAsprintf(&path, "%s/cpu/present", prefix) < 0)
++    if (virAsprintf(&path, "%s/cpu/%s", prefix, file) < 0)
+         return NULL;
++
+     return path;
+ }
+ 
++static char *
++linuxGetCPUPresentPath(const char *sysfs_prefix)
++{
++    return linuxGetCPUGlobalPath(sysfs_prefix, "present");
++}
++
+ /* Determine the maximum cpu id from a Linux sysfs cpu/present file. */
+ static int
+ linuxParseCPUmax(const char *path)
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Introduce-linuxGetCPUOnlinePath.patch b/SOURCES/libvirt-nodeinfo-Introduce-linuxGetCPUOnlinePath.patch
new file mode 100644
index 0000000..a96d1a2
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Introduce-linuxGetCPUOnlinePath.patch
@@ -0,0 +1,45 @@
+From bad19eb327daa3ad90674f09587113a2ef6d3620 Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:23 +0200
+Subject: [PATCH] nodeinfo: Introduce linuxGetCPUOnlinePath()
+
+(cherry picked from commit 6fecc4017d953d2c4c73b29b0ac6209644585137)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index b09a4fd..5459cc6 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -976,6 +976,12 @@ linuxGetCPUPresentPath(const char *sysfs_prefix)
+     return linuxGetCPUGlobalPath(sysfs_prefix, "present");
+ }
+ 
++static char *
++linuxGetCPUOnlinePath(const char *sysfs_prefix)
++{
++    return linuxGetCPUGlobalPath(sysfs_prefix, "online");
++}
++
+ /* Determine the maximum cpu id from a Linux sysfs cpu/present file. */
+ static int
+ linuxParseCPUmax(const char *path)
+@@ -1316,7 +1322,7 @@ nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+     if (present < 0)
+         return NULL;
+ 
+-    if (virAsprintf(&online_path, "%s/cpu/online", prefix) < 0)
++    if (!(online_path = linuxGetCPUOnlinePath(sysfs_prefix)))
+         return NULL;
+     if (virFileExists(online_path)) {
+         cpumap = linuxParseCPUmap(present, online_path);
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Introduce-local-linuxGetCPUPresentPath.patch b/SOURCES/libvirt-nodeinfo-Introduce-local-linuxGetCPUPresentPath.patch
new file mode 100644
index 0000000..9e6057e
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Introduce-local-linuxGetCPUPresentPath.patch
@@ -0,0 +1,118 @@
+From e1215ada2684480adcac35d58728cfac4fffd537 Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: John Ferlan 
+Date: Wed, 5 Aug 2015 18:18:07 +0200
+Subject: [PATCH] nodeinfo: Introduce local linuxGetCPUPresentPath
+
+The API will print the path to the /cpu/present file using the sysfs_prefix.
+
+NB: This is setup for future patches which will allow local/test sysfs paths.
+
+(cherry picked from commit 3119e05e267d6d5e49b54c8353d9e49da4889d1d)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 43 ++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 34 insertions(+), 9 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 2fafe2d..f3e3108 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -1,7 +1,7 @@
+ /*
+  * nodeinfo.c: Helper routines for OS specific node information
+  *
+- * Copyright (C) 2006-2008, 2010-2014 Red Hat, Inc.
++ * Copyright (C) 2006-2008, 2010-2015 Red Hat, Inc.
+  * Copyright (C) 2006 Daniel P. Berrange
+  *
+  * This library is free software; you can redistribute it and/or
+@@ -944,6 +944,16 @@ linuxNodeGetMemoryStats(FILE *meminfo,
+     return ret;
+ }
+ 
++static char *
++linuxGetCPUPresentPath(const char *sysfs_prefix)
++{
++    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
++    char *path = NULL;
++
++    if (virAsprintf(&path, "%s/cpu/present", prefix) < 0)
++        return NULL;
++    return path;
++}
+ 
+ /* Determine the maximum cpu id from a Linux sysfs cpu/present file. */
+ static int
+@@ -1193,27 +1203,34 @@ nodeGetCPUCount(void)
+      * that such kernels also lack hotplug, and therefore cpu/cpuNN
+      * will be consecutive.
+      */
++    char *present_path = NULL;
+     char *cpupath = NULL;
+-    int ncpu;
++    int ncpu = -1;
+ 
+-    if (virFileExists(SYSFS_SYSTEM_PATH "/cpu/present")) {
+-        ncpu = linuxParseCPUmax(SYSFS_SYSTEM_PATH "/cpu/present");
++    if (!(present_path = linuxGetCPUPresentPath(NULL)))
++        return -1;
++
++    if (virFileExists(present_path)) {
++        ncpu = linuxParseCPUmax(present_path);
+     } else if (virFileExists(SYSFS_SYSTEM_PATH "/cpu/cpu0")) {
+         ncpu = 0;
+         do {
+             ncpu++;
+             VIR_FREE(cpupath);
+             if (virAsprintf(&cpupath, "%s/cpu/cpu%d",
+-                            SYSFS_SYSTEM_PATH, ncpu) < 0)
+-                return -1;
++                            SYSFS_SYSTEM_PATH, ncpu) < 0) {
++                ncpu = -1;
++                goto cleanup;
++            }
+         } while (virFileExists(cpupath));
+     } else {
+         /* no cpu/cpu0: we give up */
+         virReportError(VIR_ERR_NO_SUPPORT, "%s",
+                        _("host cpu counting not supported on this node"));
+-        return -1;
+     }
+ 
++ cleanup:
++    VIR_FREE(present_path);
+     VIR_FREE(cpupath);
+     return ncpu;
+ #elif defined(__FreeBSD__) || defined(__APPLE__)
+@@ -1229,13 +1246,21 @@ virBitmapPtr
+ nodeGetPresentCPUBitmap(void)
+ {
+     int max_present;
++#ifdef __linux__
++    char *present_path = NULL;
++    virBitmapPtr bitmap = NULL;
++#endif
+ 
+     if ((max_present = nodeGetCPUCount()) < 0)
+         return NULL;
+ 
+ #ifdef __linux__
+-    if (virFileExists(SYSFS_SYSTEM_PATH "/cpu/present"))
+-        return linuxParseCPUmap(max_present, SYSFS_SYSTEM_PATH "/cpu/present");
++    if (!(present_path = linuxGetCPUPresentPath(NULL)))
++        return NULL;
++    if (virFileExists(present_path))
++        bitmap = linuxParseCPUmap(max_present, present_path);
++    VIR_FREE(present_path);
++    return bitmap;
+ #endif
+     virReportError(VIR_ERR_NO_SUPPORT, "%s",
+                    _("non-continuous host cpu numbers not implemented on this platform"));
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Make-sysfs_prefix-usage-more-consistent.patch b/SOURCES/libvirt-nodeinfo-Make-sysfs_prefix-usage-more-consistent.patch
new file mode 100644
index 0000000..4c561b3
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Make-sysfs_prefix-usage-more-consistent.patch
@@ -0,0 +1,266 @@
+From 7186535d4cb2661b6cc841440b46a154e6598d8e Mon Sep 17 00:00:00 2001
+Message-Id: <7186535d4cb2661b6cc841440b46a154e6598d8e@dist-git>
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:17 +0200
+Subject: [PATCH] nodeinfo: Make sysfs_prefix usage more consistent
+
+Make sure sysfs_prefix, when present, is always the first argument
+to a function; don't use a different name to refer to it; check
+whether it is NULL, and hence SYSFS_SYSTEM_PATH should be used, only
+when using it directly and not just passing it down to another
+function; always pass down the same value we've been passed when
+calling another function.
+
+(cherry picked from commit 75f6f5454602d54bdb3218db2ec4931df133b8d0)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c       | 41 +++++++++++++++++++----------------------
+ src/nodeinfopriv.h   |  4 ++--
+ tests/nodeinfotest.c | 14 +++++++-------
+ 3 files changed, 28 insertions(+), 31 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 5158680..60dfc8b 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -415,7 +415,6 @@ virNodeParseNode(const char *sysfs_prefix,
+                  int *threads,
+                  int *offline)
+ {
+-    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     int ret = -1;
+     int processors = 0;
+     DIR *cpudir = NULL;
+@@ -441,7 +440,7 @@ virNodeParseNode(const char *sysfs_prefix,
+         goto cleanup;
+     }
+ 
+-    present_cpumap = nodeGetPresentCPUBitmap(prefix);
++    present_cpumap = nodeGetPresentCPUBitmap(sysfs_prefix);
+ 
+     /* enumerate sockets in the node */
+     CPU_ZERO(&sock_map);
+@@ -553,11 +552,12 @@ virNodeParseNode(const char *sysfs_prefix,
+     return ret;
+ }
+ 
+-int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
+-                             const char *sysfs_dir,
++int linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
++                             FILE *cpuinfo,
+                              virArch arch,
+                              virNodeInfoPtr nodeinfo)
+ {
++    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     char line[1024];
+     DIR *nodedir = NULL;
+     struct dirent *nodedirent = NULL;
+@@ -652,7 +652,7 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
+     /* OK, we've parsed clock speed out of /proc/cpuinfo. Get the
+      * core, node, socket, thread and topology information from /sys
+      */
+-    if (virAsprintf(&sysfs_nodedir, "%s/node", sysfs_dir) < 0)
++    if (virAsprintf(&sysfs_nodedir, "%s/node", prefix) < 0)
+         goto cleanup;
+ 
+     if (!(nodedir = opendir(sysfs_nodedir))) {
+@@ -667,10 +667,10 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
+         nodeinfo->nodes++;
+ 
+         if (virAsprintf(&sysfs_cpudir, "%s/node/%s",
+-                        sysfs_dir, nodedirent->d_name) < 0)
++                        prefix, nodedirent->d_name) < 0)
+             goto cleanup;
+ 
+-        if ((cpus = virNodeParseNode(sysfs_dir, sysfs_cpudir, arch,
++        if ((cpus = virNodeParseNode(sysfs_prefix, sysfs_cpudir, arch,
+                                      &socks, &cores,
+                                      &threads, &offline)) < 0)
+             goto cleanup;
+@@ -698,10 +698,10 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
+  fallback:
+     VIR_FREE(sysfs_cpudir);
+ 
+-    if (virAsprintf(&sysfs_cpudir, "%s/cpu", sysfs_dir) < 0)
++    if (virAsprintf(&sysfs_cpudir, "%s/cpu", prefix) < 0)
+         goto cleanup;
+ 
+-    if ((cpus = virNodeParseNode(sysfs_dir, sysfs_cpudir, arch,
++    if ((cpus = virNodeParseNode(sysfs_prefix, sysfs_cpudir, arch,
+                                  &socks, &cores,
+                                  &threads, &offline)) < 0)
+         goto cleanup;
+@@ -1059,7 +1059,6 @@ int nodeGetInfo(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+ #ifdef __linux__
+     {
+     int ret = -1;
+-    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     FILE *cpuinfo = fopen(CPUINFO_PATH, "r");
+ 
+     if (!cpuinfo) {
+@@ -1068,7 +1067,7 @@ int nodeGetInfo(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+         return -1;
+     }
+ 
+-    ret = linuxNodeInfoCPUPopulate(cpuinfo, prefix,
++    ret = linuxNodeInfoCPUPopulate(sysfs_prefix, cpuinfo,
+                                    hostarch, nodeinfo);
+     if (ret < 0)
+         goto cleanup;
+@@ -1225,7 +1224,7 @@ nodeGetCPUCount(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+     char *cpupath = NULL;
+     int ncpu = -1;
+ 
+-    if (!(present_path = linuxGetCPUPresentPath(prefix)))
++    if (!(present_path = linuxGetCPUPresentPath(sysfs_prefix)))
+         return -1;
+ 
+     if (virFileExists(present_path)) {
+@@ -1273,13 +1272,12 @@ nodeGetPresentCPUBitmap(const char *sysfs_prefix)
+     char *present_path = NULL;
+     virBitmapPtr bitmap = NULL;
+ #endif
+-    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+ 
+-    if ((max_present = nodeGetCPUCount(prefix)) < 0)
++    if ((max_present = nodeGetCPUCount(sysfs_prefix)) < 0)
+         return NULL;
+ 
+ #ifdef __linux__
+-    if (!(present_path = linuxGetCPUPresentPath(prefix)))
++    if (!(present_path = linuxGetCPUPresentPath(sysfs_prefix)))
+         return NULL;
+     if (virFileExists(present_path))
+         bitmap = linuxParseCPUmap(max_present, present_path);
+@@ -1301,7 +1299,7 @@ nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+     virBitmapPtr cpumap;
+     int present;
+ 
+-    present = nodeGetCPUCount(prefix);
++    present = nodeGetCPUCount(sysfs_prefix);
+     if (present < 0)
+         return NULL;
+ 
+@@ -1646,7 +1644,6 @@ nodeGetCPUMap(const char *sysfs_prefix,
+               unsigned int *online,
+               unsigned int flags)
+ {
+-    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     virBitmapPtr cpus = NULL;
+     int maxpresent;
+     int ret = -1;
+@@ -1655,9 +1652,9 @@ nodeGetCPUMap(const char *sysfs_prefix,
+     virCheckFlags(0, -1);
+ 
+     if (!cpumap && !online)
+-        return nodeGetCPUCount(prefix);
++        return nodeGetCPUCount(sysfs_prefix);
+ 
+-    if (!(cpus = nodeGetCPUBitmap(prefix, &maxpresent)))
++    if (!(cpus = nodeGetCPUBitmap(sysfs_prefix, &maxpresent)))
+         goto cleanup;
+ 
+     if (cpumap && virBitmapToData(cpus, cpumap, &dummy) < 0)
+@@ -1674,7 +1671,7 @@ nodeGetCPUMap(const char *sysfs_prefix,
+ }
+ 
+ static int
+-nodeCapsInitNUMAFake(const char *prefix,
++nodeCapsInitNUMAFake(const char *sysfs_prefix,
+                      const char *cpupath ATTRIBUTE_UNUSED,
+                      virCapsPtr caps ATTRIBUTE_UNUSED)
+ {
+@@ -1685,7 +1682,7 @@ nodeCapsInitNUMAFake(const char *prefix,
+     int id, cid;
+     int onlinecpus ATTRIBUTE_UNUSED;
+ 
+-    if (nodeGetInfo(prefix, &nodeinfo) < 0)
++    if (nodeGetInfo(sysfs_prefix, &nodeinfo) < 0)
+         return -1;
+ 
+     ncpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
+@@ -1957,7 +1954,7 @@ nodeCapsInitNUMA(const char *sysfs_prefix,
+         return -1;
+ 
+     if (!virNumaIsAvailable()) {
+-        ret = nodeCapsInitNUMAFake(prefix, cpupath, caps);
++        ret = nodeCapsInitNUMAFake(sysfs_prefix, cpupath, caps);
+         goto cleanup;
+     }
+ 
+diff --git a/src/nodeinfopriv.h b/src/nodeinfopriv.h
+index 8bfbe1e..1aab4ad 100644
+--- a/src/nodeinfopriv.h
++++ b/src/nodeinfopriv.h
+@@ -25,8 +25,8 @@
+ # include "nodeinfo.h"
+ 
+ # ifdef __linux__
+-int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
+-                             const char *sysfs_dir,
++int linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
++                             FILE *cpuinfo,
+                              virArch arch,
+                              virNodeInfoPtr nodeinfo);
+ 
+diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c
+index be099f0..60467bc 100644
+--- a/tests/nodeinfotest.c
++++ b/tests/nodeinfotest.c
+@@ -24,8 +24,8 @@ main(void)
+ #else
+ 
+ static int
+-linuxTestCompareFiles(const char *cpuinfofile,
+-                      char *sysfs_dir,
++linuxTestCompareFiles(char *sysfs_prefix,
++                      const char *cpuinfofile,
+                       virArch arch,
+                       const char *outputfile)
+ {
+@@ -42,7 +42,7 @@ linuxTestCompareFiles(const char *cpuinfofile,
+     }
+ 
+     memset(&nodeinfo, 0, sizeof(nodeinfo));
+-    if (linuxNodeInfoCPUPopulate(cpuinfo, sysfs_dir, arch, &nodeinfo) < 0) {
++    if (linuxNodeInfoCPUPopulate(sysfs_prefix, cpuinfo, arch, &nodeinfo) < 0) {
+         if (virTestGetDebug()) {
+             virErrorPtr error = virSaveLastError();
+             if (error && error->code != VIR_ERR_OK)
+@@ -163,12 +163,12 @@ linuxTestNodeInfo(const void *opaque)
+ {
+     int result = -1;
+     char *cpuinfo = NULL;
+-    char *sysfs_dir = NULL;
++    char *sysfs_prefix = NULL;
+     char *output = NULL;
+     struct linuxTestNodeInfoData *data = (struct linuxTestNodeInfoData *) opaque;
+     const char *archStr = virArchToString(data->arch);
+ 
+-    if (virAsprintf(&sysfs_dir, "%s/nodeinfodata/linux-%s",
++    if (virAsprintf(&sysfs_prefix, "%s/nodeinfodata/linux-%s",
+                     abs_srcdir, data->testName) < 0 ||
+         virAsprintf(&cpuinfo, "%s/nodeinfodata/linux-%s-%s.cpuinfo",
+                     abs_srcdir, archStr, data->testName) < 0 ||
+@@ -177,12 +177,12 @@ linuxTestNodeInfo(const void *opaque)
+         goto cleanup;
+     }
+ 
+-    result = linuxTestCompareFiles(cpuinfo, sysfs_dir, data->arch, output);
++    result = linuxTestCompareFiles(sysfs_prefix, cpuinfo, data->arch, output);
+ 
+  cleanup:
+     VIR_FREE(cpuinfo);
+     VIR_FREE(output);
+-    VIR_FREE(sysfs_dir);
++    VIR_FREE(sysfs_prefix);
+ 
+     return result;
+ }
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Phase-out-cpu_set_t-usage.patch b/SOURCES/libvirt-nodeinfo-Phase-out-cpu_set_t-usage.patch
new file mode 100644
index 0000000..9f2b75c
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Phase-out-cpu_set_t-usage.patch
@@ -0,0 +1,186 @@
+From 1a4abb61662ff2090ffb1c1f44cc626101742764 Mon Sep 17 00:00:00 2001
+Message-Id: <1a4abb61662ff2090ffb1c1f44cc626101742764@dist-git>
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:28 +0200
+Subject: [PATCH] nodeinfo: Phase out cpu_set_t usage
+
+Swap out all instances of cpu_set_t and replace them with virBitmap,
+which some of the code was already using anyway.
+
+The changes are pretty mechanical, with one notable exception: an
+assumption has been added on the max value we can run into while
+reading either socket_it or core_id.
+
+While this specific assumption was not in place before, we were
+using cpu_set_t improperly by not making sure not to set any bit
+past CPU_SETSIZE or explicitly allocating bigger bitmaps; in fact
+the default size of a cpu_set_t, 1024, is way too low to run our
+testsuite, which includes core_id values in the 2000s.
+
+(cherry picked from commit b7b506475ca176276bfaa5dbcdba5b16744b6d56)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 65 ++++++++++++++++++++++++++++++++++------------------------
+ 1 file changed, 38 insertions(+), 27 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 3550e24..7d0e6b0 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -30,7 +30,6 @@
+ #include 
+ #include 
+ #include 
+-#include 
+ #include "conf/domain_conf.h"
+ 
+ #if defined(__FreeBSD__) || defined(__APPLE__)
+@@ -388,19 +387,6 @@ virNodeParseSocket(const char *dir,
+     return ret;
+ }
+ 
+-# ifndef CPU_COUNT
+-static int
+-CPU_COUNT(cpu_set_t *set)
+-{
+-    size_t i, count = 0;
+-
+-    for (i = 0; i < CPU_SETSIZE; i++)
+-        if (CPU_ISSET(i, set))
+-            count++;
+-    return count;
+-}
+-# endif /* !CPU_COUNT */
+-
+ /* parses a node entry, returning number of processors in the node and
+  * filling arguments */
+ static int
+@@ -415,15 +401,18 @@ virNodeParseNode(const char *sysfs_prefix,
+                  int *threads,
+                  int *offline)
+ {
++    /* Biggest value we can expect to be used as either socket id
++     * or core id. Bitmaps will need to be sized accordingly */
++    const int ID_MAX = 4095;
+     int ret = -1;
+     int processors = 0;
+     DIR *cpudir = NULL;
+     struct dirent *cpudirent = NULL;
+     virBitmapPtr present_cpumap = NULL;
++    virBitmapPtr sockets_map = NULL;
++    virBitmapPtr *cores_maps = NULL;
+     int sock_max = 0;
+-    cpu_set_t sock_map;
+     int sock;
+-    cpu_set_t *core_maps = NULL;
+     int core;
+     size_t i;
+     int siblings;
+@@ -445,7 +434,9 @@ virNodeParseNode(const char *sysfs_prefix,
+         goto cleanup;
+ 
+     /* enumerate sockets in the node */
+-    CPU_ZERO(&sock_map);
++    if (!(sockets_map = virBitmapNew(ID_MAX + 1)))
++        goto cleanup;
++
+     while ((direrr = virDirRead(cpudir, &cpudirent, node)) > 0) {
+         if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
+             continue;
+@@ -462,7 +453,15 @@ virNodeParseNode(const char *sysfs_prefix,
+         /* Parse socket */
+         if ((sock = virNodeParseSocket(node, arch, cpu)) < 0)
+             goto cleanup;
+-        CPU_SET(sock, &sock_map);
++        if (sock > ID_MAX) {
++            virReportError(VIR_ERR_INTERNAL_ERROR,
++                           _("Socket %d can't be handled (max socket is %d)"),
++                           sock, ID_MAX);
++            goto cleanup;
++        }
++
++        if (virBitmapSetBit(sockets_map, sock) < 0)
++            goto cleanup;
+ 
+         if (sock > sock_max)
+             sock_max = sock;
+@@ -473,12 +472,13 @@ virNodeParseNode(const char *sysfs_prefix,
+ 
+     sock_max++;
+ 
+-    /* allocate cpu maps for each socket */
+-    if (VIR_ALLOC_N(core_maps, sock_max) < 0)
++    /* allocate cores maps for each socket */
++    if (VIR_ALLOC_N(cores_maps, sock_max) < 0)
+         goto cleanup;
+ 
+     for (i = 0; i < sock_max; i++)
+-        CPU_ZERO(&core_maps[i]);
++        if (!(cores_maps[i] = virBitmapNew(ID_MAX + 1)))
++            goto cleanup;
+ 
+     /* iterate over all CPU's in the node */
+     rewinddir(cpudir);
+@@ -502,7 +502,7 @@ virNodeParseNode(const char *sysfs_prefix,
+         /* Parse socket */
+         if ((sock = virNodeParseSocket(node, arch, cpu)) < 0)
+             goto cleanup;
+-        if (!CPU_ISSET(sock, &sock_map)) {
++        if (!virBitmapIsBitSet(sockets_map, sock)) {
+             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("CPU socket topology has changed"));
+             goto cleanup;
+@@ -515,8 +515,15 @@ virNodeParseNode(const char *sysfs_prefix,
+         } else {
+             core = virNodeGetCpuValue(node, cpu, "topology/core_id", 0);
+         }
++        if (core > ID_MAX) {
++            virReportError(VIR_ERR_INTERNAL_ERROR,
++                           _("Core %d can't be handled (max core is %d)"),
++                           core, ID_MAX);
++            goto cleanup;
++        }
+ 
+-        CPU_SET(core, &core_maps[sock]);
++        if (virBitmapSetBit(cores_maps[sock], core) < 0)
++            goto cleanup;
+ 
+         if (!(siblings = virNodeCountThreadSiblings(node, cpu)))
+             goto cleanup;
+@@ -529,13 +536,13 @@ virNodeParseNode(const char *sysfs_prefix,
+         goto cleanup;
+ 
+     /* finalize the returned data */
+-    *sockets = CPU_COUNT(&sock_map);
++    *sockets = virBitmapCountBits(sockets_map);
+ 
+     for (i = 0; i < sock_max; i++) {
+-        if (!CPU_ISSET(i, &sock_map))
++        if (!virBitmapIsBitSet(sockets_map, i))
+             continue;
+ 
+-        core = CPU_COUNT(&core_maps[i]);
++        core = virBitmapCountBits(cores_maps[i]);
+         if (core > *cores)
+             *cores = core;
+     }
+@@ -548,7 +555,11 @@ virNodeParseNode(const char *sysfs_prefix,
+         virReportSystemError(errno, _("problem closing %s"), node);
+         ret = -1;
+     }
+-    VIR_FREE(core_maps);
++    if (cores_maps)
++        for (i = 0; i < sock_max; i++)
++            virBitmapFree(cores_maps[i]);
++    VIR_FREE(cores_maps);
++    virBitmapFree(sockets_map);
+     virBitmapFree(present_cpumap);
+ 
+     return ret;
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Prefer-MIN-in-nodeGetFreePages.patch b/SOURCES/libvirt-nodeinfo-Prefer-MIN-in-nodeGetFreePages.patch
deleted file mode 100644
index d4d6d62..0000000
--- a/SOURCES/libvirt-nodeinfo-Prefer-MIN-in-nodeGetFreePages.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From a9f728e94fbed7434c8286fc60dfcd1f980e3c6e Mon Sep 17 00:00:00 2001
-Message-Id: 
-From: Michal Privoznik 
-Date: Tue, 23 Sep 2014 11:54:35 +0200
-Subject: [PATCH] nodeinfo: Prefer MIN in nodeGetFreePages
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1145050
-
-It's better to use a macro instead of if-else construct.
-
-Signed-off-by: Michal Privoznik 
-(cherry picked from commit f8857c8f88ece3bb0790436e42751c2a09ae4453)
-Signed-off-by: Jiri Denemark 
----
- src/nodeinfo.c | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
-
-diff --git a/src/nodeinfo.c b/src/nodeinfo.c
-index 134fee7..80c723e 100644
---- a/src/nodeinfo.c
-+++ b/src/nodeinfo.c
-@@ -2045,9 +2045,7 @@ nodeGetFreePages(unsigned int npages,
-         goto cleanup;
-     }
- 
--    lastCell = startCell + cellCount;
--    if (startCell + cellCount < lastCell)
--        lastCell = startCell + cellCount;
-+    lastCell = MIN(lastCell, startCell + cellCount);
- 
-     for (cell = startCell; cell < lastCell; cell++) {
-         for (i = 0; i < npages; i++) {
--- 
-2.1.1
-
diff --git a/SOURCES/libvirt-nodeinfo-Remove-out-parameter-from-nodeGetCPUBitmap.patch b/SOURCES/libvirt-nodeinfo-Remove-out-parameter-from-nodeGetCPUBitmap.patch
new file mode 100644
index 0000000..8289aaa
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Remove-out-parameter-from-nodeGetCPUBitmap.patch
@@ -0,0 +1,87 @@
+From fa55eec14a4739ff3ab0a9e2c97319abb47168e6 Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:26 +0200
+Subject: [PATCH] nodeinfo: Remove out parameter from nodeGetCPUBitmap()
+
+Not all users of this API will need the size of the returned
+bitmap; those who do can simply call virBitmapSize() themselves.
+
+(cherry picked from commit ccd0ea7ef58130c46599453925e8f6716d310d5c)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 12 +++++-------
+ src/nodeinfo.h |  2 +-
+ 2 files changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index ceb517a..69c15fc 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -1324,8 +1324,7 @@ nodeGetPresentCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+ }
+ 
+ virBitmapPtr
+-nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+-                 int *max_id ATTRIBUTE_UNUSED)
++nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+ {
+ #ifdef __linux__
+     const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+@@ -1363,8 +1362,7 @@ nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED,
+                 ignore_value(virBitmapSetBit(cpumap, i));
+         }
+     }
+-    if (max_id && cpumap)
+-        *max_id = present;
++
+  cleanup:
+     VIR_FREE(online_path);
+     VIR_FREE(cpudir);
+@@ -1685,7 +1683,6 @@ nodeGetCPUMap(const char *sysfs_prefix,
+               unsigned int flags)
+ {
+     virBitmapPtr cpus = NULL;
+-    int maxpresent;
+     int ret = -1;
+     int dummy;
+ 
+@@ -1694,7 +1691,7 @@ nodeGetCPUMap(const char *sysfs_prefix,
+     if (!cpumap && !online)
+         return nodeGetCPUCount(sysfs_prefix);
+ 
+-    if (!(cpus = nodeGetCPUBitmap(sysfs_prefix, &maxpresent)))
++    if (!(cpus = nodeGetCPUBitmap(sysfs_prefix)))
+         goto cleanup;
+ 
+     if (cpumap && virBitmapToData(cpus, cpumap, &dummy) < 0)
+@@ -1702,7 +1699,8 @@ nodeGetCPUMap(const char *sysfs_prefix,
+     if (online)
+         *online = virBitmapCountBits(cpus);
+ 
+-    ret = maxpresent;
++    ret = virBitmapSize(cpus);
++
+  cleanup:
+     if (ret < 0 && cpumap)
+         VIR_FREE(*cpumap);
+diff --git a/src/nodeinfo.h b/src/nodeinfo.h
+index 4f983c2..02af9c5 100644
+--- a/src/nodeinfo.h
++++ b/src/nodeinfo.h
+@@ -45,7 +45,7 @@ int nodeGetMemory(unsigned long long *mem,
+                   unsigned long long *freeMem);
+ 
+ virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix);
+-virBitmapPtr nodeGetCPUBitmap(const char *sysfs_prefix, int *max_id);
++virBitmapPtr nodeGetCPUBitmap(const char *sysfs_prefix);
+ int nodeGetCPUCount(const char *sysfs_prefix);
+ 
+ int nodeGetMemoryParameters(virTypedParameterPtr params,
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Rename-linuxParseCPUmax-to-linuxParseCPUCount.patch b/SOURCES/libvirt-nodeinfo-Rename-linuxParseCPUmax-to-linuxParseCPUCount.patch
new file mode 100644
index 0000000..5bd17fe
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Rename-linuxParseCPUmax-to-linuxParseCPUCount.patch
@@ -0,0 +1,51 @@
+From 3897d418e69e7604302040a8015bf6f50d40ae45 Mon Sep 17 00:00:00 2001
+Message-Id: <3897d418e69e7604302040a8015bf6f50d40ae45@dist-git>
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:24 +0200
+Subject: [PATCH] nodeinfo: Rename linuxParseCPUmax() to linuxParseCPUCount()
+
+The original name was confusing because the function returns the number
+of CPUs, not the maximum CPU id. The comment above the function has
+been updated to reflect this.
+
+No behavioral changes.
+
+(cherry picked from commit a2e2add1f1e253b5ba150446980aa32a161dc107)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 5459cc6..a7a5d98 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -982,9 +982,10 @@ linuxGetCPUOnlinePath(const char *sysfs_prefix)
+     return linuxGetCPUGlobalPath(sysfs_prefix, "online");
+ }
+ 
+-/* Determine the maximum cpu id from a Linux sysfs cpu/present file. */
++/* Determine the number of CPUs (maximum CPU id + 1) from a file containing
++ * a list of CPU ids, like the Linux sysfs cpu/present file */
+ static int
+-linuxParseCPUmax(const char *path)
++linuxParseCPUCount(const char *path)
+ {
+     char *str = NULL;
+     char *tmp;
+@@ -1246,7 +1247,7 @@ nodeGetCPUCount(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+         return -1;
+ 
+     if (virFileExists(present_path)) {
+-        ncpu = linuxParseCPUmax(present_path);
++        ncpu = linuxParseCPUCount(present_path);
+         goto cleanup;
+     }
+ 
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Rename-nodeGetCPUBitmap-to-nodeGetOnlineCPUBitmap.patch b/SOURCES/libvirt-nodeinfo-Rename-nodeGetCPUBitmap-to-nodeGetOnlineCPUBitmap.patch
new file mode 100644
index 0000000..fa26c15
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Rename-nodeGetCPUBitmap-to-nodeGetOnlineCPUBitmap.patch
@@ -0,0 +1,92 @@
+From cd6ca9ba097bb551c02dbfd85d5010d3bceee9b9 Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:27 +0200
+Subject: [PATCH] nodeinfo: Rename nodeGetCPUBitmap() to
+ nodeGetOnlineCPUBitmap()
+
+The new name makes it clear that the returned bitmap contains the
+information about which CPUs are online, not eg. which CPUs are
+present.
+
+No behavioral change.
+
+(cherry picked from commit c1df42d734fbd40b7220dad4a9c15f2584828a80)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/libvirt_private.syms | 2 +-
+ src/nodeinfo.c           | 6 +++---
+ src/nodeinfo.h           | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index e92d2d0..1363c92 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -998,7 +998,6 @@ virLockManagerRelease;
+ nodeAllocPages;
+ nodeCapsInitNUMA;
+ nodeGetCellsFreeMemory;
+-nodeGetCPUBitmap;
+ nodeGetCPUCount;
+ nodeGetCPUMap;
+ nodeGetCPUStats;
+@@ -1007,6 +1006,7 @@ nodeGetInfo;
+ nodeGetMemory;
+ nodeGetMemoryParameters;
+ nodeGetMemoryStats;
++nodeGetOnlineCPUBitmap;
+ nodeGetPresentCPUBitmap;
+ nodeSetMemoryParameters;
+ 
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 69c15fc..3550e24 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -1324,7 +1324,7 @@ nodeGetPresentCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+ }
+ 
+ virBitmapPtr
+-nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
++nodeGetOnlineCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+ {
+ #ifdef __linux__
+     const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+@@ -1369,7 +1369,7 @@ nodeGetCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+     return cpumap;
+ #else
+     virReportError(VIR_ERR_NO_SUPPORT, "%s",
+-                   _("node cpumap not implemented on this platform"));
++                   _("node online CPU map not implemented on this platform"));
+     return NULL;
+ #endif
+ }
+@@ -1691,7 +1691,7 @@ nodeGetCPUMap(const char *sysfs_prefix,
+     if (!cpumap && !online)
+         return nodeGetCPUCount(sysfs_prefix);
+ 
+-    if (!(cpus = nodeGetCPUBitmap(sysfs_prefix)))
++    if (!(cpus = nodeGetOnlineCPUBitmap(sysfs_prefix)))
+         goto cleanup;
+ 
+     if (cpumap && virBitmapToData(cpus, cpumap, &dummy) < 0)
+diff --git a/src/nodeinfo.h b/src/nodeinfo.h
+index 02af9c5..1810c1c 100644
+--- a/src/nodeinfo.h
++++ b/src/nodeinfo.h
+@@ -45,7 +45,7 @@ int nodeGetMemory(unsigned long long *mem,
+                   unsigned long long *freeMem);
+ 
+ virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix);
+-virBitmapPtr nodeGetCPUBitmap(const char *sysfs_prefix);
++virBitmapPtr nodeGetOnlineCPUBitmap(const char *sysfs_prefix);
+ int nodeGetCPUCount(const char *sysfs_prefix);
+ 
+ int nodeGetMemoryParameters(virTypedParameterPtr params,
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Use-a-bitmap-to-keep-track-of-node-CPUs.patch b/SOURCES/libvirt-nodeinfo-Use-a-bitmap-to-keep-track-of-node-CPUs.patch
new file mode 100644
index 0000000..6414464
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Use-a-bitmap-to-keep-track-of-node-CPUs.patch
@@ -0,0 +1,102 @@
+From 40939c6b2ef877a46fa0b3ec177673e6b0831414 Mon Sep 17 00:00:00 2001
+Message-Id: <40939c6b2ef877a46fa0b3ec177673e6b0831414@dist-git>
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:30 +0200
+Subject: [PATCH] nodeinfo: Use a bitmap to keep track of node CPUs
+
+Keep track of what CPUs belong to the current node while walking
+through the sysfs node entry, so we don't need to do it a second
+time immediately afterwards.
+
+This also allows us to loop through all CPUs that are part of a
+node in guaranteed ascending order, which is something that is
+required for some upcoming changes.
+
+(cherry picked from commit 05be6062822f3f694b9e2ba1982d60cad5c09f33)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 26 +++++++++++++++++---------
+ 1 file changed, 17 insertions(+), 9 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 2d910c9..2328a86 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -410,8 +410,10 @@ virNodeParseNode(const char *sysfs_prefix,
+     struct dirent *cpudirent = NULL;
+     virBitmapPtr present_cpumap = NULL;
+     virBitmapPtr online_cpus_map = NULL;
++    virBitmapPtr node_cpus_map = NULL;
+     virBitmapPtr sockets_map = NULL;
+     virBitmapPtr *cores_maps = NULL;
++    int npresent_cpus;
+     int sock_max = 0;
+     int sock;
+     int core;
+@@ -436,6 +438,12 @@ virNodeParseNode(const char *sysfs_prefix,
+     if (!online_cpus_map)
+         goto cleanup;
+ 
++    npresent_cpus = virBitmapSize(present_cpumap);
++
++    /* Keep track of the CPUs that belong to the current node */
++    if (!(node_cpus_map = virBitmapNew(npresent_cpus)))
++        goto cleanup;
++
+     /* enumerate sockets in the node */
+     if (!(sockets_map = virBitmapNew(ID_MAX + 1)))
+         goto cleanup;
+@@ -447,6 +455,10 @@ virNodeParseNode(const char *sysfs_prefix,
+         if (!virBitmapIsBitSet(present_cpumap, cpu))
+             continue;
+ 
++        /* Mark this CPU as part of the current node */
++        if (virBitmapSetBit(node_cpus_map, cpu) < 0)
++            goto cleanup;
++
+         if (!virBitmapIsBitSet(online_cpus_map, cpu))
+             continue;
+ 
+@@ -480,13 +492,11 @@ virNodeParseNode(const char *sysfs_prefix,
+         if (!(cores_maps[i] = virBitmapNew(ID_MAX + 1)))
+             goto cleanup;
+ 
+-    /* iterate over all CPU's in the node */
+-    rewinddir(cpudir);
+-    while ((direrr = virDirRead(cpudir, &cpudirent, node)) > 0) {
+-        if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
+-            continue;
++    /* Iterate over all CPUs in the node, in ascending order */
++    for (cpu = 0; cpu < npresent_cpus; cpu++) {
+ 
+-        if (!virBitmapIsBitSet(present_cpumap, cpu))
++        /* Skip CPUs that are not part of the current node */
++        if (!virBitmapIsBitSet(node_cpus_map, cpu))
+             continue;
+ 
+         if (!virBitmapIsBitSet(online_cpus_map, cpu)) {
+@@ -529,9 +539,6 @@ virNodeParseNode(const char *sysfs_prefix,
+             *threads = siblings;
+     }
+ 
+-    if (direrr < 0)
+-        goto cleanup;
+-
+     /* finalize the returned data */
+     *sockets = virBitmapCountBits(sockets_map);
+ 
+@@ -557,6 +564,7 @@ virNodeParseNode(const char *sysfs_prefix,
+             virBitmapFree(cores_maps[i]);
+     VIR_FREE(cores_maps);
+     virBitmapFree(sockets_map);
++    virBitmapFree(node_cpus_map);
+     virBitmapFree(online_cpus_map);
+     virBitmapFree(present_cpumap);
+ 
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-Use-nodeGetOnlineCPUBitmap-when-parsing-node.patch b/SOURCES/libvirt-nodeinfo-Use-nodeGetOnlineCPUBitmap-when-parsing-node.patch
new file mode 100644
index 0000000..a00ffb4
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-Use-nodeGetOnlineCPUBitmap-when-parsing-node.patch
@@ -0,0 +1,84 @@
+From 7d9e53dfd33baa9a934548aeba04abcf6775d7ca Mon Sep 17 00:00:00 2001
+Message-Id: <7d9e53dfd33baa9a934548aeba04abcf6775d7ca@dist-git>
+From: Andrea Bolognani 
+Date: Wed, 5 Aug 2015 18:18:29 +0200
+Subject: [PATCH] nodeinfo: Use nodeGetOnlineCPUBitmap() when parsing node
+
+No need to look up the online status of each CPU separately when we
+can get all the information in one go.
+
+(cherry picked from commit b909e9fb2c095b7c83eab99e1f812bd1ffe6e480)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 16 +++++++---------
+ 1 file changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index 7d0e6b0..2d910c9 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -409,6 +409,7 @@ virNodeParseNode(const char *sysfs_prefix,
+     DIR *cpudir = NULL;
+     struct dirent *cpudirent = NULL;
+     virBitmapPtr present_cpumap = NULL;
++    virBitmapPtr online_cpus_map = NULL;
+     virBitmapPtr sockets_map = NULL;
+     virBitmapPtr *cores_maps = NULL;
+     int sock_max = 0;
+@@ -417,7 +418,6 @@ virNodeParseNode(const char *sysfs_prefix,
+     size_t i;
+     int siblings;
+     unsigned int cpu;
+-    int online;
+     int direrr;
+ 
+     *threads = 0;
+@@ -432,6 +432,9 @@ virNodeParseNode(const char *sysfs_prefix,
+     present_cpumap = nodeGetPresentCPUBitmap(sysfs_prefix);
+     if (!present_cpumap)
+         goto cleanup;
++    online_cpus_map = nodeGetOnlineCPUBitmap(sysfs_prefix);
++    if (!online_cpus_map)
++        goto cleanup;
+ 
+     /* enumerate sockets in the node */
+     if (!(sockets_map = virBitmapNew(ID_MAX + 1)))
+@@ -444,10 +447,7 @@ virNodeParseNode(const char *sysfs_prefix,
+         if (!virBitmapIsBitSet(present_cpumap, cpu))
+             continue;
+ 
+-        if ((online = virNodeGetCpuValue(node, cpu, "online", 1)) < 0)
+-            goto cleanup;
+-
+-        if (!online)
++        if (!virBitmapIsBitSet(online_cpus_map, cpu))
+             continue;
+ 
+         /* Parse socket */
+@@ -489,10 +489,7 @@ virNodeParseNode(const char *sysfs_prefix,
+         if (!virBitmapIsBitSet(present_cpumap, cpu))
+             continue;
+ 
+-        if ((online = virNodeGetCpuValue(node, cpu, "online", 1)) < 0)
+-            goto cleanup;
+-
+-        if (!online) {
++        if (!virBitmapIsBitSet(online_cpus_map, cpu)) {
+             (*offline)++;
+             continue;
+         }
+@@ -560,6 +557,7 @@ virNodeParseNode(const char *sysfs_prefix,
+             virBitmapFree(cores_maps[i]);
+     VIR_FREE(cores_maps);
+     virBitmapFree(sockets_map);
++    virBitmapFree(online_cpus_map);
+     virBitmapFree(present_cpumap);
+ 
+     return ret;
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-fix-nodeGetFreePages-when-max-node-is-zero.patch b/SOURCES/libvirt-nodeinfo-fix-nodeGetFreePages-when-max-node-is-zero.patch
deleted file mode 100644
index f30941b..0000000
--- a/SOURCES/libvirt-nodeinfo-fix-nodeGetFreePages-when-max-node-is-zero.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 2c3dba741df506af7a46f43ddff856a975b794dd Mon Sep 17 00:00:00 2001
-Message-Id: <2c3dba741df506af7a46f43ddff856a975b794dd@dist-git>
-From: Jincheng Miao 
-Date: Wed, 15 Oct 2014 12:11:13 +0200
-Subject: [PATCH] nodeinfo: fix nodeGetFreePages when max node is zero
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1145048
-
-In nodeGetFreePages, if startCell is given by '0',
-and the max node number is '0' too. The for-loop
-wouldn't be executed.
-So convert it to while-loop.
-
-Before:
-> virsh freepages --cellno 0 --pagesize 4
-error: internal error: no suitable info found
-
-After:
-> virsh freepages --cellno 0 --pagesize 4
-4KiB: 472637
-
-Signed-off-by: Jincheng Miao 
-Signed-off-by: Michal Privoznik 
-(cherry picked from commit 8baf0f025f975267e3f9a3af71f69137130907b7)
-Signed-off-by: Jiri Denemark 
----
- src/nodeinfo.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/nodeinfo.c b/src/nodeinfo.c
-index 80c723e..dfde085 100644
---- a/src/nodeinfo.c
-+++ b/src/nodeinfo.c
-@@ -2047,7 +2047,7 @@ nodeGetFreePages(unsigned int npages,
- 
-     lastCell = MIN(lastCell, startCell + cellCount);
- 
--    for (cell = startCell; cell < lastCell; cell++) {
-+    for (cell = startCell; cell <= lastCell; cell++) {
-         for (i = 0; i < npages; i++) {
-             unsigned int page_size = pages[i];
-             unsigned int page_free;
--- 
-2.1.3
-
diff --git a/SOURCES/libvirt-nodeinfo-fix-to-parse-present-cpus-rather-than-possible-cpus.patch b/SOURCES/libvirt-nodeinfo-fix-to-parse-present-cpus-rather-than-possible-cpus.patch
new file mode 100644
index 0000000..8089aa7
--- /dev/null
+++ b/SOURCES/libvirt-nodeinfo-fix-to-parse-present-cpus-rather-than-possible-cpus.patch
@@ -0,0 +1,123 @@
+From ecd0ade9104cecedc1e82fac2b8e025ee98e2cb4 Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Kothapally Madhu Pavan 
+Date: Wed, 5 Aug 2015 18:18:15 +0200
+Subject: [PATCH] nodeinfo: fix to parse present cpus rather than possible cpus
+
+This patch resolves a situation where a core is defective and is not
+in the present mask during boot. Optionally a host can have empty sockets
+could be brought online if the socket is added. In this case the present
+mask contains the cpu's that are actually there in the sockets even though
+they might be offline for some reason. This patch excludes the cpu's that
+are offline because the socket is defective/empty by checking the present
+mask before reading the cpu directory. Otherwise, the nodeinfo on such
+hosts always displays wrong output which includes the defective/empty
+sockets as set of offline cpu's.
+
+Signed-off-by: Kothapally Madhu Pavan 
+(cherry picked from commit bb31f4532b285a7392911f420bcdf05a126be8a0)
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
+
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/nodeinfo.c | 23 ++++++++++++++++++-----
+ 1 file changed, 18 insertions(+), 5 deletions(-)
+
+diff --git a/src/nodeinfo.c b/src/nodeinfo.c
+index ca9cb3a..5158680 100644
+--- a/src/nodeinfo.c
++++ b/src/nodeinfo.c
+@@ -43,6 +43,7 @@
+ #include "c-ctype.h"
+ #include "viralloc.h"
+ #include "nodeinfopriv.h"
++#include "nodeinfo.h"
+ #include "physmem.h"
+ #include "virerror.h"
+ #include "count-one-bits.h"
+@@ -403,20 +404,23 @@ CPU_COUNT(cpu_set_t *set)
+ /* parses a node entry, returning number of processors in the node and
+  * filling arguments */
+ static int
+-ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
++ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5)
+-ATTRIBUTE_NONNULL(6)
+-virNodeParseNode(const char *node,
++ATTRIBUTE_NONNULL(6) ATTRIBUTE_NONNULL(7)
++virNodeParseNode(const char *sysfs_prefix,
++                 const char *node,
+                  virArch arch,
+                  int *sockets,
+                  int *cores,
+                  int *threads,
+                  int *offline)
+ {
++    const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
+     int ret = -1;
+     int processors = 0;
+     DIR *cpudir = NULL;
+     struct dirent *cpudirent = NULL;
++    virBitmapPtr present_cpumap = NULL;
+     int sock_max = 0;
+     cpu_set_t sock_map;
+     int sock;
+@@ -437,12 +441,17 @@ virNodeParseNode(const char *node,
+         goto cleanup;
+     }
+ 
++    present_cpumap = nodeGetPresentCPUBitmap(prefix);
++
+     /* enumerate sockets in the node */
+     CPU_ZERO(&sock_map);
+     while ((direrr = virDirRead(cpudir, &cpudirent, node)) > 0) {
+         if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
+             continue;
+ 
++        if (present_cpumap && !(virBitmapIsBitSet(present_cpumap, cpu)))
++            continue;
++
+         if ((online = virNodeGetCpuValue(node, cpu, "online", 1)) < 0)
+             goto cleanup;
+ 
+@@ -476,6 +485,9 @@ virNodeParseNode(const char *node,
+         if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
+             continue;
+ 
++        if (present_cpumap && !(virBitmapIsBitSet(present_cpumap, cpu)))
++            continue;
++
+         if ((online = virNodeGetCpuValue(node, cpu, "online", 1)) < 0)
+             goto cleanup;
+ 
+@@ -536,6 +548,7 @@ virNodeParseNode(const char *node,
+         ret = -1;
+     }
+     VIR_FREE(core_maps);
++    virBitmapFree(present_cpumap);
+ 
+     return ret;
+ }
+@@ -657,7 +670,7 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
+                         sysfs_dir, nodedirent->d_name) < 0)
+             goto cleanup;
+ 
+-        if ((cpus = virNodeParseNode(sysfs_cpudir, arch,
++        if ((cpus = virNodeParseNode(sysfs_dir, sysfs_cpudir, arch,
+                                      &socks, &cores,
+                                      &threads, &offline)) < 0)
+             goto cleanup;
+@@ -688,7 +701,7 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
+     if (virAsprintf(&sysfs_cpudir, "%s/cpu", sysfs_dir) < 0)
+         goto cleanup;
+ 
+-    if ((cpus = virNodeParseNode(sysfs_cpudir, arch,
++    if ((cpus = virNodeParseNode(sysfs_dir, sysfs_cpudir, arch,
+                                  &socks, &cores,
+                                  &threads, &offline)) < 0)
+         goto cleanup;
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nodeinfo-report-error-when-given-node-is-out-of-range.patch b/SOURCES/libvirt-nodeinfo-report-error-when-given-node-is-out-of-range.patch
deleted file mode 100644
index 86fbc49..0000000
--- a/SOURCES/libvirt-nodeinfo-report-error-when-given-node-is-out-of-range.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 150db6173b1983eb77d9d40a541599dac4ecf0d4 Mon Sep 17 00:00:00 2001
-Message-Id: <150db6173b1983eb77d9d40a541599dac4ecf0d4@dist-git>
-From: Jincheng Miao 
-Date: Tue, 23 Sep 2014 10:34:04 +0200
-Subject: [PATCH] nodeinfo: report error when given node is out of range
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1145050
-
-Signed-off-by: Jincheng Miao 
-Signed-off-by: Michal Privoznik 
-(cherry picked from commit 7db19366423dcab388907c12caf766c6e5870d00)
-Signed-off-by: Jiri Denemark 
----
- src/nodeinfo.c | 18 ++++++++++++++++--
- 1 file changed, 16 insertions(+), 2 deletions(-)
-
-diff --git a/src/nodeinfo.c b/src/nodeinfo.c
-index 92a3718..134fee7 100644
---- a/src/nodeinfo.c
-+++ b/src/nodeinfo.c
-@@ -2032,10 +2032,24 @@ nodeGetFreePages(unsigned int npages,
-                  unsigned long long *counts)
- {
-     int ret = -1;
--    int cell;
-+    int cell, lastCell;
-     size_t i, ncounts = 0;
- 
--    for (cell = startCell; cell < (int) (startCell + cellCount); cell++) {
-+    if ((lastCell = virNumaGetMaxNode()) < 0)
-+        return 0;
-+
-+    if (startCell > lastCell) {
-+        virReportError(VIR_ERR_INTERNAL_ERROR,
-+                       _("start cell %d out of range (0-%d)"),
-+                       startCell, lastCell);
-+        goto cleanup;
-+    }
-+
-+    lastCell = startCell + cellCount;
-+    if (startCell + cellCount < lastCell)
-+        lastCell = startCell + cellCount;
-+
-+    for (cell = startCell; cell < lastCell; cell++) {
-         for (i = 0; i < npages; i++) {
-             unsigned int page_size = pages[i];
-             unsigned int page_free;
--- 
-2.1.1
-
diff --git a/SOURCES/libvirt-numa_conf-Introduce-virDomainNumaGetMaxCPUID.patch b/SOURCES/libvirt-numa_conf-Introduce-virDomainNumaGetMaxCPUID.patch
new file mode 100644
index 0000000..34e7ebb
--- /dev/null
+++ b/SOURCES/libvirt-numa_conf-Introduce-virDomainNumaGetMaxCPUID.patch
@@ -0,0 +1,89 @@
+From ce34d90fb56c195924a0ef4d076d39ed4fc4cabc Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Michal Privoznik 
+Date: Fri, 7 Aug 2015 17:30:16 +0200
+Subject: [PATCH] numa_conf: Introduce virDomainNumaGetMaxCPUID
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1176020
+
+This function should return the greatest CPU number set in
+/domain/cpu/numa/cell/@cpus. The idea is that we should compare
+the returned value against /domain/vcpu value. Yes, there exist
+users who think the following is a good idea:
+
+  4
+  
+    
+    
+      
+      
+    
+  
+
+Signed-off-by: Michal Privoznik 
+(cherry picked from commit 8f2535dec1fdd969e86aa39c8a2583c723341733)
+Signed-off-by: Michal Privoznik 
+Signed-off-by: Jiri Denemark 
+---
+ src/conf/numa_conf.c     | 17 +++++++++++++++++
+ src/conf/numa_conf.h     |  3 +++
+ src/libvirt_private.syms |  1 +
+ 3 files changed, 21 insertions(+)
+
+diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
+index 57da215..5c123b9 100644
+--- a/src/conf/numa_conf.c
++++ b/src/conf/numa_conf.c
+@@ -847,6 +847,23 @@ virDomainNumaGetCPUCountTotal(virDomainNumaPtr numa)
+     return ret;
+ }
+ 
++unsigned int
++virDomainNumaGetMaxCPUID(virDomainNumaPtr numa)
++{
++    size_t i;
++    unsigned int ret = 0;
++
++    for (i = 0; i < numa->nmem_nodes; i++) {
++        int bit;
++
++        bit = virBitmapLastSetBit(virDomainNumaGetNodeCpumask(numa, i));
++        if (bit > ret)
++            ret = bit;
++    }
++
++    return ret;
++}
++
+ 
+ virDomainNumaPtr
+ virDomainNumaNew(void)
+diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h
+index 6739065..90deacb 100644
+--- a/src/conf/numa_conf.h
++++ b/src/conf/numa_conf.h
+@@ -99,6 +99,9 @@ unsigned long long virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa,
+ unsigned long long virDomainNumaGetMemorySize(virDomainNumaPtr numa)
+     ATTRIBUTE_NONNULL(1);
+ 
++unsigned int
++virDomainNumaGetMaxCPUID(virDomainNumaPtr numa);
++
+ /*
+  * Formatters
+  */
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index 0517c24..ad9ebb1 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -679,6 +679,7 @@ virNodeDeviceObjUnlock;
+ virDomainNumaCheckABIStability;
+ virDomainNumaEquals;
+ virDomainNumaFree;
++virDomainNumaGetMaxCPUID;
+ virDomainNumaGetMemorySize;
+ virDomainNumaGetNodeCount;
+ virDomainNumaGetNodeCpumask;
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-nvram-Fix-permissions.patch b/SOURCES/libvirt-nvram-Fix-permissions.patch
deleted file mode 100644
index aa5c0d7..0000000
--- a/SOURCES/libvirt-nvram-Fix-permissions.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 441f44f75c0d62a93da6b3cedaf55e44ff401fa7 Mon Sep 17 00:00:00 2001
-Message-Id: <441f44f75c0d62a93da6b3cedaf55e44ff401fa7@dist-git>
-From: Michal Privoznik 
-Date: Thu, 18 Sep 2014 11:45:33 +0200
-Subject: [PATCH] nvram: Fix permissions
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1026772
-
-I've noticed two problem with the automatically created NVRAM varstore
-file. The first, even though I run qemu as root:root for some reason I
-get Permission denied when trying to open the _VARS.fd file. The
-problem is, the upper directory misses execute permissions, which in
-combination with us dropping some capabilities result in EPERM.
-
-The next thing is, that if I switch SELinux to enforcing mode, I get
-another EPERM because the vars file is not labeled correctly. It is
-passed to qemu as disk and hence should be labelled as disk. QEMU may
-write to it eventually, so this is different to kernel or initrd.
-
-Signed-off-by: Michal Privoznik 
-(cherry picked from commit 37d8c75fad297891b80086b125046ed3990eaf59)
-Signed-off-by: Jiri Denemark 
----
- libvirt.spec.in                 | 2 +-
- src/security/security_selinux.c | 5 ++++-
- 2 files changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
-index 65f0d64..1c9150b 100644
---- a/src/security/security_selinux.c
-+++ b/src/security/security_selinux.c
-@@ -2298,8 +2298,11 @@ virSecuritySELinuxSetSecurityAllLabel(virSecurityManagerPtr mgr,
-                                      mgr) < 0)
-         return -1;
- 
-+    /* This is different than kernel or initrd. The nvram store
-+     * is really a disk, qemu can read and write to it. */
-     if (def->os.loader && def->os.loader->nvram &&
--        virSecuritySELinuxSetFilecon(def->os.loader->nvram, data->content_context) < 0)
-+        secdef && secdef->imagelabel &&
-+        virSecuritySELinuxSetFilecon(def->os.loader->nvram, secdef->imagelabel) < 0)
-         return -1;
- 
-     if (def->os.kernel &&
--- 
-2.1.0
-
diff --git a/SOURCES/libvirt-nwfilter-fix-crash-when-adding-non-existing-nwfilter.patch b/SOURCES/libvirt-nwfilter-fix-crash-when-adding-non-existing-nwfilter.patch
deleted file mode 100644
index f8bcacc..0000000
--- a/SOURCES/libvirt-nwfilter-fix-crash-when-adding-non-existing-nwfilter.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 08c80f998f5d9135aa5affc36ba7848a2bfa447e Mon Sep 17 00:00:00 2001
-Message-Id: <08c80f998f5d9135aa5affc36ba7848a2bfa447e@dist-git>
-From: Pavel Hrdina 
-Date: Tue, 2 Dec 2014 11:16:20 +0100
-Subject: [PATCH] nwfilter: fix crash when adding non-existing nwfilter
-
-Adding non-existing nwfilter to a network interface device without any
-nwfilter specified will crash libvirt daemon with segfault. The reason is
-that the nwfilter is not found an libvirt will try to restore old
-nwfilter configuration but there is no nwfilter specified.
-
-Signed-off-by: Pavel Hrdina 
-(cherry picked from commit d98ad8dd0c5a1d9f6a804e23f0568c784469c3fd)
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1169409
-
-Signed-off-by: Pavel Hrdina 
-Signed-off-by: Jiri Denemark 
----
- src/conf/nwfilter_conf.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
-index 52f24e4..24e0b68 100644
---- a/src/conf/nwfilter_conf.c
-+++ b/src/conf/nwfilter_conf.c
-@@ -2770,7 +2770,7 @@ virNWFilterObjFindByName(virNWFilterObjListPtr nwfilters, const char *name)
- 
-     for (i = 0; i < nwfilters->count; i++) {
-         virNWFilterObjLock(nwfilters->objs[i]);
--        if (STREQ(nwfilters->objs[i]->def->name, name))
-+        if (STREQ_NULLABLE(nwfilters->objs[i]->def->name, name))
-             return nwfilters->objs[i];
-         virNWFilterObjUnlock(nwfilters->objs[i]);
-     }
--- 
-2.2.0
-
diff --git a/SOURCES/libvirt-nwfilter-fix-deadlock-caused-updating-network-device-and-nwfilter.patch b/SOURCES/libvirt-nwfilter-fix-deadlock-caused-updating-network-device-and-nwfilter.patch
deleted file mode 100644
index e94cbdb..0000000
--- a/SOURCES/libvirt-nwfilter-fix-deadlock-caused-updating-network-device-and-nwfilter.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-From 3188a720b9f7d9335af7718862ca96f1cae6d4b1 Mon Sep 17 00:00:00 2001
-Message-Id: <3188a720b9f7d9335af7718862ca96f1cae6d4b1@dist-git>
-From: Pavel Hrdina 
-Date: Thu, 13 Nov 2014 11:19:10 +0100
-Subject: [PATCH] nwfilter: fix deadlock caused updating network device and
- nwfilter
-
-Commit 6e5c79a1 tried to fix deadlock between nwfilter{Define,Undefine}
-and starting of guest, but this same deadlock exists for
-updating/attaching network device to domain.
-
-The deadlock was introduced by removing global QEMU driver lock because
-nwfilter was counting on this lock and ensure that all driver locks are
-locked inside of nwfilter{Define,Undefine}.
-
-This patch extends usage of virNWFilterReadLockFilterUpdates to prevent
-the deadlock for all possible paths in QEMU driver. LXC and UML drivers
-still have global lock.
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1143780
-
-Signed-off-by: Pavel Hrdina 
-(cherry picked from commit 41127244fb90f08cf5032a5d7553f5f0390d925e)
-Signed-off-by: Pavel Hrdina 
-Signed-off-by: Jiri Denemark 
----
- src/qemu/qemu_driver.c    | 12 ++++++++++++
- src/qemu/qemu_migration.c |  4 ++++
- src/qemu/qemu_process.c   |  5 +++++
- 3 files changed, 21 insertions(+)
-
-diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
-index d419689..6ed830c 100644
---- a/src/qemu/qemu_driver.c
-+++ b/src/qemu/qemu_driver.c
-@@ -5902,6 +5902,8 @@ qemuDomainRestoreFlags(virConnectPtr conn,
-                   VIR_DOMAIN_SAVE_PAUSED, -1);
- 
- 
-+    virNWFilterReadLockFilterUpdates();
-+
-     fd = qemuDomainSaveImageOpen(driver, path, &def, &header, &xml,
-                                  (flags & VIR_DOMAIN_SAVE_BYPASS_CACHE) != 0,
-                                  &wrapperFd, false, false);
-@@ -5979,6 +5981,7 @@ qemuDomainRestoreFlags(virConnectPtr conn,
-     virFileWrapperFdFree(wrapperFd);
-     if (vm)
-         virObjectUnlock(vm);
-+    virNWFilterUnlockFilterUpdates();
-     return ret;
- }
- 
-@@ -7412,6 +7415,8 @@ static int qemuDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
-     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
-                   VIR_DOMAIN_AFFECT_CONFIG, -1);
- 
-+    virNWFilterReadLockFilterUpdates();
-+
-     cfg = virQEMUDriverGetConfig(driver);
- 
-     affect = flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG);
-@@ -7528,6 +7533,7 @@ static int qemuDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
-         virObjectUnlock(vm);
-     virObjectUnref(caps);
-     virObjectUnref(cfg);
-+    virNWFilterUnlockFilterUpdates();
-     return ret;
- }
- 
-@@ -7558,6 +7564,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
-                   VIR_DOMAIN_AFFECT_CONFIG |
-                   VIR_DOMAIN_DEVICE_MODIFY_FORCE, -1);
- 
-+    virNWFilterReadLockFilterUpdates();
-+
-     cfg = virQEMUDriverGetConfig(driver);
- 
-     affect = flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG);
-@@ -7674,6 +7682,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
-         virObjectUnlock(vm);
-     virObjectUnref(caps);
-     virObjectUnref(cfg);
-+    virNWFilterUnlockFilterUpdates();
-     return ret;
- }
- 
-@@ -14415,6 +14424,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
-      * and use of FORCE can cause multiple transitions.
-      */
- 
-+    virNWFilterReadLockFilterUpdates();
-+
-     if (!(vm = qemuDomObjFromSnapshot(snapshot)))
-         return -1;
- 
-@@ -14736,6 +14747,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
-         virObjectUnlock(vm);
-     virObjectUnref(caps);
-     virObjectUnref(cfg);
-+    virNWFilterUnlockFilterUpdates();
- 
-     return ret;
- }
-diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
-index 98fd376..d6c8553 100644
---- a/src/qemu/qemu_migration.c
-+++ b/src/qemu/qemu_migration.c
-@@ -57,6 +57,7 @@
- #include "virstring.h"
- #include "virtypedparam.h"
- #include "virprocess.h"
-+#include "nwfilter_conf.h"
- 
- #define VIR_FROM_THIS VIR_FROM_QEMU
- 
-@@ -2525,6 +2526,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
-     if (virTimeMillisNow(&now) < 0)
-         return -1;
- 
-+    virNWFilterReadLockFilterUpdates();
-+
-     if (flags & VIR_MIGRATE_OFFLINE) {
-         if (flags & (VIR_MIGRATE_NON_SHARED_DISK |
-                      VIR_MIGRATE_NON_SHARED_INC)) {
-@@ -2834,6 +2837,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
-         qemuDomainEventQueue(driver, event);
-     qemuMigrationCookieFree(mig);
-     virObjectUnref(caps);
-+    virNWFilterUnlockFilterUpdates();
-     return ret;
- 
-  stop:
-diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
-index ed095a2..9c640f0 100644
---- a/src/qemu/qemu_process.c
-+++ b/src/qemu/qemu_process.c
-@@ -68,6 +68,7 @@
- #include "virhostdev.h"
- #include "storage/storage_driver.h"
- #include "configmake.h"
-+#include "nwfilter_conf.h"
- 
- #define VIR_FROM_THIS VIR_FROM_QEMU
- 
-@@ -3420,6 +3421,8 @@ qemuProcessReconnect(void *opaque)
- 
-     VIR_FREE(data);
- 
-+    virNWFilterReadLockFilterUpdates();
-+
-     virObjectLock(obj);
- 
-     cfg = virQEMUDriverGetConfig(driver);
-@@ -3571,6 +3574,7 @@ qemuProcessReconnect(void *opaque)
- 
-     virObjectUnref(conn);
-     virObjectUnref(cfg);
-+    virNWFilterUnlockFilterUpdates();
- 
-     return;
- 
-@@ -3606,6 +3610,7 @@ qemuProcessReconnect(void *opaque)
-     }
-     virObjectUnref(conn);
-     virObjectUnref(cfg);
-+    virNWFilterUnlockFilterUpdates();
- }
- 
- static int
--- 
-2.1.3
-
diff --git a/SOURCES/libvirt-qemu-Add-RDMA-migration-capabilities.patch b/SOURCES/libvirt-qemu-Add-RDMA-migration-capabilities.patch
deleted file mode 100644
index 3175b4e..0000000
--- a/SOURCES/libvirt-qemu-Add-RDMA-migration-capabilities.patch
+++ /dev/null
@@ -1,3863 +0,0 @@
-From 25ab0e10faaffed0f182b7e8f893a934382b0a94 Mon Sep 17 00:00:00 2001
-Message-Id: <25ab0e10faaffed0f182b7e8f893a934382b0a94@dist-git>
-From: Jiri Denemark 
-Date: Tue, 23 Sep 2014 15:47:56 +0200
-Subject: [PATCH] qemu: Add RDMA migration capabilities
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1013055
-
-(cherry picked from commit b3fd95e368e507b619e6c0588ed18b14c6536adf)
-Signed-off-by: Jiri Denemark 
----
- src/qemu/qemu_capabilities.c                     |   32 +-
- src/qemu/qemu_capabilities.h                     |    1 +
- src/qemu/qemu_monitor.c                          |   22 +-
- src/qemu/qemu_monitor.h                          |    3 +
- src/qemu/qemu_monitor_json.c                     |   44 +-
- src/qemu/qemu_monitor_json.h                     |    2 +
- tests/qemucapabilitiesdata/caps_1.2.2-1.replies  |   10 +
- tests/qemucapabilitiesdata/caps_1.3.1-1.replies  |   10 +
- tests/qemucapabilitiesdata/caps_1.4.2-1.replies  |   10 +
- tests/qemucapabilitiesdata/caps_1.5.3-1.replies  |   10 +
- tests/qemucapabilitiesdata/caps_1.6.0-1.replies  |   22 +
- tests/qemucapabilitiesdata/caps_1.6.50-1.replies |   22 +
- tests/qemucapabilitiesdata/caps_2.1.1-1.caps     |  162 ++
- tests/qemucapabilitiesdata/caps_2.1.1-1.replies  | 3264 ++++++++++++++++++++++
- tests/qemucapabilitiestest.c                     |    1 +
- 15 files changed, 3602 insertions(+), 13 deletions(-)
- create mode 100644 tests/qemucapabilitiesdata/caps_2.1.1-1.caps
- create mode 100644 tests/qemucapabilitiesdata/caps_2.1.1-1.replies
-
-diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
-index 4145c22..ca112e9 100644
---- a/src/qemu/qemu_capabilities.c
-+++ b/src/qemu/qemu_capabilities.c
-@@ -269,6 +269,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
- 
-               "splash-timeout", /* 175 */
-               "iothread",
-+              "migrate-rdma",
-     );
- 
- 
-@@ -993,9 +994,9 @@ virCapsPtr virQEMUCapsInit(virQEMUCapsCachePtr cache)
-     if (virQEMUCapsInitPages(caps) < 0)
-         VIR_WARN("Failed to get pages info");
- 
--    /* Add domain migration transport URI */
--    virCapabilitiesAddHostMigrateTransport(caps,
--                                           "tcp");
-+    /* Add domain migration transport URIs */
-+    virCapabilitiesAddHostMigrateTransport(caps, "tcp");
-+    virCapabilitiesAddHostMigrateTransport(caps, "rdma");
- 
-     /* QEMU can support pretty much every arch that exists,
-      * so just probe for them all - we gracefully fail
-@@ -1435,6 +1436,10 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = {
-     { "rtc-reset-reinjection", QEMU_CAPS_RTC_RESET_REINJECTION },
- };
- 
-+struct virQEMUCapsStringFlags virQEMUCapsMigration[] = {
-+    { "rdma-pin-all", QEMU_CAPS_MIGRATE_RDMA },
-+};
-+
- struct virQEMUCapsStringFlags virQEMUCapsEvents[] = {
-     { "BALLOON_CHANGE", QEMU_CAPS_BALLOON_EVENT },
-     { "SPICE_MIGRATE_COMPLETED", QEMU_CAPS_SEAMLESS_MIGRATION },
-@@ -2476,6 +2481,25 @@ virQEMUCapsProbeQMPCommandLine(virQEMUCapsPtr qemuCaps,
-     return 0;
- }
- 
-+static int
-+virQEMUCapsProbeQMPMigrationCapabilities(virQEMUCapsPtr qemuCaps,
-+                                         qemuMonitorPtr mon)
-+{
-+    char **caps = NULL;
-+    int ncaps;
-+
-+    if ((ncaps = qemuMonitorGetMigrationCapabilities(mon, &caps)) < 0)
-+        return -1;
-+
-+    virQEMUCapsProcessStringFlags(qemuCaps,
-+                                  ARRAY_CARDINALITY(virQEMUCapsMigration),
-+                                  virQEMUCapsMigration,
-+                                  ncaps, caps);
-+    virQEMUCapsFreeStringList(ncaps, caps);
-+
-+    return 0;
-+}
-+
- int virQEMUCapsProbeQMP(virQEMUCapsPtr qemuCaps,
-                         qemuMonitorPtr mon)
- {
-@@ -3168,6 +3192,8 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
-         goto cleanup;
-     if (virQEMUCapsProbeQMPCommandLine(qemuCaps, mon) < 0)
-         goto cleanup;
-+    if (virQEMUCapsProbeQMPMigrationCapabilities(qemuCaps, mon) < 0)
-+        goto cleanup;
- 
-     ret = 0;
-  cleanup:
-diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
-index cf69e59..b15b9f1 100644
---- a/src/qemu/qemu_capabilities.h
-+++ b/src/qemu/qemu_capabilities.h
-@@ -216,6 +216,7 @@ typedef enum {
-     QEMU_CAPS_RTC_RESET_REINJECTION = 174, /* rtc-reset-reinjection monitor command */
-     QEMU_CAPS_SPLASH_TIMEOUT     = 175, /* -boot splash-time */
-     QEMU_CAPS_OBJECT_IOTHREAD    = 176, /* -object iothread */
-+    QEMU_CAPS_MIGRATE_RDMA       = 177, /* have rdma migration */
- 
-     QEMU_CAPS_LAST,                   /* this must always be the last item */
- } virQEMUCapsFlags;
-diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
-index ab252fd..fea551d 100644
---- a/src/qemu/qemu_monitor.c
-+++ b/src/qemu/qemu_monitor.c
-@@ -121,7 +121,7 @@ VIR_ENUM_IMPL(qemuMonitorMigrationStatus,
- 
- VIR_ENUM_IMPL(qemuMonitorMigrationCaps,
-               QEMU_MONITOR_MIGRATION_CAPS_LAST,
--              "xbzrle", "auto-converge")
-+              "xbzrle", "auto-converge", "rdma-pin-all")
- 
- VIR_ENUM_IMPL(qemuMonitorVMStatus,
-               QEMU_MONITOR_VM_STATUS_LAST,
-@@ -3789,6 +3789,26 @@ char *qemuMonitorGetTargetArch(qemuMonitorPtr mon)
- }
- 
- 
-+int
-+qemuMonitorGetMigrationCapabilities(qemuMonitorPtr mon,
-+                                    char ***capabilities)
-+{
-+    VIR_DEBUG("mon=%p", mon);
-+
-+    if (!mon) {
-+        virReportError(VIR_ERR_INVALID_ARG, "%s",
-+                       _("monitor must not be NULL"));
-+        return -1;
-+    }
-+
-+    /* No capability is supported without JSON monitor */
-+    if (!mon->json)
-+        return 0;
-+
-+    return qemuMonitorJSONGetMigrationCapabilities(mon, capabilities);
-+}
-+
-+
- /**
-  * Returns 1 if @capability is supported, 0 if it's not, or -1 on error.
-  */
-diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
-index ed96011..62c9f2e 100644
---- a/src/qemu/qemu_monitor.h
-+++ b/src/qemu/qemu_monitor.h
-@@ -461,12 +461,15 @@ int qemuMonitorGetSpiceMigrationStatus(qemuMonitorPtr mon,
- typedef enum {
-     QEMU_MONITOR_MIGRATION_CAPS_XBZRLE,
-     QEMU_MONITOR_MIGRATION_CAPS_AUTO_CONVERGE,
-+    QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL,
- 
-     QEMU_MONITOR_MIGRATION_CAPS_LAST
- } qemuMonitorMigrationCaps;
- 
- VIR_ENUM_DECL(qemuMonitorMigrationCaps);
- 
-+int qemuMonitorGetMigrationCapabilities(qemuMonitorPtr mon,
-+                                        char ***capabilities);
- int qemuMonitorGetMigrationCapability(qemuMonitorPtr mon,
-                                       qemuMonitorMigrationCaps capability);
- int qemuMonitorSetMigrationCapability(qemuMonitorPtr mon,
-diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
-index 5ad0d05..17b082c 100644
---- a/src/qemu/qemu_monitor_json.c
-+++ b/src/qemu/qemu_monitor_json.c
-@@ -5228,14 +5228,18 @@ qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon)
- 
- 
- int
--qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
--                                      qemuMonitorMigrationCaps capability)
-+qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
-+                                        char ***capabilities)
- {
-     int ret;
-     virJSONValuePtr cmd;
-     virJSONValuePtr reply = NULL;
-     virJSONValuePtr caps;
-+    char **list = NULL;
-     size_t i;
-+    int n;
-+
-+    *capabilities = NULL;
- 
-     if (!(cmd = qemuMonitorJSONMakeCommand("query-migrate-capabilities",
-                                            NULL)))
-@@ -5254,14 +5258,17 @@ qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
- 
-     ret = -1;
- 
--    caps = virJSONValueObjectGet(reply, "return");
--    if (!caps || caps->type != VIR_JSON_TYPE_ARRAY) {
-+    if (!(caps = virJSONValueObjectGet(reply, "return")) ||
-+        (n = virJSONValueArraySize(caps)) < 0) {
-         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                        _("missing migration capabilities"));
-         goto cleanup;
-     }
- 
--    for (i = 0; i < virJSONValueArraySize(caps); i++) {
-+    if (VIR_ALLOC_N(list, n + 1) < 0)
-+        goto cleanup;
-+
-+    for (i = 0; i < n; i++) {
-         virJSONValuePtr cap = virJSONValueArrayGet(caps, i);
-         const char *name;
- 
-@@ -5277,15 +5284,16 @@ qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
-             goto cleanup;
-         }
- 
--        if (qemuMonitorMigrationCapsTypeFromString(name) == capability) {
--            ret = 1;
-+        if (VIR_STRDUP(list[i], name) < 1)
-             goto cleanup;
--        }
-     }
- 
--    ret = 0;
-+    ret = n;
-+    *capabilities = list;
- 
-  cleanup:
-+    if (ret < 0)
-+        virStringFreeList(list);
-     virJSONValueFree(cmd);
-     virJSONValueFree(reply);
-     return ret;
-@@ -5293,6 +5301,24 @@ qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
- 
- 
- int
-+qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
-+                                      qemuMonitorMigrationCaps capability)
-+{
-+    int ret;
-+    char **capsList = NULL;
-+    const char *cap = qemuMonitorMigrationCapsTypeToString(capability);
-+
-+    if (qemuMonitorJSONGetMigrationCapabilities(mon, &capsList) < 0)
-+        return -1;
-+
-+    ret = virStringArrayHasString(capsList, cap);
-+
-+    virStringFreeList(capsList);
-+    return ret;
-+}
-+
-+
-+int
- qemuMonitorJSONSetMigrationCapability(qemuMonitorPtr mon,
-                                       qemuMonitorMigrationCaps capability)
- {
-diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
-index dc5a059..c4e795c 100644
---- a/src/qemu/qemu_monitor_json.h
-+++ b/src/qemu/qemu_monitor_json.h
-@@ -133,6 +133,8 @@ int qemuMonitorJSONSetMigrationCacheSize(qemuMonitorPtr mon,
- int qemuMonitorJSONGetMigrationStatus(qemuMonitorPtr mon,
-                                       qemuMonitorMigrationStatusPtr status);
- 
-+int qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
-+                                            char ***capabilities);
- int qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
-                                           qemuMonitorMigrationCaps capability);
- int qemuMonitorJSONSetMigrationCapability(qemuMonitorPtr mon,
-diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies
-index 345c32b..4fce9d7 100644
---- a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies
-+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies
-@@ -1555,3 +1555,13 @@
-         "desc": "The command query-command-line-options has not been found"
-     }
- }
-+
-+{
-+    "return": [
-+        {
-+            "capability": "xbzrle",
-+            "state": false
-+        }
-+    ],
-+    "id": "libvirt-32"
-+}
-diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies
-index 04d2141..43713b2 100644
---- a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies
-+++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies
-@@ -1735,3 +1735,13 @@
-         "desc": "The command query-command-line-options has not been found"
-     }
- }
-+
-+{
-+    "return": [
-+        {
-+            "capability": "xbzrle",
-+            "state": false
-+        }
-+    ],
-+    "id": "libvirt-34"
-+}
-diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies
-index aef359c..34384f8 100644
---- a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies
-+++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies
-@@ -1785,3 +1785,13 @@
-         "desc": "The command query-command-line-options has not been found"
-     }
- }
-+
-+{
-+    "return": [
-+        {
-+            "capability": "xbzrle",
-+            "state": false
-+        }
-+    ],
-+    "id": "libvirt-34"
-+}
-diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies
-index 1f84bb6..4613472 100644
---- a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies
-+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies
-@@ -2539,3 +2539,13 @@
-     ],
-     "id": "libvirt-33"
- }
-+
-+{
-+    "return": [
-+        {
-+            "capability": "xbzrle",
-+            "state": false
-+        }
-+    ],
-+    "id": "libvirt-34"
-+}
-diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies
-index c9dc29b..4205c89 100644
---- a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies
-+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies
-@@ -2519,3 +2519,25 @@
-     ],
-     "id": "libvirt-33"
- }
-+
-+{
-+    "return": [
-+        {
-+            "capability": "xbzrle",
-+            "state": false
-+        },
-+        {
-+            "capability": "x-rdma-pin-all",
-+            "state": false
-+        },
-+        {
-+            "capability": "auto-converge",
-+            "state": false
-+        },
-+        {
-+            "capability": "zero-blocks",
-+            "state": false
-+        }
-+    ],
-+    "id": "libvirt-34"
-+}
-diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies
-index ec7451f..7582385 100644
---- a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies
-+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies
-@@ -2501,3 +2501,25 @@
-     ],
-     "id": "libvirt-33"
- }
-+
-+{
-+    "return": [
-+        {
-+            "capability": "xbzrle",
-+            "state": false
-+        },
-+        {
-+            "capability": "x-rdma-pin-all",
-+            "state": false
-+        },
-+        {
-+            "capability": "auto-converge",
-+            "state": false
-+        },
-+        {
-+            "capability": "zero-blocks",
-+            "state": false
-+        }
-+    ],
-+    "id": "libvirt-34"
-+}
-diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
-new file mode 100644
-index 0000000..71d2459
---- /dev/null
-+++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps
-@@ -0,0 +1,162 @@
-+  
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+    
-+  
-diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.replies b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies
-new file mode 100644
-index 0000000..74d09dc
---- /dev/null
-+++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies
-@@ -0,0 +1,3264 @@
-+{
-+  "QMP": {
-+    "version": {
-+      "qemu": {
-+        "micro": 1,
-+        "minor": 1,
-+        "major": 2
-+      },
-+      "package": ""
-+    },
-+    "capabilities": [
-+    ]
-+  }
-+}
-+
-+{
-+  "return": {
-+  },
-+  "id": "libvirt-1"
-+}
-+
-+{
-+  "return": {
-+    "qemu": {
-+      "micro": 1,
-+      "minor": 1,
-+      "major": 2
-+    },
-+    "package": ""
-+  },
-+  "id": "libvirt-2"
-+}
-+
-+{
-+  "return": {
-+    "arch": "x86_64"
-+  },
-+  "id": "libvirt-3"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "rtc-reset-reinjection"
-+    },
-+    {
-+      "name": "query-acpi-ospm-status"
-+    },
-+    {
-+      "name": "query-memory-devices"
-+    },
-+    {
-+      "name": "query-memdev"
-+    },
-+    {
-+      "name": "query-named-block-nodes"
-+    },
-+    {
-+      "name": "blockdev-add"
-+    },
-+    {
-+      "name": "query-rx-filter"
-+    },
-+    {
-+      "name": "chardev-remove"
-+    },
-+    {
-+      "name": "chardev-add"
-+    },
-+    {
-+      "name": "query-tpm-types"
-+    },
-+    {
-+      "name": "query-tpm-models"
-+    },
-+    {
-+      "name": "query-tpm"
-+    },
-+    {
-+      "name": "query-target"
-+    },
-+    {
-+      "name": "query-cpu-definitions"
-+    },
-+    {
-+      "name": "query-machines"
-+    },
-+    {
-+      "name": "device-list-properties"
-+    },
-+    {
-+      "name": "qom-list-types"
-+    },
-+    {
-+      "name": "change-vnc-password"
-+    },
-+    {
-+      "name": "nbd-server-stop"
-+    },
-+    {
-+      "name": "nbd-server-add"
-+    },
-+    {
-+      "name": "nbd-server-start"
-+    },
-+    {
-+      "name": "qom-get"
-+    },
-+    {
-+      "name": "qom-set"
-+    },
-+    {
-+      "name": "qom-list"
-+    },
-+    {
-+      "name": "query-block-jobs"
-+    },
-+    {
-+      "name": "query-balloon"
-+    },
-+    {
-+      "name": "query-migrate-capabilities"
-+    },
-+    {
-+      "name": "migrate-set-capabilities"
-+    },
-+    {
-+      "name": "query-migrate"
-+    },
-+    {
-+      "name": "query-command-line-options"
-+    },
-+    {
-+      "name": "query-uuid"
-+    },
-+    {
-+      "name": "query-name"
-+    },
-+    {
-+      "name": "query-spice"
-+    },
-+    {
-+      "name": "query-vnc"
-+    },
-+    {
-+      "name": "query-mice"
-+    },
-+    {
-+      "name": "query-status"
-+    },
-+    {
-+      "name": "query-kvm"
-+    },
-+    {
-+      "name": "query-pci"
-+    },
-+    {
-+      "name": "query-iothreads"
-+    },
-+    {
-+      "name": "query-cpus"
-+    },
-+    {
-+      "name": "query-blockstats"
-+    },
-+    {
-+      "name": "query-block"
-+    },
-+    {
-+      "name": "query-chardev-backends"
-+    },
-+    {
-+      "name": "query-chardev"
-+    },
-+    {
-+      "name": "query-events"
-+    },
-+    {
-+      "name": "query-commands"
-+    },
-+    {
-+      "name": "query-version"
-+    },
-+    {
-+      "name": "human-monitor-command"
-+    },
-+    {
-+      "name": "qmp_capabilities"
-+    },
-+    {
-+      "name": "add_client"
-+    },
-+    {
-+      "name": "expire_password"
-+    },
-+    {
-+      "name": "set_password"
-+    },
-+    {
-+      "name": "block_set_io_throttle"
-+    },
-+    {
-+      "name": "block_passwd"
-+    },
-+    {
-+      "name": "query-fdsets"
-+    },
-+    {
-+      "name": "remove-fd"
-+    },
-+    {
-+      "name": "add-fd"
-+    },
-+    {
-+      "name": "closefd"
-+    },
-+    {
-+      "name": "getfd"
-+    },
-+    {
-+      "name": "set_link"
-+    },
-+    {
-+      "name": "balloon"
-+    },
-+    {
-+      "name": "change-backing-file"
-+    },
-+    {
-+      "name": "drive-mirror"
-+    },
-+    {
-+      "name": "blockdev-snapshot-delete-internal-sync"
-+    },
-+    {
-+      "name": "blockdev-snapshot-internal-sync"
-+    },
-+    {
-+      "name": "blockdev-snapshot-sync"
-+    },
-+    {
-+      "name": "transaction"
-+    },
-+    {
-+      "name": "block-job-complete"
-+    },
-+    {
-+      "name": "block-job-resume"
-+    },
-+    {
-+      "name": "block-job-pause"
-+    },
-+    {
-+      "name": "block-job-cancel"
-+    },
-+    {
-+      "name": "block-job-set-speed"
-+    },
-+    {
-+      "name": "drive-backup"
-+    },
-+    {
-+      "name": "block-commit"
-+    },
-+    {
-+      "name": "block-stream"
-+    },
-+    {
-+      "name": "block_resize"
-+    },
-+    {
-+      "name": "object-del"
-+    },
-+    {
-+      "name": "object-add"
-+    },
-+    {
-+      "name": "netdev_del"
-+    },
-+    {
-+      "name": "netdev_add"
-+    },
-+    {
-+      "name": "query-dump-guest-memory-capability"
-+    },
-+    {
-+      "name": "dump-guest-memory"
-+    },
-+    {
-+      "name": "client_migrate_info"
-+    },
-+    {
-+      "name": "migrate_set_downtime"
-+    },
-+    {
-+      "name": "migrate_set_speed"
-+    },
-+    {
-+      "name": "query-migrate-cache-size"
-+    },
-+    {
-+      "name": "migrate-set-cache-size"
-+    },
-+    {
-+      "name": "migrate_cancel"
-+    },
-+    {
-+      "name": "migrate"
-+    },
-+    {
-+      "name": "xen-set-global-dirty-log"
-+    },
-+    {
-+      "name": "xen-save-devices-state"
-+    },
-+    {
-+      "name": "ringbuf-read"
-+    },
-+    {
-+      "name": "ringbuf-write"
-+    },
-+    {
-+      "name": "inject-nmi"
-+    },
-+    {
-+      "name": "pmemsave"
-+    },
-+    {
-+      "name": "memsave"
-+    },
-+    {
-+      "name": "cpu-add"
-+    },
-+    {
-+      "name": "cpu"
-+    },
-+    {
-+      "name": "send-key"
-+    },
-+    {
-+      "name": "device_del"
-+    },
-+    {
-+      "name": "device_add"
-+    },
-+    {
-+      "name": "system_powerdown"
-+    },
-+    {
-+      "name": "system_reset"
-+    },
-+    {
-+      "name": "system_wakeup"
-+    },
-+    {
-+      "name": "cont"
-+    },
-+    {
-+      "name": "stop"
-+    },
-+    {
-+      "name": "screendump"
-+    },
-+    {
-+      "name": "change"
-+    },
-+    {
-+      "name": "eject"
-+    },
-+    {
-+      "name": "quit"
-+    }
-+  ],
-+  "id": "libvirt-4"
-+}
-+
-+{
-+  "return": {
-+    "fd": 10,
-+    "fdset-id": 0
-+  },
-+  "id": "libvirt-5"
-+}
-+
-+{
-+  "id": "libvirt-6",
-+  "error": {
-+    "class": "DeviceNotFound",
-+    "desc": "Device 'bogus' not found"
-+  }
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "VSERPORT_CHANGE"
-+    },
-+    {
-+      "name": "QUORUM_REPORT_BAD"
-+    },
-+    {
-+      "name": "QUORUM_FAILURE"
-+    },
-+    {
-+      "name": "GUEST_PANICKED"
-+    },
-+    {
-+      "name": "BALLOON_CHANGE"
-+    },
-+    {
-+      "name": "ACPI_DEVICE_OST"
-+    },
-+    {
-+      "name": "SPICE_MIGRATE_COMPLETED"
-+    },
-+    {
-+      "name": "SPICE_DISCONNECTED"
-+    },
-+    {
-+      "name": "SPICE_INITIALIZED"
-+    },
-+    {
-+      "name": "SPICE_CONNECTED"
-+    },
-+    {
-+      "name": "VNC_DISCONNECTED"
-+    },
-+    {
-+      "name": "VNC_INITIALIZED"
-+    },
-+    {
-+      "name": "VNC_CONNECTED"
-+    },
-+    {
-+      "name": "NIC_RX_FILTER_CHANGED"
-+    },
-+    {
-+      "name": "DEVICE_DELETED"
-+    },
-+    {
-+      "name": "WATCHDOG"
-+    },
-+    {
-+      "name": "RTC_CHANGE"
-+    },
-+    {
-+      "name": "WAKEUP"
-+    },
-+    {
-+      "name": "SUSPEND_DISK"
-+    },
-+    {
-+      "name": "SUSPEND"
-+    },
-+    {
-+      "name": "RESUME"
-+    },
-+    {
-+      "name": "STOP"
-+    },
-+    {
-+      "name": "RESET"
-+    },
-+    {
-+      "name": "POWERDOWN"
-+    },
-+    {
-+      "name": "SHUTDOWN"
-+    },
-+    {
-+      "name": "DEVICE_TRAY_MOVED"
-+    },
-+    {
-+      "name": "BLOCK_JOB_READY"
-+    },
-+    {
-+      "name": "BLOCK_JOB_ERROR"
-+    },
-+    {
-+      "name": "BLOCK_JOB_CANCELLED"
-+    },
-+    {
-+      "name": "BLOCK_JOB_COMPLETED"
-+    },
-+    {
-+      "name": "BLOCK_IO_ERROR"
-+    },
-+    {
-+      "name": "BLOCK_IMAGE_CORRUPTED"
-+    }
-+  ],
-+  "id": "libvirt-7"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "pc-0.13-machine"
-+    },
-+    {
-+      "name": "fw_cfg"
-+    },
-+    {
-+      "name": "i82551"
-+    },
-+    {
-+      "name": "i82550"
-+    },
-+    {
-+      "name": "Westmere-x86_64-cpu"
-+    },
-+    {
-+      "name": "xlnx,ps7-usb"
-+    },
-+    {
-+      "name": "e1000-82540em"
-+    },
-+    {
-+      "name": "pci-serial-4x"
-+    },
-+    {
-+      "name": "Penryn-x86_64-cpu"
-+    },
-+    {
-+      "name": "Haswell-x86_64-cpu"
-+    },
-+    {
-+      "name": "iothread"
-+    },
-+    {
-+      "name": "icc-bridge"
-+    },
-+    {
-+      "name": "cfi.pflash01"
-+    },
-+    {
-+      "name": "Opteron_G3-x86_64-cpu"
-+    },
-+    {
-+      "name": "Broadwell-x86_64-cpu"
-+    },
-+    {
-+      "name": "piix3-ide"
-+    },
-+    {
-+      "name": "isa-parallel"
-+    },
-+    {
-+      "name": "i2c-bus"
-+    },
-+    {
-+      "name": "megasas"
-+    },
-+    {
-+      "name": "usb-braille"
-+    },
-+    {
-+      "name": "exynos4210-ehci-usb"
-+    },
-+    {
-+      "name": "vmware-svga"
-+    },
-+    {
-+      "name": "pc-i440fx-2.0-machine"
-+    },
-+    {
-+      "name": "PIIX3-xen"
-+    },
-+    {
-+      "name": "ccid-bus"
-+    },
-+    {
-+      "name": "scsi-cd"
-+    },
-+    {
-+      "name": "isa-serial"
-+    },
-+    {
-+      "name": "usb-ehci"
-+    },
-+    {
-+      "name": "user-creatable"
-+    },
-+    {
-+      "name": "container"
-+    },
-+    {
-+      "name": "host-x86_64-cpu"
-+    },
-+    {
-+      "name": "pci-serial-2x"
-+    },
-+    {
-+      "name": "piix4-ide"
-+    },
-+    {
-+      "name": "scsi-generic"
-+    },
-+    {
-+      "name": "pc-1.0-machine"
-+    },
-+    {
-+      "name": "virtio-net-pci"
-+    },
-+    {
-+      "name": "pc-dimm"
-+    },
-+    {
-+      "name": "pc-i440fx-2.1-machine"
-+    },
-+    {
-+      "name": "isa-debugcon"
-+    },
-+    {
-+      "name": "ide-hd"
-+    },
-+    {
-+      "name": "qemu64-x86_64-cpu"
-+    },
-+    {
-+      "name": "pc-q35-1.7-machine"
-+    },
-+    {
-+      "name": "rng-egd"
-+    },
-+    {
-+      "name": "isa-pcspk"
-+    },
-+    {
-+      "name": "isa-pit"
-+    },
-+    {
-+      "name": "pc-1.1-machine"
-+    },
-+    {
-+      "name": "ich9-usb-ehci2"
-+    },
-+    {
-+      "name": "ich9-usb-ehci1"
-+    },
-+    {
-+      "name": "irq"
-+    },
-+    {
-+      "name": "cirrus-vga"
-+    },
-+    {
-+      "name": "virtconsole"
-+    },
-+    {
-+      "name": "virtio-rng-pci"
-+    },
-+    {
-+      "name": "PCIE"
-+    },
-+    {
-+      "name": "pentium3-x86_64-cpu"
-+    },
-+    {
-+      "name": "qxl-vga"
-+    },
-+    {
-+      "name": "ioapic"
-+    },
-+    {
-+      "name": "kvm-pit"
-+    },
-+    {
-+      "name": "pc-0.14-machine"
-+    },
-+    {
-+      "name": "xen-apic"
-+    },
-+    {
-+      "name": "pc-q35-2.0-machine"
-+    },
-+    {
-+      "name": "usb-host"
-+    },
-+    {
-+      "name": "usb-bus"
-+    },
-+    {
-+      "name": "pc-i440fx-1.4-machine"
-+    },
-+    {
-+      "name": "vhost-scsi-pci"
-+    },
-+    {
-+      "name": "usb-kbd"
-+    },
-+    {
-+      "name": "486-x86_64-cpu"
-+    },
-+    {
-+      "name": "ES1370"
-+    },
-+    {
-+      "name": "gus"
-+    },
-+    {
-+      "name": "isa-applesmc"
-+    },
-+    {
-+      "name": "PIIX3"
-+    },
-+    {
-+      "name": "kvm-pci-assign"
-+    },
-+    {
-+      "name": "xen-pci-passthrough"
-+    },
-+    {
-+      "name": "i82559er"
-+    },
-+    {
-+      "name": "e1000-82545em"
-+    },
-+    {
-+      "name": "q35-pcihost"
-+    },
-+    {
-+      "name": "tegra2-ehci-usb"
-+    },
-+    {
-+      "name": "pc-i440fx-1.5-machine"
-+    },
-+    {
-+      "name": "usb-bt-dongle"
-+    },
-+    {
-+      "name": "AC97"
-+    },
-+    {
-+      "name": "i6300esb"
-+    },
-+    {
-+      "name": "mc146818rtc"
-+    },
-+    {
-+      "name": "e1000-82544gc"
-+    },
-+    {
-+      "name": "PIIX4_PM"
-+    },
-+    {
-+      "name": "piix4-usb-uhci"
-+    },
-+    {
-+      "name": "sysbus-ahci"
-+    },
-+    {
-+      "name": "kvm-ioapic"
-+    },
-+    {
-+      "name": "pvpanic"
-+    },
-+    {
-+      "name": "core2duo-x86_64-cpu"
-+    },
-+    {
-+      "name": "virtio-9p-pci"
-+    },
-+    {
-+      "name": "scsi-disk"
-+    },
-+    {
-+      "name": "acpi-device-interface"
-+    },
-+    {
-+      "name": "sb16"
-+    },
-+    {
-+      "name": "pc-0.15-machine"
-+    },
-+    {
-+      "name": "xenfv-machine"
-+    },
-+    {
-+      "name": "usb-mouse"
-+    },
-+    {
-+      "name": "piix3-usb-uhci"
-+    },
-+    {
-+      "name": "virtio-scsi-device"
-+    },
-+    {
-+      "name": "virtio-blk-pci"
-+    },
-+    {
-+      "name": "virtio-9p-device"
-+    },
-+    {
-+      "name": "hda-output"
-+    },
-+    {
-+      "name": "SUNW,fdtwo"
-+    },
-+    {
-+      "name": "tpci200"
-+    },
-+    {
-+      "name": "Opteron_G4-x86_64-cpu"
-+    },
-+    {
-+      "name": "pc-q35-1.4-machine"
-+    },
-+    {
-+      "name": "virtio-mmio"
-+    },
-+    {
-+      "name": "qemu-console"
-+    },
-+    {
-+      "name": "isa-i8259"
-+    },
-+    {
-+      "name": "System"
-+    },
-+    {
-+      "name": "pvscsi"
-+    },
-+    {
-+      "name": "virtio-net-device"
-+    },
-+    {
-+      "name": "usb-hub"
-+    },
-+    {
-+      "name": "hda-duplex"
-+    },
-+    {
-+      "name": "isapc-machine"
-+    },
-+    {
-+      "name": "ipoctal232"
-+    },
-+    {
-+      "name": "pc-1.2-machine"
-+    },
-+    {
-+      "name": "xio3130-downstream"
-+    },
-+    {
-+      "name": "ide-cd"
-+    },
-+    {
-+      "name": "apic"
-+    },
-+    {
-+      "name": "isabus-bridge"
-+    },
-+    {
-+      "name": "memory-backend-file"
-+    },
-+    {
-+      "name": "isa-ide"
-+    },
-+    {
-+      "name": "isa-vga"
-+    },
-+    {
-+      "name": "qemu:memory-region"
-+    },
-+    {
-+      "name": "kvm-i8259"
-+    },
-+    {
-+      "name": "rng-random"
-+    },
-+    {
-+      "name": "hotplug-handler"
-+    },
-+    {
-+      "name": "pci-ohci"
-+    },
-+    {
-+      "name": "i440FX-pcihost"
-+    },
-+    {
-+      "name": "qemu32-x86_64-cpu"
-+    },
-+    {
-+      "name": "tpm-tis"
-+    },
-+    {
-+      "name": "tpm-passthrough"
-+    },
-+    {
-+      "name": "nec-usb-xhci"
-+    },
-+    {
-+      "name": "isa-debug-exit"
-+    },
-+    {
-+      "name": "pc-0.10-machine"
-+    },
-+    {
-+      "name": "pc-testdev"
-+    },
-+    {
-+      "name": "sga"
-+    },
-+    {
-+      "name": "Opteron_G1-x86_64-cpu"
-+    },
-+    {
-+      "name": "xen-pvdevice"
-+    },
-+    {
-+      "name": "pcnet"
-+    },
-+    {
-+      "name": "ivshmem"
-+    },
-+    {
-+      "name": "hpet"
-+    },
-+    {
-+      "name": "adlib"
-+    },
-+    {
-+      "name": "lsi53c895a"
-+    },
-+    {
-+      "name": "usb-audio"
-+    },
-+    {
-+      "name": "usb-wacom-tablet"
-+    },
-+    {
-+      "name": "pc-0.11-machine"
-+    },
-+    {
-+      "name": "kvm-apic"
-+    },
-+    {
-+      "name": "phenom-x86_64-cpu"
-+    },
-+    {
-+      "name": "ioh3420"
-+    },
-+    {
-+      "name": "cs4231a"
-+    },
-+    {
-+      "name": "dc390"
-+    },
-+    {
-+      "name": "nvme"
-+    },
-+    {
-+      "name": "i82801b11-bridge"
-+    },
-+    {
-+      "name": "kvmvapic"
-+    },
-+    {
-+      "name": "pc-q35-2.1-machine"
-+    },
-+    {
-+      "name": "fw-path-provider"
-+    },
-+    {
-+      "name": "usb-net"
-+    },
-+    {
-+      "name": "mch"
-+    },
-+    {
-+      "name": "usb-tablet"
-+    },
-+    {
-+      "name": "vhost-scsi"
-+    },
-+    {
-+      "name": "usb-ccid"
-+    },
-+    {
-+      "name": "pc-i440fx-1.7-machine"
-+    },
-+    {
-+      "name": "virtio-mmio-bus"
-+    },
-+    {
-+      "name": "usb-bot"
-+    },
-+    {
-+      "name": "ICH9-LPC"
-+    },
-+    {
-+      "name": "pci-bridge"
-+    },
-+    {
-+      "name": "pc-i440fx-1.6-machine"
-+    },
-+    {
-+      "name": "kvmclock"
-+    },
-+    {
-+      "name": "lsi53c810"
-+    },
-+    {
-+      "name": "isa-cirrus-vga"
-+    },
-+    {
-+      "name": "virtio-serial-bus"
-+    },
-+    {
-+      "name": "ICH9 SMB"
-+    },
-+    {
-+      "name": "SandyBridge-x86_64-cpu"
-+    },
-+    {
-+      "name": "esp"
-+    },
-+    {
-+      "name": "virtio-balloon-device"
-+    },
-+    {
-+      "name": "ccid-card-passthru"
-+    },
-+    {
-+      "name": "qxl"
-+    },
-+    {
-+      "name": "intel-hda"
-+    },
-+    {
-+      "name": "vmxnet3"
-+    },
-+    {
-+      "name": "virtio-serial-device"
-+    },
-+    {
-+      "name": "pci-testdev"
-+    },
-+    {
-+      "name": "ich9-usb-uhci6"
-+    },
-+    {
-+      "name": "ib700"
-+    },
-+    {
-+      "name": "ich9-usb-uhci4"
-+    },
-+    {
-+      "name": "piix3-ide-xen"
-+    },
-+    {
-+      "name": "ich9-usb-uhci5"
-+    },
-+    {
-+      "name": "icc-bus"
-+    },
-+    {
-+      "name": "IDE"
-+    },
-+    {
-+      "name": "VGA"
-+    },
-+    {
-+      "name": "ich9-usb-uhci3"
-+    },
-+    {
-+      "name": "ich9-usb-uhci2"
-+    },
-+    {
-+      "name": "ich9-usb-uhci1"
-+    },
-+    {
-+      "name": "x3130-upstream"
-+    },
-+    {
-+      "name": "none-machine"
-+    },
-+    {
-+      "name": "sysbus-fdc"
-+    },
-+    {
-+      "name": "SCSI"
-+    },
-+    {
-+      "name": "n270-x86_64-cpu"
-+    },
-+    {
-+      "name": "pci-serial"
-+    },
-+    {
-+      "name": "xenpv-machine"
-+    },
-+    {
-+      "name": "athlon-x86_64-cpu"
-+    },
-+    {
-+      "name": "ISA"
-+    },
-+    {
-+      "name": "i8042"
-+    },
-+    {
-+      "name": "ccid-card-emulated"
-+    },
-+    {
-+      "name": "i82559c"
-+    },
-+    {
-+      "name": "i82559b"
-+    },
-+    {
-+      "name": "i82559a"
-+    },
-+    {
-+      "name": "scsi-hd"
-+    },
-+    {
-+      "name": "pc-q35-1.5-machine"
-+    },
-+    {
-+      "name": "virtio-balloon-pci"
-+    },
-+    {
-+      "name": "hda-micro"
-+    },
-+    {
-+      "name": "scsi-block"
-+    },
-+    {
-+      "name": "virtio-scsi-pci"
-+    },
-+    {
-+      "name": "rtl8139"
-+    },
-+    {
-+      "name": "vmmouse"
-+    },
-+    {
-+      "name": "ich9-intel-hda"
-+    },
-+    {
-+      "name": "usb-mtp"
-+    },
-+    {
-+      "name": "ide-drive"
-+    },
-+    {
-+      "name": "PCI"
-+    },
-+    {
-+      "name": "Opteron_G5-x86_64-cpu"
-+    },
-+    {
-+      "name": "vmport"
-+    },
-+    {
-+      "name": "coreduo-x86_64-cpu"
-+    },
-+    {
-+      "name": "virtio-serial-pci"
-+    },
-+    {
-+      "name": "pc-q35-1.6-machine"
-+    },
-+    {
-+      "name": "xen-platform"
-+    },
-+    {
-+      "name": "pentium2-x86_64-cpu"
-+    },
-+    {
-+      "name": "i82558b"
-+    },
-+    {
-+      "name": "i82558a"
-+    },
-+    {
-+      "name": "pc-0.12-machine"
-+    },
-+    {
-+      "name": "kvm64-x86_64-cpu"
-+    },
-+    {
-+      "name": "port92"
-+    },
-+    {
-+      "name": "virtio-pci-bus"
-+    },
-+    {
-+      "name": "am53c974"
-+    },
-+    {
-+      "name": "e1000"
-+    },
-+    {
-+      "name": "Conroe-x86_64-cpu"
-+    },
-+    {
-+      "name": "ne2k_isa"
-+    },
-+    {
-+      "name": "HDA"
-+    },
-+    {
-+      "name": "usb-storage"
-+    },
-+    {
-+      "name": "pc-1.3-machine"
-+    },
-+    {
-+      "name": "usb-serial"
-+    },
-+    {
-+      "name": "sysbus-ohci"
-+    },
-+    {
-+      "name": "usb-redir"
-+    },
-+    {
-+      "name": "i82801"
-+    },
-+    {
-+      "name": "usb-uas"
-+    },
-+    {
-+      "name": "i82557b"
-+    },
-+    {
-+      "name": "i82557c"
-+    },
-+    {
-+      "name": "Nehalem-x86_64-cpu"
-+    },
-+    {
-+      "name": "memory-backend-ram"
-+    },
-+    {
-+      "name": "i82557a"
-+    },
-+    {
-+      "name": "virtserialport"
-+    },
-+    {
-+      "name": "i440FX"
-+    },
-+    {
-+      "name": "ne2k_pci"
-+    },
-+    {
-+      "name": "smbus-eeprom"
-+    },
-+    {
-+      "name": "i82562"
-+    },
-+    {
-+      "name": "ich9-ahci"
-+    },
-+    {
-+      "name": "isa-fdc"
-+    },
-+    {
-+      "name": "kvm32-x86_64-cpu"
-+    },
-+    {
-+      "name": "Opteron_G2-x86_64-cpu"
-+    },
-+    {
-+      "name": "virtio-rng-device"
-+    },
-+    {
-+      "name": "IndustryPack"
-+    },
-+    {
-+      "name": "vfio-pci"
-+    },
-+    {
-+      "name": "vt82c686b-usb-uhci"
-+    },
-+    {
-+      "name": "secondary-vga"
-+    },
-+    {
-+      "name": "pentium-x86_64-cpu"
-+    },
-+    {
-+      "name": "virtio-blk-device"
-+    },
-+    {
-+      "name": "fusbh200-ehci-usb"
-+    }
-+  ],
-+  "id": "libvirt-8"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "iothread",
-+      "type": "link"
-+    },
-+    {
-+      "name": "x-data-plane",
-+      "type": "bool"
-+    },
-+    {
-+      "name": "scsi",
-+      "type": "bool"
-+    },
-+    {
-+      "name": "config-wce",
-+      "type": "bool"
-+    },
-+    {
-+      "name": "serial",
-+      "type": "str"
-+    },
-+    {
-+      "name": "secs",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "heads",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "cyls",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "discard_granularity",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "bootindex",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "opt_io_size",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "min_io_size",
-+      "type": "uint16"
-+    },
-+    {
-+      "name": "physical_block_size",
-+      "type": "uint16"
-+    },
-+    {
-+      "name": "logical_block_size",
-+      "type": "uint16"
-+    },
-+    {
-+      "name": "drive",
-+      "type": "str"
-+    },
-+    {
-+      "name": "virtio-backend",
-+      "type": "child"
-+    },
-+    {
-+      "name": "command_serr_enable",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "multifunction",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "rombar",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "romfile",
-+      "type": "str"
-+    },
-+    {
-+      "name": "addr",
-+      "type": "pci-devfn"
-+    },
-+    {
-+      "name": "event_idx",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "indirect_desc",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "vectors",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "ioeventfd",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "class",
-+      "type": "uint32"
-+    }
-+  ],
-+  "id": "libvirt-9"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "virtio-backend",
-+      "type": "child"
-+    },
-+    {
-+      "name": "command_serr_enable",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "multifunction",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "rombar",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "romfile",
-+      "type": "str"
-+    },
-+    {
-+      "name": "addr",
-+      "type": "pci-devfn"
-+    },
-+    {
-+      "name": "event_idx",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "indirect_desc",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "tx",
-+      "type": "str"
-+    },
-+    {
-+      "name": "x-txburst",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "x-txtimer",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "bootindex",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "netdev",
-+      "type": "netdev"
-+    },
-+    {
-+      "name": "vlan",
-+      "type": "vlan"
-+    },
-+    {
-+      "name": "mac",
-+      "type": "macaddr"
-+    },
-+    {
-+      "name": "mq",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "ctrl_guest_offloads",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "ctrl_mac_addr",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "ctrl_rx_extra",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "ctrl_vlan",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "ctrl_rx",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "ctrl_vq",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "status",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "mrg_rxbuf",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "host_ufo",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "host_ecn",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "host_tso6",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "host_tso4",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "guest_announce",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "guest_ufo",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "guest_ecn",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "guest_tso6",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "guest_tso4",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "gso",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "guest_csum",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "csum",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "any_layout",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "vectors",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "ioeventfd",
-+      "type": "on/off"
-+    }
-+  ],
-+  "id": "libvirt-10"
-+}
-+
-+{
-+  "id": "libvirt-11",
-+  "error": {
-+    "class": "DeviceNotFound",
-+    "desc": "Device 'virtio-blk-ccw' not found"
-+  }
-+}
-+
-+{
-+  "id": "libvirt-12",
-+  "error": {
-+    "class": "DeviceNotFound",
-+    "desc": "Device 'virtio-net-ccw' not found"
-+  }
-+}
-+
-+{
-+  "id": "libvirt-13",
-+  "error": {
-+    "class": "DeviceNotFound",
-+    "desc": "Device 'virtio-blk-s390' not found"
-+  }
-+}
-+
-+{
-+  "id": "libvirt-14",
-+  "error": {
-+    "class": "DeviceNotFound",
-+    "desc": "Device 'virtio-net-s390' not found"
-+  }
-+}
-+
-+{
-+  "id": "libvirt-15",
-+  "error": {
-+    "class": "DeviceNotFound",
-+    "desc": "Device 'pci-assign' not found"
-+  }
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "command_serr_enable",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "multifunction",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "rombar",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "romfile",
-+      "type": "str"
-+    },
-+    {
-+      "name": "addr",
-+      "type": "pci-devfn"
-+    },
-+    {
-+      "name": "configfd",
-+      "type": "str"
-+    },
-+    {
-+      "name": "bootindex",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "share_intx",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "prefer_msi",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "host",
-+      "type": "pci-host-devaddr"
-+    }
-+  ],
-+  "id": "libvirt-16"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "command_serr_enable",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "multifunction",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "rombar",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "romfile",
-+      "type": "str"
-+    },
-+    {
-+      "name": "addr",
-+      "type": "pci-devfn"
-+    },
-+    {
-+      "name": "bootindex",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "x-vga",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "x-intx-mmap-timeout-ms",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "host",
-+      "type": "pci-host-devaddr"
-+    }
-+  ],
-+  "id": "libvirt-17"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "lun",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "scsi-id",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "channel",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "max_unmap_size",
-+      "type": "uint64"
-+    },
-+    {
-+      "name": "port_index",
-+      "type": "uint16"
-+    },
-+    {
-+      "name": "port_wwn",
-+      "type": "uint64"
-+    },
-+    {
-+      "name": "wwn",
-+      "type": "uint64"
-+    },
-+    {
-+      "name": "dpofua",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "removable",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "product",
-+      "type": "str"
-+    },
-+    {
-+      "name": "vendor",
-+      "type": "str"
-+    },
-+    {
-+      "name": "serial",
-+      "type": "str"
-+    },
-+    {
-+      "name": "ver",
-+      "type": "str"
-+    },
-+    {
-+      "name": "discard_granularity",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "bootindex",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "opt_io_size",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "min_io_size",
-+      "type": "uint16"
-+    },
-+    {
-+      "name": "physical_block_size",
-+      "type": "blocksize"
-+    },
-+    {
-+      "name": "logical_block_size",
-+      "type": "blocksize"
-+    },
-+    {
-+      "name": "drive",
-+      "type": "drive"
-+    }
-+  ],
-+  "id": "libvirt-18"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "unit",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "model",
-+      "type": "str"
-+    },
-+    {
-+      "name": "serial",
-+      "type": "str"
-+    },
-+    {
-+      "name": "wwn",
-+      "type": "uint64"
-+    },
-+    {
-+      "name": "ver",
-+      "type": "str"
-+    },
-+    {
-+      "name": "discard_granularity",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "bootindex",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "opt_io_size",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "min_io_size",
-+      "type": "uint16"
-+    },
-+    {
-+      "name": "physical_block_size",
-+      "type": "blocksize"
-+    },
-+    {
-+      "name": "logical_block_size",
-+      "type": "blocksize"
-+    },
-+    {
-+      "name": "drive",
-+      "type": "drive"
-+    }
-+  ],
-+  "id": "libvirt-19"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "command_serr_enable",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "multifunction",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "rombar",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "romfile",
-+      "type": "str"
-+    },
-+    {
-+      "name": "addr",
-+      "type": "pci-devfn"
-+    },
-+    {
-+      "name": "memory-hotplug-support",
-+      "type": "bool"
-+    },
-+    {
-+      "name": "acpi-pci-hotplug-with-bridge-support",
-+      "type": "bool"
-+    },
-+    {
-+      "name": "s4_val",
-+      "type": "uint8"
-+    },
-+    {
-+      "name": "disable_s4",
-+      "type": "uint8"
-+    },
-+    {
-+      "name": "disable_s3",
-+      "type": "uint8"
-+    },
-+    {
-+      "name": "smb_io_base",
-+      "type": "uint32"
-+    }
-+  ],
-+  "id": "libvirt-20"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "msos-desc",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "full-path",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "serial",
-+      "type": "str"
-+    },
-+    {
-+      "name": "port",
-+      "type": "str"
-+    },
-+    {
-+      "name": "bootindex",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "filter",
-+      "type": "str"
-+    },
-+    {
-+      "name": "debug",
-+      "type": "uint8"
-+    },
-+    {
-+      "name": "chardev",
-+      "type": "chr"
-+    }
-+  ],
-+  "id": "libvirt-21"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "msos-desc",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "full-path",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "serial",
-+      "type": "str"
-+    },
-+    {
-+      "name": "port",
-+      "type": "str"
-+    },
-+    {
-+      "name": "pipeline",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "loglevel",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "bootindex",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "isobsize",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "isobufs",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "productid",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "vendorid",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "hostport",
-+      "type": "str"
-+    },
-+    {
-+      "name": "hostaddr",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "hostbus",
-+      "type": "uint32"
-+    }
-+  ],
-+  "id": "libvirt-22"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "lun",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "scsi-id",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "channel",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "bootindex",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "drive",
-+      "type": "drive"
-+    }
-+  ],
-+  "id": "libvirt-23"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "pci-hole64-end",
-+      "type": "int"
-+    },
-+    {
-+      "name": "pci-hole64-start",
-+      "type": "int"
-+    },
-+    {
-+      "name": "pci-hole-end",
-+      "type": "int"
-+    },
-+    {
-+      "name": "pci-hole-start",
-+      "type": "int"
-+    },
-+    {
-+      "name": "pci-conf-data[0]",
-+      "type": "child"
-+    },
-+    {
-+      "name": "pci-conf-idx[0]",
-+      "type": "child"
-+    },
-+    {
-+      "name": "short_root_bus",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "pci-hole64-size",
-+      "type": "size"
-+    }
-+  ],
-+  "id": "libvirt-24"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "mcfg_size",
-+      "type": "int"
-+    },
-+    {
-+      "name": "pci-hole64-end",
-+      "type": "int"
-+    },
-+    {
-+      "name": "pci-hole64-start",
-+      "type": "int"
-+    },
-+    {
-+      "name": "pci-hole-end",
-+      "type": "int"
-+    },
-+    {
-+      "name": "pci-hole-start",
-+      "type": "int"
-+    },
-+    {
-+      "name": "mch",
-+      "type": "child"
-+    },
-+    {
-+      "name": "pci-conf-data[0]",
-+      "type": "child"
-+    },
-+    {
-+      "name": "pci-conf-idx[0]",
-+      "type": "child"
-+    },
-+    {
-+      "name": "short_root_bus",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "pci-hole64-size",
-+      "type": "size"
-+    },
-+    {
-+      "name": "MCFG",
-+      "type": "uint64"
-+    }
-+  ],
-+  "id": "libvirt-25"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "msos-desc",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "full-path",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "serial",
-+      "type": "str"
-+    },
-+    {
-+      "name": "port",
-+      "type": "str"
-+    },
-+    {
-+      "name": "removable",
-+      "type": "on/off"
-+    },
-+    {
-+      "name": "discard_granularity",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "bootindex",
-+      "type": "int32"
-+    },
-+    {
-+      "name": "opt_io_size",
-+      "type": "uint32"
-+    },
-+    {
-+      "name": "min_io_size",
-+      "type": "uint16"
-+    },
-+    {
-+      "name": "physical_block_size",
-+      "type": "blocksize"
-+    },
-+    {
-+      "name": "logical_block_size",
-+      "type": "blocksize"
-+    },
-+    {
-+      "name": "drive",
-+      "type": "drive"
-+    }
-+  ],
-+  "id": "libvirt-26"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "lost_tick_policy",
-+      "type": "LostTickPolicy"
-+    },
-+    {
-+      "name": "iobase",
-+      "type": "uint32"
-+    }
-+  ],
-+  "id": "libvirt-27"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "pc-1.3",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-0.12",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-q35-1.6",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-q35-1.5",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "xenpv",
-+      "cpu-max": 1
-+    },
-+    {
-+      "name": "none",
-+      "cpu-max": 1
-+    },
-+    {
-+      "name": "pc-i440fx-1.6",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-i440fx-1.7",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-q35-2.1",
-+      "cpu-max": 255,
-+      "alias": "q35"
-+    },
-+    {
-+      "name": "pc-0.11",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-0.10",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-1.2",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "isapc",
-+      "cpu-max": 1
-+    },
-+    {
-+      "name": "pc-q35-1.4",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "xenfv",
-+      "cpu-max": 128
-+    },
-+    {
-+      "name": "pc-0.15",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-i440fx-1.5",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-i440fx-1.4",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-q35-2.0",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-0.14",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-1.1",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-q35-1.7",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-i440fx-2.1",
-+      "is-default": true,
-+      "cpu-max": 255,
-+      "alias": "pc"
-+    },
-+    {
-+      "name": "pc-1.0",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-i440fx-2.0",
-+      "cpu-max": 255
-+    },
-+    {
-+      "name": "pc-0.13",
-+      "cpu-max": 255
-+    }
-+  ],
-+  "id": "libvirt-28"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "name": "Opteron_G5"
-+    },
-+    {
-+      "name": "Opteron_G4"
-+    },
-+    {
-+      "name": "Opteron_G3"
-+    },
-+    {
-+      "name": "Opteron_G2"
-+    },
-+    {
-+      "name": "Opteron_G1"
-+    },
-+    {
-+      "name": "Broadwell"
-+    },
-+    {
-+      "name": "Haswell"
-+    },
-+    {
-+      "name": "SandyBridge"
-+    },
-+    {
-+      "name": "Westmere"
-+    },
-+    {
-+      "name": "Nehalem"
-+    },
-+    {
-+      "name": "Penryn"
-+    },
-+    {
-+      "name": "Conroe"
-+    },
-+    {
-+      "name": "n270"
-+    },
-+    {
-+      "name": "athlon"
-+    },
-+    {
-+      "name": "pentium3"
-+    },
-+    {
-+      "name": "pentium2"
-+    },
-+    {
-+      "name": "pentium"
-+    },
-+    {
-+      "name": "486"
-+    },
-+    {
-+      "name": "coreduo"
-+    },
-+    {
-+      "name": "kvm32"
-+    },
-+    {
-+      "name": "qemu32"
-+    },
-+    {
-+      "name": "kvm64"
-+    },
-+    {
-+      "name": "core2duo"
-+    },
-+    {
-+      "name": "phenom"
-+    },
-+    {
-+      "name": "qemu64"
-+    }
-+  ],
-+  "id": "libvirt-29"
-+}
-+
-+{
-+  "return": {
-+    "enabled": false,
-+    "present": true
-+  },
-+  "id": "libvirt-30"
-+}
-+
-+{
-+  "return": [
-+    "tpm-tis"
-+  ],
-+  "id": "libvirt-31"
-+}
-+
-+{
-+  "return": [
-+    "passthrough"
-+  ],
-+  "id": "libvirt-32"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "parameters": [
-+        {
-+          "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",
-+          "help": "password for CHAP authentication to target",
-+          "type": "string"
-+        },
-+        {
-+          "name": "user",
-+          "help": "username for CHAP authentication to target",
-+          "type": "string"
-+        }
-+      ],
-+      "option": "iscsi"
-+    },
-+    {
-+      "parameters": [
-+        {
-+          "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": "ipv6",
-+          "type": "boolean"
-+        },
-+        {
-+          "name": "ipv4",
-+          "type": "boolean"
-+        },
-+        {
-+          "name": "addr",
-+          "type": "string"
-+        },
-+        {
-+          "name": "tls-port",
-+          "type": "number"
-+        },
-+        {
-+          "name": "port",
-+          "type": "number"
-+        }
-+      ],
-+      "option": "spice"
-+    },
-+    {
-+      "parameters": [
-+      ],
-+      "option": "acpi"
-+    },
-+    {
-+      "parameters": [
-+        {
-+          "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": "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": [
-+      ],
-+      "option": "smbios"
-+    },
-+    {
-+      "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": "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": "enable",
-+          "type": "boolean"
-+        }
-+      ],
-+      "option": "sandbox"
-+    },
-+    {
-+      "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": "max-ram-below-4g",
-+          "help": "maximum ram below the 4G boundary (32bit boundary)",
-+          "type": "size"
-+        },
-+        {
-+          "name": "kvm-type",
-+          "help": "Specifies the KVM virtualization mode (HV, PR)",
-+          "type": "string"
-+        },
-+        {
-+          "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"
-+        }
-+      ],
-+      "option": "trace"
-+    },
-+    {
-+      "parameters": [
-+        {
-+          "name": "pretty",
-+          "type": "boolean"
-+        },
-+        {
-+          "name": "default",
-+          "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": "netdev"
-+    },
-+    {
-+      "parameters": [
-+      ],
-+      "option": "device"
-+    },
-+    {
-+      "parameters": [
-+        {
-+          "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": "telnet",
-+          "type": "boolean"
-+        },
-+        {
-+          "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": "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": "serial",
-+          "help": "disk serial number",
-+          "type": "string"
-+        },
-+        {
-+          "name": "addr",
-+          "help": "pci address (virtio only)",
-+          "type": "string"
-+        },
-+        {
-+          "name": "boot",
-+          "help": "(deprecated, ignored)",
-+          "type": "boolean"
-+        },
-+        {
-+          "name": "trans",
-+          "help": "chs translation (auto, lba, none)",
-+          "type": "string"
-+        },
-+        {
-+          "name": "secs",
-+          "help": "number of sectors (ide disk geometry)",
-+          "type": "number"
-+        },
-+        {
-+          "name": "heads",
-+          "help": "number of heads (ide disk geometry)",
-+          "type": "number"
-+        },
-+        {
-+          "name": "cyls",
-+          "help": "number of cylinders (ide disk geometry)",
-+          "type": "number"
-+        },
-+        {
-+          "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": "detect-zeroes",
-+          "help": "try to optimize zero writes (off, on, unmap)",
-+          "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",
-+          "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": "aio",
-+          "help": "host AIO implementation (threads, native)",
-+          "type": "string"
-+        },
-+        {
-+          "name": "cache.no-flush",
-+          "help": "ignore any flush requests for the device",
-+          "type": "boolean"
-+        },
-+        {
-+          "name": "cache.direct",
-+          "help": "enables use of O_DIRECT (bypass the host page cache)",
-+          "type": "boolean"
-+        },
-+        {
-+          "name": "cache.writeback",
-+          "help": "enables writeback mode for any caches",
-+          "type": "boolean"
-+        },
-+        {
-+          "name": "discard",
-+          "help": "discard operation (ignore/off, unmap/on)",
-+          "type": "string"
-+        },
-+        {
-+          "name": "snapshot",
-+          "help": "enable/disable snapshot mode",
-+          "type": "boolean"
-+        }
-+      ],
-+      "option": "drive"
-+    }
-+  ],
-+  "id": "libvirt-33"
-+}
-+
-+{
-+  "return": [
-+    {
-+      "state": false,
-+      "capability": "xbzrle"
-+    },
-+    {
-+      "state": false,
-+      "capability": "rdma-pin-all"
-+    },
-+    {
-+      "state": false,
-+      "capability": "auto-converge"
-+    },
-+    {
-+      "state": false,
-+      "capability": "zero-blocks"
-+    }
-+  ],
-+  "id": "libvirt-34"
-+}
-diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
-index 2f2b73d..0fbc43c 100644
---- a/tests/qemucapabilitiestest.c
-+++ b/tests/qemucapabilitiestest.c
-@@ -189,6 +189,7 @@ mymain(void)
-     DO_TEST("caps_1.5.3-1");
-     DO_TEST("caps_1.6.0-1");
-     DO_TEST("caps_1.6.50-1");
-+    DO_TEST("caps_2.1.1-1");
- 
-     virObjectUnref(xmlopt);
-     return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
--- 
-2.1.1
-
diff --git a/SOURCES/libvirt-qemu-Add-check-for-invalid-iothread_id-in-qemuDomainChgIOThread.patch b/SOURCES/libvirt-qemu-Add-check-for-invalid-iothread_id-in-qemuDomainChgIOThread.patch
new file mode 100644
index 0000000..a210223
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Add-check-for-invalid-iothread_id-in-qemuDomainChgIOThread.patch
@@ -0,0 +1,45 @@
+From e654ad03a40a7f908704ec28cb50c38267eb7bff Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: John Ferlan 
+Date: Tue, 18 Aug 2015 14:47:15 -0400
+Subject: [PATCH] qemu: Add check for invalid iothread_id in
+ qemuDomainChgIOThread
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1251886
+
+Since iothread_id == 0 is an invalid value for QEMU let's point
+that out specifically.  For the IOThreadDel code, the failure would
+have ended up being a failure to find the IOThread ID; however, for
+the IOThreadAdd code - an IOThread 0 was added and that isn't good.
+
+It seems during many reviews/edits to the code the check for
+iothread_id = 0 being invalid was lost - it could have originally
+been in the API code, but requested to be moved - I cannot remember.
+
+(cherry picked from commit 32c6b1908bbf8a1aa4a2692135e7d02a166a0317)
+Signed-off-by: John Ferlan 
+Signed-off-by: Jiri Denemark 
+---
+ src/qemu/qemu_driver.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index 748f16a..ec61bb5 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -6152,6 +6152,12 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
+     virDomainDefPtr persistentDef;
+     int ret = -1;
+ 
++    if (iothread_id == 0) {
++        virReportError(VIR_ERR_INVALID_ARG, "%s",
++                       _("invalid value of 0 for iothread_id"));
++        return -1;
++    }
++
+     cfg = virQEMUDriverGetConfig(driver);
+ 
+     priv = vm->privateData;
+-- 
+2.5.0
+
diff --git a/SOURCES/libvirt-qemu-Add-conditions-for-qemu-kvm-use-on-ppc64.patch b/SOURCES/libvirt-qemu-Add-conditions-for-qemu-kvm-use-on-ppc64.patch
new file mode 100644
index 0000000..a143a80
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Add-conditions-for-qemu-kvm-use-on-ppc64.patch
@@ -0,0 +1,55 @@
+From 4058cc05cce5ed00aa9b2da4976a1a5565b9d3aa Mon Sep 17 00:00:00 2001
+Message-Id: <4058cc05cce5ed00aa9b2da4976a1a5565b9d3aa@dist-git>
+From: Andrea Bolognani 
+Date: Mon, 5 Oct 2015 10:49:44 +0200
+Subject: [PATCH] qemu: Add conditions for qemu-kvm use on ppc64
+
+qemu-kvm can be used to run ppc64 guests on ppc64le hosts and vice
+versa, since the hardware is actually the same and the endianness
+is chosen by the guest kernel.
+
+Up until now, however, libvirt didn't allow the use of qemu-kvm
+to run guests if their endianness didn't match the host's.
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1267882
+(cherry picked from commit 938368f8382ca94c5156c44ad85a06cf9e4f8f8f)
+Signed-off-by: Andrea Bolognani 
+Signed-off-by: Jiri Denemark 
+---
+ src/qemu/qemu_capabilities.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
+index 5b21307..12af0dc 100644
+--- a/src/qemu/qemu_capabilities.c
++++ b/src/qemu/qemu_capabilities.c
+@@ -770,7 +770,7 @@ virQEMUCapsInitGuest(virCapsPtr caps,
+     char *binary = NULL;
+     virQEMUCapsPtr qemubinCaps = NULL;
+     virQEMUCapsPtr kvmbinCaps = NULL;
+-    bool native_kvm, x86_32on64_kvm, arm_32on64_kvm;
++    bool native_kvm, x86_32on64_kvm, arm_32on64_kvm, ppc64_kvm;
+     int ret = -1;
+ 
+     /* Check for existence of base emulator, or alternate base
+@@ -790,14 +790,16 @@ virQEMUCapsInitGuest(virCapsPtr caps,
+      *  - host & guest arches match
+      *  - hostarch is x86_64 and guest arch is i686 (needs -cpu qemu32)
+      *  - hostarch is aarch64 and guest arch is armv7l (needs -cpu aarch64=off)
++     *  - hostarch and guestarch are both ppc64*
+      */
+     native_kvm = (hostarch == guestarch);
+     x86_32on64_kvm = (hostarch == VIR_ARCH_X86_64 &&
+         guestarch == VIR_ARCH_I686);
+     arm_32on64_kvm = (hostarch == VIR_ARCH_AARCH64 &&
+         guestarch == VIR_ARCH_ARMV7L);
++    ppc64_kvm = (ARCH_IS_PPC64(hostarch) && ARCH_IS_PPC64(guestarch));
+ 
+-    if (native_kvm || x86_32on64_kvm || arm_32on64_kvm) {
++    if (native_kvm || x86_32on64_kvm || arm_32on64_kvm || ppc64_kvm) {
+         const char *kvmbins[] = {
+             "/usr/libexec/qemu-kvm", /* RHEL */
+             "qemu-kvm", /* Fedora */
+-- 
+2.6.1
+
diff --git a/SOURCES/libvirt-qemu-Add-handling-for-VSERPORT_CHANGE-event.patch b/SOURCES/libvirt-qemu-Add-handling-for-VSERPORT_CHANGE-event.patch
deleted file mode 100644
index 157c37f..0000000
--- a/SOURCES/libvirt-qemu-Add-handling-for-VSERPORT_CHANGE-event.patch
+++ /dev/null
@@ -1,287 +0,0 @@
-From e646797b59c759839d3f0b97223d5cb67ef5ea04 Mon Sep 17 00:00:00 2001
-Message-Id: 
-From: Peter Krempa 
-Date: Mon, 24 Nov 2014 17:51:15 +0100
-Subject: [PATCH] qemu: Add handling for VSERPORT_CHANGE event
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1146944
-
-New qemu added a new event that is emitted when a virtio serial channel
-is opened in the guest OS. This allows us to update the state of the
-port in the output-only XML element.
-
-This patch implements the monitor callbacks and necessary handlers to
-update the state in the definition.
-
-(cherry picked from commit 15bbaaf014d0eb524a941be2b924d7768ef7c269)
-
-Signed-off-by: Jiri Denemark 
----
- src/qemu/qemu_domain.h       |  1 +
- src/qemu/qemu_driver.c       | 57 ++++++++++++++++++++++++++++++++++++++++++++
- src/qemu/qemu_monitor.c      | 14 +++++++++++
- src/qemu/qemu_monitor.h      | 10 ++++++++
- src/qemu/qemu_monitor_json.c | 23 ++++++++++++++++++
- src/qemu/qemu_process.c      | 44 ++++++++++++++++++++++++++++++++++
- 6 files changed, 149 insertions(+)
-
-diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
-index ad45a66..e4ea4ce 100644
---- a/src/qemu/qemu_domain.h
-+++ b/src/qemu/qemu_domain.h
-@@ -196,6 +196,7 @@ typedef enum {
-     QEMU_PROCESS_EVENT_GUESTPANIC,
-     QEMU_PROCESS_EVENT_DEVICE_DELETED,
-     QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED,
-+    QEMU_PROCESS_EVENT_SERIAL_CHANGED,
- 
-     QEMU_PROCESS_EVENT_LAST
- } qemuProcessEventType;
-diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
-index 5d2a335..fe498b9 100644
---- a/src/qemu/qemu_driver.c
-+++ b/src/qemu/qemu_driver.c
-@@ -4339,6 +4339,60 @@ processNicRxFilterChangedEvent(virQEMUDriverPtr driver,
- }
- 
- 
-+static void
-+processSerialChangedEvent(virQEMUDriverPtr driver,
-+                          virDomainObjPtr vm,
-+                          char *devAlias,
-+                          bool connected)
-+{
-+    virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
-+    virDomainChrDeviceState newstate;
-+    virDomainDeviceDef dev;
-+
-+    if (connected)
-+        newstate = VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED;
-+    else
-+        newstate = VIR_DOMAIN_CHR_DEVICE_STATE_DISCONNECTED;
-+
-+    VIR_DEBUG("Changing serial port state %s in domain %p %s",
-+              devAlias, vm, vm->def->name);
-+
-+    if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
-+        goto cleanup;
-+
-+    if (!virDomainObjIsActive(vm)) {
-+        VIR_DEBUG("Domain is not running");
-+        goto endjob;
-+    }
-+
-+    if (virDomainDefFindDevice(vm->def, devAlias, &dev, true) < 0)
-+        goto endjob;
-+
-+    /* we care only about certain devices */
-+    if (dev.type != VIR_DOMAIN_DEVICE_CHR ||
-+        dev.data.chr->deviceType != VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL ||
-+        dev.data.chr->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO)
-+        goto endjob;
-+
-+    dev.data.chr->state = newstate;
-+
-+    if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
-+        VIR_WARN("unable to save status of domain %s after updating state of "
-+                 "channel %s", vm->def->name, devAlias);
-+
-+ endjob:
-+    /* We had an extra reference to vm before starting a new job so ending the
-+     * job is guaranteed not to remove the last reference.
-+     */
-+    ignore_value(qemuDomainObjEndJob(driver, vm));
-+
-+ cleanup:
-+    VIR_FREE(devAlias);
-+    virObjectUnref(cfg);
-+
-+}
-+
-+
- static void qemuProcessEventHandler(void *data, void *opaque)
- {
-     struct qemuProcessEvent *processEvent = data;
-@@ -4362,6 +4416,9 @@ static void qemuProcessEventHandler(void *data, void *opaque)
-     case QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED:
-         processNicRxFilterChangedEvent(driver, vm, processEvent->data);
-         break;
-+    case QEMU_PROCESS_EVENT_SERIAL_CHANGED:
-+        processSerialChangedEvent(driver, vm, processEvent->data,
-+                                  processEvent->action);
-     case QEMU_PROCESS_EVENT_LAST:
-         break;
-     }
-diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
-index 09935f5..55a0542 100644
---- a/src/qemu/qemu_monitor.c
-+++ b/src/qemu/qemu_monitor.c
-@@ -1404,6 +1404,20 @@ qemuMonitorEmitNicRxFilterChanged(qemuMonitorPtr mon,
- }
- 
- 
-+int
-+qemuMonitorEmitSerialChange(qemuMonitorPtr mon,
-+                            const char *devAlias,
-+                            bool connected)
-+{
-+    int ret = -1;
-+    VIR_DEBUG("mon=%p, devAlias='%s', connected=%d", mon, devAlias, connected);
-+
-+    QEMU_MONITOR_CALLBACK(mon, ret, domainSerialChange, mon->vm, devAlias, connected);
-+
-+    return ret;
-+}
-+
-+
- int qemuMonitorSetCapabilities(qemuMonitorPtr mon)
- {
-     int ret;
-diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
-index b63799b..8ae0dbe 100644
---- a/src/qemu/qemu_monitor.h
-+++ b/src/qemu/qemu_monitor.h
-@@ -176,6 +176,12 @@ typedef int (*qemuMonitorDomainNicRxFilterChangedCallback)(qemuMonitorPtr mon,
-                                                            const char *devAlias,
-                                                            void *opaque);
- 
-+typedef int (*qemuMonitorDomainSerialChangeCallback)(qemuMonitorPtr mon,
-+                                                     virDomainObjPtr vm,
-+                                                     const char *devAlias,
-+                                                     bool connected,
-+                                                     void *opaque);
-+
- typedef struct _qemuMonitorCallbacks qemuMonitorCallbacks;
- typedef qemuMonitorCallbacks *qemuMonitorCallbacksPtr;
- struct _qemuMonitorCallbacks {
-@@ -202,6 +208,7 @@ struct _qemuMonitorCallbacks {
-     qemuMonitorDomainGuestPanicCallback domainGuestPanic;
-     qemuMonitorDomainDeviceDeletedCallback domainDeviceDeleted;
-     qemuMonitorDomainNicRxFilterChangedCallback domainNicRxFilterChanged;
-+    qemuMonitorDomainSerialChangeCallback domainSerialChange;
- };
- 
- char *qemuMonitorEscapeArg(const char *in);
-@@ -292,6 +299,9 @@ int qemuMonitorEmitDeviceDeleted(qemuMonitorPtr mon,
-                                  const char *devAlias);
- int qemuMonitorEmitNicRxFilterChanged(qemuMonitorPtr mon,
-                                       const char *devAlias);
-+int qemuMonitorEmitSerialChange(qemuMonitorPtr mon,
-+                                const char *devAlias,
-+                                bool connected);
- 
- int qemuMonitorStartCPUs(qemuMonitorPtr mon,
-                          virConnectPtr conn);
-diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
-index bf28832..e5f49ef 100644
---- a/src/qemu/qemu_monitor_json.c
-+++ b/src/qemu/qemu_monitor_json.c
-@@ -82,6 +82,7 @@ static void qemuMonitorJSONHandlePMSuspendDisk(qemuMonitorPtr mon, virJSONValueP
- static void qemuMonitorJSONHandleGuestPanic(qemuMonitorPtr mon, virJSONValuePtr data);
- static void qemuMonitorJSONHandleDeviceDeleted(qemuMonitorPtr mon, virJSONValuePtr data);
- static void qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitorPtr mon, virJSONValuePtr data);
-+static void qemuMonitorJSONHandleSerialChange(qemuMonitorPtr mon, virJSONValuePtr data);
- 
- typedef struct {
-     const char *type;
-@@ -112,6 +113,7 @@ static qemuEventHandler eventHandlers[] = {
-     { "VNC_CONNECTED", qemuMonitorJSONHandleVNCConnect, },
-     { "VNC_DISCONNECTED", qemuMonitorJSONHandleVNCDisconnect, },
-     { "VNC_INITIALIZED", qemuMonitorJSONHandleVNCInitialize, },
-+    { "VSERPORT_CHANGE", qemuMonitorJSONHandleSerialChange, },
-     { "WAKEUP", qemuMonitorJSONHandlePMWakeup, },
-     { "WATCHDOG", qemuMonitorJSONHandleWatchdog, },
-     /* We use bsearch, so keep this list sorted.  */
-@@ -1038,6 +1040,27 @@ qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitorPtr mon, virJSONValuePtr data
- }
- 
- 
-+static void
-+qemuMonitorJSONHandleSerialChange(qemuMonitorPtr mon,
-+                                  virJSONValuePtr data)
-+{
-+    const char *name;
-+    bool connected;
-+
-+    if (!(name = virJSONValueObjectGetString(data, "id"))) {
-+        VIR_WARN("missing device alias in VSERPORT_CHANGE event");
-+        return;
-+    }
-+
-+    if (virJSONValueObjectGetBoolean(data, "open", &connected) < 0) {
-+        VIR_WARN("missing port state for '%s' in VSERPORT_CHANGE event", name);
-+        return;
-+    }
-+
-+    qemuMonitorEmitSerialChange(mon, name, connected);
-+}
-+
-+
- int
- qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon,
-                                   const char *cmd_str,
-diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
-index b7b2d80..7e1b9a2 100644
---- a/src/qemu/qemu_process.c
-+++ b/src/qemu/qemu_process.c
-@@ -1539,6 +1539,49 @@ qemuProcessHandleNicRxFilterChanged(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
- }
- 
- 
-+static int
-+qemuProcessHandleSerialChanged(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
-+                               virDomainObjPtr vm,
-+                               const char *devAlias,
-+                               bool connected,
-+                               void *opaque)
-+{
-+    virQEMUDriverPtr driver = opaque;
-+    struct qemuProcessEvent *processEvent = NULL;
-+    char *data;
-+
-+    virObjectLock(vm);
-+
-+    VIR_DEBUG("Serial port %s state changed to '%d' in domain %p %s",
-+              devAlias, connected, vm, vm->def->name);
-+
-+    if (VIR_ALLOC(processEvent) < 0)
-+        goto error;
-+
-+    processEvent->eventType = QEMU_PROCESS_EVENT_SERIAL_CHANGED;
-+    if (VIR_STRDUP(data, devAlias) < 0)
-+        goto error;
-+    processEvent->data = data;
-+    processEvent->action = connected;
-+    processEvent->vm = vm;
-+
-+    virObjectRef(vm);
-+    if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
-+        ignore_value(virObjectUnref(vm));
-+        goto error;
-+    }
-+
-+ cleanup:
-+    virObjectUnlock(vm);
-+    return 0;
-+ error:
-+    if (processEvent)
-+        VIR_FREE(processEvent->data);
-+    VIR_FREE(processEvent);
-+    goto cleanup;
-+}
-+
-+
- static qemuMonitorCallbacks monitorCallbacks = {
-     .eofNotify = qemuProcessHandleMonitorEOF,
-     .errorNotify = qemuProcessHandleMonitorError,
-@@ -1561,6 +1604,7 @@ static qemuMonitorCallbacks monitorCallbacks = {
-     .domainGuestPanic = qemuProcessHandleGuestPanic,
-     .domainDeviceDeleted = qemuProcessHandleDeviceDeleted,
-     .domainNicRxFilterChanged = qemuProcessHandleNicRxFilterChanged,
-+    .domainSerialChange = qemuProcessHandleSerialChanged,
- };
- 
- static int
--- 
-2.1.3
-
diff --git a/SOURCES/libvirt-qemu-Add-mem-path-even-with-numa.patch b/SOURCES/libvirt-qemu-Add-mem-path-even-with-numa.patch
new file mode 100644
index 0000000..9e09770
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Add-mem-path-even-with-numa.patch
@@ -0,0 +1,46 @@
+From eb59153c2c09c2e59f214e0bdcb90ea430753060 Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Martin Kletzander 
+Date: Tue, 6 Oct 2015 15:20:34 +0200
+Subject: [PATCH] qemu: Add -mem-path even with numa
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1266856
+
+So since the introduction of the memory-backend-file object until now we
+only added '-mem-path' for non-NUMA guests and we used the parameters of
+the memory-backend-file object to specify the path to the hugetlbfs
+mount.  But hugepages can be also used without memory-backend-file
+object, as it used to be before its introduction.  Let's just get this
+part of the code back and properly append the '-mem-path' for NUMA
+guests as well, but only when the memory backend is not needed.
+
+This parameter is already being applied when no numa is requested and
+because we still use memory-object-file unconditionally for
+hugepage-backed NUMA guests, this should not fire until later.
+
+Signed-off-by: Martin Kletzander 
+(cherry picked from commit a2dba3ceb2e2639cc5fd91da81204682f27d0d8c)
+Signed-off-by: Martin Kletzander 
+Signed-off-by: Jiri Denemark 
+---
+ src/qemu/qemu_command.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
+index 0822ee4..1d020d2 100644
+--- a/src/qemu/qemu_command.c
++++ b/src/qemu/qemu_command.c
+@@ -7856,6 +7856,10 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
+         }
+     }
+ 
++    if (!needBackend &&
++        qemuBuildMemPathStr(cfg, def, qemuCaps, cmd) < 0)
++        goto cleanup;
++
+     for (i = 0; i < ncells; i++) {
+         VIR_FREE(cpumask);
+         if (!(cpumask = virBitmapFormat(virDomainNumaGetNodeCpumask(def->numa, i))))
+-- 
+2.6.1
+
diff --git a/SOURCES/libvirt-qemu-Add-missing-goto-error-in-qemuRestoreCgroupState.patch b/SOURCES/libvirt-qemu-Add-missing-goto-error-in-qemuRestoreCgroupState.patch
deleted file mode 100644
index 582c5f9..0000000
--- a/SOURCES/libvirt-qemu-Add-missing-goto-error-in-qemuRestoreCgroupState.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 1c369e232e7a9a7e631cbb059182b14c6fdea845 Mon Sep 17 00:00:00 2001
-Message-Id: <1c369e232e7a9a7e631cbb059182b14c6fdea845@dist-git>
-From: Martin Kletzander 
-Date: Wed, 21 Jan 2015 17:22:05 +0100
-Subject: [PATCH] qemu: Add missing goto error in qemuRestoreCgroupState
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1161540
-
-Commit af2a1f05 tried clearly separating each condition in
-qemuRestoreCgroupState() for the sake of readability, however somehow
-one condition body was missing.  That means that the body of the next
-condition got executed only if both of there were true, which is
-impossible, thus resulting in a dead code and a logic error.
-
-Signed-off-by: Martin Kletzander 
-(cherry picked from commit 86759ec61a77f545f9238d83adbfaa16d85fa830)
-Signed-off-by: Martin Kletzander 
-Signed-off-by: Jiri Denemark 
----
- src/qemu/qemu_cgroup.c | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
-
-diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
-index 0a4576a..8824426 100644
---- a/src/qemu/qemu_cgroup.c
-+++ b/src/qemu/qemu_cgroup.c
-@@ -796,9 +796,7 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
-         goto error;
- 
-     if ((empty = virCgroupHasEmptyTasks(priv->cgroup,
--                                        VIR_CGROUP_CONTROLLER_CPUSET)) < 0)
--
--    if (!empty)
-+                                        VIR_CGROUP_CONTROLLER_CPUSET)) <= 0)
-         goto error;
- 
-     if (virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0)
--- 
-2.2.1
-
diff --git a/SOURCES/libvirt-qemu-Add-missing-goto-on-rawio.patch b/SOURCES/libvirt-qemu-Add-missing-goto-on-rawio.patch
deleted file mode 100644
index c390746..0000000
--- a/SOURCES/libvirt-qemu-Add-missing-goto-on-rawio.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 0a11b90fc609d5ff7c32f2f25ff25a4e7d4013d9 Mon Sep 17 00:00:00 2001
-Message-Id: <0a11b90fc609d5ff7c32f2f25ff25a4e7d4013d9@dist-git>
-From: John Ferlan 
-Date: Fri, 19 Sep 2014 08:32:36 -0400
-Subject: [PATCH] qemu: Add missing goto on rawio
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1103739
-
-Commit id '9a2f36ec' added a build conditional of CAP_SYS_RAWIO
-in order to determine whether or not a disk definition using rawio
-should be allowed on platforms without CAP_SYS_RAWIO. If one was
-found, virReportError was used but the code didn't goto cleanup.
-
-This patch adds the goto.
-
-(cherry picked from commit 8921d48868652e7dbb67aa7c77035ac2d5ccb5a3)
-Signed-off-by: John Ferlan 
-Signed-off-by: Jiri Denemark 
----
- src/qemu/qemu_process.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
-index a0eb845..528b6eb 100644
---- a/src/qemu/qemu_process.c
-+++ b/src/qemu/qemu_process.c
-@@ -4355,13 +4355,15 @@ int qemuProcessStart(virConnectPtr conn,
-         virDomainDeviceDef dev;
-         virDomainDiskDefPtr disk = vm->def->disks[i];
- 
--        if (vm->def->disks[i]->rawio == 1)
-+        if (vm->def->disks[i]->rawio == 1) {
- #ifdef CAP_SYS_RAWIO
-             virCommandAllowCap(cmd, CAP_SYS_RAWIO);
- #else
-             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                            _("Raw I/O is not supported on this platform"));
-+            goto cleanup;
- #endif
-+        }
- 
-         dev.type = VIR_DOMAIN_DEVICE_DISK;
-         dev.data.disk = disk;
--- 
-2.1.1
-
diff --git a/SOURCES/libvirt-qemu-Align-memory-module-sizes-to-2MiB.patch b/SOURCES/libvirt-qemu-Align-memory-module-sizes-to-2MiB.patch
new file mode 100644
index 0000000..6611986
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Align-memory-module-sizes-to-2MiB.patch
@@ -0,0 +1,80 @@
+From 64eebe80b8722e3abb3c51a9b7282ae7445fef58 Mon Sep 17 00:00:00 2001
+Message-Id: <64eebe80b8722e3abb3c51a9b7282ae7445fef58@dist-git>
+From: Peter Krempa 
+Date: Wed, 23 Sep 2015 14:06:01 +0200
+Subject: [PATCH] qemu: Align memory module sizes to 2MiB
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1252685
+
+My original implementation was based on a qemu version that still did
+not have all the checks in place. Using sizes that would align to odd
+megabyte increments will produce the following error:
+
+qemu-kvm: -device pc-dimm,node=0,memdev=memdimm0,id=dimm0: backend memory size must be multiple of 0x200000
+qemu-kvm: -device pc-dimm,node=0,memdev=memdimm0,id=dimm0: Device 'pc-dimm' could not be initialized
+
+Introduce an alignment retrieval function for memory devices and use it
+to align the devices separately and modify a test case to verify it.
+
+(cherry picked from commit 624ec1c2f9157082db415711cd3b347d1af7f5c4)
+
+Signed-off-by: Jiri Denemark 
+---
+ src/qemu/qemu_domain.c                                | 19 ++++++++++++++++++-
+ .../qemuxml2argv-memory-hotplug-dimm.xml              |  2 +-
+ 2 files changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
+index a47535e..1528cfd 100644
+--- a/src/qemu/qemu_domain.c
++++ b/src/qemu/qemu_domain.c
+@@ -3173,6 +3173,21 @@ qemuDomainGetMemorySizeAlignment(virDomainDefPtr def)
+ }
+ 
+ 
++static unsigned long long
++qemuDomainGetMemoryModuleSizeAlignment(const virDomainDef *def,
++                                       const virDomainMemoryDef *mem ATTRIBUTE_UNUSED)
++{
++    /* PPC requires the memory sizes to be rounded to 256MiB increments, so
++     * round them to the size always. */
++    if (ARCH_IS_PPC64(def->os.arch))
++        return 256 * 1024;
++
++    /* dimm memory modules require 2MiB alignment rather than the 1MiB we are
++     * using elsewhere. */
++    return 2048;
++}
++
++
+ int
+ qemuDomainAlignMemorySizes(virDomainDefPtr def)
+ {
+@@ -3199,8 +3214,10 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def)
+     def->mem.max_memory = VIR_ROUND_UP(def->mem.max_memory, align);
+ 
+     /* Align memory module sizes */
+-    for (i = 0; i < def->nmems; i++)
++    for (i = 0; i < def->nmems; i++) {
++        align = qemuDomainGetMemoryModuleSizeAlignment(def, def->mems[i]);
+         def->mems[i]->size = VIR_ROUND_UP(def->mems[i]->size, align);
++    }
+ 
+     return 0;
+ }
+diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml
+index 3f468ec..fbcac84 100644
+--- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml
++++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml
+@@ -36,7 +36,7 @@
+     
+     
+       
+-        524287
++        523264
+         0
+       
+     
+-- 
+2.5.3
+
diff --git a/SOURCES/libvirt-qemu-Allow-others-to-browse-var-lib-libvirt-qemu.patch b/SOURCES/libvirt-qemu-Allow-others-to-browse-var-lib-libvirt-qemu.patch
new file mode 100644
index 0000000..5079679
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Allow-others-to-browse-var-lib-libvirt-qemu.patch
@@ -0,0 +1,43 @@
+From bb648b91212e2f43ef408e7be7212c60d02203ce Mon Sep 17 00:00:00 2001
+Message-Id: 
+From: Martin Kletzander 
+Date: Mon, 14 Sep 2015 10:15:27 +0200
+Subject: [PATCH] qemu: Allow others to browse /var/lib/libvirt/qemu
+
+Commit f1f68ca33433 tried fixing running multiple domains under various
+users, but if the user can't browse the directory, it's hard for the
+qemu running under that user to create the monitor socket.
+
+The permissions need to be fixed in two places in the spec file due to
+support for both installations with and without driver modules.
+
+Creating a directory with '$(MKDIR_P) -m' shouldn't fail even on systems
+where autoconf needs to fallback to 'install-sh -d'.
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146886
+
+Signed-off-by: Martin Kletzander 
+(cherry picked from commit f05f005c8b0ec8a53bb7fd6da65f4ac08afac858)
+Signed-off-by: Martin Kletzander 
+Signed-off-by: Jiri Denemark 
+---
+ libvirt.spec.in | 4 ++--
+ src/Makefile.am | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 62b8fd6..8c202a5 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -2777,7 +2777,7 @@ if WITH_SANLOCK
+ 	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
+ endif WITH_SANLOCK
+ if WITH_QEMU
+-	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
++	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
+ 	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
+ 	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
+ 	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
+-- 
+2.5.2
+
diff --git a/SOURCES/libvirt-qemu-Allow-pinning-specific-IOThreads-to-a-CPU.patch b/SOURCES/libvirt-qemu-Allow-pinning-specific-IOThreads-to-a-CPU.patch
deleted file mode 100644
index a625992..0000000
--- a/SOURCES/libvirt-qemu-Allow-pinning-specific-IOThreads-to-a-CPU.patch
+++ /dev/null
@@ -1,202 +0,0 @@
-From 4e2265af50edd9b7772750a534310f87ba76e071 Mon Sep 17 00:00:00 2001
-Message-Id: <4e2265af50edd9b7772750a534310f87ba76e071@dist-git>
-From: John Ferlan 
-Date: Thu, 18 Sep 2014 09:29:54 -0400
-Subject: [PATCH] qemu: Allow pinning specific IOThreads to a CPU
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1101574
-
-Modify qemuProcessStart() in order to allowing setting affinity to
-specific CPU's for IOThreads. The process followed is similar to
-that for the vCPU's.
-
-This involves adding a function to fetch the IOThread id's via
-qemuMonitorGetIOThreads() and adding them to iothreadpids[] list.
-Then making sure all the cgroup data has been properly set up and
-finally assigning affinity.
-
-(cherry picked from commit 9bef96ec502a01abde055233a8ab428a6824a4c0)
-
-NOTE: Requires commit id 938fb12fad6d15c9fdb73f998c4e0ec1e278721f in order
-      to build (next patch)
-
-Signed-off-by: John Ferlan 
-Signed-off-by: Jiri Denemark 
----
- src/qemu/qemu_driver.c  |  8 ++++
- src/qemu/qemu_process.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 106 insertions(+)
-
-diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
-index 0a5605a..a1379c2 100644
---- a/src/qemu/qemu_driver.c
-+++ b/src/qemu/qemu_driver.c
-@@ -8766,6 +8766,14 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm,
-         virCgroupSetCpusetMems(priv->cgroup, nodeset_str) < 0)
-         goto cleanup;
- 
-+    for (i = 0; i < priv->niothreadpids; i++) {
-+        if (virCgroupNewIOThread(priv->cgroup, i, false, &cgroup_temp) < 0 ||
-+            virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0)
-+            goto cleanup;
-+        virCgroupFree(&cgroup_temp);
-+    }
-+
-+
-     ret = 0;
-  cleanup:
-     VIR_FREE(nodeset_str);
-diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
-index bf1f0de..ed73ae5 100644
---- a/src/qemu/qemu_process.c
-+++ b/src/qemu/qemu_process.c
-@@ -2093,6 +2093,51 @@ qemuProcessDetectVcpuPIDs(virQEMUDriverPtr driver,
- }
- 
- 
-+static int
-+qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver,
-+                              virDomainObjPtr vm,
-+                              int asyncJob)
-+{
-+    qemuDomainObjPrivatePtr priv = vm->privateData;
-+    qemuMonitorIOThreadsInfoPtr *iothreads = NULL;
-+    int niothreads = 0;
-+    int ret = -1;
-+    size_t i;
-+
-+    /* Get the list of IOThreads from qemu */
-+    if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
-+        goto cleanup;
-+    niothreads = qemuMonitorGetIOThreads(priv->mon, &iothreads);
-+    qemuDomainObjExitMonitor(driver, vm);
-+    if (niothreads <= 0)
-+        goto cleanup;
-+
-+    if (niothreads != vm->def->iothreads) {
-+        virReportError(VIR_ERR_INTERNAL_ERROR,
-+                       _("got wrong number of IOThread pids from QEMU monitor. "
-+                         "got %d, wanted %d"),
-+                       niothreads, vm->def->iothreads);
-+        goto cleanup;
-+    }
-+
-+    if (VIR_ALLOC_N(priv->iothreadpids, niothreads) < 0)
-+        goto cleanup;
-+    priv->niothreadpids = niothreads;
-+
-+    for (i = 0; i < priv->niothreadpids; i++)
-+        priv->iothreadpids[i] = iothreads[i]->thread_id;
-+
-+    ret = 0;
-+
-+ cleanup:
-+    if (iothreads) {
-+        for (i = 0; i < niothreads; i++)
-+            qemuMonitorIOThreadsInfoFree(iothreads[i]);
-+        VIR_FREE(iothreads);
-+    }
-+    return ret;
-+}
-+
- /* Helper to prepare cpumap for affinity setting, convert
-  * NUMA nodeset into cpuset if @nodemask is not NULL, otherwise
-  * just return a new allocated bitmap.
-@@ -2285,6 +2330,41 @@ qemuProcessSetEmulatorAffinity(virDomainObjPtr vm)
-     return ret;
- }
- 
-+/* Set CPU affinities for IOThreads threads. */
-+static int
-+qemuProcessSetIOThreadsAffinity(virDomainObjPtr vm)
-+{
-+    qemuDomainObjPrivatePtr priv = vm->privateData;
-+    virDomainDefPtr def = vm->def;
-+    virDomainVcpuPinDefPtr pininfo;
-+    size_t i;
-+    int ret = -1;
-+
-+    if (!def->cputune.niothreadspin)
-+        return 0;
-+
-+    if (priv->iothreadpids == NULL) {
-+        virReportError(VIR_ERR_OPERATION_INVALID,
-+                       "%s", _("IOThread affinity is not supported"));
-+        return -1;
-+    }
-+
-+    for (i = 0; i < def->iothreads; i++) {
-+        /* set affinity only for existing vcpus */
-+        if (!(pininfo = virDomainVcpuPinFindByVcpu(def->cputune.iothreadspin,
-+                                                   def->cputune.niothreadspin,
-+                                                   i+1)))
-+            continue;
-+
-+        if (virProcessSetAffinity(priv->iothreadpids[i], pininfo->cpumask) < 0)
-+            goto cleanup;
-+    }
-+    ret = 0;
-+
-+ cleanup:
-+    return ret;
-+}
-+
- static int
- qemuProcessInitPasswords(virConnectPtr conn,
-                          virQEMUDriverPtr driver,
-@@ -4411,6 +4491,10 @@ int qemuProcessStart(virConnectPtr conn,
-     if (qemuProcessDetectVcpuPIDs(driver, vm, asyncJob) < 0)
-         goto cleanup;
- 
-+    VIR_DEBUG("Detecting IOThread PIDs");
-+    if (qemuProcessDetectIOThreadPIDs(driver, vm, asyncJob) < 0)
-+        goto cleanup;
-+
-     VIR_DEBUG("Setting cgroup for each VCPU (if required)");
-     if (qemuSetupCgroupForVcpu(vm) < 0)
-         goto cleanup;
-@@ -4419,6 +4503,10 @@ int qemuProcessStart(virConnectPtr conn,
-     if (qemuSetupCgroupForEmulator(driver, vm, nodemask) < 0)
-         goto cleanup;
- 
-+    VIR_DEBUG("Setting cgroup for each IOThread (if required)");
-+    if (qemuSetupCgroupForIOThreads(vm) < 0)
-+        goto cleanup;
-+
-     VIR_DEBUG("Setting VCPU affinities");
-     if (qemuProcessSetVcpuAffinities(vm) < 0)
-         goto cleanup;
-@@ -4427,6 +4515,10 @@ int qemuProcessStart(virConnectPtr conn,
-     if (qemuProcessSetEmulatorAffinity(vm) < 0)
-         goto cleanup;
- 
-+    VIR_DEBUG("Setting affinity of IOThread threads");
-+    if (qemuProcessSetIOThreadsAffinity(vm) < 0)
-+        goto cleanup;
-+
-     VIR_DEBUG("Setting any required VM passwords");
-     if (qemuProcessInitPasswords(conn, driver, vm, asyncJob) < 0)
-         goto cleanup;
-@@ -4842,6 +4934,8 @@ void qemuProcessStop(virQEMUDriverPtr driver,
-     virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, reason);
-     VIR_FREE(priv->vcpupids);
-     priv->nvcpupids = 0;
-+    VIR_FREE(priv->iothreadpids);
-+    priv->niothreadpids = 0;
-     virObjectUnref(priv->qemuCaps);
-     priv->qemuCaps = NULL;
-     VIR_FREE(priv->pidfile);
-@@ -5034,6 +5128,10 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
-     if (qemuProcessDetectVcpuPIDs(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
-         goto error;
- 
-+    VIR_DEBUG("Detecting IOThread PIDs");
-+    if (qemuProcessDetectIOThreadPIDs(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
-+        goto error;
-+
-     /* If we have -device, then addresses are assigned explicitly.
-      * If not, then we have to detect dynamic ones here */
-     if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
--- 
-2.1.0
-
diff --git a/SOURCES/libvirt-qemu-Always-re-detect-backing-chain.patch b/SOURCES/libvirt-qemu-Always-re-detect-backing-chain.patch
deleted file mode 100644
index 6cfaa80..0000000
--- a/SOURCES/libvirt-qemu-Always-re-detect-backing-chain.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 03adce7ea2b92a0650652fe9f12279207459a860 Mon Sep 17 00:00:00 2001
-Message-Id: <03adce7ea2b92a0650652fe9f12279207459a860@dist-git>
-From: Peter Krempa 
-Date: Fri, 26 Sep 2014 09:47:01 +0200
-Subject: [PATCH] qemu: Always re-detect backing chain
-
-Since 363e9a68 we track backing chain metadata when creating snapshots
-the right way even for the inactive configuration. As we did not yet
-update other code paths that modify the backing chain (blockpull) the
-newDef backing chain gets out of sync.
-
-After stopping of a VM the new definition gets copied to the next start
-one. The new VM then has incorrect backing chain info. This patch
-switches the backing chain detector to always purge the existing backing
-chain and forces re-detection to avoid this issue until we'll have full
-backing chain tracking support.
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1144922
-(cherry picked from commit fe7ef7b112b3b4d6f9c9edf499a79683fb0b7edb)
-
-Signed-off-by: Jiri Denemark 
----
- src/qemu/qemu_domain.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
-index ac70f62..72d7279 100644
---- a/src/qemu/qemu_domain.c
-+++ b/src/qemu/qemu_domain.c
-@@ -2544,7 +2544,7 @@ qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
-             virFileExists(path))
-             continue;
- 
--        if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) >= 0)
-+        if (qemuDomainDetermineDiskChain(driver, vm, disk, true, true) >= 0)
-             continue;
- 
-         if (disk->startupPolicy &&
--- 
-2.1.1
-
diff --git a/SOURCES/libvirt-qemu-Always-set-migration-capabilities.patch b/SOURCES/libvirt-qemu-Always-set-migration-capabilities.patch
deleted file mode 100644
index 18c0810..0000000
--- a/SOURCES/libvirt-qemu-Always-set-migration-capabilities.patch
+++ /dev/null
@@ -1,254 +0,0 @@
-From 73d70735326d8577eadfbc97d9cf2217da3d8e69 Mon Sep 17 00:00:00 2001
-Message-Id: <73d70735326d8577eadfbc97d9cf2217da3d8e69@dist-git>
-From: Jiri Denemark 
-Date: Mon, 10 Nov 2014 14:46:26 +0100
-Subject: [PATCH] qemu: Always set migration capabilities
-
-We used to set migration capabilities only when a user asked for them in
-flags. This is fine when migration succeeds since the QEMU process is
-killed in the end but in case migration fails or if it's cancelled, some
-capabilities may remain turned on with no way to turn them off. To fix
-that, migration capabilities have to be turned on if requested but
-explicitly turned off in case they were not requested but QEMU supports
-them.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1163953
-Signed-off-by: Jiri Denemark 
-(cherry picked from commit ab393383c84eb049fc2d75c3e79249ca58062887)
-Signed-off-by: Jiri Denemark 
----
- src/qemu/qemu_migration.c    | 42 +++++++++++++++++++++++++++++-------------
- src/qemu/qemu_monitor.c      |  5 +++--
- src/qemu/qemu_monitor.h      |  3 ++-
- src/qemu/qemu_monitor_json.c |  5 +++--
- src/qemu/qemu_monitor_json.h |  3 ++-
- tests/qemumonitorjsontest.c  |  3 ++-
- 6 files changed, 41 insertions(+), 20 deletions(-)
-
-diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
-index d6c8553..7745d77 100644
---- a/src/qemu/qemu_migration.c
-+++ b/src/qemu/qemu_migration.c
-@@ -1805,6 +1805,7 @@ qemuMigrationSetOffline(virQEMUDriverPtr driver,
- static int
- qemuMigrationSetCompression(virQEMUDriverPtr driver,
-                             virDomainObjPtr vm,
-+                            bool state,
-                             qemuDomainAsyncJob job)
- {
-     qemuDomainObjPrivatePtr priv = vm->privateData;
-@@ -1819,6 +1820,9 @@ qemuMigrationSetCompression(virQEMUDriverPtr driver,
- 
-     if (ret < 0) {
-         goto cleanup;
-+    } else if (ret == 0 && !state) {
-+        /* Unsupported but we want it off anyway */
-+        goto cleanup;
-     } else if (ret == 0) {
-         if (job == QEMU_ASYNC_JOB_MIGRATION_IN) {
-             virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
-@@ -1835,7 +1839,8 @@ qemuMigrationSetCompression(virQEMUDriverPtr driver,
- 
-     ret = qemuMonitorSetMigrationCapability(
-                 priv->mon,
--                QEMU_MONITOR_MIGRATION_CAPS_XBZRLE);
-+                QEMU_MONITOR_MIGRATION_CAPS_XBZRLE,
-+                state);
- 
-  cleanup:
-     qemuDomainObjExitMonitor(driver, vm);
-@@ -1845,6 +1850,7 @@ qemuMigrationSetCompression(virQEMUDriverPtr driver,
- static int
- qemuMigrationSetAutoConverge(virQEMUDriverPtr driver,
-                              virDomainObjPtr vm,
-+                             bool state,
-                              qemuDomainAsyncJob job)
- {
-     qemuDomainObjPrivatePtr priv = vm->privateData;
-@@ -1859,6 +1865,9 @@ qemuMigrationSetAutoConverge(virQEMUDriverPtr driver,
- 
-     if (ret < 0) {
-         goto cleanup;
-+    } else if (ret == 0 && !state) {
-+        /* Unsupported but we want it off anyway */
-+        goto cleanup;
-     } else if (ret == 0) {
-         virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
-                        _("Auto-Converge is not supported by "
-@@ -1869,7 +1878,8 @@ qemuMigrationSetAutoConverge(virQEMUDriverPtr driver,
- 
-     ret = qemuMonitorSetMigrationCapability(
-                 priv->mon,
--                QEMU_MONITOR_MIGRATION_CAPS_AUTO_CONVERGE);
-+                QEMU_MONITOR_MIGRATION_CAPS_AUTO_CONVERGE,
-+                state);
- 
-  cleanup:
-     qemuDomainObjExitMonitor(driver, vm);
-@@ -1880,6 +1890,7 @@ qemuMigrationSetAutoConverge(virQEMUDriverPtr driver,
- static int
- qemuMigrationSetPinAll(virQEMUDriverPtr driver,
-                        virDomainObjPtr vm,
-+                       bool state,
-                        qemuDomainAsyncJob job)
- {
-     qemuDomainObjPrivatePtr priv = vm->privateData;
-@@ -1894,6 +1905,9 @@ qemuMigrationSetPinAll(virQEMUDriverPtr driver,
- 
-     if (ret < 0) {
-         goto cleanup;
-+    } else if (ret == 0 && !state) {
-+        /* Unsupported but we want it off anyway */
-+        goto cleanup;
-     } else if (ret == 0) {
-         if (job == QEMU_ASYNC_JOB_MIGRATION_IN) {
-             virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
-@@ -1910,7 +1924,8 @@ qemuMigrationSetPinAll(virQEMUDriverPtr driver,
- 
-     ret = qemuMonitorSetMigrationCapability(
-                 priv->mon,
--                QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL);
-+                QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL,
-+                state);
- 
-  cleanup:
-     qemuDomainObjExitMonitor(driver, vm);
-@@ -2745,8 +2760,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
-         dataFD[1] = -1; /* 'st' owns the FD now & will close it */
-     }
- 
--    if (flags & VIR_MIGRATE_COMPRESSED &&
--        qemuMigrationSetCompression(driver, vm,
-+    if (qemuMigrationSetCompression(driver, vm,
-+                                    flags & VIR_MIGRATE_COMPRESSED,
-                                     QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
-         goto stop;
- 
-@@ -2755,8 +2770,9 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
-         goto stop;
-     }
- 
--    if (flags & VIR_MIGRATE_RDMA_PIN_ALL &&
--        qemuMigrationSetPinAll(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
-+    if (qemuMigrationSetPinAll(driver, vm,
-+                               flags & VIR_MIGRATE_RDMA_PIN_ALL,
-+                               QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
-         goto stop;
- 
-     if (mig->lockState) {
-@@ -3573,18 +3589,18 @@ qemuMigrationRun(virQEMUDriverPtr driver,
-             goto cleanup;
-     }
- 
--    if (flags & VIR_MIGRATE_COMPRESSED &&
--        qemuMigrationSetCompression(driver, vm,
-+    if (qemuMigrationSetCompression(driver, vm,
-+                                    flags & VIR_MIGRATE_COMPRESSED,
-                                     QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
-         goto cleanup;
- 
--    if (flags & VIR_MIGRATE_AUTO_CONVERGE &&
--        qemuMigrationSetAutoConverge(driver, vm,
-+    if (qemuMigrationSetAutoConverge(driver, vm,
-+                                     flags & VIR_MIGRATE_AUTO_CONVERGE,
-                                      QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
-         goto cleanup;
- 
--    if (flags & VIR_MIGRATE_RDMA_PIN_ALL &&
--        qemuMigrationSetPinAll(driver, vm,
-+    if (qemuMigrationSetPinAll(driver, vm,
-+                               flags & VIR_MIGRATE_RDMA_PIN_ALL,
-                                QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
-         goto cleanup;
- 
-diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
-index b516880..d2f0b46 100644
---- a/src/qemu/qemu_monitor.c
-+++ b/src/qemu/qemu_monitor.c
-@@ -3907,7 +3907,8 @@ int qemuMonitorGetMigrationCapability(qemuMonitorPtr mon,
- }
- 
- int qemuMonitorSetMigrationCapability(qemuMonitorPtr mon,
--                                      qemuMonitorMigrationCaps capability)
-+                                      qemuMonitorMigrationCaps capability,
-+                                      bool state)
- {
-     VIR_DEBUG("mon=%p capability=%d", mon, capability);
- 
-@@ -3923,7 +3924,7 @@ int qemuMonitorSetMigrationCapability(qemuMonitorPtr mon,
-         return -1;
-     }
- 
--    return qemuMonitorJSONSetMigrationCapability(mon, capability);
-+    return qemuMonitorJSONSetMigrationCapability(mon, capability, state);
- }
- 
- int qemuMonitorNBDServerStart(qemuMonitorPtr mon,
-diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
-index 69f41bf..70bb608 100644
---- a/src/qemu/qemu_monitor.h
-+++ b/src/qemu/qemu_monitor.h
-@@ -506,7 +506,8 @@ int qemuMonitorGetMigrationCapabilities(qemuMonitorPtr mon,
- int qemuMonitorGetMigrationCapability(qemuMonitorPtr mon,
-                                       qemuMonitorMigrationCaps capability);
- int qemuMonitorSetMigrationCapability(qemuMonitorPtr mon,
--                                      qemuMonitorMigrationCaps capability);
-+                                      qemuMonitorMigrationCaps capability,
-+                                      bool state);
- 
- typedef enum {
-   QEMU_MONITOR_MIGRATE_BACKGROUND	= 1 << 0,
-diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
-index 4fb1d81..f1f65ea 100644
---- a/src/qemu/qemu_monitor_json.c
-+++ b/src/qemu/qemu_monitor_json.c
-@@ -5731,7 +5731,8 @@ qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
- 
- int
- qemuMonitorJSONSetMigrationCapability(qemuMonitorPtr mon,
--                                      qemuMonitorMigrationCaps capability)
-+                                      qemuMonitorMigrationCaps capability,
-+                                      bool state)
- {
-     int ret = -1;
- 
-@@ -5751,7 +5752,7 @@ qemuMonitorJSONSetMigrationCapability(qemuMonitorPtr mon,
-                 qemuMonitorMigrationCapsTypeToString(capability)) < 0)
-         goto cleanup;
- 
--    if (virJSONValueObjectAppendBoolean(cap, "state", 1) < 0)
-+    if (virJSONValueObjectAppendBoolean(cap, "state", state) < 0)
-         goto cleanup;
- 
-     if (virJSONValueArrayAppend(caps, cap) < 0)
-diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
-index 8d88c6d..97397fe 100644
---- a/src/qemu/qemu_monitor_json.h
-+++ b/src/qemu/qemu_monitor_json.h
-@@ -142,7 +142,8 @@ int qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
- int qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
-                                           qemuMonitorMigrationCaps capability);
- int qemuMonitorJSONSetMigrationCapability(qemuMonitorPtr mon,
--                                          qemuMonitorMigrationCaps capability);
-+                                          qemuMonitorMigrationCaps capability,
-+                                          bool state);
- 
- int qemuMonitorJSONMigrate(qemuMonitorPtr mon,
-                            unsigned int flags,
-diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
-index d53ab05..f7b7ea5 100644
---- a/tests/qemumonitorjsontest.c
-+++ b/tests/qemumonitorjsontest.c
-@@ -1939,7 +1939,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapability(const void *data)
-     }
- 
-     if (qemuMonitorJSONSetMigrationCapability(qemuMonitorTestGetMonitor(test),
--                                              QEMU_MONITOR_MIGRATION_CAPS_XBZRLE) < 0)
-+                                              QEMU_MONITOR_MIGRATION_CAPS_XBZRLE,
-+                                              true) < 0)
-         goto cleanup;
- 
-     ret = 0;
--- 
-2.1.3
-
diff --git a/SOURCES/libvirt-qemu-Always-update-migration-times-on-destination.patch b/SOURCES/libvirt-qemu-Always-update-migration-times-on-destination.patch
new file mode 100644
index 0000000..e32a06e
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Always-update-migration-times-on-destination.patch
@@ -0,0 +1,43 @@
+From 779b0c17407ca656c666a0eb6f66d6210bf65eca Mon Sep 17 00:00:00 2001
+Message-Id: <779b0c17407ca656c666a0eb6f66d6210bf65eca@dist-git>
+From: Jiri Denemark 
+Date: Thu, 1 Oct 2015 21:39:35 +0200
+Subject: [PATCH] qemu: Always update migration times on destination
+
+Even if we are migrating a domain with VIR_MIGRATE_PAUSED flag set, we
+should still update the total time of the migration. Updating downtime
+doesn't hurt either, even though we don't actually start guest CPUs.
+
+Signed-off-by: Jiri Denemark 
+(cherry picked from commit d27c66dbaae33d9b463eab8a8a2b0ad8cebff06a)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1265902
+
+Signed-off-by: Jiri Denemark 
+---
+ src/qemu/qemu_migration.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
+index cb82687..759fd21 100644
+--- a/src/qemu/qemu_migration.c
++++ b/src/qemu/qemu_migration.c
+@@ -5735,10 +5735,11 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
+                 }
+                 goto endjob;
+             }
+-            if (priv->job.completed) {
+-                qemuDomainJobInfoUpdateTime(priv->job.completed);
+-                qemuDomainJobInfoUpdateDowntime(priv->job.completed);
+-            }
++        }
++
++        if (priv->job.completed) {
++            qemuDomainJobInfoUpdateTime(priv->job.completed);
++            qemuDomainJobInfoUpdateDowntime(priv->job.completed);
+         }
+ 
+         dom = virGetDomain(dconn, vm->def->name, vm->def->uuid);
+-- 
+2.6.1
+
diff --git a/SOURCES/libvirt-qemu-Auto-assign-pci-addresses-for-shared-memory-devices.patch b/SOURCES/libvirt-qemu-Auto-assign-pci-addresses-for-shared-memory-devices.patch
new file mode 100644
index 0000000..9bb773d
--- /dev/null
+++ b/SOURCES/libvirt-qemu-Auto-assign-pci-addresses-for-shared-memory-devices.patch
@@ -0,0 +1,94 @@
+From 1298c305b6e4dcb364e8944a60bf2f698eb601ca Mon Sep 17 00:00:00 2001
+Message-Id: <1298c305b6e4dcb364e8944a60bf2f698eb601ca@dist-git>
+From: Luyao Huang 
+Date: Thu, 6 Aug 2015 13:09:12 +0200
+Subject: [PATCH] qemu: Auto assign pci addresses for shared memory devices
+
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1165029
+
+Signed-off-by: Luyao Huang 
+(cherry picked from commit e309ea66580798860154c70f275c56236702c7dc)
+Signed-off-by: Martin Kletzander 
+Signed-off-by: Jiri Denemark 
+---
+ src/qemu/qemu_command.c                        | 11 +++++++++++
+ tests/qemuxml2argvdata/qemuxml2argv-shmem.args | 19 +++++++++++--------
+ tests/qemuxml2argvdata/qemuxml2argv-shmem.xml  |  1 +
+ 3 files changed, 23 insertions(+), 8 deletions(-)
+
+diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
+index feba308..1e5e244 100644
+--- a/src/qemu/qemu_command.c
++++ b/src/qemu/qemu_command.c
+@@ -2562,6 +2562,7 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
+                                                flags) < 0)
+             goto error;
+     }
++
+     /* Further non-primary video cards which have to be qxl type */
+     for (i = 1; i < def->nvideos; i++) {
+         if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
+@@ -2575,6 +2576,16 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
+                                                flags) < 0)
+             goto error;
+     }
++
++    /* Shared Memory */
++    for (i = 0; i < def->nshmems; i++) {
++        if (def->shmems[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
++            continue;
++
++        if (virDomainPCIAddressReserveNextSlot(addrs,
++                                               &def->shmems[i]->info, flags) < 0)
++            goto error;
++    }
+     for (i = 0; i < def->ninputs; i++) {
+         /* Nada - none are PCI based (yet) */
+     }
+diff --git a/tests/qemuxml2argvdata/qemuxml2argv-shmem.args b/tests/qemuxml2argvdata/qemuxml2argv-shmem.args
+index a3d3cc8..7e10fc4 100644
+--- a/tests/qemuxml2argvdata/qemuxml2argv-shmem.args
++++ b/tests/qemuxml2argvdata/qemuxml2argv-shmem.args
+@@ -1,16 +1,19 @@
+ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+ /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults \
+ -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
+--device ivshmem,shm=shmem0 \
+--device ivshmem,size=128m,shm=shmem1 \
+--device ivshmem,size=256m,shm=shmem2 \
+--device ivshmem,size=512m,chardev=charshmem3 \
++-device ivshmem,shm=shmem0,bus=pci.0,addr=0x3 \
++-device ivshmem,size=128m,shm=shmem1,bus=pci.0,addr=0x5 \
++-device ivshmem,size=256m,shm=shmem2,bus=pci.0,addr=0x4 \
++-device ivshmem,size=512m,chardev=charshmem3,bus=pci.0,addr=0x6 \
+ -chardev socket,id=charshmem3,path=/var/lib/libvirt/shmem-shmem3-sock \
+--device ivshmem,size=1024m,chardev=charshmem4 \
++-device ivshmem,size=1024m,chardev=charshmem4,bus=pci.0,addr=0x7 \
+ -chardev socket,id=charshmem4,path=/tmp/shmem4-sock \
+--device ivshmem,size=2048m,chardev=charshmem5,msi=on,ioeventfd=off \
++-device ivshmem,size=2048m,chardev=charshmem5,\
++msi=on,ioeventfd=off,bus=pci.0,addr=0x8 \
+ -chardev socket,id=charshmem5,path=/tmp/shmem5-sock \
+--device ivshmem,size=4096m,chardev=charshmem6,msi=on,vectors=16 \
++-device ivshmem,size=4096m,chardev=charshmem6,\
++msi=on,vectors=16,bus=pci.0,addr=0x9 \
+ -chardev socket,id=charshmem6,path=/tmp/shmem6-sock \
+--device ivshmem,size=8192m,chardev=charshmem7,msi=on,vectors=32,ioeventfd=on \
++-device ivshmem,size=8192m,chardev=charshmem7,\
++msi=on,vectors=32,ioeventfd=on,bus=pci.0,addr=0xa \
+ -chardev socket,id=charshmem7,path=/tmp/shmem7-sock
+diff --git a/tests/qemuxml2argvdata/qemuxml2argv-shmem.xml b/tests/qemuxml2argvdata/qemuxml2argv-shmem.xml
+index fd79c89..d4b38f9 100644
+--- a/tests/qemuxml2argvdata/qemuxml2argv-shmem.xml
++++ b/tests/qemuxml2argvdata/qemuxml2argv-shmem.xml
+@@ -23,6 +23,7 @@
+     
+     
+       256
++      
+ + + 512 +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Automatically-create-NVRAM-store.patch b/SOURCES/libvirt-qemu-Automatically-create-NVRAM-store.patch deleted file mode 100644 index 9f85647..0000000 --- a/SOURCES/libvirt-qemu-Automatically-create-NVRAM-store.patch +++ /dev/null @@ -1,566 +0,0 @@ -From 2f7b1149c58002de91314c409df97723226db6e2 Mon Sep 17 00:00:00 2001 -Message-Id: <2f7b1149c58002de91314c409df97723226db6e2@dist-git> -From: Michal Privoznik -Date: Wed, 10 Sep 2014 10:11:45 +0200 -Subject: [PATCH] qemu: Automatically create NVRAM store - -https://bugzilla.redhat.com/show_bug.cgi?id=1112257 - -When using split UEFI image, it may come handy if libvirt manages per -domain _VARS file automatically. While the _CODE file is RO and can be -shared among multiple domains, you certainly don't want to do that on -the _VARS file. This latter one needs to be per domain. So at the -domain startup process, if it's determined that domain needs _VARS -file it's copied from this master _VARS file. The location of the -master file is configurable in qemu.conf. - -Temporary, on per domain basis the location of master NVRAM file can -be overridden by this @template attribute I'm inventing to the - element. All it does is holding path to the master NVRAM file -from which local copy is created. If that's the case, the map in -qemu.conf is not consulted. - -Signed-off-by: Michal Privoznik -Acked-by: Laszlo Ersek -(cherry picked from commit 742b08e30fd503bc992e864828cbabd7e6a099ec) -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 11 +- - docs/schemas/domaincommon.rng | 9 +- - libvirt.spec.in | 2 + - src/Makefile.am | 1 + - src/conf/domain_conf.c | 11 +- - src/conf/domain_conf.h | 1 + - src/qemu/libvirtd_qemu.aug | 3 + - src/qemu/qemu.conf | 14 +++ - src/qemu/qemu_conf.c | 94 ++++++++++++++ - src/qemu/qemu_conf.h | 5 + - src/qemu/qemu_process.c | 137 +++++++++++++++++++++ - src/qemu/test_libvirtd_qemu.aug.in | 3 + - tests/domainschemadata/domain-bios-nvram-empty.xml | 40 ++++++ - 13 files changed, 325 insertions(+), 6 deletions(-) - create mode 100644 tests/domainschemadata/domain-bios-nvram-empty.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 757035a..a2ea758 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -103,7 +103,7 @@ - <os> - <type>hvm</type> - <loader readonly='on' type='rom'>/usr/lib/xen/boot/hvmloader</loader> -- <nvram>/var/lib/libvirt/nvram/guest_VARS.fd</nvram> -+ <nvram template='/usr/share/OVMF/OVMF_VARS.fd'>/var/lib/libvirt/nvram/guest_VARS.fd</nvram> - <boot dev='hd'/> - <boot dev='cdrom'/> - <bootmenu enable='yes' timeout='3000'/> -@@ -142,9 +142,12 @@ - pflash. -
nvram
-
Some UEFI firmwares may want to use a non-volatile memory to store -- some variables. In the host, this is represented as a file and the -- path to the file is stored in this element. Since -- 1.2.8
-+ some variables. In the host, this is represented as a file and the path -+ to the file is stored in this element. Moreover, when the domain is -+ started up libvirt copies so called master NVRAM store file defined -+ in qemu.conf. If needed, the template -+ attribute can be used to per domain override map of master NVRAM stores -+ from the config file. Since 1.2.8 -
boot
-
The dev attribute takes one of the values "fd", "hd", - "cdrom" or "network" and is used to specify the next boot device -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 5d9c21c..6ae940a 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -263,7 +263,14 @@ - - - -- -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/Makefile.am b/src/Makefile.am -index 46e411e..fa741a8 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -2679,6 +2679,7 @@ endif WITH_SANLOCK - if WITH_QEMU - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu/channel/target" -+ $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu/nvram" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu" -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 6ee5c17..84f5f1d 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -2023,6 +2023,7 @@ virDomainLoaderDefFree(virDomainLoaderDefPtr loader) - - VIR_FREE(loader->path); - VIR_FREE(loader->nvram); -+ VIR_FREE(loader->templt); - VIR_FREE(loader); - } - -@@ -12768,6 +12769,7 @@ virDomainDefParseXML(xmlDocPtr xml, - goto error; - - def->os.loader->nvram = virXPathString("string(./os/nvram[1])", ctxt); -+ def->os.loader->templt = virXPathString("string(./os/nvram[1]/@template)", ctxt); - } - } - -@@ -17866,7 +17868,14 @@ virDomainLoaderDefFormat(virBufferPtr buf, - virBufferAsprintf(buf, " type='%s'>", type); - - virBufferEscapeString(buf, "%s\n", loader->path); -- virBufferEscapeString(buf, "%s\n", loader->nvram); -+ if (loader->nvram || loader->templt) { -+ virBufferAddLit(buf, "templt); -+ if (loader->nvram) -+ virBufferEscapeString(buf, ">%s\n", loader->nvram); -+ else -+ virBufferAddLit(buf, "/>\n"); -+ } - } - - static bool -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index c97a10c..3316fb6 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -1644,6 +1644,7 @@ struct _virDomainLoaderDef { - int readonly; /* enum virTristateBool */ - virDomainLoader type; - char *nvram; /* path to non-volatile RAM */ -+ char *templt; /* user override of path to master nvram */ - }; - - void virDomainLoaderDefFree(virDomainLoaderDefPtr loader); -diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug -index e7db7fe..62951da 100644 ---- a/src/qemu/libvirtd_qemu.aug -+++ b/src/qemu/libvirtd_qemu.aug -@@ -88,6 +88,8 @@ module Libvirtd_qemu = - - let log_entry = bool_entry "log_timestamp" - -+ let nvram_entry = str_array_entry "nvram" -+ - (* Each entry in the config is one of the following ... *) - let entry = vnc_entry - | spice_entry -@@ -100,6 +102,7 @@ module Libvirtd_qemu = - | rpc_entry - | network_entry - | log_entry -+ | nvram_entry - - let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ] - let empty = [ label "#empty" . eol ] -diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf -index 7bbbe09..79bba36 100644 ---- a/src/qemu/qemu.conf -+++ b/src/qemu/qemu.conf -@@ -487,3 +487,17 @@ - # Defaults to 1. - # - #log_timestamp = 0 -+ -+ -+# Location of master nvram file -+# -+# When a domain is configured to use UEFI instead of standard -+# BIOS it may use a separate storage for UEFI variables. If -+# that's the case libvirt creates the variable store per domain -+# using this master file as image. Each UEFI firmware can, -+# however, have different variables store. Therefore the nvram is -+# a list of strings when a single item is in form of: -+# ${PATH_TO_UEFI_FW}:${PATH_TO_UEFI_VARS}. -+# Later, when libvirt creates per domain variable store, this -+# list is searched for the master image. -+#nvram = [ "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd" ] -diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c -index e2ec54f..ac10b64 100644 ---- a/src/qemu/qemu_conf.c -+++ b/src/qemu/qemu_conf.c -@@ -107,6 +107,9 @@ void qemuDomainCmdlineDefFree(qemuDomainCmdlineDefPtr def) - VIR_FREE(def); - } - -+#define VIR_QEMU_LOADER_FILE_PATH "/usr/share/OVMF/OVMF_CODE.fd" -+#define VIR_QEMU_NVRAM_FILE_PATH "/usr/share/OVMF/OVMF_VARS.fd" -+ - virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged) - { - virQEMUDriverConfigPtr cfg; -@@ -255,6 +258,15 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged) - - cfg->logTimestamp = true; - -+ if (VIR_ALLOC_N(cfg->loader, 1) < 0 || -+ VIR_ALLOC_N(cfg->nvram, 1) < 0) -+ goto error; -+ cfg->nloader = 1; -+ -+ if (VIR_STRDUP(cfg->loader[0], VIR_QEMU_LOADER_FILE_PATH) < 0 || -+ VIR_STRDUP(cfg->nvram[0], VIR_QEMU_NVRAM_FILE_PATH) < 0) -+ goto error; -+ - return cfg; - - error: -@@ -305,6 +317,14 @@ static void virQEMUDriverConfigDispose(void *obj) - virStringFreeList(cfg->securityDriverNames); - - VIR_FREE(cfg->lockManagerName); -+ -+ while (cfg->nloader) { -+ VIR_FREE(cfg->loader[cfg->nloader - 1]); -+ VIR_FREE(cfg->nvram[cfg->nloader - 1]); -+ cfg->nloader--; -+ } -+ VIR_FREE(cfg->loader); -+ VIR_FREE(cfg->nvram); - } - - -@@ -328,6 +348,43 @@ virQEMUDriverConfigHugeTLBFSInit(virHugeTLBFSPtr hugetlbfs, - } - - -+static int -+virQEMUDriverConfigNVRAMParse(const char *str, -+ char **loader, -+ char **nvram) -+{ -+ int ret = -1; -+ char **token; -+ -+ if (!(token = virStringSplit(str, ":", 0))) -+ goto cleanup; -+ -+ if (token[0]) { -+ virSkipSpaces((const char **) &token[0]); -+ if (token[1]) -+ virSkipSpaces((const char **) &token[1]); -+ } -+ -+ /* Exactly two tokens are expected */ -+ if (!token[0] || !token[1] || token[2] || -+ STREQ(token[0], "") || STREQ(token[1], "")) { -+ virReportError(VIR_ERR_CONF_SYNTAX, -+ _("Invalid nvram format: '%s'"), -+ str); -+ goto cleanup; -+ } -+ -+ if (VIR_STRDUP(*loader, token[0]) < 0 || -+ VIR_STRDUP(*nvram, token[1]) < 0) -+ goto cleanup; -+ -+ ret = 0; -+ cleanup: -+ virStringFreeList(token); -+ return ret; -+} -+ -+ - int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg, - const char *filename) - { -@@ -654,6 +711,43 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg, - - GET_VALUE_BOOL("log_timestamp", cfg->logTimestamp); - -+ if ((p = virConfGetValue(conf, "nvram"))) { -+ size_t len; -+ virConfValuePtr pp; -+ -+ CHECK_TYPE("nvram", VIR_CONF_LIST); -+ -+ while (cfg->nloader) { -+ VIR_FREE(cfg->loader[cfg->nloader - 1]); -+ VIR_FREE(cfg->nvram[cfg->nloader - 1]); -+ cfg->nloader--; -+ } -+ VIR_FREE(cfg->loader); -+ VIR_FREE(cfg->nvram); -+ -+ /* Calc length and check items */ -+ for (len = 0, pp = p->list; pp; len++, pp = pp->next) { -+ if (pp->type != VIR_CONF_STRING) { -+ virReportError(VIR_ERR_CONF_SYNTAX, "%s", -+ _("nvram must be a list of strings")); -+ goto cleanup; -+ } -+ } -+ -+ if (len && -+ (VIR_ALLOC_N(cfg->loader, len) < 0 || -+ VIR_ALLOC_N(cfg->nvram, len) < 0)) -+ goto cleanup; -+ cfg->nloader = len; -+ -+ for (i = 0, pp = p->list; pp; i++, pp = pp->next) { -+ if (virQEMUDriverConfigNVRAMParse(pp->str, -+ &cfg->loader[i], -+ &cfg->nvram[i]) < 0) -+ goto cleanup; -+ } -+ } -+ - ret = 0; - - cleanup: -diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h -index ae7ac56..1f521e5 100644 ---- a/src/qemu/qemu_conf.h -+++ b/src/qemu/qemu_conf.h -@@ -172,6 +172,11 @@ struct _virQEMUDriverConfig { - int migrationPortMax; - - bool logTimestamp; -+ -+ /* Pairs of loader:nvram paths. The list is @nloader items long */ -+ char **loader; -+ char **nvram; -+ size_t nloader; - }; - - /* Main driver state */ -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 0f269b9..d7f6bdf 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -67,6 +67,7 @@ - #include "virstring.h" - #include "virhostdev.h" - #include "storage/storage_driver.h" -+#include "configmake.h" - - #define VIR_FROM_THIS VIR_FROM_QEMU - -@@ -3741,6 +3742,135 @@ qemuProcessVerifyGuestCPU(virQEMUDriverPtr driver, - } - - -+static int -+qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg, -+ virDomainDefPtr def, -+ bool migrated) -+{ -+ int ret = -1; -+ int srcFD = -1; -+ int dstFD = -1; -+ virDomainLoaderDefPtr loader = def->os.loader; -+ bool generated = false; -+ bool created = false; -+ -+ /* Unless domain has RO loader of pflash type, we have -+ * nothing to do here. If the loader is RW then it's not -+ * using split code and vars feature, so no nvram file needs -+ * to be created. */ -+ if (!loader || loader->type != VIR_DOMAIN_LOADER_TYPE_PFLASH || -+ loader->readonly != VIR_TRISTATE_SWITCH_ON) -+ return 0; -+ -+ /* If the nvram path is configured already, there's nothing -+ * we need to do. Unless we are starting the destination side -+ * of migration in which case nvram is configured in the -+ * domain XML but the file doesn't exist yet. Moreover, after -+ * the migration is completed, qemu will invoke a -+ * synchronization write into the nvram file so we don't have -+ * to take care about transmitting the real data on the other -+ * side. */ -+ if (loader->nvram && !migrated) -+ return 0; -+ -+ /* Autogenerate nvram path if needed.*/ -+ if (!loader->nvram) { -+ if (virAsprintf(&loader->nvram, -+ "%s/lib/libvirt/qemu/nvram/%s_VARS.fd", -+ LOCALSTATEDIR, def->name) < 0) -+ goto cleanup; -+ -+ generated = true; -+ } -+ -+ if (!virFileExists(loader->nvram)) { -+ const char *master_nvram_path = loader->templt; -+ ssize_t r; -+ -+ if (!loader->templt) { -+ size_t i; -+ for (i = 0; i < cfg->nloader; i++) { -+ if (STREQ(cfg->loader[i], loader->path)) { -+ master_nvram_path = cfg->nvram[i]; -+ break; -+ } -+ } -+ } -+ -+ if (!master_nvram_path) { -+ virReportError(VIR_ERR_OPERATION_FAILED, -+ _("unable to find any master var store for " -+ "loader: %s"), loader->path); -+ goto cleanup; -+ } -+ -+ if ((srcFD = virFileOpenAs(master_nvram_path, O_RDONLY, -+ 0, -1, -1, 0)) < 0) { -+ virReportSystemError(-srcFD, -+ _("Failed to open file '%s'"), -+ master_nvram_path); -+ goto cleanup; -+ } -+ if ((dstFD = virFileOpenAs(loader->nvram, -+ O_WRONLY | O_CREAT | O_EXCL, -+ S_IRUSR | S_IWUSR, -+ cfg->user, cfg->group, 0)) < 0) { -+ virReportSystemError(-dstFD, -+ _("Failed to create file '%s'"), -+ loader->nvram); -+ goto cleanup; -+ } -+ created = true; -+ -+ do { -+ char buf[1024]; -+ -+ if ((r = saferead(srcFD, buf, sizeof(buf))) < 0) { -+ virReportSystemError(errno, -+ _("Unable to read from file '%s'"), -+ master_nvram_path); -+ goto cleanup; -+ } -+ -+ if (safewrite(dstFD, buf, r) < 0) { -+ virReportSystemError(errno, -+ _("Unable to write to file '%s'"), -+ loader->nvram); -+ goto cleanup; -+ } -+ } while (r); -+ -+ if (VIR_CLOSE(srcFD) < 0) { -+ virReportSystemError(errno, -+ _("Unable to close file '%s'"), -+ master_nvram_path); -+ goto cleanup; -+ } -+ if (VIR_CLOSE(dstFD) < 0) { -+ virReportSystemError(errno, -+ _("Unable to close file '%s'"), -+ loader->nvram); -+ goto cleanup; -+ } -+ } -+ -+ ret = 0; -+ cleanup: -+ /* We successfully generated the nvram path, but failed to -+ * copy the file content. Roll back. */ -+ if (ret < 0) { -+ if (created) -+ unlink(loader->nvram); -+ if (generated) -+ VIR_FREE(loader->nvram); -+ } -+ -+ VIR_FORCE_CLOSE(srcFD); -+ VIR_FORCE_CLOSE(dstFD); -+ return ret; -+} -+ -+ - int qemuProcessStart(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, -@@ -3809,6 +3939,13 @@ int qemuProcessStart(virConnectPtr conn, - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; - -+ /* Some things, paths, ... are generated here and we want them to persist. -+ * Fill them in prior to setting the domain def as transient. */ -+ VIR_DEBUG("Generating paths"); -+ -+ if (qemuPrepareNVRAM(cfg, vm->def, migrateFrom) < 0) -+ goto cleanup; -+ - /* Do this upfront, so any part of the startup process can add - * runtime state to vm->def that won't be persisted. This let's us - * report implicit runtime defaults in the XML, like vnc listen/socket -diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in -index 7796acc..d2bc2c0 100644 ---- a/src/qemu/test_libvirtd_qemu.aug.in -+++ b/src/qemu/test_libvirtd_qemu.aug.in -@@ -74,3 +74,6 @@ module Test_libvirtd_qemu = - { "migration_port_min" = "49152" } - { "migration_port_max" = "49215" } - { "log_timestamp" = "0" } -+{ "nvram" -+ { "1" = "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd" } -+} -diff --git a/tests/domainschemadata/domain-bios-nvram-empty.xml b/tests/domainschemadata/domain-bios-nvram-empty.xml -new file mode 100644 -index 0000000..e7643f3 ---- /dev/null -+++ b/tests/domainschemadata/domain-bios-nvram-empty.xml -@@ -0,0 +1,40 @@ -+ -+ test-bios -+ 362d1fc1-df7d-193e-5c18-49a71bd1da66 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ /usr/share/OVMF/OVMF_CODE.fd -+ -+ -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ restart -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Avoid-incrementing-jobs_queued-if-virTimeMillisNow-fails.patch b/SOURCES/libvirt-qemu-Avoid-incrementing-jobs_queued-if-virTimeMillisNow-fails.patch deleted file mode 100644 index d30f06f..0000000 --- a/SOURCES/libvirt-qemu-Avoid-incrementing-jobs_queued-if-virTimeMillisNow-fails.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 44f6d2dbebe8d8e3dc95465d0e90cb8c30e0cdb8 Mon Sep 17 00:00:00 2001 -Message-Id: <44f6d2dbebe8d8e3dc95465d0e90cb8c30e0cdb8@dist-git> -From: Jiri Denemark -Date: Tue, 9 Sep 2014 09:17:58 +0200 -Subject: [PATCH] qemu: Avoid incrementing jobs_queued if virTimeMillisNow - fails - -Signed-off-by: Jiri Denemark -(cherry picked from commit 4365247677fb835edd00e791a9ed13788b812bfa) - -https://bugzilla.redhat.com/show_bug.cgi?id=1063724 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 7b54306..8c94e27 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -1222,13 +1222,12 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, - qemuDomainAsyncJobTypeToString(priv->job.asyncJob), - obj, obj->def->name); - -- priv->jobs_queued++; -- - if (virTimeMillisNow(&now) < 0) { - virObjectUnref(cfg); - return -1; - } - -+ priv->jobs_queued++; - then = now + QEMU_JOB_WAIT_TIME; - - virObjectRef(obj); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Build-command-line-for-ivshmem-device.patch b/SOURCES/libvirt-qemu-Build-command-line-for-ivshmem-device.patch deleted file mode 100644 index aa40d4b..0000000 --- a/SOURCES/libvirt-qemu-Build-command-line-for-ivshmem-device.patch +++ /dev/null @@ -1,291 +0,0 @@ -From d7ec27fd43a6c58e81fd0f7a2149d0f81929c3e1 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Martin Kletzander -Date: Fri, 3 Oct 2014 22:54:57 +0200 -Subject: [PATCH] qemu: Build command line for ivshmem device - -https://bugzilla.redhat.com/show_bug.cgi?id=1126991 - -This patch implements support for the ivshmem device in QEMU. - -Signed-off-by: Maxime Leroy -Signed-off-by: Martin Kletzander -(cherry picked from commit b90a9a637490acd7f35c6dc52d6e55b5a1054f34) -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 4 +- - src/qemu/qemu_command.c | 117 +++++++++++++++++++++ - .../qemuxml2argv-shmem-invalid-size.xml | 24 +++++ - .../qemuxml2argv-shmem-small-size.xml | 24 +++++ - tests/qemuxml2argvdata/qemuxml2argv-shmem.args | 16 +++ - tests/qemuxml2argvtest.c | 5 + - 6 files changed, 188 insertions(+), 2 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-shmem-invalid-size.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-shmem-small-size.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-shmem.args - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 2768660..d61358b 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -9743,7 +9743,7 @@ virDomainShmemDefParseXML(xmlNodePtr node, - 1, ULLONG_MAX, false) < 0) - goto cleanup; - -- if ((server = virXPathNode("./server", ctxt))) { -+ if ((server = virXPathNode("./server[1]", ctxt))) { - def->server.enabled = true; - - if ((tmp = virXMLPropString(server, "path"))) -@@ -9751,7 +9751,7 @@ virDomainShmemDefParseXML(xmlNodePtr node, - VIR_FREE(tmp); - } - -- if ((msi = virXPathNode("./msi", ctxt))) { -+ if ((msi = virXPathNode("./msi[1]", ctxt))) { - def->msi.enabled = true; - - if ((tmp = virXMLPropString(msi, "vectors")) && -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 6c4e2ff..3adf19e 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -1027,6 +1027,10 @@ qemuAssignDeviceAliases(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) - if (virAsprintf(&def->hubs[i]->info.alias, "hub%zu", i) < 0) - return -1; - } -+ for (i = 0; i < def->nshmems; i++) { -+ if (virAsprintf(&def->shmems[i]->info.alias, "shmem%zu", i) < 0) -+ return -1; -+ } - for (i = 0; i < def->nsmartcards; i++) { - if (virAsprintf(&def->smartcards[i]->info.alias, "smartcard%zu", i) < 0) - return -1; -@@ -7495,6 +7499,114 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd, - } - - static int -+qemuBuildShmemDevCmd(virCommandPtr cmd, -+ virDomainDefPtr def, -+ virDomainShmemDefPtr shmem, -+ virQEMUCapsPtr qemuCaps) -+{ -+ virBuffer buf = VIR_BUFFER_INITIALIZER; -+ -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("ivshmem device is not supported " -+ "with this QEMU binary")); -+ goto error; -+ } -+ -+ virBufferAddLit(&buf, "ivshmem"); -+ if (shmem->size) { -+ /* -+ * Thanks to our parsing code, we have a guarantee that the -+ * size is power of two and is at least a mebibyte in size. -+ * But because it may change inthe future, the checks are -+ * doubled in here. -+ */ -+ if (shmem->size & (shmem->size - 1)) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("shmem size must be a power of two")); -+ goto error; -+ } -+ if (shmem->size < 1024 * 1024) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("shmem size must be at least 1 MiB")); -+ goto error; -+ } -+ virBufferAsprintf(&buf, ",size=%llum", -+ VIR_DIV_UP(shmem->size, 1024 * 1024)); -+ } -+ -+ if (!shmem->server.enabled) { -+ virBufferAsprintf(&buf, ",shm=%s", shmem->name); -+ } else { -+ virBufferAsprintf(&buf, ",chardev=char%s", shmem->info.alias); -+ if (shmem->msi.enabled) { -+ virBufferAddLit(&buf, ",msi=on"); -+ if (shmem->msi.vectors) -+ virBufferAsprintf(&buf, ",vectors=%u", shmem->msi.vectors); -+ if (shmem->msi.ioeventfd) -+ virBufferAsprintf(&buf, ",ioeventfd=%s", -+ virTristateSwitchTypeToString(shmem->msi.ioeventfd)); -+ } -+ } -+ -+ if (qemuBuildDeviceAddressStr(&buf, def, &shmem->info, qemuCaps) < 0) -+ goto error; -+ -+ if (virBufferCheckError(&buf) < 0) -+ goto error; -+ -+ virCommandAddArg(cmd, "-device"); -+ virCommandAddArgBuffer(cmd, &buf); -+ -+ return 0; -+ -+ error: -+ virBufferFreeAndReset(&buf); -+ return -1; -+} -+ -+static int -+qemuBuildShmemCommandLine(virCommandPtr cmd, -+ virDomainDefPtr def, -+ virDomainShmemDefPtr shmem, -+ virQEMUCapsPtr qemuCaps) -+{ -+ if (qemuBuildShmemDevCmd(cmd, def, shmem, qemuCaps) < 0) -+ return -1; -+ -+ if (shmem->server.enabled) { -+ char *devstr = NULL; -+ virDomainChrSourceDef source = { -+ .type = VIR_DOMAIN_CHR_TYPE_UNIX, -+ .data.nix = { -+ .path = shmem->server.path, -+ .listen = false, -+ } -+ }; -+ -+ if (!shmem->server.path && -+ virAsprintf(&source.data.nix.path, -+ "/var/lib/libvirt/shmem-%s-sock", -+ shmem->name) < 0) -+ return -1; -+ -+ devstr = qemuBuildChrChardevStr(&source, shmem->info.alias, qemuCaps); -+ -+ if (!shmem->server.path) -+ VIR_FREE(source.data.nix.path); -+ -+ if (!devstr) -+ return -1; -+ -+ virCommandAddArg(cmd, "-chardev"); -+ virCommandAddArg(cmd, devstr); -+ VIR_FREE(devstr); -+ } -+ -+ return 0; -+} -+ -+static int - qemuBuildChrDeviceCommandLine(virCommandPtr cmd, - virDomainDefPtr def, - virDomainChrDefPtr chr, -@@ -9683,6 +9795,11 @@ qemuBuildCommandLine(virConnectPtr conn, - } - } - -+ for (i = 0; i < def->nshmems; i++) { -+ if (qemuBuildShmemCommandLine(cmd, def, def->shmems[i], qemuCaps)) -+ goto error; -+ } -+ - if (mlock) { - unsigned long long memKB; - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-shmem-invalid-size.xml b/tests/qemuxml2argvdata/qemuxml2argv-shmem-invalid-size.xml -new file mode 100644 -index 0000000..992f8fd ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-shmem-invalid-size.xml -@@ -0,0 +1,24 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+ 12345 -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-shmem-small-size.xml b/tests/qemuxml2argvdata/qemuxml2argv-shmem-small-size.xml -new file mode 100644 -index 0000000..8f99b14 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-shmem-small-size.xml -@@ -0,0 +1,24 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+ 16 -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-shmem.args b/tests/qemuxml2argvdata/qemuxml2argv-shmem.args -new file mode 100644 -index 0000000..a3d3cc8 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-shmem.args -@@ -0,0 +1,16 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-device ivshmem,shm=shmem0 \ -+-device ivshmem,size=128m,shm=shmem1 \ -+-device ivshmem,size=256m,shm=shmem2 \ -+-device ivshmem,size=512m,chardev=charshmem3 \ -+-chardev socket,id=charshmem3,path=/var/lib/libvirt/shmem-shmem3-sock \ -+-device ivshmem,size=1024m,chardev=charshmem4 \ -+-chardev socket,id=charshmem4,path=/tmp/shmem4-sock \ -+-device ivshmem,size=2048m,chardev=charshmem5,msi=on,ioeventfd=off \ -+-chardev socket,id=charshmem5,path=/tmp/shmem5-sock \ -+-device ivshmem,size=4096m,chardev=charshmem6,msi=on,vectors=16 \ -+-chardev socket,id=charshmem6,path=/tmp/shmem6-sock \ -+-device ivshmem,size=8192m,chardev=charshmem7,msi=on,vectors=32,ioeventfd=on \ -+-chardev socket,id=charshmem7,path=/tmp/shmem7-sock -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index ae8bbfc..dafe683 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1463,6 +1463,11 @@ mymain(void) - - DO_TEST("fips-enabled", QEMU_CAPS_ENABLE_FIPS); - -+ DO_TEST("shmem", QEMU_CAPS_PCIDEVICE, -+ QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_IVSHMEM); -+ DO_TEST_FAILURE("shmem", NONE); -+ DO_TEST_FAILURE("shmem-invalid-size", NONE); -+ DO_TEST_FAILURE("shmem-small-size", NONE); - DO_TEST_PARSE_ERROR("shmem-msi-only", NONE); - - virObjectUnref(driver.config); --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-Check-duplicate-WWNs-also-for-hotplugged-disks.patch b/SOURCES/libvirt-qemu-Check-duplicate-WWNs-also-for-hotplugged-disks.patch new file mode 100644 index 0000000..59e8c2e --- /dev/null +++ b/SOURCES/libvirt-qemu-Check-duplicate-WWNs-also-for-hotplugged-disks.patch @@ -0,0 +1,77 @@ +From 7bf87a91878c0a2830be2534430f98527e361cd5 Mon Sep 17 00:00:00 2001 +Message-Id: <7bf87a91878c0a2830be2534430f98527e361cd5@dist-git> +From: Peter Krempa +Date: Fri, 10 Jul 2015 09:20:32 +0200 +Subject: [PATCH] qemu: Check duplicate WWNs also for hotplugged disks + +In commit 714b38cb232bcbbd7487af4c058fa6d0999b3326 I tried to avoid +having two disks with the same WWN in a VM. I forgot to check the +hotplug paths though which make it possible bypass that check. Reinforce +the fix by checking the wwn when attaching the disk. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1208009 +(cherry picked from commit 780fe4e4baf7e2f10f65ba1a34f9274fc547cad2) + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index f3416cf..535701e 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -22130,6 +22130,34 @@ virDomainDeviceInfoCheckBootIndex(virDomainDefPtr def ATTRIBUTE_UNUSED, + return 0; + } + ++ ++/** ++ * virDomainDefGetDiskByWWN: ++ * @def: domain definition ++ * @wwn: wwn of a disk to find ++ * ++ * Returns a disk definition pointer corresponding to the given WWN identifier ++ * or NULL either if @wwn was NULL or if disk with given WWN is not present in ++ * the domain definition. ++ */ ++static virDomainDiskDefPtr ++virDomainDefGetDiskByWWN(virDomainDefPtr def, ++ const char *wwn) ++{ ++ size_t i; ++ ++ if (!wwn) ++ return NULL; ++ ++ for (i = 0; i < def->ndisks; i++) { ++ if (STREQ_NULLABLE(def->disks[i]->wwn, wwn)) ++ return def->disks[i]; ++ } ++ ++ return NULL; ++} ++ ++ + int + virDomainDefCompatibleDevice(virDomainDefPtr def, + virDomainDeviceDefPtr dev, +@@ -22173,6 +22201,15 @@ virDomainDefCompatibleDevice(virDomainDefPtr def, + } + } + ++ if (dev->type == VIR_DOMAIN_DEVICE_DISK) { ++ if (!!virDomainDefGetDiskByWWN(def, dev->data.disk->wwn)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("Domain already has a disk with wwn '%s'"), ++ dev->data.disk->wwn); ++ return -1; ++ } ++ } ++ + return 0; + } + +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu-Check-for-iotune_max-support-properly.patch b/SOURCES/libvirt-qemu-Check-for-iotune_max-support-properly.patch new file mode 100644 index 0000000..6b3be5e --- /dev/null +++ b/SOURCES/libvirt-qemu-Check-for-iotune_max-support-properly.patch @@ -0,0 +1,58 @@ +From 314408b2a7fea6400ba6d5dda4c6031b7c7bde4e Mon Sep 17 00:00:00 2001 +Message-Id: <314408b2a7fea6400ba6d5dda4c6031b7c7bde4e@dist-git> +From: Martin Kletzander +Date: Tue, 4 Aug 2015 13:11:29 +0200 +Subject: [PATCH] qemu: Check for iotune_max support properly + +Commit d506a51aeb2a7a7b0c963f760e32b94376ea7173 meant to check for +QEMU_CAPS_DRIVE_IOTUNE_MAX, but checked for QEMU_CAPS_DRIVE_IOTUNE +instead. That's clearly visible from the diff, but it got in. Because +of that, we were supplying information unknown for QEMU if it wasn't new +enough and we couldn't even properly handle the error, leading to +"Unexpected error". Also iops_size came at the same time with all the +other "_max" options, so check whether we're not setting that either if +QEMU_CAPS_DRIVE_IOTUNE_MAX is not supported. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1224053 + +Signed-off-by: Martin Kletzander +(cherry picked from commit ba167186cf7753cf662697ab67a4b10e9b3d4096) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index fbe37c2..c59186d 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -17666,7 +17666,8 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, + } + + if (flags & VIR_DOMAIN_AFFECT_LIVE) { +- supportMaxOptions = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE); ++ supportMaxOptions = virQEMUCapsGet(priv->qemuCaps, ++ QEMU_CAPS_DRIVE_IOTUNE_MAX); + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("block I/O throttling not supported with this " +@@ -17674,12 +17675,13 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, + goto endjob; + } + +- if (!supportMaxOptions && (set_iops_max || set_bytes_max)) { ++ if (!supportMaxOptions && ++ (set_iops_max || set_bytes_max || set_size_iops)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("a block I/O throttling parameter is not " + "supported with this QEMU binary")); + goto endjob; +- } ++ } + + if (!(device = qemuDiskPathToAlias(vm, disk, &idx))) + goto endjob; +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Copy-completed-migration-stats-only-on-success.patch b/SOURCES/libvirt-qemu-Copy-completed-migration-stats-only-on-success.patch new file mode 100644 index 0000000..e00870f --- /dev/null +++ b/SOURCES/libvirt-qemu-Copy-completed-migration-stats-only-on-success.patch @@ -0,0 +1,79 @@ +From 7d1f7fce8d06ca2154be5f0a6f9a07bddcfac794 Mon Sep 17 00:00:00 2001 +Message-Id: <7d1f7fce8d06ca2154be5f0a6f9a07bddcfac794@dist-git> +From: Jiri Denemark +Date: Thu, 1 Oct 2015 21:54:38 +0200 +Subject: [PATCH] qemu: Copy completed migration stats only on success + +The destination host gets detailed statistics about the current +migration form the source host via migration cookie and copies them to +the domain object so that they can be queried using +virDomainGetJobStats. However, we should only copy statistics to the +domain object when migration finished successfully. + +Signed-off-by: Jiri Denemark +(cherry picked from commit b106c8b910ec49f1018146dd82b0f93833a66600) + +https://bugzilla.redhat.com/show_bug.cgi?id=1265902 + +Conflicts: + src/qemu/qemu_migration.c -- missing qemuMigrationFinish + refactoring + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_migration.c | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 759fd21..e04459d 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -5617,6 +5617,10 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + * object, but if no, clean up the empty qemu process. + */ + if (retcode == 0) { ++ unsigned long long timeReceived = 0; ++ ++ ignore_value(virTimeMillisNow(&timeReceived)); ++ + if (!virDomainObjIsActive(vm) && !(flags & VIR_MIGRATE_OFFLINE)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); +@@ -5624,16 +5628,6 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + goto endjob; + } + +- if (mig->jobInfo) { +- qemuDomainJobInfoPtr jobInfo = mig->jobInfo; +- priv->job.completed = jobInfo; +- mig->jobInfo = NULL; +- if (jobInfo->sent && virTimeMillisNow(&jobInfo->received) == 0) { +- jobInfo->timeDelta = jobInfo->received - jobInfo->sent; +- jobInfo->timeDeltaSet = true; +- } +- } +- + if (!(flags & VIR_MIGRATE_OFFLINE)) { + if (qemuMigrationVPAssociatePortProfiles(vm->def) < 0) { + qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, +@@ -5737,7 +5731,16 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + } + } + +- if (priv->job.completed) { ++ if (mig->jobInfo) { ++ qemuDomainJobInfoPtr jobInfo = mig->jobInfo; ++ priv->job.completed = jobInfo; ++ mig->jobInfo = NULL; ++ ++ if (jobInfo->sent && timeReceived) { ++ jobInfo->timeDelta = timeReceived - jobInfo->sent; ++ jobInfo->received = timeReceived; ++ jobInfo->timeDeltaSet = true; ++ } + qemuDomainJobInfoUpdateTime(priv->job.completed); + qemuDomainJobInfoUpdateDowntime(priv->job.completed); + } +-- +2.6.1 + diff --git a/SOURCES/libvirt-qemu-Create-memory-backend-ram-file-iff-needed.patch b/SOURCES/libvirt-qemu-Create-memory-backend-ram-file-iff-needed.patch deleted file mode 100644 index ee90372..0000000 --- a/SOURCES/libvirt-qemu-Create-memory-backend-ram-file-iff-needed.patch +++ /dev/null @@ -1,128 +0,0 @@ -From f3bb37db51fda463f584b989ad5faca570949fa2 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Fri, 19 Dec 2014 08:21:42 +0100 -Subject: [PATCH] qemu: Create memory-backend-{ram, file} iff needed - -Libvirt BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1175397 -QEMU BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1170093 - -In qemu there are two interesting arguments: - -1) -numa to create a guest NUMA node -2) -object memory-backend-{ram,file} to tell qemu which memory -region on which host's NUMA node it should allocate the guest -memory from. - -Combining these two together we can instruct qemu to create a -guest NUMA node that is tied to a host NUMA node. And it works -just fine. However, depending on machine type used, there might -be some issued during migration when OVMF is enabled (see QEMU -BZ). While this truly is a QEMU bug, we can help avoiding it. The -problem lies within the memory backend objects somewhere. Having -said that, fix on our side consists on putting those objects on -the command line if and only if needed. For instance, while -previously we would construct this (in all ways correct) command -line: - - -object memory-backend-ram,size=256M,id=ram-node0 \ - -numa node,nodeid=0,cpus=0,memdev=ram-node0 - -now we create just: - - -numa node,nodeid=0,cpus=0,mem=256 - -because the backend object is obviously not tied to any specific -host NUMA node. - -Signed-off-by: Michal Privoznik -(cherry picked from commit f309db1f4d51009bad0d32e12efc75530b66836b) - -Conflicts: - src/qemu/qemu_command.c: Some context -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 16 +++++++++------- - .../qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args | 3 +-- - .../qemuxml2argv-numatune-memnode-no-memory.args | 3 +-- - 3 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index ed66cea..d3eb43b 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -6583,6 +6583,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - } - - for (i = 0; i < def->cpu->ncells; i++) { -+ virDomainHugePagePtr hugepage = NULL; - int cellmem = VIR_DIV_UP(def->cpu->cells[i].mem, 1024); - def->cpu->cells[i].mem = cellmem * 1024; - virTristateSwitch memAccess = def->cpu->cells[i].memAccess; -@@ -6604,7 +6605,6 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) || - virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE)) { - virDomainNumatuneMemMode mode; -- virDomainHugePagePtr hugepage = NULL; - const char *policy = NULL; - - mode = virDomainNumatuneGetMode(def->numatune, i); -@@ -6714,8 +6714,12 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - virBufferAsprintf(&buf, ",policy=%s", policy); - } - -- virCommandAddArg(cmd, "-object"); -- virCommandAddArgBuffer(cmd, &buf); -+ if (hugepage || nodemask) { -+ virCommandAddArg(cmd, "-object"); -+ virCommandAddArgBuffer(cmd, &buf); -+ } else { -+ virBufferFreeAndReset(&buf); -+ } - } else { - if (memAccess) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -@@ -6735,12 +6739,10 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - virBufferAdd(&buf, tmpmask, -1); - } - -- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) || -- virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE)) { -+ if (hugepage || nodemask) - virBufferAsprintf(&buf, ",memdev=ram-node%zu", i); -- } else { -+ else - virBufferAsprintf(&buf, ",mem=%d", cellmem); -- } - - virCommandAddArgBuffer(cmd, &buf); - } -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args -index 27b3f8e..f81947e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args -@@ -1,7 +1,6 @@ - LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ - /usr/bin/qemu -S -M pc -m 1024 -smp 2 \ ---object memory-backend-ram,size=256M,id=ram-node0 \ ---numa node,nodeid=0,cpus=0,memdev=ram-node0 \ -+-numa node,nodeid=0,cpus=0,mem=256 \ - -object memory-backend-file,prealloc=yes,\ - mem-path=/dev/hugepages1G/libvirt/qemu,size=768M,id=ram-node1 \ - -numa node,nodeid=1,cpus=1,memdev=ram-node1 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args -index b0e274c..2addf97 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args -@@ -2,7 +2,6 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ - /usr/bin/kvm -S -M pc -m 64 -smp 2 \ - -object memory-backend-ram,size=32M,id=ram-node0,host-nodes=3,policy=preferred \ - -numa node,nodeid=0,cpus=0,memdev=ram-node0 \ ---object memory-backend-ram,size=32M,id=ram-node1 \ ---numa node,nodeid=1,cpus=1,memdev=ram-node1 \ -+-numa node,nodeid=1,cpus=1,mem=32 \ - -nographic -monitor unix:/tmp/test-monitor,server,nowait \ - -no-acpi -boot c -usb -net none -serial none -parallel none --- -2.2.1 - diff --git a/SOURCES/libvirt-qemu-Disallow-concurrent-block-jobs-on-a-single-disk.patch b/SOURCES/libvirt-qemu-Disallow-concurrent-block-jobs-on-a-single-disk.patch deleted file mode 100644 index 13a9f92..0000000 --- a/SOURCES/libvirt-qemu-Disallow-concurrent-block-jobs-on-a-single-disk.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 4e7b21b4138e011c05ae72ed8b92f0bd2b888744 Mon Sep 17 00:00:00 2001 -Message-Id: <4e7b21b4138e011c05ae72ed8b92f0bd2b888744@dist-git> -From: Peter Krempa -Date: Tue, 17 Mar 2015 13:13:53 +0100 -Subject: [PATCH] qemu: Disallow concurrent block jobs on a single disk - -https://bugzilla.redhat.com/show_bug.cgi?id=1202719 - -While qemu may be prepared to do this libvirt is not. Forbid the block -ops until we fix our code. - -(cherry picked from commit 51f9f03a4ca50b070c0fbfb29748d49f583e15e1) - -Conflicts: - src/qemu/qemu_domain.h - context with upstream changes - -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.h | 4 ++++ - src/qemu/qemu_domain.c | 23 +++++++++++++++++++++++ - src/qemu/qemu_domain.h | 2 ++ - src/qemu/qemu_driver.c | 28 +++++++++++++--------------- - 4 files changed, 42 insertions(+), 15 deletions(-) - -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 1436eb8..654c27d 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -636,6 +636,10 @@ struct _virDomainDiskDef { - int tray_status; /* enum virDomainDiskTray */ - int removable; /* enum virTristateSwitch */ - -+ /* ideally we want a smarter way to interlock block jobs on single qemu disk -+ * in the future, but for now we just disallow any concurrent job on a -+ * single disk */ -+ bool blockjob; - virStorageSourcePtr mirror; - int mirrorState; /* enum virDomainDiskMirrorState */ - int mirrorJob; /* virDomainBlockJobType */ -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 0c3d21f..b9bf3eb 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -2771,6 +2771,29 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, - return ret; - } - -+ -+bool -+qemuDomainDiskBlockJobIsActive(virDomainDiskDefPtr disk) -+{ -+ if (disk->mirror) { -+ virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, -+ _("disk '%s' already in active block job"), -+ disk->dst); -+ -+ return true; -+ } -+ -+ if (disk->blockjob) { -+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, -+ _("disk '%s' already in active block job"), -+ disk->dst); -+ return true; -+ } -+ -+ return false; -+} -+ -+ - int - qemuDomainUpdateDeviceList(virQEMUDriverPtr driver, - virDomainObjPtr vm, -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 76054ec..63d1261 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -416,4 +416,6 @@ int qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo, - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); - -+bool qemuDomainDiskBlockJobIsActive(virDomainDiskDefPtr disk); -+ - #endif /* __QEMU_DOMAIN_H__ */ -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index a19281d..2bd4a1d 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4490,6 +4490,7 @@ processBlockJobEvent(virQEMUDriverPtr driver, - disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; - ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, - true, true)); -+ disk->blockjob = false; - break; - - case VIR_DOMAIN_BLOCK_JOB_READY: -@@ -4505,6 +4506,7 @@ processBlockJobEvent(virQEMUDriverPtr driver, - VIR_DOMAIN_DISK_MIRROR_STATE_ABORT : VIR_DOMAIN_DISK_MIRROR_STATE_NONE; - disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; - save = true; -+ disk->blockjob = false; - break; - - case VIR_DOMAIN_BLOCK_JOB_LAST: -@@ -15583,6 +15585,7 @@ qemuDomainBlockPivot(virConnectPtr conn, - disk->mirror = NULL; - disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; - disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -+ disk->blockjob = false; - } - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) - ret = -1; -@@ -15679,12 +15682,9 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm, - goto endjob; - disk = vm->def->disks[idx]; - -- if (mode == BLOCK_JOB_PULL && disk->mirror) { -- virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, -- _("disk '%s' already in active block job"), -- disk->dst); -+ if (mode == BLOCK_JOB_PULL && qemuDomainDiskBlockJobIsActive(disk)) - goto endjob; -- } -+ - if (mode == BLOCK_JOB_ABORT) { - if ((flags & VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT) && - !(async && disk->mirror)) { -@@ -15756,6 +15756,8 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm, - if (mode == BLOCK_JOB_ABORT && disk->mirror) - disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; - goto endjob; -+ } else if (mode == BLOCK_JOB_PULL) { -+ disk->blockjob = true; - } - - /* Snoop block copy operations, so future cancel operations can -@@ -15943,12 +15945,8 @@ qemuDomainBlockCopy(virDomainObjPtr vm, - goto endjob; - } - disk = vm->def->disks[idx]; -- if (disk->mirror) { -- virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, -- _("disk '%s' already in active block job"), -- disk->dst); -+ if (qemuDomainDiskBlockJobIsActive(disk)) - goto endjob; -- } - - if (!(virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_MIRROR) && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKJOB_ASYNC))) { -@@ -16074,6 +16072,7 @@ qemuDomainBlockCopy(virDomainObjPtr vm, - disk->mirror = mirror; - mirror = NULL; - disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_COPY; -+ disk->blockjob = true; - - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) - VIR_WARN("Unable to save status on vm %s after state change", -@@ -16232,12 +16231,9 @@ qemuDomainBlockCommit(virDomainPtr dom, - disk->dst); - goto endjob; - } -- if (disk->mirror) { -- virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, -- _("disk '%s' already in active block job"), -- disk->dst); -+ -+ if (qemuDomainDiskBlockJobIsActive(disk)) - goto endjob; -- } - if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0) - goto endjob; - -@@ -16358,6 +16354,8 @@ qemuDomainBlockCommit(virDomainPtr dom, - bandwidth); - qemuDomainObjExitMonitor(driver, vm); - -+ disk->blockjob = true; -+ - if (mirror) { - if (ret == 0) { - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); --- -2.3.3 - diff --git a/SOURCES/libvirt-qemu-Do-not-allow-others-into-per-VM-subdirectories.patch b/SOURCES/libvirt-qemu-Do-not-allow-others-into-per-VM-subdirectories.patch new file mode 100644 index 0000000..c2376cb --- /dev/null +++ b/SOURCES/libvirt-qemu-Do-not-allow-others-into-per-VM-subdirectories.patch @@ -0,0 +1,41 @@ +From 1b3b61bc9cd913a2f3fea1ab39ded81c6da2bacd Mon Sep 17 00:00:00 2001 +Message-Id: <1b3b61bc9cd913a2f3fea1ab39ded81c6da2bacd@dist-git> +From: Martin Kletzander +Date: Mon, 14 Sep 2015 10:15:26 +0200 +Subject: [PATCH] qemu: Do not allow others into per-VM subdirectories + +https://bugzilla.redhat.com/show_bug.cgi?id=1146886 + +Signed-off-by: Martin Kletzander +(cherry picked from commit 192a13948905668955ff39e32d4622f8511fadf0) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_process.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index d5b0fc0..ee1d6b2 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -4737,7 +4737,7 @@ int qemuProcessStart(virConnectPtr conn, + if (virAsprintf(&tmppath, "%s/domain-%s", cfg->libDir, vm->def->name) < 0) + goto cleanup; + +- if (virFileMakePath(tmppath) < 0) { ++ if (virFileMakePathWithMode(tmppath, 0750) < 0) { + virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath); + goto cleanup; + } +@@ -4752,7 +4752,7 @@ int qemuProcessStart(virConnectPtr conn, + cfg->channelTargetDir, vm->def->name) < 0) + goto cleanup; + +- if (virFileMakePath(tmppath) < 0) { ++ if (virFileMakePathWithMode(tmppath, 0750) < 0) { + virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath); + goto cleanup; + } +-- +2.5.2 + diff --git a/SOURCES/libvirt-qemu-Do-not-reset-labels-when-migration-fails.patch b/SOURCES/libvirt-qemu-Do-not-reset-labels-when-migration-fails.patch new file mode 100644 index 0000000..7697d8f --- /dev/null +++ b/SOURCES/libvirt-qemu-Do-not-reset-labels-when-migration-fails.patch @@ -0,0 +1,147 @@ +From 73cc6287624a227f16c27e138258b5199c8687a0 Mon Sep 17 00:00:00 2001 +Message-Id: <73cc6287624a227f16c27e138258b5199c8687a0@dist-git> +From: Jiri Denemark +Date: Thu, 30 Jul 2015 16:42:43 +0200 +Subject: [PATCH] qemu: Do not reset labels when migration fails + +When stopping a domain on the destination host after a failed migration, +we need to avoid reseting security labels since the domain is still +running on the source host. While we were correctly doing so in some +cases, there were still some paths which did this wrong. + +https://bugzilla.redhat.com/show_bug.cgi?id=1242904 + +Signed-off-by: Jiri Denemark +(cherry picked from commit e8d0166e1d27c18aacea4b1316760fad4106e1c7) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 5 ++++- + src/qemu/qemu_migration.c | 3 ++- + src/qemu/qemu_process.c | 19 ++++++++++++++----- + 3 files changed, 20 insertions(+), 7 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 204ed72..fbe37c2 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -2199,6 +2199,7 @@ qemuDomainDestroyFlags(virDomainPtr dom, + int ret = -1; + virObjectEventPtr event = NULL; + qemuDomainObjPrivatePtr priv; ++ unsigned int stopFlags = 0; + + virCheckFlags(VIR_DOMAIN_DESTROY_GRACEFUL, -1); + +@@ -2212,6 +2213,8 @@ qemuDomainDestroyFlags(virDomainPtr dom, + + qemuDomainSetFakeReboot(driver, vm, false); + ++ if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) ++ stopFlags |= VIR_QEMU_PROCESS_STOP_MIGRATED; + + /* We need to prevent monitor EOF callback from doing our work (and sending + * misleading events) while the vm is unlocked inside BeginJob/ProcessKill API +@@ -2246,7 +2249,7 @@ qemuDomainDestroyFlags(virDomainPtr dom, + goto endjob; + } + +- qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED, 0); ++ qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED, stopFlags); + event = virDomainEventLifecycleNewFromObj(vm, + VIR_DOMAIN_EVENT_STOPPED, + VIR_DOMAIN_EVENT_STOPPED_DESTROYED); +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 6386744..16bb1af 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -3474,7 +3474,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, + + stop: + virDomainAuditStart(vm, "migrated", false); +- qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, 0); ++ qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, ++ VIR_QEMU_PROCESS_STOP_MIGRATED); + + endjob: + qemuMigrationJobFinish(driver, vm); +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 31315b1..f41fd9d 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -285,6 +285,7 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + int eventReason = VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN; + int stopReason = VIR_DOMAIN_SHUTOFF_SHUTDOWN; + const char *auditReason = "shutdown"; ++ unsigned int stopFlags = 0; + + VIR_DEBUG("Received EOF on %p '%s'", vm, vm->def->name); + +@@ -310,14 +311,16 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + auditReason = "failed"; + } + +- if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) ++ if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) { ++ stopFlags |= VIR_QEMU_PROCESS_STOP_MIGRATED; + qemuMigrationErrorSave(driver, vm->def->name, + qemuMonitorLastError(priv->mon)); ++ } + + event = virDomainEventLifecycleNewFromObj(vm, + VIR_DOMAIN_EVENT_STOPPED, + eventReason); +- qemuProcessStop(driver, vm, stopReason, 0); ++ qemuProcessStop(driver, vm, stopReason, stopFlags); + virDomainAuditStop(vm, auditReason); + + if (!vm->persistent) { +@@ -3732,10 +3735,13 @@ qemuProcessReconnect(void *opaque) + virQEMUDriverConfigPtr cfg; + size_t i; + int ret; ++ unsigned int stopFlags = 0; + + VIR_FREE(data); + + qemuDomainObjRestoreJob(obj, &oldjob); ++ if (oldjob.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) ++ stopFlags |= VIR_QEMU_PROCESS_STOP_MIGRATED; + + cfg = virQEMUDriverGetConfig(driver); + priv = obj->privateData; +@@ -3916,7 +3922,7 @@ qemuProcessReconnect(void *opaque) + * really is and FAILED means "failed to start" */ + state = VIR_DOMAIN_SHUTOFF_UNKNOWN; + } +- qemuProcessStop(driver, obj, state, 0); ++ qemuProcessStop(driver, obj, state, stopFlags); + } + + if (!obj->persistent) +@@ -5692,9 +5698,13 @@ qemuProcessAutoDestroy(virDomainObjPtr dom, + virQEMUDriverPtr driver = opaque; + qemuDomainObjPrivatePtr priv = dom->privateData; + virObjectEventPtr event = NULL; ++ unsigned int stopFlags = 0; + + VIR_DEBUG("vm=%s, conn=%p", dom->def->name, conn); + ++ if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) ++ stopFlags |= VIR_QEMU_PROCESS_STOP_MIGRATED; ++ + if (priv->job.asyncJob) { + VIR_DEBUG("vm=%s has long-term job active, cancelling", + dom->def->name); +@@ -5707,8 +5717,7 @@ qemuProcessAutoDestroy(virDomainObjPtr dom, + + VIR_DEBUG("Killing domain"); + +- qemuProcessStop(driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED, +- VIR_QEMU_PROCESS_STOP_MIGRATED); ++ qemuProcessStop(driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED, stopFlags); + + virDomainAuditStop(dom, "destroyed"); + event = virDomainEventLifecycleNewFromObj(dom, +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Don-t-fail-startup-attach-for-IOThreads-if-no-JSON.patch b/SOURCES/libvirt-qemu-Don-t-fail-startup-attach-for-IOThreads-if-no-JSON.patch deleted file mode 100644 index 1f75c15..0000000 --- a/SOURCES/libvirt-qemu-Don-t-fail-startup-attach-for-IOThreads-if-no-JSON.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 3ddcdff13e730d59851f99ce0135f499c5188495 Mon Sep 17 00:00:00 2001 -Message-Id: <3ddcdff13e730d59851f99ce0135f499c5188495@dist-git> -From: John Ferlan -Date: Thu, 18 Sep 2014 09:30:02 -0400 -Subject: [PATCH] qemu: Don't fail startup/attach for IOThreads if no JSON - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -If the qemu being used doesn't support JSON, then querying for IOThread -data would fail. In that case, ensure the *iothreads is NULL and return 0 -as the count of iothreads available. - -(cherry picked from commit 15ee3c2511157a7dfd3516e633057ce26b9fbd62) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 00f1d38..db2fe71 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -4113,10 +4113,10 @@ qemuMonitorGetIOThreads(qemuMonitorPtr mon, - return -1; - } - -+ /* Requires JSON to make the query */ - if (!mon->json) { -- virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -- _("JSON monitor is required")); -- return -1; -+ *iothreads = NULL; -+ return 0; - } - - return qemuMonitorJSONGetIOThreads(mon, iothreads); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Don-t-report-false-error-from-MigrateFinish.patch b/SOURCES/libvirt-qemu-Don-t-report-false-error-from-MigrateFinish.patch new file mode 100644 index 0000000..2c4d9be --- /dev/null +++ b/SOURCES/libvirt-qemu-Don-t-report-false-error-from-MigrateFinish.patch @@ -0,0 +1,79 @@ +From b70bc3fb7517fe18b7ef6d2c3801c3b217f977bb Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Thu, 2 Jul 2015 22:32:54 +0200 +Subject: [PATCH] qemu: Don't report false error from MigrateFinish + +virDomainMigrateFinish* APIs were unfortunately designed to return the +pointer to the domain on destination and NULL on error. This looks OK in +normal cases but the same API is also called when we know migration +failed and thus we expect Finish to return NULL even if it actually did +all it was supposed to do without any error. The call is defined to +return nonnull domain pointer over RPC, which means returning NULL will +always result in an error being send. If this was not in fact an error, +the API itself wouldn't set anything to the thread local virError, which +makes the RPC layer come up with it's own "Library function returned +error but did not set virError" error. + +This is quite confusing and also hard to detect by the caller. This +patch adds a special error code which can be used to check that Finish +successfully aborted migration. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 44c42b564dc61ddc8fdfc5b6ca4ca969bcffc7d8) + +https://bugzilla.redhat.com/show_bug.cgi?id=1090093 + +Signed-off-by: Jiri Denemark +--- + include/libvirt/virterror.h | 1 + + src/qemu/qemu_migration.c | 6 ++++++ + src/util/virerror.c | 3 +++ + 3 files changed, 10 insertions(+) + +diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h +index 6325030..f716cb9 100644 +--- a/include/libvirt/virterror.h ++++ b/include/libvirt/virterror.h +@@ -307,6 +307,7 @@ typedef enum { + VIR_ERR_CPU_INCOMPATIBLE = 91, /* given CPU is incompatible with host + CPU*/ + VIR_ERR_XML_INVALID_SCHEMA = 92, /* XML document doesn't validate against schema */ ++ VIR_ERR_MIGRATE_FINISH_OK = 93, /* Finish API succeeded but it is expected to return NULL */ + } virErrorNumber; + + /** +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 58874ee..a9cbada 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -5751,6 +5751,12 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + } + virObjectUnref(caps); + virObjectUnref(cfg); ++ ++ /* Set a special error if Finish is expected to return NULL as a result of ++ * successful call with retcode != 0 ++ */ ++ if (retcode != 0 && !dom && !virGetLastError()) ++ virReportError(VIR_ERR_MIGRATE_FINISH_OK, NULL); + return dom; + } + +diff --git a/src/util/virerror.c b/src/util/virerror.c +index 60b2e79..6dc05f4 100644 +--- a/src/util/virerror.c ++++ b/src/util/virerror.c +@@ -1369,6 +1369,9 @@ virErrorMsg(virErrorNumber error, const char *info) + else + errmsg = _("XML document failed to validate against schema: %s"); + break; ++ case VIR_ERR_MIGRATE_FINISH_OK: ++ errmsg = _("migration successfully aborted"); ++ break; + } + return errmsg; + } +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu-Don-t-track-quiesced-state-of-FSs.patch b/SOURCES/libvirt-qemu-Don-t-track-quiesced-state-of-FSs.patch deleted file mode 100644 index 7e7fefe..0000000 --- a/SOURCES/libvirt-qemu-Don-t-track-quiesced-state-of-FSs.patch +++ /dev/null @@ -1,206 +0,0 @@ -From c8ef4373f815e030c3dd505b00bd9fffebe333f3 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Fri, 28 Nov 2014 15:15:06 +0100 -Subject: [PATCH] qemu: Don't track quiesced state of FSs - -https://bugzilla.redhat.com/show_bug.cgi?id=1160084 - -As of b6d4dad11b (1.2.5) we are trying to keep the status of FSFreeze -in the guest. Even though I've tried to fixed couple of corner cases -(6ea54769ba18), it occurred to me just recently, that the approach is -broken by design. Firstly, there are many other ways to talk to -qemu-ga (even through libvirt) that filesystems can be thawed (e.g. -qemu-agent-command) without libvirt noticing. Moreover, there are -plenty of ways to thaw filesystems without even qemu-ga noticing (yes, -qemu-ga keeps internal track of FSFreeze status). So, instead of -keeping the track ourselves, or asking qemu-ga for stale state, it's -the best to let qemu-ga deal with that (and possibly let guest kernel -propagate an error). - -Moreover, there's one bug with the following approach, if fsfreeze -command failed, we've executed fsthaw subsequently. So issuing -domfsfreeze in virsh gave the following result: - -virsh # domfsfreeze gentoo -Froze 1 filesystem(s) - -virsh # domfsfreeze gentoo -error: Unable to freeze filesystems -error: internal error: unable to execute QEMU agent command 'guest-fsfreeze-freeze': The command guest-fsfreeze-freeze has been disabled for this instance - -virsh # domfsfreeze gentoo -Froze 1 filesystem(s) - -virsh # domfsfreeze gentoo -error: Unable to freeze filesystems -error: internal error: unable to execute QEMU agent command 'guest-fsfreeze-freeze': The command guest-fsfreeze-freeze has been disabled for this instance - -Signed-off-by: Michal Privoznik -(cherry picked from commit 6085d917d5c5839b7ed351e99fadbbb56f5178fe) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 5 ----- - src/qemu/qemu_domain.h | 2 -- - src/qemu/qemu_driver.c | 44 ++------------------------------------------ - src/qemu/qemu_process.c | 5 ----- - 4 files changed, 2 insertions(+), 54 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index d248d5b..01fa3ac 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -564,9 +564,6 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, void *data) - virBufferAddLit(buf, "\n"); - } - -- if (priv->quiesced) -- virBufferAddLit(buf, "\n"); -- - return 0; - } - -@@ -751,8 +748,6 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data) - } - VIR_FREE(nodes); - -- priv->quiesced = virXPathBoolean("boolean(./quiesced)", ctxt) == 1; -- - return 0; - - error: -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index e4ea4ce..ebb282a 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -187,8 +187,6 @@ struct _qemuDomainObjPrivate { - char **qemuDevices; /* NULL-terminated list of devices aliases known to QEMU */ - - bool hookRun; /* true if there was a hook run over this domain */ -- -- bool quiesced; /* true if filesystems are quiesced */ - }; - - typedef enum { -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index e096cee..a9a7d30 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -12627,34 +12627,17 @@ qemuDomainPrepareDiskChainElement(virQEMUDriverPtr driver, - * is sent but failed, and number of frozen filesystems on success. If -2 is - * returned, FSThaw should be called revert the quiesced status. */ - static int --qemuDomainSnapshotFSFreeze(virQEMUDriverPtr driver, -+qemuDomainSnapshotFSFreeze(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - virDomainObjPtr vm, - const char **mountpoints, - unsigned int nmountpoints) - { - qemuDomainObjPrivatePtr priv = vm->privateData; -- virQEMUDriverConfigPtr cfg; - int frozen; - -- if (priv->quiesced) { -- virReportError(VIR_ERR_OPERATION_INVALID, "%s", -- _("domain is already quiesced")); -- return -1; -- } -- - if (!qemuDomainAgentAvailable(priv, true)) - return -1; - -- priv->quiesced = true; -- -- cfg = virQEMUDriverGetConfig(driver); -- if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) { -- priv->quiesced = false; -- virObjectUnref(cfg); -- return -1; -- } -- virObjectUnref(cfg); -- - qemuDomainObjEnterAgent(vm); - frozen = qemuAgentFSFreeze(priv->agent, mountpoints, nmountpoints); - qemuDomainObjExitAgent(vm); -@@ -12664,24 +12647,17 @@ qemuDomainSnapshotFSFreeze(virQEMUDriverPtr driver, - - /* Return -1 on error, otherwise number of thawed filesystems. */ - static int --qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver, -+qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - virDomainObjPtr vm, - bool report) - { - qemuDomainObjPrivatePtr priv = vm->privateData; -- virQEMUDriverConfigPtr cfg; - int thawed; - virErrorPtr err = NULL; - - if (!qemuDomainAgentAvailable(priv, report)) - return -1; - -- if (!priv->quiesced && report) { -- virReportError(VIR_ERR_OPERATION_INVALID, "%s", -- _("domain is not quiesced")); -- return -1; -- } -- - qemuDomainObjEnterAgent(vm); - if (!report) - err = virSaveLastError(); -@@ -12692,18 +12668,6 @@ qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver, - - virFreeError(err); - -- if (!report || thawed >= 0) { -- priv->quiesced = false; -- -- cfg = virQEMUDriverGetConfig(driver); -- if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) { -- /* Revert the statuses when we failed to save them. */ -- priv->quiesced = true; -- thawed = -1; -- } -- virObjectUnref(cfg); -- } -- - return thawed; - } - -@@ -17562,10 +17526,6 @@ qemuDomainFSFreeze(virDomainPtr dom, - } - - ret = qemuDomainSnapshotFSFreeze(driver, vm, mountpoints, nmountpoints); -- if (ret == -2) { -- qemuDomainSnapshotFSThaw(driver, vm, false); -- ret = -1; -- } - - endjob: - if (!qemuDomainObjEndJob(driver, vm)) -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index f384b33..1125f4c 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -537,10 +537,6 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - priv = vm->privateData; - if (priv->agent) - qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_RESET); -- /* Clear some domain runtime information. For instance, -- * fsfreeze won't survive domain reset. This, however, -- * required the domain status file to be rewritten onto disk. */ -- priv->quiesced = false; - - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) - VIR_WARN("Failed to save status on vm %s", vm->def->name); -@@ -4972,7 +4968,6 @@ void qemuProcessStop(virQEMUDriverPtr driver, - - virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort); - priv->nbdPort = 0; -- priv->quiesced = false; - - if (priv->agent) { - qemuAgentClose(priv->agent); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Drop-LFs-at-the-end-of-error-from-QEMU-log.patch b/SOURCES/libvirt-qemu-Drop-LFs-at-the-end-of-error-from-QEMU-log.patch new file mode 100644 index 0000000..7205b89 --- /dev/null +++ b/SOURCES/libvirt-qemu-Drop-LFs-at-the-end-of-error-from-QEMU-log.patch @@ -0,0 +1,37 @@ +From 4b79d32a523e7ce5dc0e1e0123e74a2ea1b6ffc5 Mon Sep 17 00:00:00 2001 +Message-Id: <4b79d32a523e7ce5dc0e1e0123e74a2ea1b6ffc5@dist-git> +From: Jiri Denemark +Date: Fri, 3 Jul 2015 19:35:06 +0200 +Subject: [PATCH] qemu: Drop LFs at the end of error from QEMU log + +Libvirt's error messages do not end with a LF. However, when reading the +error from QEMU log, we would read the LF from the log and keep it in +the message. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 04d5fb2e0a92f78eca61de59971eba7fb36c6c1d) + +https://bugzilla.redhat.com/show_bug.cgi?id=1090093 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_monitor.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c +index d7d211e..dabe8e2 100644 +--- a/src/qemu/qemu_monitor.c ++++ b/src/qemu/qemu_monitor.c +@@ -407,6 +407,9 @@ qemuMonitorGetErrorFromLog(qemuMonitorPtr mon) + if ((len = qemuProcessReadLog(mon->logfd, logbuf, 4096 - 1, 0, true)) <= 0) + goto error; + ++ while (len > 0 && logbuf[len - 1] == '\n') ++ logbuf[--len] = '\0'; ++ + cleanup: + errno = orig_errno; + VIR_FORCE_CLOSE(mon->logfd); +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu-Drop-OVMF-whitelist.patch b/SOURCES/libvirt-qemu-Drop-OVMF-whitelist.patch deleted file mode 100644 index affdf74..0000000 --- a/SOURCES/libvirt-qemu-Drop-OVMF-whitelist.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 98e3449d18692ac45ddf1637ed3e01363a91c8e4 Mon Sep 17 00:00:00 2001 -Message-Id: <98e3449d18692ac45ddf1637ed3e01363a91c8e4@dist-git> -From: Michal Privoznik -Date: Wed, 19 Nov 2014 18:59:15 +0100 -Subject: [PATCH] qemu: Drop OVMF whitelist - -https://bugzilla.redhat.com/show_bug.cgi?id=1165782 - -As discussed on the upstream list, it's better not to make this -kind of predictions in libvirt. It may happen that qemu learns -how to enable OVMF on other architectures too and we shouldn't -try to chase that. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 36148120c1c1e6ad7f4eb6f0995eb7b18ba95922) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 9 +++------ - src/qemu/qemu_command.c | 10 ---------- - 2 files changed, 3 insertions(+), 16 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index a10bc8c..e0c1b31 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -3616,7 +3616,6 @@ virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps) - static int - virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsLoaderPtr capsLoader, -- virArch arch, - char **loader, - size_t nloader) - { -@@ -3644,8 +3643,7 @@ virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps, - VIR_DOMAIN_CAPS_ENUM_SET(capsLoader->type, - VIR_DOMAIN_LOADER_TYPE_ROM); - -- if (arch == VIR_ARCH_X86_64 && -- virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE) && -+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_FORMAT)) - VIR_DOMAIN_CAPS_ENUM_SET(capsLoader->type, - VIR_DOMAIN_LOADER_TYPE_PFLASH); -@@ -3662,14 +3660,13 @@ virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps, - static int - virQEMUCapsFillDomainOSCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsOSPtr os, -- virArch arch, - char **loader, - size_t nloader) - { - virDomainCapsLoaderPtr capsLoader = &os->loader; - - os->device.supported = true; -- if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, capsLoader, arch, -+ if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, capsLoader, - loader, nloader) < 0) - return -1; - return 0; -@@ -3765,7 +3762,7 @@ virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, - - domCaps->maxvcpus = maxvcpus; - -- if (virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch, -+ if (virQEMUCapsFillDomainOSCaps(qemuCaps, os, - loader, nloader) < 0 || - virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, disk) < 0 || - virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0) -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 2b8eae0..c161824 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -7642,16 +7642,6 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd, - break; - - case VIR_DOMAIN_LOADER_TYPE_PFLASH: -- /* UEFI is supported only for x86_64 currently */ -- if (def->os.arch != VIR_ARCH_X86_64 && -- def->os.arch != VIR_ARCH_ARMV7L && -- def->os.arch != VIR_ARCH_AARCH64) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("pflash is not supported for %s guest architecture"), -- virArchToString(def->os.arch)); -- goto cleanup; -- } -- - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this QEMU binary doesn't support -drive")); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Emit-the-guest-agent-lifecycle-event.patch b/SOURCES/libvirt-qemu-Emit-the-guest-agent-lifecycle-event.patch deleted file mode 100644 index 76d9480..0000000 --- a/SOURCES/libvirt-qemu-Emit-the-guest-agent-lifecycle-event.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 24725c889ba8a2a8e445dfa7f3d3aa1a9cbbe03c Mon Sep 17 00:00:00 2001 -Message-Id: <24725c889ba8a2a8e445dfa7f3d3aa1a9cbbe03c@dist-git> -From: Peter Krempa -Date: Mon, 24 Nov 2014 17:51:20 +0100 -Subject: [PATCH] qemu: Emit the guest agent lifecycle event - -https://bugzilla.redhat.com/show_bug.cgi?id=1146944 - -Add code to emit the event on change of the channel state and reconnect -to the qemu process. - -(cherry picked from commit b29f2436ac80030f77428dcac746ccfa4e95f6cb) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 6 ++++++ - src/qemu/qemu_process.c | 22 ++++++++++++++++++---- - 2 files changed, 24 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index fe498b9..e096cee 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4347,6 +4347,7 @@ processSerialChangedEvent(virQEMUDriverPtr driver, - { - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - virDomainChrDeviceState newstate; -+ virObjectEventPtr event = NULL; - virDomainDeviceDef dev; - - if (connected) -@@ -4374,6 +4375,11 @@ processSerialChangedEvent(virQEMUDriverPtr driver, - dev.data.chr->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) - goto endjob; - -+ if (STREQ_NULLABLE(dev.data.chr->target.name, "org.qemu.guest_agent.0") && -+ (event = virDomainEventAgentLifecycleNewFromObj(vm, newstate, -+ VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL))) -+ qemuDomainEventQueue(driver, event); -+ - dev.data.chr->state = newstate; - - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index e68d9c6..f384b33 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2065,13 +2065,20 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm, - - - static int --qemuProcessRefreshChannelVirtioState(virDomainObjPtr vm, -- virHashTablePtr info) -+qemuProcessRefreshChannelVirtioState(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ virHashTablePtr info, -+ int booted) - { - size_t i; -+ int agentReason = VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL; - qemuMonitorChardevInfoPtr entry; -+ virObjectEventPtr event = NULL; - char id[32]; - -+ if (booted) -+ agentReason = VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED; -+ - for (i = 0; i < vm->def->nchannels; i++) { - virDomainChrDefPtr chr = vm->def->channels[i]; - if (chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) { -@@ -2088,6 +2095,12 @@ qemuProcessRefreshChannelVirtioState(virDomainObjPtr vm, - !entry->state) - continue; - -+ if (entry->state != VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT && -+ STREQ_NULLABLE(chr->target.name, "org.qemu.guest_agent.0") && -+ (event = virDomainEventAgentLifecycleNewFromObj(vm, entry->state, -+ agentReason))) -+ qemuDomainEventQueue(driver, event); -+ - chr->state = entry->state; - } - } -@@ -2111,7 +2124,7 @@ qemuProcessReconnectRefreshChannelVirtioState(virQEMUDriverPtr driver, - if (ret < 0) - goto cleanup; - -- ret = qemuProcessRefreshChannelVirtioState(vm, info); -+ ret = qemuProcessRefreshChannelVirtioState(driver, vm, info, false); - - cleanup: - virHashFree(info); -@@ -2167,7 +2180,8 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver, - info)) < 0) - goto cleanup; - -- if ((ret = qemuProcessRefreshChannelVirtioState(vm, info)) < 0) -+ if ((ret = qemuProcessRefreshChannelVirtioState(driver, vm, info, -+ true)) < 0) - goto cleanup; - } - --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Enable-ioeventfd-usage-for-virtio-scsi-controllers.patch b/SOURCES/libvirt-qemu-Enable-ioeventfd-usage-for-virtio-scsi-controllers.patch new file mode 100644 index 0000000..bd0860f --- /dev/null +++ b/SOURCES/libvirt-qemu-Enable-ioeventfd-usage-for-virtio-scsi-controllers.patch @@ -0,0 +1,76 @@ +From eb34bc3c4d9a9db2785d56ff30f6d7ca86663cb9 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Thu, 3 Sep 2015 15:55:44 +0200 +Subject: [PATCH] qemu: Enable ioeventfd usage for virtio-scsi controllers + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1150484 + +Signed-off-by: Martin Kletzander +(cherry picked from commit cf0404455cecb47ddbfa3266eea6b66f8540facd) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 7 +++++++ + .../qemuxml2argv-disk-virtio-scsi-ioeventfd.args | 9 +++++++++ + tests/qemuxml2argvtest.c | 3 +++ + 3 files changed, 19 insertions(+) + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index aebaf35..f3e45a5 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -4509,6 +4509,11 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, + _("'max_sectors' is only supported by virtio-scsi controller")); + return NULL; + } ++ if (def->ioeventfd) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("'ioeventfd' is only supported by virtio-scsi controller")); ++ return NULL; ++ } + } + + switch (def->type) { +@@ -4654,6 +4659,8 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, + if (def->max_sectors) + virBufferAsprintf(&buf, ",max_sectors=%u", def->max_sectors); + ++ qemuBuildIoEventFdStr(&buf, def->ioeventfd, qemuCaps); ++ + if (qemuBuildDeviceAddressStr(&buf, domainDef, &def->info, qemuCaps) < 0) + goto error; + +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args +new file mode 100644 +index 0000000..1c53189 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args +@@ -0,0 +1,9 @@ ++LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu -S -M pc -m 214 -smp 8 -nographic -nodefconfig -nodefaults \ ++-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \ ++-device virtio-scsi-pci,id=scsi0,ioeventfd=on,bus=pci.0,addr=0x3 \ ++-usb \ ++-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-scsi0-0-0-0 \ ++-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\ ++drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 \ ++-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index c2657d7..0dd1b9a 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -877,6 +877,9 @@ mymain(void) + DO_TEST("disk-virtio-scsi-max_sectors", + QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_SCSI); ++ DO_TEST("disk-virtio-scsi-ioeventfd", ++ QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_VIRTIO_IOEVENTFD, QEMU_CAPS_VIRTIO_SCSI); + DO_TEST("disk-scsi-megasas", + QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_SCSI_MEGASAS); +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Enable-migration-events-on-QMP-monitor.patch b/SOURCES/libvirt-qemu-Enable-migration-events-on-QMP-monitor.patch new file mode 100644 index 0000000..ce5892f --- /dev/null +++ b/SOURCES/libvirt-qemu-Enable-migration-events-on-QMP-monitor.patch @@ -0,0 +1,114 @@ +From ddad58d06d082ce9522de4139f3768e02de39309 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Tue, 7 Jul 2015 18:17:25 +0200 +Subject: [PATCH] qemu: Enable migration events on QMP monitor + +Even if QEMU supports migration events it doesn't send them by default. +We have to enable them by calling migrate-set-capabilities. Let's enable +migration events everytime we can and clear QEMU_CAPS_MIGRATION_EVENT in +case migrate-set-capabilities does not support events. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 3df4d2a45aaafd0fe2191c648c83a609726638f7) + +https://bugzilla.redhat.com/show_bug.cgi?id=1212077 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_monitor.c | 2 +- + src/qemu/qemu_monitor.h | 1 + + src/qemu/qemu_process.c | 36 ++++++++++++++++++++++++------------ + 3 files changed, 26 insertions(+), 13 deletions(-) + +diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c +index dd742cf..d7d211e 100644 +--- a/src/qemu/qemu_monitor.c ++++ b/src/qemu/qemu_monitor.c +@@ -163,7 +163,7 @@ VIR_ENUM_IMPL(qemuMonitorMigrationStatus, + + VIR_ENUM_IMPL(qemuMonitorMigrationCaps, + QEMU_MONITOR_MIGRATION_CAPS_LAST, +- "xbzrle", "auto-converge", "rdma-pin-all") ++ "xbzrle", "auto-converge", "rdma-pin-all", "events") + + VIR_ENUM_IMPL(qemuMonitorVMStatus, + QEMU_MONITOR_VM_STATUS_LAST, +diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h +index d2b2f94..2ceba28 100644 +--- a/src/qemu/qemu_monitor.h ++++ b/src/qemu/qemu_monitor.h +@@ -512,6 +512,7 @@ typedef enum { + QEMU_MONITOR_MIGRATION_CAPS_XBZRLE, + QEMU_MONITOR_MIGRATION_CAPS_AUTO_CONVERGE, + QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL, ++ QEMU_MONITOR_MIGRATION_CAPS_EVENTS, + + QEMU_MONITOR_MIGRATION_CAPS_LAST + } qemuMonitorMigrationCaps; +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index ba84182..1d223d3 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -1546,7 +1546,7 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob, + vm->def) < 0) { + VIR_ERROR(_("Failed to set security context for monitor for %s"), + vm->def->name); +- goto error; ++ return -1; + } + + /* Hold an extra reference because we can't allow 'vm' to be +@@ -1578,26 +1578,38 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob, + if (virSecurityManagerClearSocketLabel(driver->securityManager, vm->def) < 0) { + VIR_ERROR(_("Failed to clear security context for monitor for %s"), + vm->def->name); +- goto error; ++ return -1; + } + + if (priv->mon == NULL) { + VIR_INFO("Failed to connect monitor for %s", vm->def->name); +- goto error; ++ return -1; + } + + + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) +- goto error; +- ret = qemuMonitorSetCapabilities(priv->mon); +- if (ret == 0 && +- virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON)) +- ret = virQEMUCapsProbeQMP(priv->qemuCaps, priv->mon); ++ return -1; ++ ++ if (qemuMonitorSetCapabilities(priv->mon) < 0) ++ goto cleanup; ++ ++ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON) && ++ virQEMUCapsProbeQMP(priv->qemuCaps, priv->mon) < 0) ++ goto cleanup; ++ ++ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT) && ++ qemuMonitorSetMigrationCapability(priv->mon, ++ QEMU_MONITOR_MIGRATION_CAPS_EVENTS, ++ true) < 0) { ++ VIR_DEBUG("Cannot enable migration events; clearing capability"); ++ virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT); ++ } ++ ++ ret = 0; ++ ++ cleanup: + if (qemuDomainObjExitMonitor(driver, vm) < 0) +- return -1; +- +- error: +- ++ ret = -1; + return ret; + } + +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu-Expose-additional-migration-statistics.patch b/SOURCES/libvirt-qemu-Expose-additional-migration-statistics.patch deleted file mode 100644 index 5dcfe14..0000000 --- a/SOURCES/libvirt-qemu-Expose-additional-migration-statistics.patch +++ /dev/null @@ -1,320 +0,0 @@ -From b7beeafeb8008afc50bce60e9c5c31786a5c6e2e Mon Sep 17 00:00:00 2001 -Message-Id: -From: "Michael R. Hines" -Date: Tue, 23 Sep 2014 15:47:53 +0200 -Subject: [PATCH] qemu: Expose additional migration statistics - -RDMA migration uses the 'setup' state in QEMU to optionally lock -all memory before the migration starts. The total time spent in -this state is exposed as VIR_DOMAIN_JOB_SETUP_TIME. - -Additionally, QEMU also exports migration throughput (mbps) for both -memory and disk, so let's add them too: VIR_DOMAIN_JOB_MEMORY_BPS, -VIR_DOMAIN_JOB_DISK_BPS. - -https://bugzilla.redhat.com/show_bug.cgi?id=1013055 - -Signed-off-by: Michael R. Hines -Signed-off-by: Jiri Denemark -(cherry picked from commit 30b24df16574997d2857c705148932f793d82896) -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 25 +++++++++++++++++++++++++ - src/qemu/qemu_domain.c | 18 ++++++++++++++++++ - src/qemu/qemu_migration.c | 17 +++++++++++++++++ - src/qemu/qemu_monitor.h | 9 +++++++++ - src/qemu/qemu_monitor_json.c | 17 +++++++++++++++++ - tools/virsh-domain.c | 27 +++++++++++++++++++++++++++ - 6 files changed, 113 insertions(+) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index ec2fb8c..b07797e 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -4357,6 +4357,15 @@ int virDomainAbortJob(virDomainPtr dom); - #define VIR_DOMAIN_JOB_DOWNTIME "downtime" - - /** -+ * VIR_DOMAIN_JOB_SETUP_TIME: -+ * -+ * virDomainGetJobStats field: total time in milliseconds spent preparing -+ * the migration in the 'setup' phase before the iterations begin, as -+ * VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_JOB_SETUP_TIME "setup_time" -+ -+/** - * VIR_DOMAIN_JOB_DATA_TOTAL: - * - * virDomainGetJobStats field: total number of bytes supposed to be -@@ -4454,6 +4463,14 @@ int virDomainAbortJob(virDomainPtr dom); - #define VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES "memory_normal_bytes" - - /** -+ * VIR_DOMAIN_JOB_MEMORY_BPS: -+ * -+ * virDomainGetJobStats field: network throughput used while migrating -+ * memory in Bytes per second, as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_JOB_MEMORY_BPS "memory_bps" -+ -+/** - * VIR_DOMAIN_JOB_DISK_TOTAL: - * - * virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_TOTAL but only -@@ -4484,6 +4501,14 @@ int virDomainAbortJob(virDomainPtr dom); - #define VIR_DOMAIN_JOB_DISK_REMAINING "disk_remaining" - - /** -+ * VIR_DOMAIN_JOB_DISK_BPS: -+ * -+ * virDomainGetJobStats field: network throughput used while migrating -+ * disks in Bytes per second, as VIR_TYPED_PARAM_ULLONG. -+ */ -+#define VIR_DOMAIN_JOB_DISK_BPS "disk_bps" -+ -+/** - * VIR_DOMAIN_JOB_COMPRESSION_CACHE: - * - * virDomainGetJobStats field: size of the cache (in bytes) used for -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 863ab09..9b3edd7 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -304,6 +304,12 @@ qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo, - status->downtime) < 0) - goto error; - -+ if (status->setup_time_set && -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_SETUP_TIME, -+ status->setup_time) < 0) -+ goto error; -+ - if (virTypedParamsAddULLong(&par, &npar, &maxpar, - VIR_DOMAIN_JOB_DATA_TOTAL, - status->ram_total + -@@ -329,6 +335,12 @@ qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo, - status->ram_remaining) < 0) - goto error; - -+ if (status->ram_bps && -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_MEMORY_BPS, -+ status->ram_bps) < 0) -+ goto error; -+ - if (status->ram_duplicate_set) { - if (virTypedParamsAddULLong(&par, &npar, &maxpar, - VIR_DOMAIN_JOB_MEMORY_CONSTANT, -@@ -353,6 +365,12 @@ qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo, - status->disk_remaining) < 0) - goto error; - -+ if (status->disk_bps && -+ virTypedParamsAddULLong(&par, &npar, &maxpar, -+ VIR_DOMAIN_JOB_DISK_BPS, -+ status->disk_bps) < 0) -+ goto error; -+ - if (status->xbzrle_set) { - if (virTypedParamsAddULLong(&par, &npar, &maxpar, - VIR_DOMAIN_JOB_COMPRESSION_CACHE, -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 858794d..179af80 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -636,6 +636,10 @@ qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf, - virBufferAsprintf(buf, "<%1$s>%2$llu\n", - VIR_DOMAIN_JOB_DOWNTIME, - status->downtime); -+ if (status->setup_time_set) -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_SETUP_TIME, -+ status->setup_time); - - virBufferAsprintf(buf, "<%1$s>%2$llu\n", - VIR_DOMAIN_JOB_MEMORY_TOTAL, -@@ -646,6 +650,9 @@ qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf, - virBufferAsprintf(buf, "<%1$s>%2$llu\n", - VIR_DOMAIN_JOB_MEMORY_REMAINING, - status->ram_remaining); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_MEMORY_BPS, -+ status->ram_bps); - - if (status->ram_duplicate_set) { - virBufferAsprintf(buf, "<%1$s>%2$llu\n", -@@ -668,6 +675,9 @@ qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf, - virBufferAsprintf(buf, "<%1$s>%2$llu\n", - VIR_DOMAIN_JOB_DISK_REMAINING, - status->disk_remaining); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_DISK_BPS, -+ status->disk_bps); - - if (status->xbzrle_set) { - virBufferAsprintf(buf, "<%1$s>%2$llu\n", -@@ -904,6 +914,9 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt) - if (virXPathULongLong("string(./" VIR_DOMAIN_JOB_DOWNTIME "[1])", - ctxt, &status->downtime) == 0) - status->downtime_set = true; -+ if (virXPathULongLong("string(./" VIR_DOMAIN_JOB_SETUP_TIME "[1])", -+ ctxt, &status->setup_time) == 0) -+ status->setup_time_set = true; - - virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_TOTAL "[1])", - ctxt, &status->ram_total); -@@ -911,6 +924,8 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt) - ctxt, &status->ram_transferred); - virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_REMAINING "[1])", - ctxt, &status->ram_remaining); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_BPS "[1])", -+ ctxt, &status->ram_bps); - - if (virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_CONSTANT "[1])", - ctxt, &status->ram_duplicate) == 0) -@@ -926,6 +941,8 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt) - ctxt, &status->disk_transferred); - virXPathULongLong("string(./" VIR_DOMAIN_JOB_DISK_REMAINING "[1])", - ctxt, &status->disk_remaining); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_DISK_BPS "[1])", -+ ctxt, &status->disk_bps); - - if (virXPathULongLong("string(./" VIR_DOMAIN_JOB_COMPRESSION_CACHE "[1])", - ctxt, &status->xbzrle_cache_size) == 0) -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index 15aa1d4..ed2cf71 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -423,10 +423,18 @@ struct _qemuMonitorMigrationStatus { - /* total or expected depending on status */ - bool downtime_set; - unsigned long long downtime; -+ /* -+ * Duration of the QEMU 'setup' state. -+ * for RDMA, this may be on the order of several seconds -+ * if pinning support is requested before the migration begins. -+ */ -+ bool setup_time_set; -+ unsigned long long setup_time; - - unsigned long long ram_transferred; - unsigned long long ram_remaining; - unsigned long long ram_total; -+ unsigned long long ram_bps; - bool ram_duplicate_set; - unsigned long long ram_duplicate; - unsigned long long ram_normal; -@@ -435,6 +443,7 @@ struct _qemuMonitorMigrationStatus { - unsigned long long disk_transferred; - unsigned long long disk_remaining; - unsigned long long disk_total; -+ unsigned long long disk_bps; - - bool xbzrle_set; - unsigned long long xbzrle_cache_size; -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 53e324e..5ad0d05 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -2443,6 +2443,7 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply, - virJSONValuePtr ret; - const char *statusstr; - int rc; -+ double mbps; - - if (!(ret = virJSONValueObjectGet(reply, "return"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -2475,6 +2476,10 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply, - if (rc == 0) - status->downtime_set = true; - -+ if (virJSONValueObjectGetNumberUlong(ret, "setup-time", -+ &status->setup_time) == 0) -+ status->setup_time_set = true; -+ - if (status->status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE || - status->status == QEMU_MONITOR_MIGRATION_STATUS_COMPLETED) { - virJSONValuePtr ram = virJSONValueObjectGet(ret, "ram"); -@@ -2506,6 +2511,12 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply, - return -1; - } - -+ if (virJSONValueObjectGetNumberDouble(ram, "mbps", &mbps) == 0 && -+ mbps > 0) { -+ /* mpbs from QEMU reports Mbits/s (M as in 10^6 not Mi as 2^20) */ -+ status->ram_bps = mbps * (1000 * 1000 / 8); -+ } -+ - if (virJSONValueObjectGetNumberUlong(ram, "duplicate", - &status->ram_duplicate) == 0) - status->ram_duplicate_set = true; -@@ -2542,6 +2553,12 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply, - "data was missing")); - return -1; - } -+ -+ if (virJSONValueObjectGetNumberDouble(disk, "mbps", &mbps) == 0 && -+ mbps > 0) { -+ /* mpbs from QEMU reports Mbits/s (M as in 10^6 not Mi as 2^20) */ -+ status->disk_bps = mbps * (1000 * 1000 / 8); -+ } - } - - virJSONValuePtr comp = virJSONValueObjectGet(ret, "xbzrle-cache"); -diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c -index f964856..683d92e 100644 ---- a/tools/virsh-domain.c -+++ b/tools/virsh-domain.c -@@ -5309,6 +5309,16 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) - vshPrint(ctl, "%-17s %-.3lf %s\n", _("Memory remaining:"), val, unit); - val = vshPrettyCapacity(info.memTotal, &unit); - vshPrint(ctl, "%-17s %-.3lf %s\n", _("Memory total:"), val, unit); -+ -+ if ((rc = virTypedParamsGetULLong(params, nparams, -+ VIR_DOMAIN_JOB_MEMORY_BPS, -+ &value)) < 0) { -+ goto save_error; -+ } else if (rc && value) { -+ val = vshPrettyCapacity(value, &unit); -+ vshPrint(ctl, "%-17s %-.3lf %s/s\n", -+ _("Memory bandwidth:"), val, unit); -+ } - } - - if (info.fileTotal || info.fileRemaining || info.fileProcessed) { -@@ -5318,6 +5328,16 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) - vshPrint(ctl, "%-17s %-.3lf %s\n", _("File remaining:"), val, unit); - val = vshPrettyCapacity(info.fileTotal, &unit); - vshPrint(ctl, "%-17s %-.3lf %s\n", _("File total:"), val, unit); -+ -+ if ((rc = virTypedParamsGetULLong(params, nparams, -+ VIR_DOMAIN_JOB_DISK_BPS, -+ &value)) < 0) { -+ goto save_error; -+ } else if (rc && value) { -+ val = vshPrettyCapacity(value, &unit); -+ vshPrint(ctl, "%-17s %-.3lf %s/s\n", -+ _("File bandwidth:"), val, unit); -+ } - } - - if ((rc = virTypedParamsGetULLong(params, nparams, -@@ -5358,6 +5378,13 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) - } - - if ((rc = virTypedParamsGetULLong(params, nparams, -+ VIR_DOMAIN_JOB_SETUP_TIME, -+ &value)) < 0) -+ goto save_error; -+ else if (rc) -+ vshPrint(ctl, "%-17s %-12llu ms\n", _("Setup time:"), value); -+ -+ if ((rc = virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_COMPRESSION_CACHE, - &value)) < 0) { - goto save_error; --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-Extract-internals-of-processBlockJobEvent-into-a-helper.patch b/SOURCES/libvirt-qemu-Extract-internals-of-processBlockJobEvent-into-a-helper.patch deleted file mode 100644 index 9d7e5df..0000000 --- a/SOURCES/libvirt-qemu-Extract-internals-of-processBlockJobEvent-into-a-helper.patch +++ /dev/null @@ -1,260 +0,0 @@ -From 9eace35bd8fd465a36132f3b66b662fff0cb92e5 Mon Sep 17 00:00:00 2001 -Message-Id: <9eace35bd8fd465a36132f3b66b662fff0cb92e5@dist-git> -From: Peter Krempa -Date: Thu, 2 Apr 2015 11:27:58 +0200 -Subject: [PATCH] qemu: Extract internals of processBlockJobEvent into a helper - -https://bugzilla.redhat.com/show_bug.cgi?id=1208021 - -Later on I'll be adding a condition that will allow to synchronise a -SYNC block job abort. The approach will require this code to be called -from two different places so it has to be extracted into a helper. - -(cherry picked from commit 0c4474df4e10d27e27dbcda80b1f9cc14f4bdd8a) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 198 +++++++++++++++++++++++++------------------------ - 1 file changed, 103 insertions(+), 95 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 0939223..490650e 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4402,116 +4402,101 @@ processSerialChangedEvent(virQEMUDriverPtr driver, - - - static void --processBlockJobEvent(virQEMUDriverPtr driver, -- virDomainObjPtr vm, -- char *diskAlias, -- int type, -- int status) -+qemuBlockJobEventProcess(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ virDomainDiskDefPtr disk, -+ int type, -+ int status) - { - virObjectEventPtr event = NULL; - virObjectEventPtr event2 = NULL; - const char *path; -- virDomainDiskDefPtr disk; - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - virDomainDiskDefPtr persistDisk = NULL; - bool save = false; - -- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -- goto cleanup; -+ /* Have to generate two variants of the event for old vs. new -+ * client callbacks */ -+ if (type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT && -+ disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT) -+ type = disk->mirrorJob; -+ path = virDomainDiskGetSource(disk); -+ event = virDomainEventBlockJobNewFromObj(vm, path, type, status); -+ event2 = virDomainEventBlockJob2NewFromObj(vm, disk->dst, type, status); - -- if (!virDomainObjIsActive(vm)) { -- VIR_DEBUG("Domain is not running"); -- goto endjob; -- } -+ /* If we completed a block pull or commit, then update the XML -+ * to match. */ -+ switch ((virConnectDomainEventBlockJobStatus) status) { -+ case VIR_DOMAIN_BLOCK_JOB_COMPLETED: -+ if (disk->mirrorState == VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT) { -+ if (vm->newDef) { -+ int indx = virDomainDiskIndexByName(vm->newDef, disk->dst, false); -+ virStorageSourcePtr copy = NULL; - -- disk = qemuProcessFindDomainDiskByAlias(vm, diskAlias); -- -- if (disk) { -- /* Have to generate two variants of the event for old vs. new -- * client callbacks */ -- if (type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT && -- disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT) -- type = disk->mirrorJob; -- path = virDomainDiskGetSource(disk); -- event = virDomainEventBlockJobNewFromObj(vm, path, type, status); -- event2 = virDomainEventBlockJob2NewFromObj(vm, disk->dst, type, -- status); -- -- /* If we completed a block pull or commit, then update the XML -- * to match. */ -- switch ((virConnectDomainEventBlockJobStatus) status) { -- case VIR_DOMAIN_BLOCK_JOB_COMPLETED: -- if (disk->mirrorState == VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT) { -- if (vm->newDef) { -- int indx = virDomainDiskIndexByName(vm->newDef, disk->dst, -- false); -- virStorageSourcePtr copy = NULL; -- -- if (indx >= 0) { -- persistDisk = vm->newDef->disks[indx]; -- copy = virStorageSourceCopy(disk->mirror, false); -- if (virStorageSourceInitChainElement(copy, -- persistDisk->src, -- true) < 0) { -- VIR_WARN("Unable to update persistent definition " -- "on vm %s after block job", -- vm->def->name); -- virStorageSourceFree(copy); -- copy = NULL; -- persistDisk = NULL; -- } -- } -- if (copy) { -- virStorageSourceFree(persistDisk->src); -- persistDisk->src = copy; -+ if (indx >= 0) { -+ persistDisk = vm->newDef->disks[indx]; -+ copy = virStorageSourceCopy(disk->mirror, false); -+ if (virStorageSourceInitChainElement(copy, -+ persistDisk->src, -+ true) < 0) { -+ VIR_WARN("Unable to update persistent definition " -+ "on vm %s after block job", -+ vm->def->name); -+ virStorageSourceFree(copy); -+ copy = NULL; -+ persistDisk = NULL; - } - } -- -- /* XXX We want to revoke security labels and disk -- * lease, as well as audit that revocation, before -- * dropping the original source. But it gets tricky -- * if both source and mirror share common backing -- * files (we want to only revoke the non-shared -- * portion of the chain); so for now, we leak the -- * access to the original. */ -- virStorageSourceFree(disk->src); -- disk->src = disk->mirror; -- } else { -- virStorageSourceFree(disk->mirror); -+ if (copy) { -+ virStorageSourceFree(persistDisk->src); -+ persistDisk->src = copy; -+ } - } - -- /* Recompute the cached backing chain to match our -- * updates. Better would be storing the chain ourselves -- * rather than reprobing, but we haven't quite completed -- * that conversion to use our XML tracking. */ -- disk->mirror = NULL; -- save = disk->mirrorState != VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -- disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -- disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -- ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, -- true, true)); -- disk->blockjob = false; -- break; -- -- case VIR_DOMAIN_BLOCK_JOB_READY: -- disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY; -- save = true; -- break; -- -- case VIR_DOMAIN_BLOCK_JOB_FAILED: -- case VIR_DOMAIN_BLOCK_JOB_CANCELED: -+ /* XXX We want to revoke security labels and disk -+ * lease, as well as audit that revocation, before -+ * dropping the original source. But it gets tricky -+ * if both source and mirror share common backing -+ * files (we want to only revoke the non-shared -+ * portion of the chain); so for now, we leak the -+ * access to the original. */ -+ virStorageSourceFree(disk->src); -+ disk->src = disk->mirror; -+ } else { - virStorageSourceFree(disk->mirror); -- disk->mirror = NULL; -- disk->mirrorState = status == VIR_DOMAIN_BLOCK_JOB_FAILED ? -- VIR_DOMAIN_DISK_MIRROR_STATE_ABORT : VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -- disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -- save = true; -- disk->blockjob = false; -- break; -- -- case VIR_DOMAIN_BLOCK_JOB_LAST: -- break; - } -+ -+ /* Recompute the cached backing chain to match our -+ * updates. Better would be storing the chain ourselves -+ * rather than reprobing, but we haven't quite completed -+ * that conversion to use our XML tracking. */ -+ disk->mirror = NULL; -+ save = disk->mirrorState != VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -+ disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -+ disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -+ ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, -+ true, true)); -+ disk->blockjob = false; -+ break; -+ -+ case VIR_DOMAIN_BLOCK_JOB_READY: -+ disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY; -+ save = true; -+ break; -+ -+ case VIR_DOMAIN_BLOCK_JOB_FAILED: -+ case VIR_DOMAIN_BLOCK_JOB_CANCELED: -+ virStorageSourceFree(disk->mirror); -+ disk->mirror = NULL; -+ disk->mirrorState = status == VIR_DOMAIN_BLOCK_JOB_FAILED ? -+ VIR_DOMAIN_DISK_MIRROR_STATE_ABORT : VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -+ disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -+ save = true; -+ disk->blockjob = false; -+ break; -+ -+ case VIR_DOMAIN_BLOCK_JOB_LAST: -+ break; - } - - if (save) { -@@ -4523,13 +4508,36 @@ processBlockJobEvent(virQEMUDriverPtr driver, - VIR_WARN("Unable to update persistent definition on vm %s " - "after block job", vm->def->name); - } -- virObjectUnref(cfg); - - if (event) - qemuDomainEventQueue(driver, event); - if (event2) - qemuDomainEventQueue(driver, event2); - -+ virObjectUnref(cfg); -+} -+ -+ -+static void -+processBlockJobEvent(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ char *diskAlias, -+ int type, -+ int status) -+{ -+ virDomainDiskDefPtr disk; -+ -+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -+ goto cleanup; -+ -+ if (!virDomainObjIsActive(vm)) { -+ VIR_DEBUG("Domain is not running"); -+ goto endjob; -+ } -+ -+ if ((disk = qemuProcessFindDomainDiskByAlias(vm, diskAlias))) -+ qemuBlockJobEventProcess(driver, vm, disk, type, status); -+ - endjob: - ignore_value(qemuDomainObjEndJob(driver, vm)); - cleanup: --- -2.3.5 - diff --git a/SOURCES/libvirt-qemu-Extract-mem-path-building-into-its-own-function.patch b/SOURCES/libvirt-qemu-Extract-mem-path-building-into-its-own-function.patch new file mode 100644 index 0000000..7c2cc9c --- /dev/null +++ b/SOURCES/libvirt-qemu-Extract-mem-path-building-into-its-own-function.patch @@ -0,0 +1,173 @@ +From 75f3f4ed1356eba49f472206bb9bb0eeae728ba6 Mon Sep 17 00:00:00 2001 +Message-Id: <75f3f4ed1356eba49f472206bb9bb0eeae728ba6@dist-git> +From: Martin Kletzander +Date: Tue, 6 Oct 2015 15:20:33 +0200 +Subject: [PATCH] qemu: Extract -mem-path building into its own function + +https://bugzilla.redhat.com/show_bug.cgi?id=1266856 + +That function is called qemuBuildMemPathStr() and will be used in +other places in the future. The change in the test suite is proper due +to the fact that -mem-prealloc makes only sense with -mem-path (from +qemu documentation -- html/qemu-doc.html). + +Signed-off-by: Martin Kletzander +(cherry picked from commit ad8ab88c9141afb9b7541c67f3d0966d5a1b31cd) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 120 ++++++++++++--------- + .../qemuxml2argv-hugepages-pages6.args | 2 +- + 2 files changed, 73 insertions(+), 49 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 53c9d01..0822ee4 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -7705,6 +7705,71 @@ qemuBuildSmpArgStr(const virDomainDef *def, + } + + static int ++qemuBuildMemPathStr(virQEMUDriverConfigPtr cfg, ++ virDomainDefPtr def, ++ virQEMUCapsPtr qemuCaps, ++ virCommandPtr cmd) ++{ ++ const long system_page_size = virGetSystemPageSizeKB(); ++ char *mem_path = NULL; ++ size_t i = 0; ++ ++ /* ++ * No-op if hugepages were not requested. ++ */ ++ if (!def->mem.nhugepages) ++ return 0; ++ ++ /* There is one special case: if user specified "huge" ++ * pages of regular system pages size. ++ * And there is nothing to do in this case. ++ */ ++ if (def->mem.hugepages[0].size == system_page_size) ++ return 0; ++ ++ if (!cfg->nhugetlbfs) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ "%s", _("hugetlbfs filesystem is not mounted " ++ "or disabled by administrator config")); ++ return -1; ++ } ++ ++ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MEM_PATH)) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("hugepage backing not supported by '%s'"), ++ def->emulator); ++ return -1; ++ } ++ ++ if (!def->mem.hugepages[0].size) { ++ if (!(mem_path = qemuGetDefaultHugepath(cfg->hugetlbfs, ++ cfg->nhugetlbfs))) ++ return -1; ++ } else { ++ for (i = 0; i < cfg->nhugetlbfs; i++) { ++ if (cfg->hugetlbfs[i].size == def->mem.hugepages[0].size) ++ break; ++ } ++ ++ if (i == cfg->nhugetlbfs) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Unable to find any usable hugetlbfs " ++ "mount for %llu KiB"), ++ def->mem.hugepages[0].size); ++ return -1; ++ } ++ ++ if (!(mem_path = qemuGetHugepagePath(&cfg->hugetlbfs[i]))) ++ return -1; ++ } ++ ++ virCommandAddArgList(cmd, "-mem-prealloc", "-mem-path", mem_path, NULL); ++ VIR_FREE(mem_path); ++ ++ return 0; ++} ++ ++static int + qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, + virDomainDefPtr def, + virCommandPtr cmd, +@@ -9074,54 +9139,13 @@ qemuBuildCommandLine(virConnectPtr conn, + virCommandAddArgFormat(cmd, "%llu", virDomainDefGetMemoryInitial(def) / 1024); + } + +- if (def->mem.nhugepages && !virDomainNumaGetNodeCount(def->numa)) { +- const long system_page_size = virGetSystemPageSizeKB(); +- char *mem_path = NULL; +- +- if (def->mem.hugepages[0].size == system_page_size) { +- /* There is one special case: if user specified "huge" +- * pages of regular system pages size. */ +- } else { +- if (!cfg->nhugetlbfs) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- "%s", _("hugetlbfs filesystem is not mounted " +- "or disabled by administrator config")); +- goto error; +- } +- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MEM_PATH)) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("hugepage backing not supported by '%s'"), +- def->emulator); +- goto error; +- } +- +- if (def->mem.hugepages[0].size) { +- for (j = 0; j < cfg->nhugetlbfs; j++) { +- if (cfg->hugetlbfs[j].size == def->mem.hugepages[0].size) +- break; +- } +- +- if (j == cfg->nhugetlbfs) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Unable to find any usable hugetlbfs mount for %llu KiB"), +- def->mem.hugepages[0].size); +- goto error; +- } +- +- if (!(mem_path = qemuGetHugepagePath(&cfg->hugetlbfs[j]))) +- goto error; +- } else { +- if (!(mem_path = qemuGetDefaultHugepath(cfg->hugetlbfs, +- cfg->nhugetlbfs))) +- goto error; +- } +- } +- +- virCommandAddArg(cmd, "-mem-prealloc"); +- if (mem_path) +- virCommandAddArgList(cmd, "-mem-path", mem_path, NULL); +- VIR_FREE(mem_path); +- } ++ /* ++ * Add '-mem-path' (and '-mem-prealloc') parameter here only if ++ * there is no numa node specified. ++ */ ++ if (!virDomainNumaGetNodeCount(def->numa) && ++ qemuBuildMemPathStr(cfg, def, qemuCaps, cmd) < 0) ++ goto error; + + if (def->mem.locked && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MLOCK)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args +index 4eccb86..a3a4e57 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args +@@ -1,4 +1,4 @@ + LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +-/usr/bin/qemu -S -M pc -m 1024 -mem-prealloc -smp 2 -nographic \ ++/usr/bin/qemu -S -M pc -m 1024 -smp 2 -nographic \ + -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ + -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none +-- +2.6.1 + diff --git a/SOURCES/libvirt-qemu-Fix-access-to-auto-generated-socket-paths.patch b/SOURCES/libvirt-qemu-Fix-access-to-auto-generated-socket-paths.patch new file mode 100644 index 0000000..460f184 --- /dev/null +++ b/SOURCES/libvirt-qemu-Fix-access-to-auto-generated-socket-paths.patch @@ -0,0 +1,199 @@ +From cbd26cc9303bc0b00da7d63756c016c4f056ab4c Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Mon, 24 Aug 2015 13:04:51 +0200 +Subject: [PATCH] qemu: Fix access to auto-generated socket paths + +We are automatically generating some socket paths for domains, but all +those paths end up in a directory that's the same for multiple domains. +The problem is that multiple domains can each run with different +seclabels (users, selinux contexts, etc.). The idea here is to create a +per-domain directory labelled in a way that each domain can access its +own unix sockets. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146886 + +Signed-off-by: Martin Kletzander +(cherry picked from commit f1f68ca33433825ce0deed2d96f1990200bc6618) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 2 +- + src/qemu/qemu_domain.c | 16 +++--- + src/qemu/qemu_process.c | 57 +++++++++++++++++++++- + .../qemuxml2argv-channel-virtio-unix.args | 7 +-- + 4 files changed, 67 insertions(+), 15 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index d28063c..aebaf35 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -7807,7 +7807,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg, + if (graphics->data.vnc.socket || cfg->vncAutoUnixSocket) { + if (!graphics->data.vnc.socket && + virAsprintf(&graphics->data.vnc.socket, +- "%s/%s.vnc", cfg->libDir, def->name) == -1) ++ "%s/domain-%s/vnc.sock", cfg->libDir, def->name) == -1) + goto error; + + virBufferAsprintf(&opt, "unix:%s", graphics->data.vnc.socket); +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 3b542f5..943d727 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -1288,16 +1288,12 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, + goto cleanup; + } + +- if (dev->data.chr->target.name) { +- if (virAsprintf(&dev->data.chr->source.data.nix.path, "%s/%s.%s", +- cfg->channelTargetDir, +- def->name, dev->data.chr->target.name) < 0) +- goto cleanup; +- } else { +- if (virAsprintf(&dev->data.chr->source.data.nix.path, "%s/%s", +- cfg->channelTargetDir, def->name) < 0) +- goto cleanup; +- } ++ if (virAsprintf(&dev->data.chr->source.data.nix.path, ++ "%s/domain-%s/%s", ++ cfg->channelTargetDir, def->name, ++ dev->data.chr->target.name ? dev->data.chr->target.name ++ : "unknown.sock") < 0) ++ goto cleanup; + + dev->data.chr->source.data.nix.listen = true; + } +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index e1c7f0b..8cda456 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -46,6 +46,7 @@ + + #include "cpu/cpu.h" + #include "datatypes.h" ++#include "dirname.h" + #include "virlog.h" + #include "virerror.h" + #include "viralloc.h" +@@ -3269,7 +3270,7 @@ qemuProcessPrepareMonitorChr(virQEMUDriverConfigPtr cfg, + monConfig->type = VIR_DOMAIN_CHR_TYPE_UNIX; + monConfig->data.nix.listen = true; + +- if (virAsprintf(&monConfig->data.nix.path, "%s/%s.monitor", ++ if (virAsprintf(&monConfig->data.nix.path, "%s/domain-%s/monitor.sock", + cfg->libDir, vm) < 0) + return -1; + return 0; +@@ -4393,6 +4394,7 @@ int qemuProcessStart(virConnectPtr conn, + unsigned int hostdev_flags = 0; + size_t nnicindexes = 0; + int *nicindexes = NULL; ++ char *tmppath = NULL, *tmpdirpath = NULL; + + VIR_DEBUG("vm=%p name=%s id=%d pid=%llu", + vm, vm->def->name, vm->def->id, +@@ -4728,6 +4730,44 @@ int qemuProcessStart(virConnectPtr conn, + &nnicindexes, &nicindexes))) + goto cleanup; + ++ ++ /* ++ * Create all per-domain directories in order to make sure domain ++ * with any possible seclabels can access it. ++ */ ++ if (virAsprintf(&tmppath, "%s/domain-%s", cfg->libDir, vm->def->name) < 0) ++ goto cleanup; ++ ++ if (virFileMakePath(tmppath) < 0) ++ goto cleanup; ++ ++ if (!(tmpdirpath = mdir_name(tmppath))) ++ goto cleanup; ++ ++ if (virSecurityManagerDomainSetDirLabel(driver->securityManager, ++ vm->def, tmpdirpath) < 0) ++ goto cleanup; ++ ++ VIR_FREE(tmppath); ++ VIR_FREE(tmpdirpath); ++ ++ if (virAsprintf(&tmppath, "%s/domain-%s", ++ cfg->channelTargetDir, vm->def->name) < 0) ++ goto cleanup; ++ ++ if (virFileMakePath(tmppath) < 0) ++ goto cleanup; ++ ++ if (!(tmpdirpath = mdir_name(tmppath))) ++ goto cleanup; ++ ++ if (virSecurityManagerDomainSetDirLabel(driver->securityManager, ++ vm->def, tmpdirpath) < 0) ++ goto cleanup; ++ ++ VIR_FREE(tmpdirpath); ++ VIR_FREE(tmppath); ++ + /* now that we know it is about to start call the hook if present */ + if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { + char *xml = qemuDomainDefFormatXML(driver, vm->def, 0); +@@ -5081,6 +5121,8 @@ int qemuProcessStart(virConnectPtr conn, + /* We jump here if we failed to start the VM for any reason, or + * if we failed to initialize the now running VM. kill it off and + * pretend we never started it */ ++ VIR_FREE(tmppath); ++ VIR_FREE(tmpdirpath); + VIR_FREE(nodeset); + virCommandFree(cmd); + VIR_FORCE_CLOSE(logfile); +@@ -5143,6 +5185,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, + size_t i; + int logfile = -1; + char *timestamp; ++ char *tmppath = NULL; + char ebuf[1024]; + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + +@@ -5233,6 +5276,18 @@ void qemuProcessStop(virQEMUDriverPtr driver, + priv->monConfig = NULL; + } + ++ ignore_value(virAsprintf(&tmppath, "%s/domain-%s", ++ cfg->libDir, vm->def->name)); ++ if (tmppath) ++ virFileDeleteTree(tmppath); ++ VIR_FREE(tmppath); ++ ++ ignore_value(virAsprintf(&tmppath, "%s/domain-%s", ++ cfg->channelTargetDir, vm->def->name)); ++ if (tmppath) ++ virFileDeleteTree(tmppath); ++ VIR_FREE(tmppath); ++ + ignore_value(virDomainChrDefForeach(vm->def, + false, + qemuProcessCleanupChardevDevice, +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-unix.args b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-unix.args +index 43a34ce..289b9d7 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-unix.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-unix.args +@@ -9,11 +9,12 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ + -usb \ + -hda /dev/HostVG/QEMUGuest1 \ + -chardev socket,id=charchannel0,path=\ +-/tmp/QEMUGuest1.org.qemu.guest_agent.0,server,nowait \ ++/tmp/domain-QEMUGuest1/org.qemu.guest_agent.0,server,nowait \ + -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,\ + name=org.qemu.guest_agent.0 \ +--chardev socket,id=charchannel1,path=/tmp/QEMUGuest1,server,nowait \ ++-chardev \ ++socket,id=charchannel1,path=/tmp/domain-QEMUGuest1/unknown.sock,server,nowait \ + -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1 \ +--chardev socket,id=charchannel2,path=/tmp/QEMUGuest1.ble,server,nowait \ ++-chardev socket,id=charchannel2,path=/tmp/domain-QEMUGuest1/ble,server,nowait \ + -device virtserialport,bus=virtio-serial0.0,nr=3,chardev=charchannel2,id=channel2,\ + name=ble +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Fix-call-in-qemuDomainSetNumaParamsLive-for-virCgroupNewIOThread.patch b/SOURCES/libvirt-qemu-Fix-call-in-qemuDomainSetNumaParamsLive-for-virCgroupNewIOThread.patch deleted file mode 100644 index 6d532ed..0000000 --- a/SOURCES/libvirt-qemu-Fix-call-in-qemuDomainSetNumaParamsLive-for-virCgroupNewIOThread.patch +++ /dev/null @@ -1,36 +0,0 @@ -From f48bbd58f075b118369898c44687c2c67c791998 Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Thu, 18 Sep 2014 09:30:00 -0400 -Subject: [PATCH] qemu: Fix call in qemuDomainSetNumaParamsLive for - virCgroupNewIOThread - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -Found by inspection of the "i+1" change. IOThreads are numbered 1..n -thus the virCgroupNewIOThread needs to create a 1..n value not 0 based. - -(cherry picked from commit 82494cd628eedd4c698a7f11a4001c586107c198) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index a1379c2..f914081 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -8767,7 +8767,8 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm, - goto cleanup; - - for (i = 0; i < priv->niothreadpids; i++) { -- if (virCgroupNewIOThread(priv->cgroup, i, false, &cgroup_temp) < 0 || -+ if (virCgroupNewIOThread(priv->cgroup, i + 1, false, -+ &cgroup_temp) < 0 || - virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0) - goto cleanup; - virCgroupFree(&cgroup_temp); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Fix-crash-in-tunnelled-migration.patch b/SOURCES/libvirt-qemu-Fix-crash-in-tunnelled-migration.patch deleted file mode 100644 index 52e76c1..0000000 --- a/SOURCES/libvirt-qemu-Fix-crash-in-tunnelled-migration.patch +++ /dev/null @@ -1,37 +0,0 @@ -From d641536fa5aa5f52795f72c346d743939034ef0e Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Thu, 20 Nov 2014 13:09:16 +0100 -Subject: [PATCH] qemu: Fix crash in tunnelled migration - -Any attempt to start a tunnelled migration with libvirtd that supports -RDMA migration (specifically commit v1.2.8-226-ged22a47) crashes -libvirtd on the destination host. - -The crash is inevitable because qemuMigrationPrepareAny is always called -with NULL protocol in case of tunnelled migration. - -https://bugzilla.redhat.com/show_bug.cgi?id=1147331 -Signed-off-by: Jiri Denemark -(cherry picked from commit 52691f99fa016ac46c9546c37706e57a5180d4c6) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 7745d77..4b701d3 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -2715,7 +2715,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - QEMU_MIGRATION_COOKIE_NBD))) - goto cleanup; - -- if (STREQ(protocol, "rdma") && !vm->def->mem.hard_limit) { -+ if (STREQ_NULLABLE(protocol, "rdma") && !vm->def->mem.hard_limit) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("cannot start RDMA migration with no memory hard " - "limit set")); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Fix-dynamic_ownership-qemu.conf-setting.patch b/SOURCES/libvirt-qemu-Fix-dynamic_ownership-qemu.conf-setting.patch new file mode 100644 index 0000000..3c9528f --- /dev/null +++ b/SOURCES/libvirt-qemu-Fix-dynamic_ownership-qemu.conf-setting.patch @@ -0,0 +1,48 @@ +From 76d622dec775b332594c46fa55d1fd33785d1d62 Mon Sep 17 00:00:00 2001 +Message-Id: <76d622dec775b332594c46fa55d1fd33785d1d62@dist-git> +From: Cole Robinson +Date: Tue, 29 Sep 2015 15:57:34 +0200 +Subject: [PATCH] qemu: Fix dynamic_ownership qemu.conf setting + +https://bugzilla.redhat.com/show_bug.cgi?id=1266628 + +Commit 307fb904 (Sep 10) added a 'privileged' variable when creating +the DAC driver: + +@@ -153,6 +157,7 @@ virSecurityManagerNewDAC(const char *virtDriver, + bool defaultConfined, + bool requireConfined, + bool dynamicOwnership, ++ bool privileged, + virSecurityManagerDACChownCallback chownCallback) + +But argument order is mixed up at the caller, swapping dynamicOwnership +and privileged values. This corrects the argument order + +(cherry picked from commit 68572de8228e3971174a83c227fcb018d6f684c7) + +https://bugzilla.redhat.com/show_bug.cgi?id=1267154 + +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index e77e548..bdebf13 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -431,8 +431,8 @@ qemuSecurityInit(virQEMUDriverPtr driver) + cfg->allowDiskFormatProbing, + cfg->securityDefaultConfined, + cfg->securityRequireConfined, +- virQEMUDriverIsPrivileged(driver), + cfg->dynamicOwnership, ++ virQEMUDriverIsPrivileged(driver), + qemuSecurityChownCallback))) + goto error; + if (!stack) { +-- +2.6.0 + diff --git a/SOURCES/libvirt-qemu-Fix-hot-unplug-of-SCSI_HOST-device.patch b/SOURCES/libvirt-qemu-Fix-hot-unplug-of-SCSI_HOST-device.patch deleted file mode 100644 index f5d49de..0000000 --- a/SOURCES/libvirt-qemu-Fix-hot-unplug-of-SCSI_HOST-device.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 4d1a798e093f8251d2f045529eae85ad68fc3dd1 Mon Sep 17 00:00:00 2001 -Message-Id: <4d1a798e093f8251d2f045529eae85ad68fc3dd1@dist-git> -From: John Ferlan -Date: Mon, 6 Oct 2014 11:14:32 -0400 -Subject: [PATCH] qemu: Fix hot unplug of SCSI_HOST device - -https://bugzilla.redhat.com/show_bug.cgi?id=1141732 - -Introduced by commit id '8f76ad99' the logic to detach a scsi_host -device (SCSI or iSCSI) fails when attempting to remove the 'drive' -because as I found in my investigation - the DelDevice takes care of -that for us. - -The investigation turned up commits to adjust the logic for the -qemuMonitorDelDevice and qemuMonitorDriveDel processing for interfaces -(commit id '81f76598'), disk bus=VIRTIO,SCSI,USB (commit id '0635785b'), -and chr devices (commit id '55b21f9b'), but nothing with the host devices. - -This commit uses the model for the previous set of changes and applies -it to the hostdev path. The call to qemuDomainDetachHostSCSIDevice will -return to qemuDomainDetachThisHostDevice handling either the audit of -the failure or the wait for the removal and then call into -qemuDomainRemoveHostDevice for the event, removal from the domain hostdev -list, and audit of the removal similar to other paths. - -NOTE: For now the 'conn' param to +qemuDomainDetachHostSCSIDevice is left -as ATTRIBUTE_UNUSED. Removing requires a cascade of other changes to be -left for a future patch. - -(cherry picked from commit d2774e54cde2377c78a7572eb3fec0a663e5017f) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 50 +++++++++++++++++++++++++------------------------ - 1 file changed, 26 insertions(+), 24 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 8eb2419..fe4994a 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -2622,10 +2622,26 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver, - virDomainNetDefPtr net = NULL; - virObjectEventPtr event; - size_t i; -+ int ret = -1; -+ qemuDomainObjPrivatePtr priv = vm->privateData; -+ char *drivestr = NULL; - - VIR_DEBUG("Removing host device %s from domain %p %s", - hostdev->info->alias, vm, vm->def->name); - -+ if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI) { -+ /* build the actual drive id string as generated during -+ * qemuBuildSCSIHostdevDrvStr that is passed to qemu */ -+ if (virAsprintf(&drivestr, "%s-%s", -+ virDomainDeviceAddressTypeToString(hostdev->info->type), -+ hostdev->info->alias) < 0) -+ goto cleanup; -+ -+ qemuDomainObjEnterMonitor(driver, vm); -+ qemuMonitorDriveDel(priv->mon, drivestr); -+ qemuDomainObjExitMonitor(driver, vm); -+ } -+ - event = virDomainEventDeviceRemovedNewFromObj(vm, hostdev->info->alias); - if (event) - qemuDomainEventQueue(driver, event); -@@ -2678,8 +2694,12 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver, - networkReleaseActualDevice(vm->def, net); - virDomainNetDefFree(net); - } -+ ret = 0; -+ -+ cleanup: -+ VIR_FREE(drivestr); - virObjectUnref(cfg); -- return 0; -+ return ret; - } - - -@@ -3305,14 +3325,12 @@ qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver, - } - - static int --qemuDomainDetachHostSCSIDevice(virConnectPtr conn, -+qemuDomainDetachHostSCSIDevice(virConnectPtr conn ATTRIBUTE_UNUSED, - virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr detach) - { - qemuDomainObjPrivatePtr priv = vm->privateData; -- char *drvstr = NULL; -- char *devstr = NULL; - int ret = -1; - - if (!detach->info->alias) { -@@ -3327,33 +3345,17 @@ qemuDomainDetachHostSCSIDevice(virConnectPtr conn, - return -1; - } - -- if (!(drvstr = qemuBuildSCSIHostdevDrvStr(conn, detach, priv->qemuCaps, -- &buildCommandLineCallbacks))) -- goto cleanup; -- if (!(devstr = qemuBuildSCSIHostdevDevStr(vm->def, detach, priv->qemuCaps))) -- goto cleanup; -- - qemuDomainMarkDeviceForRemoval(vm, detach->info); - - qemuDomainObjEnterMonitor(driver, vm); -- if ((ret = qemuMonitorDelDevice(priv->mon, detach->info->alias)) == 0) { -- if ((ret = qemuMonitorDriveDel(priv->mon, drvstr)) < 0) { -- virErrorPtr orig_err = virSaveLastError(); -- if (qemuMonitorAddDevice(priv->mon, devstr) < 0) -- VIR_WARN("Unable to add device %s (%s) after failed " -- "qemuMonitorDriveDel", -- drvstr, devstr); -- if (orig_err) { -- virSetError(orig_err); -- virFreeError(orig_err); -- } -- } -+ if (qemuMonitorDelDevice(priv->mon, detach->info->alias) < 0) { -+ qemuDomainObjExitMonitor(driver, vm); -+ goto cleanup; - } - qemuDomainObjExitMonitor(driver, vm); -+ ret = 0; - - cleanup: -- VIR_FREE(drvstr); -- VIR_FREE(devstr); - return ret; - } - --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-Fix-hotplugging-cpus-with-strict-memory-pinning.patch b/SOURCES/libvirt-qemu-Fix-hotplugging-cpus-with-strict-memory-pinning.patch deleted file mode 100644 index f903e8c..0000000 --- a/SOURCES/libvirt-qemu-Fix-hotplugging-cpus-with-strict-memory-pinning.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 43c846034c4316cf53d193f52c59f4f9df484fe5 Mon Sep 17 00:00:00 2001 -Message-Id: <43c846034c4316cf53d193f52c59f4f9df484fe5@dist-git> -From: Martin Kletzander -Date: Thu, 15 Jan 2015 15:03:49 +0100 -Subject: [PATCH] qemu: Fix hotplugging cpus with strict memory pinning - -When hot-plugging a VCPU into the guest, kvm needs to allocate some data -from the DMA zone, which might be in a memory node that's not allowed in -cpuset.mems. Basically the same problem as there was with starting the -domain and due to which commit 7e72ac787848b7434c9359a57c1e2789d92350f8 -exists. This patch just extends it to hotplugging as well. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1161540 - -Signed-off-by: Martin Kletzander -(cherry picked from commit e3435caf6af41748204e542dee13ede8441d88c0) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 29 +++++++++++++++++++++++++++++ - 1 file changed, 29 insertions(+) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index ea9368d..afcf326 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -97,6 +97,7 @@ - #include "virhostdev.h" - #include "domain_capabilities.h" - #include "vircgroup.h" -+#include "virnuma.h" - - #define VIR_FROM_THIS VIR_FROM_QEMU - -@@ -4641,6 +4642,11 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, - int ncpuinfo; - qemuDomainObjPrivatePtr priv; - size_t i; -+ virCgroupPtr cgroup_temp = NULL; -+ char *mem_mask = NULL; -+ char *all_nodes_str = NULL; -+ virBitmapPtr all_nodes = NULL; -+ virErrorPtr err = NULL; - - virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | - VIR_DOMAIN_AFFECT_CONFIG | -@@ -4666,9 +4672,22 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, - - priv = vm->privateData; - -+ if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0) -+ goto cleanup; -+ -+ if (!(all_nodes = virNumaGetHostNodeset())) -+ goto cleanup; -+ -+ if (!(all_nodes_str = virBitmapFormat(all_nodes))) -+ goto cleanup; -+ - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) - goto cleanup; - -+ if (virCgroupGetCpusetMems(cgroup_temp, &mem_mask) < 0 || -+ virCgroupSetCpusetMems(cgroup_temp, all_nodes_str) < 0) -+ goto endjob; -+ - maximum = (flags & VIR_DOMAIN_VCPU_MAXIMUM) != 0; - flags &= ~VIR_DOMAIN_VCPU_MAXIMUM; - -@@ -4778,6 +4797,12 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, - ret = 0; - - endjob: -+ if (mem_mask) { -+ err = virSaveLastError(); -+ virCgroupSetCpusetMems(cgroup_temp, mem_mask); -+ virSetError(err); -+ } -+ - if (!qemuDomainObjEndJob(driver, vm)) - vm = NULL; - -@@ -4786,6 +4811,10 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, - virObjectUnlock(vm); - virObjectUnref(caps); - VIR_FREE(cpuinfo); -+ VIR_FREE(mem_mask); -+ VIR_FREE(all_nodes_str); -+ virBitmapFree(all_nodes); -+ virCgroupFree(&cgroup_temp); - virObjectUnref(cfg); - return ret; - } --- -2.2.1 - diff --git a/SOURCES/libvirt-qemu-Fix-integer-boolean-logic-in-qemuSetUnprivSGIO.patch b/SOURCES/libvirt-qemu-Fix-integer-boolean-logic-in-qemuSetUnprivSGIO.patch new file mode 100644 index 0000000..3fcfd40 --- /dev/null +++ b/SOURCES/libvirt-qemu-Fix-integer-boolean-logic-in-qemuSetUnprivSGIO.patch @@ -0,0 +1,49 @@ +From 8c46231056f7c633a9f8576018d764e3a0b7251f Mon Sep 17 00:00:00 2001 +Message-Id: <8c46231056f7c633a9f8576018d764e3a0b7251f@dist-git> +From: John Ferlan +Date: Thu, 9 Jul 2015 08:28:56 -0400 +Subject: [PATCH] qemu: Fix integer/boolean logic in qemuSetUnprivSGIO + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +Setting of 'val' is a boolean expression, so handle it that way and +adjust the check/return logic to be clearer + +Signed-off-by: John Ferlan +(cherry picked from commit 69b850fe2a19d0c32ae2f209e8d8463df6ead665) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index d41f166..7d317d7 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1433,7 +1433,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + virDomainHostdevDefPtr hostdev = NULL; + char *sysfs_path = NULL; + const char *path = NULL; +- int val = -1; ++ bool val; + int ret = -1; + + /* "sgio" is only valid for block disk; cdrom +@@ -1475,8 +1475,12 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + * whitelist is enabled. But if requesting unfiltered access, always call + * virSetDeviceUnprivSGIO, to report an error for unsupported unpriv_sgio. + */ +- if ((virFileExists(sysfs_path) || val == 1) && +- virSetDeviceUnprivSGIO(path, NULL, val) < 0) ++ if (!val || !virFileExists(sysfs_path)) { ++ ret = 0; ++ goto cleanup; ++ } ++ ++ if (virSetDeviceUnprivSGIO(path, NULL, 1) < 0) + goto cleanup; + + ret = 0; +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Fix-iothreads-issue.patch b/SOURCES/libvirt-qemu-Fix-iothreads-issue.patch deleted file mode 100644 index bd0e2b7..0000000 --- a/SOURCES/libvirt-qemu-Fix-iothreads-issue.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 58fb8449e8c7d580c48f85b49993bf0a034e94f3 Mon Sep 17 00:00:00 2001 -Message-Id: <58fb8449e8c7d580c48f85b49993bf0a034e94f3@dist-git> -From: John Ferlan -Date: Thu, 18 Sep 2014 09:29:58 -0400 -Subject: [PATCH] qemu: Fix iothreads issue - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -If there are no iothreads, then return from qemuProcessDetectIOThreadPIDs -without error; otherwise, the following occurs: - -error: Failed to start domain $dom -error: An error occurred, but the cause is unknown -(cherry picked from commit b66c950fb9d5dc0e786cdf4ebe7e206cd5d7001c) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index ed73ae5..274fc1b 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2109,9 +2109,13 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver, - goto cleanup; - niothreads = qemuMonitorGetIOThreads(priv->mon, &iothreads); - qemuDomainObjExitMonitor(driver, vm); -- if (niothreads <= 0) -+ if (niothreads < 0) - goto cleanup; - -+ /* Nothing to do */ -+ if (niothreads == 0) -+ return 0; -+ - if (niothreads != vm->def->iothreads) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("got wrong number of IOThread pids from QEMU monitor. " --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Fix-memory-leak-in-RDMA-migration-code.patch b/SOURCES/libvirt-qemu-Fix-memory-leak-in-RDMA-migration-code.patch deleted file mode 100644 index f5142e1..0000000 --- a/SOURCES/libvirt-qemu-Fix-memory-leak-in-RDMA-migration-code.patch +++ /dev/null @@ -1,46 +0,0 @@ -From e172cc333ddcdb7fdfa49147f9def22da05c3b94 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Tue, 23 Sep 2014 15:47:59 +0200 -Subject: [PATCH] qemu: Fix memory leak in RDMA migration code - -https://bugzilla.redhat.com/show_bug.cgi?id=1013055 - -Signed-off-by: Jiri Denemark -(cherry picked from commit ad56f863787d6d7f212bbffd42286349ce0ae0ad) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index fda7cda..1db9108 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -3792,13 +3792,13 @@ static int doNativeMigrate(virQEMUDriverPtr driver, - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("outgoing RDMA migration is not supported " - "with this QEMU binary")); -- return -1; -+ goto cleanup; - } - if (!vm->def->mem.hard_limit) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("cannot start RDMA migration with no memory hard " - "limit set")); -- return -1; -+ goto cleanup; - } - } - -@@ -3819,6 +3819,7 @@ static int doNativeMigrate(virQEMUDriverPtr driver, - if (spec.destType == MIGRATION_DEST_FD) - VIR_FORCE_CLOSE(spec.dest.fd.qemu); - -+ cleanup: - virURIFree(uribits); - - return ret; --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-Fix-old-tcp-host-URIs-more-cleanly.patch b/SOURCES/libvirt-qemu-Fix-old-tcp-host-URIs-more-cleanly.patch deleted file mode 100644 index 5dd1f59..0000000 --- a/SOURCES/libvirt-qemu-Fix-old-tcp-host-URIs-more-cleanly.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 79e76b8ff1ee3b5b5cea58e896ea22480653bb8f Mon Sep 17 00:00:00 2001 -Message-Id: <79e76b8ff1ee3b5b5cea58e896ea22480653bb8f@dist-git> -From: Jiri Denemark -Date: Tue, 23 Sep 2014 15:47:54 +0200 -Subject: [PATCH] qemu: Fix old tcp:host URIs more cleanly - -For compatibility with old libvirt we need to support both tcp:host and -tcp://host migration URIs. Let's make the code that parses them a bit -cleaner. - -https://bugzilla.redhat.com/show_bug.cgi?id=1013055 - -Signed-off-by: Jiri Denemark -(cherry picked from commit 1cffb25c165cc47a45380379146af526f0f87135) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 73 +++++++++++++++++++++-------------------------- - 1 file changed, 32 insertions(+), 41 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 179af80..a66ea54 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -2817,6 +2817,29 @@ qemuMigrationPrepareTunnel(virQEMUDriverPtr driver, - } - - -+static virURIPtr -+qemuMigrationParseURI(const char *uri, bool *wellFormed) -+{ -+ char *tmp = NULL; -+ virURIPtr parsed; -+ -+ /* For compatibility reasons tcp://... URIs are sent as tcp:... -+ * We need to transform them to a well-formed URI before parsing. */ -+ if (STRPREFIX(uri, "tcp:") && !STRPREFIX(uri + 4, "//")) { -+ if (virAsprintf(&tmp, "tcp://%s", uri + 4) < 0) -+ return NULL; -+ uri = tmp; -+ } -+ -+ parsed = virURIParse(uri); -+ if (parsed && wellFormed) -+ *wellFormed = !tmp; -+ VIR_FREE(tmp); -+ -+ return parsed; -+} -+ -+ - int - qemuMigrationPrepareDirect(virQEMUDriverPtr driver, - virConnectPtr dconn, -@@ -2834,11 +2857,8 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver, - unsigned short port = 0; - bool autoPort = true; - char *hostname = NULL; -- const char *p; -- char *uri_str = NULL; - int ret = -1; - virURIPtr uri = NULL; -- bool well_formed_uri = true; - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - const char *migrateHost = cfg->migrateHost; - -@@ -2890,34 +2910,18 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver, - * compatibility with old targets. We at least make the - * new targets accept both syntaxes though. - */ -- /* Caller frees */ - if (virAsprintf(uri_out, "tcp:%s:%d", hostname, port) < 0) - goto cleanup; - } else { -- /* Check the URI starts with "tcp:". We will escape the -- * URI when passing it to the qemu monitor, so bad -- * characters in hostname part don't matter. -- */ -- if (!(p = STRSKIP(uri_in, "tcp:"))) { -- virReportError(VIR_ERR_INVALID_ARG, "%s", -- _("only tcp URIs are supported for KVM/QEMU" -- " migrations")); -+ bool well_formed_uri; -+ -+ if (!(uri = qemuMigrationParseURI(uri_in, &well_formed_uri))) - goto cleanup; -- } - -- /* Convert uri_in to well-formed URI with // after tcp: */ -- if (!(STRPREFIX(uri_in, "tcp://"))) { -- well_formed_uri = false; -- if (virAsprintf(&uri_str, "tcp://%s", p) < 0) -- goto cleanup; -- } -- -- uri = virURIParse(uri_str ? uri_str : uri_in); -- VIR_FREE(uri_str); -- -- if (uri == NULL) { -- virReportError(VIR_ERR_INVALID_ARG, _("unable to parse URI: %s"), -- uri_in); -+ if (STRNEQ(uri->scheme, "tcp")) { -+ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, -+ _("unsupported scheme %s in migration URI %s"), -+ uri->scheme, uri_in); - goto cleanup; - } - -@@ -2931,18 +2935,15 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver, - if (virPortAllocatorAcquire(driver->migrationPorts, &port) < 0) - goto cleanup; - -+ /* Send well-formed URI only if uri_in was well-formed */ - if (well_formed_uri) { - uri->port = port; -- -- /* Caller frees */ - if (!(*uri_out = virURIFormat(uri))) - goto cleanup; - } else { -- /* Caller frees */ - if (virAsprintf(uri_out, "%s:%d", uri_in, port) < 0) - goto cleanup; - } -- - } else { - port = uri->port; - autoPort = false; -@@ -3704,17 +3705,7 @@ static int doNativeMigrate(virQEMUDriverPtr driver, - cookieout, cookieoutlen, flags, resource, - NULLSTR(graphicsuri)); - -- if (STRPREFIX(uri, "tcp:") && !STRPREFIX(uri, "tcp://")) { -- char *tmp; -- /* HACK: source host generates bogus URIs, so fix them up */ -- if (virAsprintf(&tmp, "tcp://%s", uri + strlen("tcp:")) < 0) -- return -1; -- uribits = virURIParse(tmp); -- VIR_FREE(tmp); -- } else { -- uribits = virURIParse(uri); -- } -- if (!uribits) -+ if (!(uribits = qemuMigrationParseURI(uri, NULL))) - return -1; - - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD)) --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-Fix-reporting-of-physical-capacity-for-block-devices.patch b/SOURCES/libvirt-qemu-Fix-reporting-of-physical-capacity-for-block-devices.patch new file mode 100644 index 0000000..e24b31f --- /dev/null +++ b/SOURCES/libvirt-qemu-Fix-reporting-of-physical-capacity-for-block-devices.patch @@ -0,0 +1,144 @@ +From f218da31d36f599ecec401773fd675a1ab5e915d Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Fri, 7 Aug 2015 13:39:30 +0200 +Subject: [PATCH] qemu: Fix reporting of physical capacity for block devices + +Qemu reports physical size 0 for block devices. As 15fa84acbb55ebfee6a4 +changed the behavior of qemuDomainGetBlockInfo to just query the monitor +this created a regression since we didn't report the size correctly any +more. + +This patch adds code to refresh the physical size of a block device by +opening it and seeking to the end and uses it both in +qemuDomainGetBlockInfo and also in qemuDomainGetStatsOneBlock that was +broken since it was introduced in this respect. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1250982 +(cherry picked from commit 8dc27259255b79758367789ed272e909bdb56735) + +Signed-off-by: Jiri Denemark +--- + src/libvirt_private.syms | 1 + + src/qemu/qemu_driver.c | 18 ++++++++++++++++-- + src/util/virstoragefile.c | 39 +++++++++++++++++++++++++++++++++++++++ + src/util/virstoragefile.h | 2 ++ + 4 files changed, 58 insertions(+), 2 deletions(-) + +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index ad9ebb1..e5d8437 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -2157,6 +2157,7 @@ virStorageSourceParseRBDColonString; + virStorageSourcePoolDefFree; + virStorageSourcePoolModeTypeFromString; + virStorageSourcePoolModeTypeToString; ++virStorageSourceUpdateBlockPhysicalSize; + virStorageTypeFromString; + virStorageTypeToString; + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 8d569fe..48857ce 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -11908,8 +11908,16 @@ qemuDomainGetBlockInfo(virDomainPtr dom, + info->allocation = entry->wr_highest_offset; + } + ++ if (entry->physical) { ++ info->physical = entry->physical; ++ } else { ++ if (virStorageSourceUpdateBlockPhysicalSize(disk->src, true) < 0) ++ goto endjob; ++ ++ info->physical = disk->src->physical; ++ } ++ + info->capacity = entry->capacity; +- info->physical = entry->physical; + + ret = 0; + +@@ -19355,9 +19363,15 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, + if (entry->capacity) + QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, + "capacity", entry->capacity); +- if (entry->physical) ++ if (entry->physical) { + QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, + "physical", entry->physical); ++ } else { ++ if (virStorageSourceUpdateBlockPhysicalSize(src, false) == 0) { ++ QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, ++ "physical", src->physical); ++ } ++ } + + ret = 0; + cleanup: +diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c +index 6c3017c..2aa1d90 100644 +--- a/src/util/virstoragefile.c ++++ b/src/util/virstoragefile.c +@@ -2587,6 +2587,45 @@ virStorageSourceNewFromBacking(virStorageSourcePtr parent) + } + + ++/** ++ * @src: disk source definiton structure ++ * @report: report libvirt errors if set to true ++ * ++ * Updates src->physical for block devices since qemu doesn't report the current ++ * size correctly for them. Returns 0 on success, -1 on error. ++ */ ++int ++virStorageSourceUpdateBlockPhysicalSize(virStorageSourcePtr src, ++ bool report) ++{ ++ int fd = -1; ++ off_t end; ++ int ret = -1; ++ ++ if (virStorageSourceGetActualType(src) != VIR_STORAGE_TYPE_BLOCK) ++ return 0; ++ ++ if ((fd = open(src->path, O_RDONLY)) < 0) { ++ if (report) ++ virReportSystemError(errno, _("failed to open block device '%s'"), ++ src->path); ++ return -1; ++ } ++ ++ if ((end = lseek(fd, 0, SEEK_END)) == (off_t) -1) { ++ if (report) ++ virReportSystemError(errno, ++ _("failed to seek to end of '%s'"), src->path); ++ } else { ++ src->physical = end; ++ ret = 0; ++ } ++ ++ VIR_FORCE_CLOSE(fd); ++ return ret; ++} ++ ++ + static char * + virStorageFileCanonicalizeFormatPath(char **components, + size_t ncomponents, +diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h +index aa17a00..b98fe25 100644 +--- a/src/util/virstoragefile.h ++++ b/src/util/virstoragefile.h +@@ -362,6 +362,8 @@ bool virStorageSourceIsLocalStorage(virStorageSourcePtr src); + bool virStorageSourceIsEmpty(virStorageSourcePtr src); + void virStorageSourceFree(virStorageSourcePtr def); + void virStorageSourceBackingStoreClear(virStorageSourcePtr def); ++int virStorageSourceUpdateBlockPhysicalSize(virStorageSourcePtr src, ++ bool report); + virStorageSourcePtr virStorageSourceNewFromBacking(virStorageSourcePtr parent); + virStorageSourcePtr virStorageSourceCopy(const virStorageSource *src, + bool backingChain) +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Fix-segfault-when-parsing-private-domain-data.patch b/SOURCES/libvirt-qemu-Fix-segfault-when-parsing-private-domain-data.patch new file mode 100644 index 0000000..492ebe0 --- /dev/null +++ b/SOURCES/libvirt-qemu-Fix-segfault-when-parsing-private-domain-data.patch @@ -0,0 +1,52 @@ +From e8ffa273684efa5de18fad0913d6da4a93a9682d Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Thu, 13 Aug 2015 15:11:45 +0200 +Subject: [PATCH] qemu: Fix segfault when parsing private domain data + +https://bugzilla.redhat.com/show_bug.cgi?id=1162947 + +When parsing private domain data, there are two paths that are flawed. +They are both error paths, just from different parts of the function. +One of them can call free() on an uninitialized pointer. Initialization +to NULL is enough here. The other one is a bit trickier to explain, but +as easy as the first one to fix. We create capabilities, parse them and +then assign them into the private data pointer inside the domain object. +If, however, we get to fail from now on, the error path calls unrefs the +capabilities and then, when the domain object is being cleaned, +qemuDomainObjPrivateFree() tries to unref them as well. That causes a +segfault. Settin the pointer to NULL upon successful addition to the +private data is enough. + +Signed-off-by: Martin Kletzander +(cherry picked from commit 92ddffdbd3c91d99f8f7ed9b661388a2c5d36cc2) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index c247737..d95f24f 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -627,7 +627,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, + { + qemuDomainObjPrivatePtr priv = vm->privateData; + char *monitorpath; +- char *tmp; ++ char *tmp = NULL; + int n; + size_t i; + xmlNodePtr *nodes = NULL; +@@ -715,6 +715,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, + } + + priv->qemuCaps = qemuCaps; ++ qemuCaps = NULL; + } + VIR_FREE(nodes); + +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Fix-updating-bandwidth-limits-in-live-XML.patch b/SOURCES/libvirt-qemu-Fix-updating-bandwidth-limits-in-live-XML.patch deleted file mode 100644 index 3741be1..0000000 --- a/SOURCES/libvirt-qemu-Fix-updating-bandwidth-limits-in-live-XML.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 2f2e177f52d83f004de1be7a91f1e6ad66db9237 Mon Sep 17 00:00:00 2001 -Message-Id: <2f2e177f52d83f004de1be7a91f1e6ad66db9237@dist-git> -From: Erik Skultety -Date: Wed, 22 Oct 2014 09:54:35 +0200 -Subject: [PATCH] qemu: Fix updating bandwidth limits in live XML - -When trying to update bandwidth limits on a running domain, limits get -updated in our internal structures, however XML parser reads -bandwidth limits from network 'actual' definition. Committing this patch -it is now available to update bandwidth 'actual' definition as well, -thus updating domain runtime XML. - -(cherry picked from commit f4ba3385ba6b6e9ce6468a48d1cd4637b36696b7) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146511 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 039b987..36b394e 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -10222,7 +10222,18 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, - } else { - net->bandwidth = NULL; - } -+ -+ if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) { -+ virNetDevBandwidthFree(net->data.network.actual->bandwidth); -+ if (virNetDevBandwidthCopy(&net->data.network.actual->bandwidth, -+ net->bandwidth) < 0) -+ goto cleanup; -+ } -+ -+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) -+ goto cleanup; - } -+ - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { - if (!persistentNet->bandwidth) { - persistentNet->bandwidth = bandwidth; --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Fix-using-guest-architecture-as-lookup-key.patch b/SOURCES/libvirt-qemu-Fix-using-guest-architecture-as-lookup-key.patch new file mode 100644 index 0000000..f10c6f6 --- /dev/null +++ b/SOURCES/libvirt-qemu-Fix-using-guest-architecture-as-lookup-key.patch @@ -0,0 +1,175 @@ +From d890a1ebfea47603a67def4658166f061a801313 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Wed, 16 Sep 2015 11:07:42 +0200 +Subject: [PATCH] qemu: Fix using guest architecture as lookup key + +When looking for a QEMU binary suitable for running ppc64le guests +we have to take into account the fact that we use the QEMU target +as key for the hash, so direct comparison is not good enough. + +Factor out the logic from virQEMUCapsFindBinaryForArch() to a new +virQEMUCapsFindTarget() function and use that both when looking +for QEMU binaries available on the system and when looking up +QEMU capabilities later. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1260753 +(cherry picked from commit eb36666d22d52ecf0a1755dd0a8a45de982e00fb) +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 107 +++++++++++++++++++++++++++++-------------- + 1 file changed, 72 insertions(+), 35 deletions(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index faebeac..5b21307 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -381,6 +381,28 @@ static const char *virQEMUCapsArchToString(virArch arch) + return virArchToString(arch); + } + ++/* Given a host and guest architectures, find a suitable QEMU target. ++ * ++ * This is meant to be used as a second attempt if qemu-system-$guestarch ++ * can't be found, eg. on a x86_64 host you want to use qemu-system-i386, ++ * if available, instead of qemu-system-x86_64 to run i686 guests */ ++static virArch ++virQEMUCapsFindTarget(virArch hostarch, ++ virArch guestarch) ++{ ++ /* Both ppc64 and ppc64le guests can use the ppc64 target */ ++ if (ARCH_IS_PPC64(guestarch)) ++ guestarch = VIR_ARCH_PPC64; ++ ++ /* armv7l guests on aarch64 hosts can use the aarch64 target ++ * i686 guests on x86_64 hosts can use the x86_64 target */ ++ if ((guestarch == VIR_ARCH_ARMV7L && hostarch == VIR_ARCH_AARCH64) || ++ (guestarch == VIR_ARCH_I686 && hostarch == VIR_ARCH_X86_64)) { ++ return hostarch; ++ } ++ ++ return guestarch; ++} + + static virCommandPtr + virQEMUCapsProbeCommand(const char *qemu, +@@ -685,51 +707,55 @@ virQEMUCapsProbeCPUModels(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid) + return ret; + } + ++static char * ++virQEMUCapsFindBinary(const char *format, ++ const char *archstr) ++{ ++ char *ret = NULL; ++ char *binary = NULL; ++ ++ if (virAsprintf(&binary, format, archstr) < 0) ++ goto out; ++ ++ ret = virFindFileInPath(binary); ++ VIR_FREE(binary); ++ if (ret && virFileIsExecutable(ret)) ++ goto out; ++ ++ VIR_FREE(ret); ++ ++ out: ++ return ret; ++} + + static char * + virQEMUCapsFindBinaryForArch(virArch hostarch, + virArch guestarch) + { +- char *ret; ++ char *ret = NULL; + const char *archstr; +- char *binary; ++ virArch target; + +- if (ARCH_IS_PPC64(guestarch)) +- archstr = virQEMUCapsArchToString(VIR_ARCH_PPC64); +- else +- archstr = virQEMUCapsArchToString(guestarch); ++ /* First attempt: try the guest architecture as it is */ ++ archstr = virQEMUCapsArchToString(guestarch); ++ if ((ret = virQEMUCapsFindBinary("qemu-system-%s", archstr)) != NULL) ++ goto out; + +- if (virAsprintf(&binary, "qemu-system-%s", archstr) < 0) +- return NULL; +- +- ret = virFindFileInPath(binary); +- VIR_FREE(binary); +- if (ret && !virFileIsExecutable(ret)) +- VIR_FREE(ret); +- +- if (guestarch == VIR_ARCH_ARMV7L && +- !ret && +- hostarch == VIR_ARCH_AARCH64) { +- ret = virFindFileInPath("qemu-system-aarch64"); +- if (ret && !virFileIsExecutable(ret)) +- VIR_FREE(ret); +- } +- +- if (guestarch == VIR_ARCH_I686 && +- !ret && +- hostarch == VIR_ARCH_X86_64) { +- ret = virFindFileInPath("qemu-system-x86_64"); +- if (ret && !virFileIsExecutable(ret)) +- VIR_FREE(ret); ++ /* Second attempt: try looking up by target instead */ ++ target = virQEMUCapsFindTarget(hostarch, guestarch); ++ if (target != guestarch) { ++ archstr = virQEMUCapsArchToString(target); ++ if ((ret = virQEMUCapsFindBinary("qemu-system-%s", archstr)) != NULL) ++ goto out; + } + +- if (guestarch == VIR_ARCH_I686 && +- !ret) { +- ret = virFindFileInPath("qemu"); +- if (ret && !virFileIsExecutable(ret)) +- VIR_FREE(ret); ++ /* Third attempt, i686 only: try 'qemu' */ ++ if (guestarch == VIR_ARCH_I686) { ++ if ((ret = virQEMUCapsFindBinary("%s", "qemu")) != NULL) ++ goto out; + } + ++ out: + return ret; + } + +@@ -3773,13 +3799,24 @@ virQEMUCapsCacheLookupByArch(virQEMUCapsCachePtr cache, + virArch arch) + { + virQEMUCapsPtr ret = NULL; ++ virArch target; + struct virQEMUCapsSearchData data = { .arch = arch }; + + virMutexLock(&cache->lock); + ret = virHashSearch(cache->binaries, virQEMUCapsCompareArch, &data); ++ if (!ret) { ++ /* If the first attempt at finding capabilities has failed, try ++ * again using the QEMU target as lookup key instead */ ++ target = virQEMUCapsFindTarget(virArchFromHost(), data.arch); ++ if (target != data.arch) { ++ data.arch = target; ++ ret = virHashSearch(cache->binaries, virQEMUCapsCompareArch, &data); ++ } ++ } ++ virObjectRef(ret); ++ virMutexUnlock(&cache->lock); ++ + VIR_DEBUG("Returning caps %p for arch %s", ret, virArchToString(arch)); +- virObjectRef(ret); +- virMutexUnlock(&cache->lock); + + return ret; + } +-- +2.5.3 + diff --git a/SOURCES/libvirt-qemu-Fix-virsh-freeze-when-blockcopy-storage-file-is-removed.patch b/SOURCES/libvirt-qemu-Fix-virsh-freeze-when-blockcopy-storage-file-is-removed.patch deleted file mode 100644 index 8c2520c..0000000 --- a/SOURCES/libvirt-qemu-Fix-virsh-freeze-when-blockcopy-storage-file-is-removed.patch +++ /dev/null @@ -1,40 +0,0 @@ -From a42824549d45c014773f7f83a177d4d4f173a9a0 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Erik Skultety -Date: Thu, 4 Dec 2014 09:53:16 +0100 -Subject: [PATCH] qemu: Fix virsh freeze when blockcopy storage file is removed - -If someone removes blockcopy storage file when still in mirroring phase -and then requesting blockjob abort using pivot, virsh cmd freezes. This -is not an issue with older qemu versions which did not support -asynchronous jobs (which we prefer by default). -As we have reached the mirroring phase successfully, polling monitor for -blockjob info always returns 1 and the loop never ends. -This fix introduces a check for qemuDomainBlockPivot return code, possibly -skipping the asynchronous waiting completely, if an error occurred and -asynchronous waiting was the preferred method. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1139567 -(cherry picked from commit fe3691f66348d55e88c9811fd79ff9314e053977) - -Signed-off-by: Jiri Denemark ---- - 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 a9a7d30..fe5fe88 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -15527,6 +15527,8 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm, - - if (disk->mirror && (flags & VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT)) { - ret = qemuDomainBlockPivot(conn, driver, vm, device, disk); -+ if (ret < 0 && async) -+ goto endjob; - goto waitjob; - } - if (disk->mirror) { --- -2.2.0 - diff --git a/SOURCES/libvirt-qemu-Forbid-image-pre-creation-for-non-shared-storage-migration.patch b/SOURCES/libvirt-qemu-Forbid-image-pre-creation-for-non-shared-storage-migration.patch new file mode 100644 index 0000000..7f98859 --- /dev/null +++ b/SOURCES/libvirt-qemu-Forbid-image-pre-creation-for-non-shared-storage-migration.patch @@ -0,0 +1,64 @@ +From 831d540170a2be5dcf89fd406b95f0449a5bcfce Mon Sep 17 00:00:00 2001 +Message-Id: <831d540170a2be5dcf89fd406b95f0449a5bcfce@dist-git> +From: Peter Krempa +Date: Wed, 5 Aug 2015 17:31:38 +0200 +Subject: [PATCH] qemu: Forbid image pre-creation for non-shared storage + migration + +Libvirt doesn't reliably know the location of the backing chain when +pre-creating images for non-shared migration. This isn't a problem for +full copy, but incremental copy requires the information. + +Forbid pre-creating the image in cases where incremental migration is +required. This limitation can perhaps be lifted once libvirt will fully +support loading of backing chain information from the XML. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1249587 +(cherry picked from commit 6da3b694cca436fcc38247aff9d1ce8e955292a8) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_migration.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 16bb1af..cee82fa 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -1613,7 +1613,8 @@ qemuMigrationPrecreateStorage(virConnectPtr conn, + virDomainObjPtr vm, + qemuMigrationCookieNBDPtr nbd, + size_t nmigrate_disks, +- const char **migrate_disks) ++ const char **migrate_disks, ++ bool incremental) + { + int ret = -1; + size_t i = 0; +@@ -1644,6 +1645,13 @@ qemuMigrationPrecreateStorage(virConnectPtr conn, + continue; + } + ++ if (incremental) { ++ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", ++ _("pre-creation of storage targets for incremental " ++ "storage migration is not supported")); ++ goto cleanup; ++ } ++ + VIR_DEBUG("Proceeding with disk source %s", NULLSTR(diskSrcPath)); + + if (qemuMigrationPrecreateDisk(conn, disk, nbd->disks[i].capacity) < 0) +@@ -3339,7 +3347,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, + } + + if (qemuMigrationPrecreateStorage(dconn, driver, vm, mig->nbd, +- nmigrate_disks, migrate_disks) < 0) ++ nmigrate_disks, migrate_disks, ++ !!(flags & VIR_MIGRATE_NON_SHARED_INC)) < 0) + goto cleanup; + + if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN) < 0) +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Honor-hugepages-for-UMA-domains.patch b/SOURCES/libvirt-qemu-Honor-hugepages-for-UMA-domains.patch deleted file mode 100644 index 7802a75..0000000 --- a/SOURCES/libvirt-qemu-Honor-hugepages-for-UMA-domains.patch +++ /dev/null @@ -1,146 +0,0 @@ -From cb1894016dbd5a776fcb86a7c0f00a898e7ba023 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Thu, 18 Sep 2014 14:39:58 +0200 -Subject: [PATCH] qemu: Honor hugepages for UMA domains - -https://bugzilla.redhat.com/show_bug.cgi?id=1135396 - -There are two ways how to tell qemu to use huge pages. The first one -is suitable for domains with NUMA nodes: the path to hugetlbfs mount -is appended to NUMA node definition on the command line. The second -one is suitable for UMA domains: here there's this global '-mem-path' -argument that accepts path to the hugetlbfs mount point. However, the -latter case was not used for all the cases that it should be. For -instance: - - - - - - - -didn't trigger the '-mem-path' so the huge pages - despite being -configured - were not used at all. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 281f70013e9d6fff7f2d4b55f5133a837f023190) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 25 ++++++++++++++--- - .../qemuxml2argv-hugepages-pages5.args | 7 +++++ - .../qemuxml2argv-hugepages-pages5.xml | 32 ++++++++++++++++++++++ - tests/qemuxml2argvtest.c | 1 + - 4 files changed, 61 insertions(+), 4 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.xml - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 45667d9..fb9c453 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -7685,7 +7685,7 @@ qemuBuildCommandLine(virConnectPtr conn, - virCommandAddArg(cmd, "-m"); - def->mem.max_balloon = VIR_DIV_UP(def->mem.max_balloon, 1024) * 1024; - virCommandAddArgFormat(cmd, "%llu", def->mem.max_balloon / 1024); -- if (def->mem.nhugepages && !def->mem.hugepages[0].size) { -+ if (def->mem.nhugepages && (!def->cpu || !def->cpu->ncells)) { - char *mem_path; - - if (!cfg->nhugetlbfs) { -@@ -7701,9 +7701,26 @@ qemuBuildCommandLine(virConnectPtr conn, - goto error; - } - -- if (!(mem_path = qemuGetDefaultHugepath(cfg->hugetlbfs, -- cfg->nhugetlbfs))) -- goto error; -+ if (def->mem.hugepages[0].size) { -+ for (j = 0; j < cfg->nhugetlbfs; j++) { -+ if (cfg->hugetlbfs[j].size == def->mem.hugepages[0].size) -+ break; -+ } -+ -+ if (j == cfg->nhugetlbfs) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("Unable to find any usable hugetlbfs mount for %llu KiB"), -+ def->mem.hugepages[0].size); -+ goto error; -+ } -+ -+ if (!(mem_path = qemuGetHugepagePath(&cfg->hugetlbfs[j]))) -+ goto error; -+ } else { -+ if (!(mem_path = qemuGetDefaultHugepath(cfg->hugetlbfs, -+ cfg->nhugetlbfs))) -+ goto error; -+ } - - virCommandAddArgList(cmd, "-mem-prealloc", "-mem-path", - mem_path, NULL); -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.args -new file mode 100644 -index 0000000..0e0f35a ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.args -@@ -0,0 +1,7 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 1024 \ -+-mem-prealloc \ -+-mem-path /dev/hugepages2M/libvirt/qemu \ -+-smp 2 -nographic \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.xml b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.xml -new file mode 100644 -index 0000000..50a9cd8 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.xml -@@ -0,0 +1,32 @@ -+ -+ SomeDummyHugepagesGuest -+ ef1bdff4-27f3-4e85-a807-5fb4d58463cc -+ 1048576 -+ 1048576 -+ -+ -+ -+ -+ -+ 2 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 3b5f31a..68fc01b 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -688,6 +688,7 @@ mymain(void) - QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST_FAILURE("hugepages-pages4", QEMU_CAPS_MEM_PATH, - QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); -+ DO_TEST("hugepages-pages5", QEMU_CAPS_MEM_PATH); - DO_TEST("nosharepages", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MEM_MERGE); - DO_TEST("disk-cdrom", NONE); - DO_TEST("disk-cdrom-network-http", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE, --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Implement-extended-loader-and-nvram.patch b/SOURCES/libvirt-qemu-Implement-extended-loader-and-nvram.patch deleted file mode 100644 index 445d6b9..0000000 --- a/SOURCES/libvirt-qemu-Implement-extended-loader-and-nvram.patch +++ /dev/null @@ -1,229 +0,0 @@ -From 51566a10c2f7cdbfb04b8be8a163f496a3792b29 Mon Sep 17 00:00:00 2001 -Message-Id: <51566a10c2f7cdbfb04b8be8a163f496a3792b29@dist-git> -From: Michal Privoznik -Date: Wed, 10 Sep 2014 10:11:44 +0200 -Subject: [PATCH] qemu: Implement extended loader and nvram - -https://bugzilla.redhat.com/show_bug.cgi?id=1112257 - -QEMU now supports UEFI with the following command line: - - -drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \ - -drive file=/usr/share/OVMF/OVMF_VARS.fd,if=pflash,format=raw,unit=1 \ - -where the first line reflects and the second one . -Moreover, these two lines obsolete the -bios argument. - -Note that UEFI is unusable without ACPI. This is handled properly now. -Among with this extension, the variable file is expected to be -writable and hence we need security drivers to label it. - -Signed-off-by: Michal Privoznik -Acked-by: Laszlo Ersek -(cherry picked from commit 542899168c382610dbad9a597d27ef3d7c699f68) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 94 +++++++++++++++++++++- - src/security/security_dac.c | 8 ++ - src/security/security_selinux.c | 8 ++ - .../qemuxml2argvdata/qemuxml2argv-bios-nvram.args | 10 +++ - tests/qemuxml2argvtest.c | 2 + - 5 files changed, 118 insertions(+), 4 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.args - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 3cb2e0b..718533b 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -7370,6 +7370,94 @@ qemuBuildChrDeviceCommandLine(virCommandPtr cmd, - return 0; - } - -+static int -+qemuBuildDomainLoaderCommandLine(virCommandPtr cmd, -+ virDomainDefPtr def, -+ virQEMUCapsPtr qemuCaps) -+{ -+ int ret = -1; -+ virDomainLoaderDefPtr loader = def->os.loader; -+ virBuffer buf = VIR_BUFFER_INITIALIZER; -+ int unit = 0; -+ -+ if (!loader) -+ return 0; -+ -+ switch ((virDomainLoader) loader->type) { -+ case VIR_DOMAIN_LOADER_TYPE_ROM: -+ virCommandAddArg(cmd, "-bios"); -+ virCommandAddArg(cmd, loader->path); -+ break; -+ -+ case VIR_DOMAIN_LOADER_TYPE_PFLASH: -+ /* UEFI is supported only for x86_64 currently */ -+ if (def->os.arch != VIR_ARCH_X86_64) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("pflash is not supported for %s guest architecture"), -+ virArchToString(def->os.arch)); -+ goto cleanup; -+ } -+ -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("this QEMU binary doesn't support -drive")); -+ goto cleanup; -+ } -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_FORMAT)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("this QEMU binary doesn't support passing " -+ "drive format")); -+ goto cleanup; -+ } -+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_ACPI) && -+ def->features[VIR_DOMAIN_FEATURE_ACPI] != VIR_TRISTATE_SWITCH_ON) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("ACPI must be enabled in order to use UEFI")); -+ goto cleanup; -+ } -+ -+ virBufferAsprintf(&buf, -+ "file=%s,if=pflash,format=raw,unit=%d", -+ loader->path, unit); -+ unit++; -+ -+ if (loader->readonly) { -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_READONLY)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("this qemu doesn't support passing " -+ "readonly attribute")); -+ goto cleanup; -+ } -+ -+ virBufferAsprintf(&buf, ",readonly=%s", -+ virTristateSwitchTypeToString(loader->readonly)); -+ } -+ -+ virCommandAddArg(cmd, "-drive"); -+ virCommandAddArgBuffer(cmd, &buf); -+ -+ if (loader->nvram) { -+ virBufferFreeAndReset(&buf); -+ virBufferAsprintf(&buf, -+ "file=%s,if=pflash,format=raw,unit=%d", -+ loader->nvram, unit); -+ -+ virCommandAddArg(cmd, "-drive"); -+ virCommandAddArgBuffer(cmd, &buf); -+ } -+ break; -+ -+ case VIR_DOMAIN_LOADER_TYPE_LAST: -+ /* nada */ -+ break; -+ } -+ -+ ret = 0; -+ cleanup: -+ virBufferFreeAndReset(&buf); -+ return ret; -+} -+ - qemuBuildCommandLineCallbacks buildCommandLineCallbacks = { - .qemuGetSCSIDeviceSgName = virSCSIDeviceGetSgName, - }; -@@ -7525,10 +7613,8 @@ qemuBuildCommandLine(virConnectPtr conn, - virCommandAddArg(cmd, "-enable-nesting"); - } - -- if (def->os.loader) { -- virCommandAddArg(cmd, "-bios"); -- virCommandAddArg(cmd, def->os.loader->path); -- } -+ if (qemuBuildDomainLoaderCommandLine(cmd, def, qemuCaps) < 0) -+ goto error; - - /* Set '-m MB' based on maxmem, because the lower 'memory' limit - * is set post-startup using the balloon driver. If balloon driver -diff --git a/src/security/security_dac.c b/src/security/security_dac.c -index e62828e..e398d2c 100644 ---- a/src/security/security_dac.c -+++ b/src/security/security_dac.c -@@ -960,6 +960,10 @@ virSecurityDACRestoreSecurityAllLabel(virSecurityManagerPtr mgr, - rc = -1; - } - -+ if (def->os.loader && def->os.loader->nvram && -+ virSecurityDACRestoreSecurityFileLabel(def->os.loader->nvram) < 0) -+ rc = -1; -+ - if (def->os.kernel && - virSecurityDACRestoreSecurityFileLabel(def->os.kernel) < 0) - rc = -1; -@@ -1036,6 +1040,10 @@ virSecurityDACSetSecurityAllLabel(virSecurityManagerPtr mgr, - if (virSecurityDACGetImageIds(secdef, priv, &user, &group)) - return -1; - -+ if (def->os.loader && def->os.loader->nvram && -+ virSecurityDACSetOwnership(def->os.loader->nvram, user, group) < 0) -+ return -1; -+ - if (def->os.kernel && - virSecurityDACSetOwnership(def->os.kernel, user, group) < 0) - return -1; -diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c -index e8c13db..65f0d64 100644 ---- a/src/security/security_selinux.c -+++ b/src/security/security_selinux.c -@@ -1911,6 +1911,10 @@ virSecuritySELinuxRestoreSecurityAllLabel(virSecurityManagerPtr mgr, - mgr) < 0) - rc = -1; - -+ if (def->os.loader && def->os.loader->nvram && -+ virSecuritySELinuxRestoreSecurityFileLabel(mgr, def->os.loader->nvram) < 0) -+ rc = -1; -+ - if (def->os.kernel && - virSecuritySELinuxRestoreSecurityFileLabel(mgr, def->os.kernel) < 0) - rc = -1; -@@ -2294,6 +2298,10 @@ virSecuritySELinuxSetSecurityAllLabel(virSecurityManagerPtr mgr, - mgr) < 0) - return -1; - -+ if (def->os.loader && def->os.loader->nvram && -+ virSecuritySELinuxSetFilecon(def->os.loader->nvram, data->content_context) < 0) -+ return -1; -+ - if (def->os.kernel && - virSecuritySELinuxSetFilecon(def->os.kernel, data->content_context) < 0) - return -1; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.args b/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.args -new file mode 100644 -index 0000000..b51e8f3 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.args -@@ -0,0 +1,10 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc \ -+-drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \ -+-drive file=/usr/share/OVMF/OVMF_VARS.fd,if=pflash,format=raw,unit=1 \ -+-m 1024 -smp 1 -nographic -nodefaults \ -+-monitor unix:/tmp/test-monitor,server,nowait -boot c -usb \ -+-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-0,format=raw \ -+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ -+-serial pty -device usb-tablet,id=input0 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 3feb2fe..5c28253 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -642,6 +642,8 @@ mymain(void) - DO_TEST_FAILURE("reboot-timeout-enabled", NONE); - - DO_TEST("bios", QEMU_CAPS_DEVICE, QEMU_CAPS_SGA); -+ DO_TEST("bios-nvram", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE, -+ QEMU_CAPS_DRIVE_FORMAT, QEMU_CAPS_DRIVE_READONLY); - DO_TEST("clock-utc", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE); - DO_TEST("clock-localtime", NONE); - DO_TEST("clock-localtime-basis-localtime", QEMU_CAPS_RTC); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Inline-qemuGetHostdevPath.patch b/SOURCES/libvirt-qemu-Inline-qemuGetHostdevPath.patch new file mode 100644 index 0000000..9294657 --- /dev/null +++ b/SOURCES/libvirt-qemu-Inline-qemuGetHostdevPath.patch @@ -0,0 +1,106 @@ +From 8cd3af12f97b099168cd76e57648924e91c02dc7 Mon Sep 17 00:00:00 2001 +Message-Id: <8cd3af12f97b099168cd76e57648924e91c02dc7@dist-git> +From: John Ferlan +Date: Thu, 9 Jul 2015 08:28:54 -0400 +Subject: [PATCH] qemu: Inline qemuGetHostdevPath + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +Since a future patch will need the device path generated when adding a +shared host device, remove the qemuAddSharedHostdev and inline the two +calls into qemuAddSharedHostdev and qemuRemoveSharedHostdev + +Signed-off-by: John Ferlan +(cherry picked from commit 3830795318d972dcce615748ef8558011c8b11bf) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.c | 39 ++++++++++++++++----------------------- + 1 file changed, 16 insertions(+), 23 deletions(-) + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index bf2ec1e..cc40dcb 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1267,43 +1267,30 @@ qemuGetHostdevPath(virDomainHostdevDefPtr hostdev) + } + + +-static char * +-qemuGetSharedHostdevKey(virDomainHostdevDefPtr hostdev) +-{ +- char *key = NULL; +- char *dev_path = NULL; +- +- if (!(dev_path = qemuGetHostdevPath(hostdev))) +- goto cleanup; +- +- if (!(key = qemuGetSharedDeviceKey(dev_path))) +- goto cleanup; +- +- cleanup: +- VIR_FREE(dev_path); +- +- return key; +-} +- +- + static int + qemuAddSharedHostdev(virQEMUDriverPtr driver, + virDomainHostdevDefPtr hostdev, + const char *name) + { ++ char *dev_path = NULL; + char *key = NULL; + int ret = -1; + + if (!qemuIsSharedHostdev(hostdev)) + return 0; + +- if (!(key = qemuGetSharedHostdevKey(hostdev))) +- return -1; ++ if (!(dev_path = qemuGetHostdevPath(hostdev))) ++ goto cleanup; ++ ++ if (!(key = qemuGetSharedDeviceKey(dev_path))) ++ goto cleanup; + + qemuDriverLock(driver); + ret = qemuSharedDeviceEntryInsert(driver, key, name); + qemuDriverUnlock(driver); + ++ cleanup: ++ VIR_FREE(dev_path); + VIR_FREE(key); + return ret; + } +@@ -1392,19 +1379,25 @@ qemuRemoveSharedHostdev(virQEMUDriverPtr driver, + virDomainHostdevDefPtr hostdev, + const char *name) + { ++ char *dev_path = NULL; + char *key = NULL; + int ret; + + if (!qemuIsSharedHostdev(hostdev)) + return 0; + +- if (!(key = qemuGetSharedHostdevKey(hostdev))) +- return -1; ++ if (!(dev_path = qemuGetHostdevPath(hostdev))) ++ goto cleanup; ++ ++ if (!(key = qemuGetSharedDeviceKey(dev_path))) ++ goto cleanup; + + qemuDriverLock(driver); + ret = qemuSharedDeviceEntryRemove(driver, key, name); + qemuDriverUnlock(driver); + ++ cleanup: ++ VIR_FREE(dev_path); + VIR_FREE(key); + return ret; + } +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_E1000.patch b/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_E1000.patch new file mode 100644 index 0000000..57646a4 --- /dev/null +++ b/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_E1000.patch @@ -0,0 +1,211 @@ +From e3f9eca39518a48a31bb3d62c468df34b9448452 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Fri, 11 Sep 2015 17:00:18 +0200 +Subject: [PATCH] qemu: Introduce QEMU_CAPS_DEVICE_E1000 + +This capability can be used to detect whether or not the QEMU +binary supports the e1000 network device. + +(cherry picked from commit fb58318d7f2c05df4d1fc497d96e5718951e9e89) + +Conflicts: + src/qemu/qemu_capabilities.h + tests/qemuhelptest.c + +Conflicts are caused by the fact that some members are missing from +the virQEMUCaps enumeration because the relevant commits have not +been backported. + +The value of QEMU_CAPS_DEVICE_E1000 has been changed from 197 to 193 +to avoid making the enumeration sparse. + +The test program has been updated accordingly as well, removing any +reference to capabilities that have not been backported. + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1254044 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 2 ++ + src/qemu/qemu_capabilities.h | 1 + + tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 + + tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 + + tests/qemuhelptest.c | 18 ++++++++++++------ + 10 files changed, 22 insertions(+), 6 deletions(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 69259f5..927b3f9 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -289,6 +289,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + "vhost-user-multiqueue", /* 190 */ + "migration-event", + "rtl8139", ++ "e1000", + ); + + +@@ -1571,6 +1572,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { + { "pc-dimm", QEMU_CAPS_DEVICE_PC_DIMM }, + { "pci-serial", QEMU_CAPS_DEVICE_PCI_SERIAL }, + { "rtl8139", QEMU_CAPS_DEVICE_RTL8139 }, ++ { "e1000", QEMU_CAPS_DEVICE_E1000 }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = { +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index 2762cec..a876eb4 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -232,6 +232,7 @@ typedef enum { + QEMU_CAPS_VHOSTUSER_MULTIQUEUE = 190, /* vhost-user with -netdev queues= */ + QEMU_CAPS_MIGRATION_EVENT = 191, /* MIGRATION event */ + QEMU_CAPS_DEVICE_RTL8139 = 192, /* -device rtl8139 */ ++ QEMU_CAPS_DEVICE_E1000 = 193, /* -device e1000 */ + + QEMU_CAPS_LAST, /* this must always be the last item */ + } virQEMUCapsFlags; +diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps +index fd44748..f2fefab 100644 +--- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps +@@ -121,4 +121,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps +index 0730eab..5e3bdeb 100644 +--- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps +@@ -136,4 +136,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps +index 66bd901..e8979a2 100644 +--- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps +@@ -137,4 +137,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps +index fb7a8b0..7a108a1 100644 +--- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps +@@ -146,4 +146,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps +index 250ef4e..2084f80 100644 +--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps +@@ -152,4 +152,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps +index a8850b8..5b2087d 100644 +--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps +@@ -152,4 +152,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps +index 705ee65..4b637d4 100644 +--- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps ++++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps +@@ -168,4 +168,5 @@ + + + ++ + +diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c +index a481693..9b1515e 100644 +--- a/tests/qemuhelptest.c ++++ b/tests/qemuhelptest.c +@@ -410,7 +410,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_NET, + QEMU_CAPS_DEVICE_USB_KBD, + QEMU_CAPS_DEVICE_PCI_BRIDGE, +- QEMU_CAPS_DEVICE_RTL8139); ++ QEMU_CAPS_DEVICE_RTL8139, ++ QEMU_CAPS_DEVICE_E1000); + DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -526,7 +527,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_STORAGE, + QEMU_CAPS_HOST_PCI_MULTIDOMAIN, + QEMU_CAPS_DEVICE_IVSHMEM, +- QEMU_CAPS_DEVICE_RTL8139); ++ QEMU_CAPS_DEVICE_RTL8139, ++ QEMU_CAPS_DEVICE_E1000); + DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -594,7 +596,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_NET, + QEMU_CAPS_DEVICE_USB_KBD, + QEMU_CAPS_DEVICE_PCI_BRIDGE, +- QEMU_CAPS_DEVICE_RTL8139); ++ QEMU_CAPS_DEVICE_RTL8139, ++ QEMU_CAPS_DEVICE_E1000); + DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -670,7 +673,8 @@ mymain(void) + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_USB_KBD, + QEMU_CAPS_DEVICE_USB_STORAGE, +- QEMU_CAPS_DEVICE_RTL8139); ++ QEMU_CAPS_DEVICE_RTL8139, ++ QEMU_CAPS_DEVICE_E1000); + DO_TEST("qemu-1.0", 1000000, 0, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -758,7 +762,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_STORAGE, + QEMU_CAPS_SPLASH_TIMEOUT, + QEMU_CAPS_DEVICE_IVSHMEM, +- QEMU_CAPS_DEVICE_RTL8139); ++ QEMU_CAPS_DEVICE_RTL8139, ++ QEMU_CAPS_DEVICE_E1000); + DO_TEST("qemu-1.1.0", 1001000, 0, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -859,7 +864,8 @@ mymain(void) + QEMU_CAPS_OBJECT_USB_AUDIO, + QEMU_CAPS_SPLASH_TIMEOUT, + QEMU_CAPS_DEVICE_IVSHMEM, +- QEMU_CAPS_DEVICE_RTL8139); ++ QEMU_CAPS_DEVICE_RTL8139, ++ QEMU_CAPS_DEVICE_E1000); + DO_TEST_FULL("qemu-1.2.0", 1002000, 0, 0, VIR_ERR_CONFIG_UNSUPPORTED, + QEMU_CAPS_LAST); + DO_TEST_FULL("qemu-kvm-1.2.0", 1002000, 1, 0, VIR_ERR_CONFIG_UNSUPPORTED, +-- +2.5.2 + diff --git a/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_RTL8139.patch b/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_RTL8139.patch new file mode 100644 index 0000000..cf16885 --- /dev/null +++ b/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_RTL8139.patch @@ -0,0 +1,219 @@ +From 4a5223042084155fafe5b54bd07fd0be106d123b Mon Sep 17 00:00:00 2001 +Message-Id: <4a5223042084155fafe5b54bd07fd0be106d123b@dist-git> +From: Andrea Bolognani +Date: Fri, 11 Sep 2015 17:00:17 +0200 +Subject: [PATCH] qemu: Introduce QEMU_CAPS_DEVICE_RTL8139 + +This capability can be used to detect whether or not the QEMU +binary supports the rtl8139 network device. + +(cherry picked from commit b8d545a8b88f03b1a4c30d272a4561d6adbfcd60) + +Conflicts: + src/qemu/qemu_capabilities.c + src/qemu/qemu_capabilities.h + tests/qemucapabilitiesdata/caps_1.2.2-1.caps + tests/qemucapabilitiesdata/caps_1.3.1-1.caps + tests/qemucapabilitiesdata/caps_1.4.2-1.caps + tests/qemucapabilitiesdata/caps_1.5.3-1.caps + tests/qemucapabilitiesdata/caps_1.6.0-1.caps + tests/qemucapabilitiesdata/caps_1.6.50-1.caps + tests/qemucapabilitiesdata/caps_2.1.1-1.caps + tests/qemuhelptest.c + +Conflicts are caused by the fact that some members are missing from +the virQEMUCaps enumeration because the relevant commits have not +been backported. + +The value of QEMU_CAPS_DEVICE_RTL8139 has been changed from 196 to +192 to avoid making the enumeration sparse. + +The test program and data have been updated accordingly as well, +removing any reference to capabilities that have not been backported. + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1254044 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 2 ++ + src/qemu/qemu_capabilities.h | 1 + + tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 + + tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 + + tests/qemuhelptest.c | 18 ++++++++++++------ + 10 files changed, 22 insertions(+), 6 deletions(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index be5384f..69259f5 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -288,6 +288,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + + "vhost-user-multiqueue", /* 190 */ + "migration-event", ++ "rtl8139", + ); + + +@@ -1569,6 +1570,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { + { "ivshmem", QEMU_CAPS_DEVICE_IVSHMEM }, + { "pc-dimm", QEMU_CAPS_DEVICE_PC_DIMM }, + { "pci-serial", QEMU_CAPS_DEVICE_PCI_SERIAL }, ++ { "rtl8139", QEMU_CAPS_DEVICE_RTL8139 }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = { +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index f77bd06..2762cec 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -231,6 +231,7 @@ typedef enum { + QEMU_CAPS_CPU_AARCH64_OFF = 189, /* -cpu ...,aarch64=off */ + QEMU_CAPS_VHOSTUSER_MULTIQUEUE = 190, /* vhost-user with -netdev queues= */ + QEMU_CAPS_MIGRATION_EVENT = 191, /* MIGRATION event */ ++ QEMU_CAPS_DEVICE_RTL8139 = 192, /* -device rtl8139 */ + + QEMU_CAPS_LAST, /* this must always be the last item */ + } virQEMUCapsFlags; +diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps +index 30239df..fd44748 100644 +--- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps +@@ -120,4 +120,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps +index ea3d850..0730eab 100644 +--- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps +@@ -135,4 +135,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps +index 2c19ddc..66bd901 100644 +--- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps +@@ -136,4 +136,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps +index aadccd5..fb7a8b0 100644 +--- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps +@@ -145,4 +145,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps +index 3e81cbf..250ef4e 100644 +--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps +@@ -151,4 +151,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps +index 84c357f..a8850b8 100644 +--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps +@@ -151,4 +151,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps +index b1ee8df..705ee65 100644 +--- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps ++++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps +@@ -167,4 +167,5 @@ + + + ++ + +diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c +index 507831c..a481693 100644 +--- a/tests/qemuhelptest.c ++++ b/tests/qemuhelptest.c +@@ -409,7 +409,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_SERIAL, + QEMU_CAPS_DEVICE_USB_NET, + QEMU_CAPS_DEVICE_USB_KBD, +- QEMU_CAPS_DEVICE_PCI_BRIDGE); ++ QEMU_CAPS_DEVICE_PCI_BRIDGE, ++ QEMU_CAPS_DEVICE_RTL8139); + DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -524,7 +525,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_KBD, + QEMU_CAPS_DEVICE_USB_STORAGE, + QEMU_CAPS_HOST_PCI_MULTIDOMAIN, +- QEMU_CAPS_DEVICE_IVSHMEM); ++ QEMU_CAPS_DEVICE_IVSHMEM, ++ QEMU_CAPS_DEVICE_RTL8139); + DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -591,7 +593,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_SERIAL, + QEMU_CAPS_DEVICE_USB_NET, + QEMU_CAPS_DEVICE_USB_KBD, +- QEMU_CAPS_DEVICE_PCI_BRIDGE); ++ QEMU_CAPS_DEVICE_PCI_BRIDGE, ++ QEMU_CAPS_DEVICE_RTL8139); + DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -666,7 +669,8 @@ mymain(void) + QEMU_CAPS_DEVICE_CIRRUS_VGA, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_USB_KBD, +- QEMU_CAPS_DEVICE_USB_STORAGE); ++ QEMU_CAPS_DEVICE_USB_STORAGE, ++ QEMU_CAPS_DEVICE_RTL8139); + DO_TEST("qemu-1.0", 1000000, 0, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -753,7 +757,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_KBD, + QEMU_CAPS_DEVICE_USB_STORAGE, + QEMU_CAPS_SPLASH_TIMEOUT, +- QEMU_CAPS_DEVICE_IVSHMEM); ++ QEMU_CAPS_DEVICE_IVSHMEM, ++ QEMU_CAPS_DEVICE_RTL8139); + DO_TEST("qemu-1.1.0", 1001000, 0, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -853,7 +858,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_STORAGE, + QEMU_CAPS_OBJECT_USB_AUDIO, + QEMU_CAPS_SPLASH_TIMEOUT, +- QEMU_CAPS_DEVICE_IVSHMEM); ++ QEMU_CAPS_DEVICE_IVSHMEM, ++ QEMU_CAPS_DEVICE_RTL8139); + DO_TEST_FULL("qemu-1.2.0", 1002000, 0, 0, VIR_ERR_CONFIG_UNSUPPORTED, + QEMU_CAPS_LAST); + DO_TEST_FULL("qemu-kvm-1.2.0", 1002000, 1, 0, VIR_ERR_CONFIG_UNSUPPORTED, +-- +2.5.2 + diff --git a/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_VIRTIO_NET.patch b/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_VIRTIO_NET.patch new file mode 100644 index 0000000..7a623b8 --- /dev/null +++ b/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_VIRTIO_NET.patch @@ -0,0 +1,210 @@ +From a682106b5bda7c88f14b7505d1e10ed457728e68 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Fri, 11 Sep 2015 17:00:19 +0200 +Subject: [PATCH] qemu: Introduce QEMU_CAPS_DEVICE_VIRTIO_NET + +This capability can be used to detect whether or not the QEMU +binary supports the virtio-net-* network device. + +(cherry picked from commit fedbb015a9084aa4dfa674cdfd813865cd3542ad) + +Conflicts: + src/qemu/qemu_capabilities.h + +Conflicts are caused by the fact that some members are missing from +the virQEMUCaps enumeration because the relevant commits have not +been backported. + +The value of QEMU_CAPS_DEVICE_VIRTIO_NET has been changed from 198 +to 194 to avoid making the enumeration sparse. + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1254044 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 5 +++++ + src/qemu/qemu_capabilities.h | 1 + + tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 + + tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 + + tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 + + tests/qemuhelptest.c | 18 ++++++++++++------ + 10 files changed, 25 insertions(+), 6 deletions(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 927b3f9..faebeac 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -290,6 +290,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + "migration-event", + "rtl8139", + "e1000", ++ "virtio-net", + ); + + +@@ -1573,6 +1574,10 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { + { "pci-serial", QEMU_CAPS_DEVICE_PCI_SERIAL }, + { "rtl8139", QEMU_CAPS_DEVICE_RTL8139 }, + { "e1000", QEMU_CAPS_DEVICE_E1000 }, ++ { "virtio-net-pci", QEMU_CAPS_DEVICE_VIRTIO_NET }, ++ { "virtio-net-ccw", QEMU_CAPS_DEVICE_VIRTIO_NET }, ++ { "virtio-net-s390", QEMU_CAPS_DEVICE_VIRTIO_NET }, ++ { "virtio-net-device", QEMU_CAPS_DEVICE_VIRTIO_NET }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = { +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index a876eb4..8ba202e 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -233,6 +233,7 @@ typedef enum { + QEMU_CAPS_MIGRATION_EVENT = 191, /* MIGRATION event */ + QEMU_CAPS_DEVICE_RTL8139 = 192, /* -device rtl8139 */ + QEMU_CAPS_DEVICE_E1000 = 193, /* -device e1000 */ ++ QEMU_CAPS_DEVICE_VIRTIO_NET = 194, /* -device virtio-net-* */ + + QEMU_CAPS_LAST, /* this must always be the last item */ + } virQEMUCapsFlags; +diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps +index f2fefab..6fd45d5 100644 +--- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps +@@ -122,4 +122,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps +index 5e3bdeb..1d25452 100644 +--- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps +@@ -137,4 +137,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps +index e8979a2..96879fd 100644 +--- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps +@@ -138,4 +138,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps +index 7a108a1..3fda753 100644 +--- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps +@@ -147,4 +147,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps +index 2084f80..9203cc8 100644 +--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps +@@ -153,4 +153,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps +index 5b2087d..636daae 100644 +--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps ++++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps +@@ -153,4 +153,5 @@ + + + ++ + +diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps +index 4b637d4..3fae0d0 100644 +--- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps ++++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps +@@ -169,4 +169,5 @@ + + + ++ + +diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c +index 9b1515e..f7f322e 100644 +--- a/tests/qemuhelptest.c ++++ b/tests/qemuhelptest.c +@@ -411,7 +411,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_KBD, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_RTL8139, +- QEMU_CAPS_DEVICE_E1000); ++ QEMU_CAPS_DEVICE_E1000, ++ QEMU_CAPS_DEVICE_VIRTIO_NET); + DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -528,7 +529,8 @@ mymain(void) + QEMU_CAPS_HOST_PCI_MULTIDOMAIN, + QEMU_CAPS_DEVICE_IVSHMEM, + QEMU_CAPS_DEVICE_RTL8139, +- QEMU_CAPS_DEVICE_E1000); ++ QEMU_CAPS_DEVICE_E1000, ++ QEMU_CAPS_DEVICE_VIRTIO_NET); + DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -597,7 +599,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_KBD, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_RTL8139, +- QEMU_CAPS_DEVICE_E1000); ++ QEMU_CAPS_DEVICE_E1000, ++ QEMU_CAPS_DEVICE_VIRTIO_NET); + DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -674,7 +677,8 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_KBD, + QEMU_CAPS_DEVICE_USB_STORAGE, + QEMU_CAPS_DEVICE_RTL8139, +- QEMU_CAPS_DEVICE_E1000); ++ QEMU_CAPS_DEVICE_E1000, ++ QEMU_CAPS_DEVICE_VIRTIO_NET); + DO_TEST("qemu-1.0", 1000000, 0, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -763,7 +767,8 @@ mymain(void) + QEMU_CAPS_SPLASH_TIMEOUT, + QEMU_CAPS_DEVICE_IVSHMEM, + QEMU_CAPS_DEVICE_RTL8139, +- QEMU_CAPS_DEVICE_E1000); ++ QEMU_CAPS_DEVICE_E1000, ++ QEMU_CAPS_DEVICE_VIRTIO_NET); + DO_TEST("qemu-1.1.0", 1001000, 0, 0, + QEMU_CAPS_VNC_COLON, + QEMU_CAPS_NO_REBOOT, +@@ -865,7 +870,8 @@ mymain(void) + QEMU_CAPS_SPLASH_TIMEOUT, + QEMU_CAPS_DEVICE_IVSHMEM, + QEMU_CAPS_DEVICE_RTL8139, +- QEMU_CAPS_DEVICE_E1000); ++ QEMU_CAPS_DEVICE_E1000, ++ QEMU_CAPS_DEVICE_VIRTIO_NET); + DO_TEST_FULL("qemu-1.2.0", 1002000, 0, 0, VIR_ERR_CONFIG_UNSUPPORTED, + QEMU_CAPS_LAST); + DO_TEST_FULL("qemu-kvm-1.2.0", 1002000, 1, 0, VIR_ERR_CONFIG_UNSUPPORTED, +-- +2.5.2 + diff --git a/SOURCES/libvirt-qemu-Introduce-flags-in-qemuMigrationCompleted.patch b/SOURCES/libvirt-qemu-Introduce-flags-in-qemuMigrationCompleted.patch new file mode 100644 index 0000000..5a2a00d --- /dev/null +++ b/SOURCES/libvirt-qemu-Introduce-flags-in-qemuMigrationCompleted.patch @@ -0,0 +1,82 @@ +From 767c91832fa9f2497a10603153b980932fc472ec Mon Sep 17 00:00:00 2001 +Message-Id: <767c91832fa9f2497a10603153b980932fc472ec@dist-git> +From: Jiri Denemark +Date: Mon, 5 Oct 2015 14:36:15 +0200 +Subject: [PATCH] qemu: Introduce flags in qemuMigrationCompleted + +The function already has two bool parameters and we will need to add a +new one. Let's switch to flags to make the callers readable. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 2af983f4c42e8f0af95fe1eb464e14ba52bb1145) + +https://bugzilla.redhat.com/show_bug.cgi?id=1265902 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_migration.c | 23 +++++++++++++++++------ + 1 file changed, 17 insertions(+), 6 deletions(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index e04459d..17c1276 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -2606,6 +2606,11 @@ qemuMigrationCheckJobStatus(virQEMUDriverPtr driver, + } + + ++enum qemuMigrationCompletedFlags { ++ QEMU_MIGRATION_COMPLETED_ABORT_ON_ERROR = (1 << 0), ++ QEMU_MIGRATION_COMPLETED_CHECK_STORAGE = (1 << 1), ++}; ++ + /** + * Returns 1 if migration completed successfully, + * 0 if the domain is still being migrated, +@@ -2617,8 +2622,7 @@ qemuMigrationCompleted(virQEMUDriverPtr driver, + virDomainObjPtr vm, + qemuDomainAsyncJob asyncJob, + virConnectPtr dconn, +- bool abort_on_error, +- bool storage) ++ unsigned int flags) + { + qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainJobInfoPtr jobInfo = priv->job.current; +@@ -2627,10 +2631,11 @@ qemuMigrationCompleted(virQEMUDriverPtr driver, + if (qemuMigrationCheckJobStatus(driver, vm, asyncJob) < 0) + goto error; + +- if (storage && qemuMigrationDriveMirrorReady(driver, vm) < 0) ++ if (flags & QEMU_MIGRATION_COMPLETED_CHECK_STORAGE && ++ qemuMigrationDriveMirrorReady(driver, vm) < 0) + goto error; + +- if (abort_on_error && ++ if (flags & QEMU_MIGRATION_COMPLETED_ABORT_ON_ERROR && + virDomainObjGetState(vm, &pauseReason) == VIR_DOMAIN_PAUSED && + pauseReason == VIR_DOMAIN_PAUSED_IOERROR) { + virReportError(VIR_ERR_OPERATION_FAILED, _("%s: %s"), +@@ -2677,11 +2682,17 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, + qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainJobInfoPtr jobInfo = priv->job.current; + bool events = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT); ++ unsigned int flags = 0; + int rv; + ++ if (abort_on_error) ++ flags |= QEMU_MIGRATION_COMPLETED_ABORT_ON_ERROR; ++ if (storage) ++ flags |= QEMU_MIGRATION_COMPLETED_CHECK_STORAGE; ++ + jobInfo->type = VIR_DOMAIN_JOB_UNBOUNDED; +- while ((rv = qemuMigrationCompleted(driver, vm, asyncJob, dconn, +- abort_on_error, storage)) != 1) { ++ while ((rv = qemuMigrationCompleted(driver, vm, asyncJob, ++ dconn, flags)) != 1) { + if (rv < 0) + return rv; + +-- +2.6.1 + diff --git a/SOURCES/libvirt-qemu-Introduce-qemuDomainMachineIsS390CCW.patch b/SOURCES/libvirt-qemu-Introduce-qemuDomainMachineIsS390CCW.patch new file mode 100644 index 0000000..ecb2c6d --- /dev/null +++ b/SOURCES/libvirt-qemu-Introduce-qemuDomainMachineIsS390CCW.patch @@ -0,0 +1,134 @@ +From f7b5000e807b3907165edd784fcf59a682d1d5ad Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Fri, 4 Sep 2015 08:55:45 -0400 +Subject: [PATCH] qemu: Introduce qemuDomainMachineIsS390CCW + +https://bugzilla.redhat.com/show_bug.cgi?id=1258361 + +Rather than have different usages of STR function in order to determine +whether the domain is s390-ccw or s390-ccw-virtio, make a single API +which will check the machine.os prefix. Then use the function. + +(cherry picked from commit d334c91751c8eea33abe8e92761433a145e38112) +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 4 ++-- + src/qemu/qemu_domain.c | 6 ++++++ + src/qemu/qemu_domain.h | 1 + + src/qemu/qemu_hotplug.c | 12 ++++++------ + 4 files changed, 15 insertions(+), 8 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index f3e45a5..f8fb71e 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -1327,7 +1327,7 @@ qemuDomainAssignS390Addresses(virDomainDefPtr def, + virDomainCCWAddressSetPtr addrs = NULL; + qemuDomainObjPrivatePtr priv = NULL; + +- if (STREQLEN(def->os.machine, "s390-ccw", 8) && ++ if (qemuDomainMachineIsS390CCW(def) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { + qemuDomainPrimeVirtioDeviceAddresses( + def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW); +@@ -1826,7 +1826,7 @@ qemuDomainReleaseDeviceAddress(virDomainObjPtr vm, + devstr = info->alias; + + if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW && +- STREQLEN(vm->def->os.machine, "s390-ccw", 8) && ++ qemuDomainMachineIsS390CCW(vm->def) && + virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW) && + virDomainCCWAddressReleaseAddr(priv->ccwaddrs, info) < 0) + VIR_WARN("Unable to release CCW address on %s", +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 943d727..66d8e3a 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3294,6 +3294,12 @@ qemuDomainMachineNeedsFDC(const virDomainDef *def) + } + + ++bool ++qemuDomainMachineIsS390CCW(const virDomainDef *def) ++{ ++ return STRPREFIX(def->os.machine, "s390-ccw"); ++} ++ + + /** + * qemuDomainUpdateCurrentMemorySize: +diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h +index 2af7c59..91eaea1 100644 +--- a/src/qemu/qemu_domain.h ++++ b/src/qemu/qemu_domain.h +@@ -469,6 +469,7 @@ virDomainChrSourceDefPtr qemuFindAgentConfig(virDomainDefPtr def); + bool qemuDomainMachineIsQ35(const virDomainDef *def); + bool qemuDomainMachineIsI440FX(const virDomainDef *def); + bool qemuDomainMachineNeedsFDC(const virDomainDef *def); ++bool qemuDomainMachineIsS390CCW(const virDomainDef *def); + + int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver, + virDomainObjPtr vm); +diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c +index aabdb78..b79fc56 100644 +--- a/src/qemu/qemu_hotplug.c ++++ b/src/qemu/qemu_hotplug.c +@@ -326,7 +326,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, + const char *src = virDomainDiskGetSource(disk); + + if (!disk->info.type) { +- if (STREQLEN(vm->def->os.machine, "s390-ccw", 8) && ++ if (qemuDomainMachineIsS390CCW(vm->def) && + virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) + disk->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; + else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) +@@ -443,7 +443,7 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver, + + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { + if (controller->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { +- if (STRPREFIX(vm->def->os.machine, "s390-ccw") && ++ if (qemuDomainMachineIsS390CCW(vm->def) && + virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) + controller->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; + else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) +@@ -991,7 +991,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, + goto cleanup; + } + +- if (STREQLEN(vm->def->os.machine, "s390-ccw", 8) && ++ if (qemuDomainMachineIsS390CCW(vm->def) && + virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { + net->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; + if (virDomainCCWAddressAssign(&net->info, priv->ccwaddrs, +@@ -1657,7 +1657,7 @@ qemuDomainAttachRNGDevice(virQEMUDriverPtr driver, + return -1; + + if (rng->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { +- if (STRPREFIX(vm->def->os.machine, "s390-ccw") && ++ if (qemuDomainMachineIsS390CCW(vm->def) && + virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { + rng->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; + } else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) { +@@ -3415,7 +3415,7 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver, + goto cleanup; + } + +- if (STREQLEN(vm->def->os.machine, "s390-ccw", 8) && ++ if (qemuDomainMachineIsS390CCW(vm->def) && + virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { + if (!virDomainDeviceAddressIsValid(&detach->info, + VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) { +@@ -3945,7 +3945,7 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver, + virDomainNetGetActualHostdev(detach)); + goto cleanup; + } +- if (STREQLEN(vm->def->os.machine, "s390-ccw", 8) && ++ if (qemuDomainMachineIsS390CCW(vm->def) && + virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { + if (!virDomainDeviceAddressIsValid(&detach->info, + VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) { +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Introduce-qemuGetHostdevPath.patch b/SOURCES/libvirt-qemu-Introduce-qemuGetHostdevPath.patch new file mode 100644 index 0000000..fd4ca44 --- /dev/null +++ b/SOURCES/libvirt-qemu-Introduce-qemuGetHostdevPath.patch @@ -0,0 +1,78 @@ +From 352a07737fdc9a3c090eee92018f62865889c0ea Mon Sep 17 00:00:00 2001 +Message-Id: <352a07737fdc9a3c090eee92018f62865889c0ea@dist-git> +From: John Ferlan +Date: Thu, 9 Jul 2015 08:28:52 -0400 +Subject: [PATCH] qemu: Introduce qemuGetHostdevPath + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +Introduce a convenience function to handle formulating the hostdev path + +Signed-off-by: John Ferlan +(cherry picked from commit 083cbe506b5134c36ecd544a2f9ac3d262951799) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.c | 27 ++++++++++++++++++++------- + 1 file changed, 20 insertions(+), 7 deletions(-) + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index 1467427..a761ec5 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1213,13 +1213,12 @@ qemuIsSharedHostdev(virDomainHostdevDefPtr hostdev) + + + static char * +-qemuGetSharedHostdevKey(virDomainHostdevDefPtr hostdev) ++qemuGetHostdevPath(virDomainHostdevDefPtr hostdev) + { + virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + char *dev_name = NULL; + char *dev_path = NULL; +- char *key = NULL; + + if (!(dev_name = virSCSIDeviceGetDevName(NULL, + scsihostsrc->adapter, +@@ -1228,19 +1227,33 @@ qemuGetSharedHostdevKey(virDomainHostdevDefPtr hostdev) + scsihostsrc->unit))) + goto cleanup; + +- if (virAsprintf(&dev_path, "/dev/%s", dev_name) < 0) +- goto cleanup; +- +- if (!(key = qemuGetSharedDeviceKey(dev_path))) +- goto cleanup; ++ ignore_value(virAsprintf(&dev_path, "/dev/%s", dev_name)); + + cleanup: + VIR_FREE(dev_name); ++ return dev_path; ++} ++ ++ ++static char * ++qemuGetSharedHostdevKey(virDomainHostdevDefPtr hostdev) ++{ ++ char *key = NULL; ++ char *dev_path = NULL; ++ ++ if (!(dev_path = qemuGetHostdevPath(hostdev))) ++ goto cleanup; ++ ++ if (!(key = qemuGetSharedDeviceKey(dev_path))) ++ goto cleanup; ++ ++ cleanup: + VIR_FREE(dev_path); + + return key; + } + ++ + static int + qemuAddSharedHostdev(virQEMUDriverPtr driver, + virDomainHostdevDefPtr hostdev, +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Introduce-qemuIsSharedHostdev.patch b/SOURCES/libvirt-qemu-Introduce-qemuIsSharedHostdev.patch new file mode 100644 index 0000000..c2edbe9 --- /dev/null +++ b/SOURCES/libvirt-qemu-Introduce-qemuIsSharedHostdev.patch @@ -0,0 +1,86 @@ +From 8dc583373f79d4b8226eb510c6466759421cf8c7 Mon Sep 17 00:00:00 2001 +Message-Id: <8dc583373f79d4b8226eb510c6466759421cf8c7@dist-git> +From: John Ferlan +Date: Thu, 9 Jul 2015 08:28:51 -0400 +Subject: [PATCH] qemu: Introduce qemuIsSharedHostdev + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +Add a single boolean function to handle whether the hostdev is shared or not. + +Use the new function for the qemu{Add|Remove}SharedHostdev calls as well +as qemuSetUnprivSGIO. NB: This third usage fixes a possible bug where +if this feature is enabled at some time in the future and the shareable flag +wasn't set, the sgio would have been erroneously set. + +Signed-off-by: John Ferlan +(cherry picked from commit 8c43258ed5fca8b285400135948300fa6f58f402) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.c | 28 ++++++++++++++++------------ + 1 file changed, 16 insertions(+), 12 deletions(-) + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index 7c2947c..1467427 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1201,6 +1201,17 @@ qemuAddSharedDisk(virQEMUDriverPtr driver, + } + + ++static bool ++qemuIsSharedHostdev(virDomainHostdevDefPtr hostdev) ++{ ++ return (hostdev->shareable && ++ (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && ++ hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI && ++ hostdev->source.subsys.u.scsi.protocol != ++ VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)); ++} ++ ++ + static char * + qemuGetSharedHostdevKey(virDomainHostdevDefPtr hostdev) + { +@@ -1238,10 +1249,7 @@ qemuAddSharedHostdev(virQEMUDriverPtr driver, + char *key = NULL; + int ret = -1; + +- if (!hostdev->shareable || +- !(hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && +- hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI && +- hostdev->source.subsys.u.scsi.protocol != VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)) ++ if (!qemuIsSharedHostdev(hostdev)) + return 0; + + if (!(key = qemuGetSharedHostdevKey(hostdev))) +@@ -1342,10 +1350,7 @@ qemuRemoveSharedHostdev(virQEMUDriverPtr driver, + char *key = NULL; + int ret; + +- if (!hostdev->shareable || +- !(hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && +- hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI && +- hostdev->source.subsys.u.scsi.protocol != VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)) ++ if (!qemuIsSharedHostdev(hostdev)) + return 0; + + if (!(key = qemuGetSharedHostdevKey(hostdev))) +@@ -1407,11 +1412,10 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + } else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) { + hostdev = dev->data.hostdev; + ++ if (!qemuIsSharedHostdev(hostdev)) ++ return 0; + +- if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && +- hostdev->source.subsys.type == +- VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI && +- hostdev->source.subsys.u.scsi.sgio) { ++ if (hostdev->source.subsys.u.scsi.sgio) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("'sgio' is not supported for SCSI " + "generic device yet ")); +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Issue-query-iothreads-and-to-get-list-of-active-IOThreads.patch b/SOURCES/libvirt-qemu-Issue-query-iothreads-and-to-get-list-of-active-IOThreads.patch deleted file mode 100644 index f7c9301..0000000 --- a/SOURCES/libvirt-qemu-Issue-query-iothreads-and-to-get-list-of-active-IOThreads.patch +++ /dev/null @@ -1,299 +0,0 @@ -From d5d5ba920d29bfdaff0f92c4eaa12620daac4b5f Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Thu, 18 Sep 2014 09:29:50 -0400 -Subject: [PATCH] qemu: Issue query-iothreads and to get list of active - IOThreads - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -Generate infrastructure and test to handle fetching the QMP -IOThreads data. - -(cherry picked from commit 4cf6bfab4cb9e47478e5e36f65bb3f3b9dd16fb8) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor.c | 41 ++++++++++++++++++++ - src/qemu/qemu_monitor.h | 12 ++++++ - src/qemu/qemu_monitor_json.c | 91 ++++++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_monitor_json.h | 4 ++ - tests/qemumonitorjsontest.c | 71 ++++++++++++++++++++++++++++++++++ - 5 files changed, 219 insertions(+) - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 78f2a20..00f1d38 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -4088,3 +4088,44 @@ qemuMonitorRTCResetReinjection(qemuMonitorPtr mon) - - return qemuMonitorJSONRTCResetReinjection(mon); - } -+ -+/** -+ * qemuMonitorGetIOThreads: -+ * @mon: Pointer to the monitor -+ * @iothreads: Location to return array of IOThreadInfo data -+ * -+ * Issue query-iothreads command. -+ * Retrieve the list of iothreads defined/running for the machine -+ * -+ * Returns count of IOThreadInfo structures on success -+ * -1 on error. -+ */ -+int -+qemuMonitorGetIOThreads(qemuMonitorPtr mon, -+ qemuMonitorIOThreadsInfoPtr **iothreads) -+{ -+ -+ VIR_DEBUG("mon=%p iothreads=%p", mon, iothreads); -+ -+ if (!mon) { -+ virReportError(VIR_ERR_INVALID_ARG, "%s", -+ _("monitor must not be NULL")); -+ return -1; -+ } -+ -+ if (!mon->json) { -+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -+ _("JSON monitor is required")); -+ return -1; -+ } -+ -+ return qemuMonitorJSONGetIOThreads(mon, iothreads); -+} -+ -+void qemuMonitorIOThreadsInfoFree(qemuMonitorIOThreadsInfoPtr iothread) -+{ -+ if (!iothread) -+ return; -+ VIR_FREE(iothread->name); -+ VIR_FREE(iothread); -+} -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index ecba7e1..15aa1d4 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -793,6 +793,18 @@ int qemuMonitorGetGuestCPU(qemuMonitorPtr mon, - - int qemuMonitorRTCResetReinjection(qemuMonitorPtr mon); - -+typedef struct _qemuMonitorIOThreadsInfo qemuMonitorIOThreadsInfo; -+typedef qemuMonitorIOThreadsInfo *qemuMonitorIOThreadsInfoPtr; -+ -+struct _qemuMonitorIOThreadsInfo { -+ char *name; -+ int thread_id; -+}; -+int qemuMonitorGetIOThreads(qemuMonitorPtr mon, -+ qemuMonitorIOThreadsInfoPtr **iothreads); -+ -+void qemuMonitorIOThreadsInfoFree(qemuMonitorIOThreadsInfoPtr iothread); -+ - /** - * When running two dd process and using <> redirection, we need a - * shell that will not truncate files. These two strings serve that -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 106d807..53e324e 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -5974,3 +5974,94 @@ qemuMonitorJSONRTCResetReinjection(qemuMonitorPtr mon) - virJSONValueFree(reply); - return ret; - } -+ -+/** -+ * Query and parse returned array of data such as: -+ * -+ * {u'return': [{u'id': u'iothread1', u'thread-id': 30992}, \ -+ * {u'id': u'iothread2', u'thread-id': 30993}]} -+ */ -+int -+qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon, -+ qemuMonitorIOThreadsInfoPtr **iothreads) -+{ -+ int ret = -1; -+ virJSONValuePtr cmd; -+ virJSONValuePtr reply = NULL; -+ virJSONValuePtr data; -+ qemuMonitorIOThreadsInfoPtr *infolist = NULL; -+ int n = 0; -+ size_t i; -+ -+ *iothreads = NULL; -+ -+ if (!(cmd = qemuMonitorJSONMakeCommand("query-iothreads", NULL))) -+ return ret; -+ -+ ret = qemuMonitorJSONCommand(mon, cmd, &reply); -+ -+ if (ret == 0) -+ ret = qemuMonitorJSONCheckError(cmd, reply); -+ -+ if (ret < 0) -+ goto cleanup; -+ -+ ret = -1; -+ -+ if (!(data = virJSONValueObjectGet(reply, "return"))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("query-iothreads reply was missing return data")); -+ goto cleanup; -+ } -+ -+ if ((n = virJSONValueArraySize(data)) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("query-iothreads reply data was not an array")); -+ goto cleanup; -+ } -+ -+ /* null-terminated list */ -+ if (VIR_ALLOC_N(infolist, n + 1) < 0) -+ goto cleanup; -+ -+ for (i = 0; i < n; i++) { -+ virJSONValuePtr child = virJSONValueArrayGet(data, i); -+ const char *tmp; -+ qemuMonitorIOThreadsInfoPtr info; -+ -+ if (VIR_ALLOC(info) < 0) -+ goto cleanup; -+ -+ infolist[i] = info; -+ -+ if (!(tmp = virJSONValueObjectGetString(child, "id"))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("query-iothreads reply data was missing 'id'")); -+ goto cleanup; -+ } -+ -+ if (VIR_STRDUP(info->name, tmp) < 0) -+ goto cleanup; -+ -+ if (virJSONValueObjectGetNumberInt(child, "thread-id", -+ &info->thread_id) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("query-iothreads reply has malformed " -+ "'thread-id' data")); -+ goto cleanup; -+ } -+ } -+ -+ ret = n; -+ *iothreads = infolist; -+ -+ cleanup: -+ if (ret < 0 && infolist) { -+ for (i = 0; i < n; i++) -+ qemuMonitorIOThreadsInfoFree(infolist[i]); -+ VIR_FREE(infolist); -+ } -+ virJSONValueFree(cmd); -+ virJSONValueFree(reply); -+ return ret; -+} -diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index efa2330..dc5a059 100644 ---- a/src/qemu/qemu_monitor_json.h -+++ b/src/qemu/qemu_monitor_json.h -@@ -443,4 +443,8 @@ int qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon, - virCPUDataPtr *data); - - int qemuMonitorJSONRTCResetReinjection(qemuMonitorPtr mon); -+ -+int qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon, -+ qemuMonitorIOThreadsInfoPtr **iothreads) -+ ATTRIBUTE_NONNULL(2); - #endif /* QEMU_MONITOR_JSON_H */ -diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c -index e3fb4f7..d53ab05 100644 ---- a/tests/qemumonitorjsontest.c -+++ b/tests/qemumonitorjsontest.c -@@ -2217,6 +2217,76 @@ testQemuMonitorJSONGetNonExistingCPUData(const void *opaque) - } - - static int -+testQemuMonitorJSONGetIOThreads(const void *data) -+{ -+ virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; -+ qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt); -+ qemuMonitorIOThreadsInfoPtr *info; -+ int ninfo = 0; -+ int ret = -1; -+ size_t i; -+ -+ if (!test) -+ return -1; -+ -+ if (qemuMonitorTestAddItem(test, "query-iothreads", -+ "{ " -+ " \"return\": [ " -+ " { " -+ " \"id\": \"iothread1\", " -+ " \"thread-id\": 30992 " -+ " }, " -+ " { " -+ " \"id\": \"iothread2\", " -+ " \"thread-id\": 30993 " -+ " } " -+ " ]" -+ "}") < 0) -+ goto cleanup; -+ -+ if ((ninfo = qemuMonitorGetIOThreads(qemuMonitorTestGetMonitor(test), -+ &info)) < 0) -+ goto cleanup; -+ -+ if (ninfo != 2) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ "ninfo %d is not 2", ninfo); -+ goto cleanup; -+ } -+ -+#define CHECK(i, wantname, wantthread_id) \ -+ do { \ -+ if (STRNEQ(info[i]->name, (wantname))) { \ -+ virReportError(VIR_ERR_INTERNAL_ERROR, \ -+ "name %s is not %s", \ -+ info[i]->name, (wantname)); \ -+ goto cleanup; \ -+ } \ -+ if (info[i]->thread_id != (wantthread_id)) { \ -+ virReportError(VIR_ERR_INTERNAL_ERROR, \ -+ "thread_id %d is not %d", \ -+ info[i]->thread_id, (wantthread_id)); \ -+ goto cleanup; \ -+ } \ -+ } while (0) -+ -+ CHECK(0, "iothread1", 30992); -+ CHECK(1, "iothread2", 30993); -+ -+#undef CHECK -+ -+ ret = 0; -+ -+ cleanup: -+ qemuMonitorTestFree(test); -+ for (i = 0; i < ninfo; i++) -+ qemuMonitorIOThreadsInfoFree(info[i]); -+ VIR_FREE(info); -+ -+ return ret; -+} -+ -+static int - mymain(void) - { - int ret = 0; -@@ -2272,6 +2342,7 @@ mymain(void) - DO_TEST(GetDeviceAliases); - DO_TEST(CPU); - DO_TEST(GetNonExistingCPUData); -+ DO_TEST(GetIOThreads); - DO_TEST_SIMPLE("qmp_capabilities", qemuMonitorJSONSetCapabilities); - DO_TEST_SIMPLE("system_powerdown", qemuMonitorJSONSystemPowerdown); - DO_TEST_SIMPLE("system_reset", qemuMonitorJSONSystemReset); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Keep-numad-hint-after-daemon-restart.patch b/SOURCES/libvirt-qemu-Keep-numad-hint-after-daemon-restart.patch new file mode 100644 index 0000000..a348b93 --- /dev/null +++ b/SOURCES/libvirt-qemu-Keep-numad-hint-after-daemon-restart.patch @@ -0,0 +1,130 @@ +From c2e77e9c6e246a254083ac0e30c9b0da209daac2 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Thu, 13 Aug 2015 15:11:47 +0200 +Subject: [PATCH] qemu: Keep numad hint after daemon restart + +https://bugzilla.redhat.com/show_bug.cgi?id=1162947 + +The numad hint stored in priv->autoNodeset is information that gets lost +during daemon restart. And because we would like to use that +information in the future, we also need to save it in the status XML. +For the sake of tests, we need to initialize nnumaCell_max to some +value, so that the restoration doesn't fail in our test suite. There is +no need to fill in the actual numa cell data since the recalculating +function virCapabilitiesGetCpusForNodemask() will not fail, it will just +skip filling the data in the bitmap which we don't use in tests anyway. + +Signed-off-by: Martin Kletzander +(cherry picked from commit 8ce86722d78d8b2a1e7d9cb29571beb791c9f3d7) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 32 +++++++++++++++++++++++++++++++- + tests/qemuxml2xmltest.c | 3 ++- + tests/testutilsqemu.c | 2 ++ + 3 files changed, 35 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index ca41ca4..3b542f5 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -618,21 +618,33 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, + virBufferAddLit(buf, "\n"); + } + ++ if (priv->autoNodeset) { ++ char *nodeset = virBitmapFormat(priv->autoNodeset); ++ ++ if (!nodeset) ++ return -1; ++ ++ virBufferAsprintf(buf, "\n", nodeset); ++ VIR_FREE(nodeset); ++ } ++ + return 0; + } + + static int + qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, + virDomainObjPtr vm, +- virDomainDefParserConfigPtr config ATTRIBUTE_UNUSED) ++ virDomainDefParserConfigPtr config) + { + qemuDomainObjPrivatePtr priv = vm->privateData; ++ virQEMUDriverPtr driver = config->priv; + char *monitorpath; + char *tmp = NULL; + int n; + size_t i; + xmlNodePtr *nodes = NULL; + virQEMUCapsPtr qemuCaps = NULL; ++ virCapsPtr caps = NULL; + + if (VIR_ALLOC(priv->monConfig) < 0) + goto error; +@@ -805,15 +817,33 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, + } + VIR_FREE(nodes); + ++ if (!(caps = virQEMUDriverGetCapabilities(driver, false))) ++ goto error; ++ ++ if ((tmp = virXPathString("string(./numad/@nodeset)", ctxt))) { ++ if (virBitmapParse(tmp, 0, &priv->autoNodeset, ++ caps->host.nnumaCell_max) < 0) ++ goto error; ++ ++ if (!(priv->autoCpuset = virCapabilitiesGetCpusForNodemask(caps, ++ priv->autoNodeset))) ++ goto error; ++ } ++ virObjectUnref(caps); ++ caps = NULL; ++ VIR_FREE(tmp); ++ + return 0; + + error: + virDomainChrSourceDefFree(priv->monConfig); + priv->monConfig = NULL; + VIR_FREE(nodes); ++ VIR_FREE(tmp); + virStringFreeList(priv->qemuDevices); + priv->qemuDevices = NULL; + virObjectUnref(qemuCaps); ++ virObjectUnref(caps); + return -1; + } + +diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c +index 7a41a18..09806b2 100644 +--- a/tests/qemuxml2xmltest.c ++++ b/tests/qemuxml2xmltest.c +@@ -130,7 +130,8 @@ static const char testStatusXMLPrefix[] = + " \n" + " \n" + " \n" +-" \n"; ++" \n" ++" \n"; + + static const char testStatusXMLSuffix[] = + "\n"; +diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c +index ceaabb6..a2f4299 100644 +--- a/tests/testutilsqemu.c ++++ b/tests/testutilsqemu.c +@@ -336,6 +336,8 @@ virCapsPtr testQemuCapsInit(void) + + caps->host.cpu = cpuDefault; + ++ caps->host.nnumaCell_max = 4; ++ + if ((machines = testQemuAllocMachines(&nmachines)) == NULL) + goto cleanup; + +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Label-correct-per-VM-path-when-starting.patch b/SOURCES/libvirt-qemu-Label-correct-per-VM-path-when-starting.patch new file mode 100644 index 0000000..cc3c10c --- /dev/null +++ b/SOURCES/libvirt-qemu-Label-correct-per-VM-path-when-starting.patch @@ -0,0 +1,91 @@ +From ebf1ada37c3566d07c6eb81a2dfe0135394b657a Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Wed, 26 Aug 2015 11:27:38 +0200 +Subject: [PATCH] qemu: Label correct per-VM path when starting + +Commit f1f68ca33433825ce0deed2d96f1990200bc6618 overused mdir_name() +event though it was not needed in the latest version, hence labelling +directory one level up in the tree and not the one it should. + +If anyone with SElinux managed to try run a domain with guest agent set +up, it's highly possible that they will need to run 'restorecon -F +/var/lib/libvirt/qemu/channel/target' to fix what was done. + +Reported-by: Luyao Huang +Signed-off-by: Martin Kletzander +(cherry picked from commit f674dc6794e0946f89313f477aa7886a4a28188e) + +https://bugzilla.redhat.com/show_bug.cgi?id=1146886 + +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_process.c | 16 +++------------- + 1 file changed, 3 insertions(+), 13 deletions(-) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 8cda456..317ef78 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -46,7 +46,6 @@ + + #include "cpu/cpu.h" + #include "datatypes.h" +-#include "dirname.h" + #include "virlog.h" + #include "virerror.h" + #include "viralloc.h" +@@ -4394,7 +4393,7 @@ int qemuProcessStart(virConnectPtr conn, + unsigned int hostdev_flags = 0; + size_t nnicindexes = 0; + int *nicindexes = NULL; +- char *tmppath = NULL, *tmpdirpath = NULL; ++ char *tmppath = NULL; + + VIR_DEBUG("vm=%p name=%s id=%d pid=%llu", + vm, vm->def->name, vm->def->id, +@@ -4741,15 +4740,11 @@ int qemuProcessStart(virConnectPtr conn, + if (virFileMakePath(tmppath) < 0) + goto cleanup; + +- if (!(tmpdirpath = mdir_name(tmppath))) +- goto cleanup; +- + if (virSecurityManagerDomainSetDirLabel(driver->securityManager, +- vm->def, tmpdirpath) < 0) ++ vm->def, tmppath) < 0) + goto cleanup; + + VIR_FREE(tmppath); +- VIR_FREE(tmpdirpath); + + if (virAsprintf(&tmppath, "%s/domain-%s", + cfg->channelTargetDir, vm->def->name) < 0) +@@ -4758,14 +4753,10 @@ int qemuProcessStart(virConnectPtr conn, + if (virFileMakePath(tmppath) < 0) + goto cleanup; + +- if (!(tmpdirpath = mdir_name(tmppath))) +- goto cleanup; +- + if (virSecurityManagerDomainSetDirLabel(driver->securityManager, +- vm->def, tmpdirpath) < 0) ++ vm->def, tmppath) < 0) + goto cleanup; + +- VIR_FREE(tmpdirpath); + VIR_FREE(tmppath); + + /* now that we know it is about to start call the hook if present */ +@@ -5122,7 +5113,6 @@ int qemuProcessStart(virConnectPtr conn, + * if we failed to initialize the now running VM. kill it off and + * pretend we never started it */ + VIR_FREE(tmppath); +- VIR_FREE(tmpdirpath); + VIR_FREE(nodeset); + virCommandFree(cmd); + VIR_FORCE_CLOSE(logfile); +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Leave-cpuset.mems-in-parent-cgroup-alone.patch b/SOURCES/libvirt-qemu-Leave-cpuset.mems-in-parent-cgroup-alone.patch deleted file mode 100644 index 004dd9a..0000000 --- a/SOURCES/libvirt-qemu-Leave-cpuset.mems-in-parent-cgroup-alone.patch +++ /dev/null @@ -1,338 +0,0 @@ -From a53fd36c939c31dbfa134d8d0f342bb257ff300d Mon Sep 17 00:00:00 2001 -Message-Id: -From: Martin Kletzander -Date: Thu, 15 Jan 2015 15:03:48 +0100 -Subject: [PATCH] qemu: Leave cpuset.mems in parent cgroup alone - -https://bugzilla.redhat.com/show_bug.cgi?id=1161540 - -Instead of setting the value of cpuset.mems once when the domain starts -and then re-calculating the value every time we need to change the child -cgroup values, leave the cgroup alone and rather set the child data -every time there is new cgroup created. We don't leave any task in the -parent group anyway. This will ease both current and future code. - -Signed-off-by: Martin Kletzander -(cherry picked from commit af2a1f0587d88656f2c14265a63fbc11ecbd924e) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_cgroup.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++-- - src/qemu/qemu_driver.c | 59 +++++++++++++++----------------------------- - 2 files changed, 85 insertions(+), 41 deletions(-) - -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index fa94037..0a4576a 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -35,6 +35,7 @@ - #include "virstring.h" - #include "virfile.h" - #include "virtypedparam.h" -+#include "virnuma.h" - - #define VIR_FROM_THIS VIR_FROM_QEMU - -@@ -625,8 +626,7 @@ qemuSetupCpusetMems(virDomainObjPtr vm) - - if (mem_mask) - if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0 || -- virCgroupSetCpusetMems(cgroup_temp, mem_mask) < 0 || -- virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0) -+ virCgroupSetCpusetMems(cgroup_temp, mem_mask) < 0) - goto cleanup; - - ret = 0; -@@ -781,6 +781,39 @@ qemuInitCgroup(virQEMUDriverPtr driver, - return ret; - } - -+static void -+qemuRestoreCgroupState(virDomainObjPtr vm) -+{ -+ char *mem_mask; -+ int empty = -1; -+ qemuDomainObjPrivatePtr priv = vm->privateData; -+ virBitmapPtr all_nodes; -+ -+ if (!(all_nodes = virNumaGetHostNodeset())) -+ goto error; -+ -+ if (!(mem_mask = virBitmapFormat(all_nodes))) -+ goto error; -+ -+ if ((empty = virCgroupHasEmptyTasks(priv->cgroup, -+ VIR_CGROUP_CONTROLLER_CPUSET)) < 0) -+ -+ if (!empty) -+ goto error; -+ -+ if (virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0) -+ goto error; -+ -+ cleanup: -+ VIR_FREE(mem_mask); -+ virBitmapFree(all_nodes); -+ return; -+ -+ error: -+ virResetLastError(); -+ VIR_DEBUG("Couldn't restore cgroups to meaningful state"); -+ goto cleanup; -+} - - int - qemuConnectCgroup(virQEMUDriverPtr driver, -@@ -808,6 +841,8 @@ qemuConnectCgroup(virQEMUDriverPtr driver, - &priv->cgroup) < 0) - goto cleanup; - -+ qemuRestoreCgroupState(vm); -+ - done: - ret = 0; - cleanup: -@@ -959,6 +994,7 @@ qemuSetupCgroupForVcpu(virDomainObjPtr vm) - size_t i, j; - unsigned long long period = vm->def->cputune.period; - long long quota = vm->def->cputune.quota; -+ char *mem_mask = NULL; - - if ((period || quota) && - !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU)) { -@@ -990,6 +1026,13 @@ qemuSetupCgroupForVcpu(virDomainObjPtr vm) - return 0; - } - -+ if (virDomainNumatuneGetMode(vm->def->numatune, -1) == -+ VIR_DOMAIN_NUMATUNE_MEM_STRICT && -+ virDomainNumatuneMaybeFormatNodeset(vm->def->numatune, -+ priv->autoNodeset, -+ &mem_mask, -1) < 0) -+ goto cleanup; -+ - for (i = 0; i < priv->nvcpupids; i++) { - if (virCgroupNewVcpu(priv->cgroup, i, true, &cgroup_vcpu) < 0) - goto cleanup; -@@ -998,6 +1041,10 @@ qemuSetupCgroupForVcpu(virDomainObjPtr vm) - if (virCgroupAddTask(cgroup_vcpu, priv->vcpupids[i]) < 0) - goto cleanup; - -+ if (mem_mask && -+ virCgroupSetCpusetMems(cgroup_vcpu, mem_mask) < 0) -+ goto cleanup; -+ - if (period || quota) { - if (qemuSetupCgroupVcpuBW(cgroup_vcpu, period, quota) < 0) - goto cleanup; -@@ -1023,6 +1070,7 @@ qemuSetupCgroupForVcpu(virDomainObjPtr vm) - - virCgroupFree(&cgroup_vcpu); - } -+ VIR_FREE(mem_mask); - - return 0; - -@@ -1031,6 +1079,7 @@ qemuSetupCgroupForVcpu(virDomainObjPtr vm) - virCgroupRemove(cgroup_vcpu); - virCgroupFree(&cgroup_vcpu); - } -+ VIR_FREE(mem_mask); - - return -1; - } -@@ -1119,6 +1168,7 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm) - size_t i, j; - unsigned long long period = vm->def->cputune.period; - long long quota = vm->def->cputune.quota; -+ char *mem_mask = NULL; - - if ((period || quota) && - !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU)) { -@@ -1147,6 +1197,13 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm) - return 0; - } - -+ if (virDomainNumatuneGetMode(vm->def->numatune, -1) == -+ VIR_DOMAIN_NUMATUNE_MEM_STRICT && -+ virDomainNumatuneMaybeFormatNodeset(vm->def->numatune, -+ priv->autoNodeset, -+ &mem_mask, -1) < 0) -+ goto cleanup; -+ - for (i = 0; i < priv->niothreadpids; i++) { - /* IOThreads are numbered 1..n, although the array is 0..n-1, - * so we will account for that here -@@ -1164,6 +1221,10 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm) - goto cleanup; - } - -+ if (mem_mask && -+ virCgroupSetCpusetMems(cgroup_iothread, mem_mask) < 0) -+ goto cleanup; -+ - /* Set iothreadpin in cgroup if iothreadpin xml is provided */ - if (virCgroupHasController(priv->cgroup, - VIR_CGROUP_CONTROLLER_CPUSET)) { -@@ -1186,6 +1247,7 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm) - - virCgroupFree(&cgroup_iothread); - } -+ VIR_FREE(mem_mask); - - return 0; - -@@ -1194,6 +1256,7 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm) - virCgroupRemove(cgroup_iothread); - virCgroupFree(&cgroup_iothread); - } -+ VIR_FREE(mem_mask); - - return -1; - } -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 8830e04..ea9368d 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4447,6 +4447,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, - pid_t *cpupids = NULL; - int ncpupids; - virCgroupPtr cgroup_vcpu = NULL; -+ char *mem_mask = NULL; - - qemuDomainObjEnterMonitor(driver, vm); - -@@ -4510,6 +4511,13 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, - goto cleanup; - } - -+ if (virDomainNumatuneGetMode(vm->def->numatune, -1) == -+ VIR_DOMAIN_NUMATUNE_MEM_STRICT && -+ virDomainNumatuneMaybeFormatNodeset(vm->def->numatune, -+ priv->autoNodeset, -+ &mem_mask, -1) < 0) -+ goto cleanup; -+ - if (nvcpus > oldvcpus) { - for (i = oldvcpus; i < nvcpus; i++) { - if (priv->cgroup) { -@@ -4518,6 +4526,10 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, - if (virCgroupNewVcpu(priv->cgroup, i, true, &cgroup_vcpu) < 0) - goto cleanup; - -+ if (mem_mask && -+ virCgroupSetCpusetMems(cgroup_vcpu, mem_mask) < 0) -+ goto cleanup; -+ - /* Add vcpu thread to the cgroup */ - rv = virCgroupAddTask(cgroup_vcpu, cpupids[i]); - if (rv < 0) { -@@ -4527,6 +4539,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, - virCgroupRemove(cgroup_vcpu); - goto cleanup; - } -+ - } - - /* Inherit def->cpuset */ -@@ -4599,6 +4612,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, - qemuDomainObjExitMonitor(driver, vm); - vm->def->vcpus = vcpus; - VIR_FREE(cpupids); -+ VIR_FREE(mem_mask); - virDomainAuditVcpu(vm, oldvcpus, nvcpus, "update", rc == 1); - if (cgroup_vcpu) - virCgroupFree(&cgroup_vcpu); -@@ -9143,11 +9157,9 @@ qemuDomainGetMemoryParameters(virDomainPtr dom, - - static int - qemuDomainSetNumaParamsLive(virDomainObjPtr vm, -- virCapsPtr caps, - virBitmapPtr nodeset) - { - virCgroupPtr cgroup_temp = NULL; -- virBitmapPtr temp_nodeset = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; - char *nodeset_str = NULL; - size_t i = 0; -@@ -9161,39 +9173,15 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm, - goto cleanup; - } - -- /* Get existing nodeset values */ -- if (virCgroupGetCpusetMems(priv->cgroup, &nodeset_str) < 0 || -- virBitmapParse(nodeset_str, 0, &temp_nodeset, -- VIR_DOMAIN_CPUMASK_LEN) < 0) -- goto cleanup; -- VIR_FREE(nodeset_str); -- -- for (i = 0; i < caps->host.nnumaCell; i++) { -- bool result; -- virCapsHostNUMACellPtr cell = caps->host.numaCell[i]; -- if (virBitmapGetBit(nodeset, cell->num, &result) < 0) { -- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("Failed to get cpuset bit values")); -- goto cleanup; -- } -- if (result && (virBitmapSetBit(temp_nodeset, cell->num) < 0)) { -- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("Failed to set temporary cpuset bit values")); -- goto cleanup; -- } -- } -- -- if (!(nodeset_str = virBitmapFormat(temp_nodeset))) -- goto cleanup; -- -- if (virCgroupSetCpusetMems(priv->cgroup, nodeset_str) < 0) -- goto cleanup; -- VIR_FREE(nodeset_str); -- - /* Ensure the cpuset string is formatted before passing to cgroup */ - if (!(nodeset_str = virBitmapFormat(nodeset))) - goto cleanup; - -+ if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0 || -+ virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0) -+ goto cleanup; -+ virCgroupFree(&cgroup_temp); -+ - for (i = 0; i < priv->nvcpupids; i++) { - if (virCgroupNewVcpu(priv->cgroup, i, false, &cgroup_temp) < 0 || - virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0) -@@ -9201,11 +9189,6 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm, - virCgroupFree(&cgroup_temp); - } - -- if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0 || -- virCgroupSetCpusetMems(cgroup_temp, nodeset_str) < 0 || -- virCgroupSetCpusetMems(priv->cgroup, nodeset_str) < 0) -- goto cleanup; -- - for (i = 0; i < priv->niothreadpids; i++) { - if (virCgroupNewIOThread(priv->cgroup, i + 1, false, - &cgroup_temp) < 0 || -@@ -9214,11 +9197,9 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm, - virCgroupFree(&cgroup_temp); - } - -- - ret = 0; - cleanup: - VIR_FREE(nodeset_str); -- virBitmapFree(temp_nodeset); - virCgroupFree(&cgroup_temp); - - return ret; -@@ -9313,7 +9294,7 @@ qemuDomainSetNumaParameters(virDomainPtr dom, - } - - if (nodeset && -- qemuDomainSetNumaParamsLive(vm, caps, nodeset) < 0) -+ qemuDomainSetNumaParamsLive(vm, nodeset) < 0) - goto endjob; - - if (virDomainNumatuneSet(&vm->def->numatune, --- -2.2.1 - diff --git a/SOURCES/libvirt-qemu-Make-memory-alignment-helper-more-universal.patch b/SOURCES/libvirt-qemu-Make-memory-alignment-helper-more-universal.patch new file mode 100644 index 0000000..0047973 --- /dev/null +++ b/SOURCES/libvirt-qemu-Make-memory-alignment-helper-more-universal.patch @@ -0,0 +1,124 @@ +From a8f30a71dbe0327b945e9a85e561cace913d17a4 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:38 +0200 +Subject: [PATCH] qemu: Make memory alignment helper more universal + +https://bugzilla.redhat.com/show_bug.cgi?id=1252685 + +Extract the size determination into a separate function and reuse it +across the memory device alignment functions. Since later we will need +to decide the alignment size according to architecture let's pass def to +the functions. + +(cherry picked from commit 3fb0819830cef3b269fbcdea217d7f1de4b62e87) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 26 ++++++++++++++++++-------- + src/qemu/qemu_domain.h | 3 ++- + src/qemu/qemu_hotplug.c | 4 ++-- + 3 files changed, 22 insertions(+), 11 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 9d9fb06..15cdf7b 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3158,30 +3158,39 @@ qemuDomainAgentAvailable(virDomainObjPtr vm, + } + + ++static unsigned long long ++qemuDomainGetMemorySizeAlignment(virDomainDefPtr def ATTRIBUTE_UNUSED) ++{ ++ /* Align memory size. QEMU requires rounding to next 4KiB block. ++ * We'll take the "traditional" path and round it to 1MiB*/ ++ ++ return 1024; ++} ++ ++ + int + qemuDomainAlignMemorySizes(virDomainDefPtr def) + { + unsigned long long mem; ++ unsigned long long align = qemuDomainGetMemorySizeAlignment(def); + size_t ncells = virDomainNumaGetNodeCount(def->numa); + size_t i; + + /* align NUMA cell sizes if relevant */ + for (i = 0; i < ncells; i++) { + mem = virDomainNumaGetNodeMemorySize(def->numa, i); +- virDomainNumaSetNodeMemorySize(def->numa, i, VIR_ROUND_UP(mem, 1024)); ++ virDomainNumaSetNodeMemorySize(def->numa, i, VIR_ROUND_UP(mem, align)); + } + + /* align initial memory size */ + mem = virDomainDefGetMemoryInitial(def); +- virDomainDefSetMemoryInitial(def, VIR_ROUND_UP(mem, 1024)); ++ virDomainDefSetMemoryInitial(def, VIR_ROUND_UP(mem, align)); + +- /* Align maximum memory size. QEMU requires rounding to next 4KiB block. +- * We'll take the "traditional" path and round it to 1MiB*/ +- def->mem.max_memory = VIR_ROUND_UP(def->mem.max_memory, 1024); ++ def->mem.max_memory = VIR_ROUND_UP(def->mem.max_memory, align); + + /* Align memory module sizes */ + for (i = 0; i < def->nmems; i++) +- qemuDomainMemoryDeviceAlignSize(def->mems[i]); ++ def->mems[i]->size = VIR_ROUND_UP(def->mems[i]->size, align); + + return 0; + } +@@ -3196,9 +3205,10 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) + * size so this should be safe). + */ + void +-qemuDomainMemoryDeviceAlignSize(virDomainMemoryDefPtr mem) ++qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def, ++ virDomainMemoryDefPtr mem) + { +- mem->size = VIR_ROUND_UP(mem->size, 1024); ++ mem->size = VIR_ROUND_UP(mem->size, qemuDomainGetMemorySizeAlignment(def)); + } + + +diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h +index 91eaea1..e283b58 100644 +--- a/src/qemu/qemu_domain.h ++++ b/src/qemu/qemu_domain.h +@@ -462,7 +462,8 @@ bool qemuDomainHasBlockjob(virDomainObjPtr vm, bool copy_only) + ATTRIBUTE_NONNULL(1); + + int qemuDomainAlignMemorySizes(virDomainDefPtr def); +-void qemuDomainMemoryDeviceAlignSize(virDomainMemoryDefPtr mem); ++void qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def, ++ virDomainMemoryDefPtr mem); + + virDomainChrSourceDefPtr qemuFindAgentConfig(virDomainDefPtr def); + +diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c +index 31c56ae..f702c9f 100644 +--- a/src/qemu/qemu_hotplug.c ++++ b/src/qemu/qemu_hotplug.c +@@ -1801,7 +1801,7 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver, + if (!(devstr = qemuBuildMemoryDeviceStr(mem, vm->def, priv->qemuCaps))) + goto cleanup; + +- qemuDomainMemoryDeviceAlignSize(mem); ++ qemuDomainMemoryDeviceAlignSize(vm->def, mem); + + if (qemuBuildMemoryBackendStr(mem->size, mem->pagesize, + mem->targetNode, mem->sourceNodes, NULL, +@@ -4282,7 +4282,7 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver, + return -1; + } + +- qemuDomainMemoryDeviceAlignSize(memdef); ++ qemuDomainMemoryDeviceAlignSize(vm->def, memdef); + + if ((idx = virDomainMemoryFindByDef(vm->def, memdef)) < 0) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", +-- +2.5.3 + diff --git a/SOURCES/libvirt-qemu-Make-updating-stats-in-qemuMigrationCheckJobStatus-optional.patch b/SOURCES/libvirt-qemu-Make-updating-stats-in-qemuMigrationCheckJobStatus-optional.patch new file mode 100644 index 0000000..1a9938f --- /dev/null +++ b/SOURCES/libvirt-qemu-Make-updating-stats-in-qemuMigrationCheckJobStatus-optional.patch @@ -0,0 +1,90 @@ +From 71a02a994244ade016cadf1cc51b0cfa32482b8c Mon Sep 17 00:00:00 2001 +Message-Id: <71a02a994244ade016cadf1cc51b0cfa32482b8c@dist-git> +From: Jiri Denemark +Date: Mon, 5 Oct 2015 14:32:58 +0200 +Subject: [PATCH] qemu: Make updating stats in qemuMigrationCheckJobStatus + optional + +With new QEMU which supports migration events, +qemuMigrationCheckJobStatus needs to explicitly query QEMU for migration +statistics once migration is completed to make sure the caller sees +up-to-date statistics with both old and new QEMU. However, some callers +are not interested in the statistics at all and once we start waiting +for a completed migration on the destination host too, checking the +statistics would even fail. Let's push the decision whether to update +the statistics or not to the caller. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 829c62b7a5268a639116bc1cea51d1c6598f4bf4) + +https://bugzilla.redhat.com/show_bug.cgi?id=1265902 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_migration.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 17c1276..83614f5 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -2562,7 +2562,8 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver, + static int + qemuMigrationCheckJobStatus(virQEMUDriverPtr driver, + virDomainObjPtr vm, +- qemuDomainAsyncJob asyncJob) ++ qemuDomainAsyncJob asyncJob, ++ bool updateJobStats) + { + qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainJobInfoPtr jobInfo = priv->job.current; +@@ -2592,7 +2593,7 @@ qemuMigrationCheckJobStatus(virQEMUDriverPtr driver, + + case VIR_DOMAIN_JOB_COMPLETED: + /* Fetch statistics of a completed migration */ +- if (events && ++ if (events && updateJobStats && + qemuMigrationUpdateJobStatus(driver, vm, asyncJob) < 0) + return -1; + break; +@@ -2609,6 +2610,7 @@ qemuMigrationCheckJobStatus(virQEMUDriverPtr driver, + enum qemuMigrationCompletedFlags { + QEMU_MIGRATION_COMPLETED_ABORT_ON_ERROR = (1 << 0), + QEMU_MIGRATION_COMPLETED_CHECK_STORAGE = (1 << 1), ++ QEMU_MIGRATION_COMPLETED_UPDATE_STATS = (1 << 2), + }; + + /** +@@ -2627,8 +2629,9 @@ qemuMigrationCompleted(virQEMUDriverPtr driver, + qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainJobInfoPtr jobInfo = priv->job.current; + int pauseReason; ++ bool updateStats = !!(flags & QEMU_MIGRATION_COMPLETED_UPDATE_STATS); + +- if (qemuMigrationCheckJobStatus(driver, vm, asyncJob) < 0) ++ if (qemuMigrationCheckJobStatus(driver, vm, asyncJob, updateStats) < 0) + goto error; + + if (flags & QEMU_MIGRATION_COMPLETED_CHECK_STORAGE && +@@ -2682,7 +2685,7 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, + qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainJobInfoPtr jobInfo = priv->job.current; + bool events = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT); +- unsigned int flags = 0; ++ unsigned int flags = QEMU_MIGRATION_COMPLETED_UPDATE_STATS; + int rv; + + if (abort_on_error) +@@ -4352,7 +4355,8 @@ qemuMigrationRun(virQEMUDriverPtr driver, + * connection from qemu which may never be initiated. + */ + if (qemuMigrationCheckJobStatus(driver, vm, +- QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) ++ QEMU_ASYNC_JOB_MIGRATION_OUT, ++ false) < 0) + goto cancel; + + while ((fd = accept(spec->dest.unix_socket.sock, NULL, NULL)) < 0) { +-- +2.6.1 + diff --git a/SOURCES/libvirt-qemu-Memory-pre-pinning-support-for-RDMA-migration.patch b/SOURCES/libvirt-qemu-Memory-pre-pinning-support-for-RDMA-migration.patch deleted file mode 100644 index 9c4a23b..0000000 --- a/SOURCES/libvirt-qemu-Memory-pre-pinning-support-for-RDMA-migration.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 088baea86780021290cc9dbb3e313723d7040cbd Mon Sep 17 00:00:00 2001 -Message-Id: <088baea86780021290cc9dbb3e313723d7040cbd@dist-git> -From: "Michael R. Hines" -Date: Tue, 23 Sep 2014 15:47:58 +0200 -Subject: [PATCH] qemu: Memory pre-pinning support for RDMA migration - -RDMA Live migration requires registering memory with the hardware, and -thus QEMU offers a new 'capability' to pre-register / mlock() the guest -memory in advance for higher RDMA performance before the migration -begins. This capability is disabled by default, which means QEMU will -register the memory with the hardware in an on-demand basis. - -This patch exposes this capability with the following example usage: - -virsh migrate --live --rdma-pin-all --migrateuri rdma://hostname domain qemu+ssh://hostname/system - -https://bugzilla.redhat.com/show_bug.cgi?id=1013055 - -Signed-off-by: Michael R. Hines -Signed-off-by: Jiri Denemark -(cherry picked from commit 9cc1586d2b5b6d4d396ebfa0479ae441e0b917ea) -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 1 + - src/qemu/qemu_migration.c | 49 ++++++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_migration.h | 3 ++- - tools/virsh-domain.c | 7 +++++++ - 4 files changed, 59 insertions(+), 1 deletion(-) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index b07797e..0b40727 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -1224,6 +1224,7 @@ typedef enum { - VIR_MIGRATE_COMPRESSED = (1 << 11), /* compress data during migration */ - VIR_MIGRATE_ABORT_ON_ERROR = (1 << 12), /* abort migration on I/O errors happened during migration */ - VIR_MIGRATE_AUTO_CONVERGE = (1 << 13), /* force convergence */ -+ VIR_MIGRATE_RDMA_PIN_ALL = (1 << 14), /* RDMA memory pinning */ - } virDomainMigrateFlags; - - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 3433ec9..fda7cda 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -1874,6 +1874,46 @@ qemuMigrationSetAutoConverge(virQEMUDriverPtr driver, - - - static int -+qemuMigrationSetPinAll(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ qemuDomainAsyncJob job) -+{ -+ qemuDomainObjPrivatePtr priv = vm->privateData; -+ int ret; -+ -+ if (qemuDomainObjEnterMonitorAsync(driver, vm, job) < 0) -+ return -1; -+ -+ ret = qemuMonitorGetMigrationCapability( -+ priv->mon, -+ QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL); -+ -+ if (ret < 0) { -+ goto cleanup; -+ } else if (ret == 0) { -+ if (job == QEMU_ASYNC_JOB_MIGRATION_IN) { -+ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", -+ _("rdma pinning migration is not supported by " -+ "target QEMU binary")); -+ } else { -+ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", -+ _("rdma pinning migration is not supported by " -+ "source QEMU binary")); -+ } -+ ret = -1; -+ goto cleanup; -+ } -+ -+ ret = qemuMonitorSetMigrationCapability( -+ priv->mon, -+ QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL); -+ -+ cleanup: -+ qemuDomainObjExitMonitor(driver, vm); -+ return ret; -+} -+ -+static int - qemuMigrationWaitForSpice(virQEMUDriverPtr driver, - virDomainObjPtr vm) - { -@@ -2709,6 +2749,10 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - goto stop; - } - -+ if (flags & VIR_MIGRATE_RDMA_PIN_ALL && -+ qemuMigrationSetPinAll(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN) < 0) -+ goto stop; -+ - if (mig->lockState) { - VIR_DEBUG("Received lockstate %s", mig->lockState); - VIR_FREE(priv->lockState); -@@ -3532,6 +3576,11 @@ qemuMigrationRun(virQEMUDriverPtr driver, - QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) - goto cleanup; - -+ if (flags & VIR_MIGRATE_RDMA_PIN_ALL && -+ qemuMigrationSetPinAll(driver, vm, -+ QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) -+ goto cleanup; -+ - if (qemuDomainObjEnterMonitorAsync(driver, vm, - QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) - goto cleanup; -diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h -index 3fa68dc..e7a90c3 100644 ---- a/src/qemu/qemu_migration.h -+++ b/src/qemu/qemu_migration.h -@@ -40,7 +40,8 @@ - VIR_MIGRATE_OFFLINE | \ - VIR_MIGRATE_COMPRESSED | \ - VIR_MIGRATE_ABORT_ON_ERROR | \ -- VIR_MIGRATE_AUTO_CONVERGE) -+ VIR_MIGRATE_AUTO_CONVERGE | \ -+ VIR_MIGRATE_RDMA_PIN_ALL) - - /* All supported migration parameters and their types. */ - # define QEMU_MIGRATION_PARAMETERS \ -diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c -index 683d92e..23395e5 100644 ---- a/tools/virsh-domain.c -+++ b/tools/virsh-domain.c -@@ -8999,6 +8999,10 @@ static const vshCmdOptDef opts_migrate[] = { - .type = VSH_OT_BOOL, - .help = N_("force convergence during live migration") - }, -+ {.name = "rdma-pin-all", -+ .type = VSH_OT_BOOL, -+ .help = N_("support memory pinning during RDMA live migration") -+ }, - {.name = "abort-on-error", - .type = VSH_OT_BOOL, - .help = N_("abort on soft errors during migration") -@@ -9147,6 +9151,9 @@ doMigrate(void *opaque) - if (vshCommandOptBool(cmd, "auto-converge")) - flags |= VIR_MIGRATE_AUTO_CONVERGE; - -+ if (vshCommandOptBool(cmd, "rdma-pin-all")) -+ flags |= VIR_MIGRATE_RDMA_PIN_ALL; -+ - if (vshCommandOptBool(cmd, "offline")) { - flags |= VIR_MIGRATE_OFFLINE; - } --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-Move-simplification-variable-to-begining-of-the-function.patch b/SOURCES/libvirt-qemu-Move-simplification-variable-to-begining-of-the-function.patch new file mode 100644 index 0000000..b706411 --- /dev/null +++ b/SOURCES/libvirt-qemu-Move-simplification-variable-to-begining-of-the-function.patch @@ -0,0 +1,40 @@ +From 5693792f3f900eacdfee55902726e1052d714a91 Mon Sep 17 00:00:00 2001 +Message-Id: <5693792f3f900eacdfee55902726e1052d714a91@dist-git> +From: Martin Kletzander +Date: Tue, 6 Oct 2015 15:20:32 +0200 +Subject: [PATCH] qemu: Move simplification variable to begining of the + function + +https://bugzilla.redhat.com/show_bug.cgi?id=1266856 + +Signed-off-by: Martin Kletzander +(cherry picked from commit 04b57b4ae19cf299ac13efdd7d84de47b8d26e0e) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 6314976..53c9d01 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -4767,6 +4767,7 @@ qemuBuildMemoryBackendStr(unsigned long long size, + virBitmapPtr nodemask = NULL; + int ret = -1; + virJSONValuePtr props = NULL; ++ bool nodeSpecified = virDomainNumatuneNodeSpecified(def->numa, guestNode); + + *backendProps = NULL; + *backendType = NULL; +@@ -4919,7 +4920,6 @@ qemuBuildMemoryBackendStr(unsigned long long size, + } + + if (!hugepage && !pagesize) { +- bool nodeSpecified = virDomainNumatuneNodeSpecified(def->numa, guestNode); + + if ((userNodeset || nodeSpecified || force) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM)) { +-- +2.6.1 + diff --git a/SOURCES/libvirt-qemu-Need-to-check-for-capability-before-query.patch b/SOURCES/libvirt-qemu-Need-to-check-for-capability-before-query.patch deleted file mode 100644 index 6de47a3..0000000 --- a/SOURCES/libvirt-qemu-Need-to-check-for-capability-before-query.patch +++ /dev/null @@ -1,35 +0,0 @@ -From f5cbe13c52948be555c63f9b120ac5448075c072 Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Thu, 18 Sep 2014 09:30:01 -0400 -Subject: [PATCH] qemu: Need to check for capability before query - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -Prior to trying the query-iothreads call - check if the qemu has -the capability - -Signed-off-by: John Ferlan -(cherry picked from commit 76a81b1d312f10ec4d66b05d39f4d75869f0f121) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index a2304dc..3b43912 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2104,6 +2104,9 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver, - int ret = -1; - size_t i; - -+ if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_IOTHREAD)) -+ return 0; -+ - /* Get the list of IOThreads from qemu */ - if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) - goto cleanup; --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Need-to-check-for-machine.os-when-using-ADDRESS_TYPE_CCW.patch b/SOURCES/libvirt-qemu-Need-to-check-for-machine.os-when-using-ADDRESS_TYPE_CCW.patch new file mode 100644 index 0000000..8acec47 --- /dev/null +++ b/SOURCES/libvirt-qemu-Need-to-check-for-machine.os-when-using-ADDRESS_TYPE_CCW.patch @@ -0,0 +1,164 @@ +From 4e2eecec6b3d239e846594db23cc7004f43d5371 Mon Sep 17 00:00:00 2001 +Message-Id: <4e2eecec6b3d239e846594db23cc7004f43d5371@dist-git> +From: John Ferlan +Date: Fri, 4 Sep 2015 08:55:46 -0400 +Subject: [PATCH] qemu: Need to check for machine.os when using + ADDRESS_TYPE_CCW + +https://bugzilla.redhat.com/show_bug.cgi?id=1258361 + +When attaching a disk, controller, or rng using an address type ccw +or s390, we need to ensure the support is provided by both the machine.os +and the emulator capabilities (corollary to unconditional setting when +address was not provided for the correct machine.os and emulator. + +For an inactive guest, an addition followed by a start would cause the +startup to fail after qemu_command builds the command line and attempts +to start the guest. For an active guest, libvirtd would crash. + +(cherry picked from commit a39ab909081ab126990ca705852d38ff056b8f13) +Signed-off-by: John Ferlan +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ + src/qemu/qemu_command.h | 5 +++++ + src/qemu/qemu_hotplug.c | 12 ++++++++++++ + 3 files changed, 68 insertions(+) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index f8fb71e..47d91c6 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -3485,6 +3485,46 @@ qemuCheckDiskConfig(virDomainDiskDefPtr disk) + } + + ++/* Check whether the device address is using either 'ccw' or default s390 ++ * address format and whether that's "legal" for the current qemu and/or ++ * guest os.machine type. This is the corollary to the code which doesn't ++ * find the address type set using an emulator that supports either 'ccw' ++ * or s390 and sets the address type based on the capabilities. ++ * ++ * If the address is using 'ccw' or s390 and it's not supported, generate ++ * an error and return false; otherwise, return true. ++ */ ++bool ++qemuCheckCCWS390AddressSupport(virDomainDefPtr def, ++ virDomainDeviceInfo info, ++ virQEMUCapsPtr qemuCaps, ++ const char *devicename) ++{ ++ if (info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { ++ if (!qemuDomainMachineIsS390CCW(def)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("cannot use CCW address type for device " ++ "'%s' using machine type '%s'"), ++ devicename, def->os.machine); ++ return false; ++ } else if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("CCW address type is not supported by " ++ "this QEMU")); ++ return false; ++ } ++ } else if (info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390) { ++ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_S390)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("virtio S390 address type is not supported by " ++ "this QEMU")); ++ return false; ++ } ++ } ++ return true; ++} ++ ++ + /* Qemu 1.2 and later have a binary flag -enable-fips that must be + * used for VNC auth to obey FIPS settings; but the flag only + * exists on Linux, and with no way to probe for it via QMP. Our +@@ -4038,6 +4078,9 @@ qemuBuildDriveDevStr(virDomainDefPtr def, + } + } + ++ if (!qemuCheckCCWS390AddressSupport(def, disk->info, qemuCaps, disk->dst)) ++ goto error; ++ + if (disk->iothread && !qemuCheckIOThreads(def, qemuCaps, disk)) + goto error; + +@@ -4487,6 +4530,10 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, + virBuffer buf = VIR_BUFFER_INITIALIZER; + int model = def->model; + ++ if (!qemuCheckCCWS390AddressSupport(domainDef, def->info, qemuCaps, ++ "controller")) ++ return NULL; ++ + if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { + if ((qemuSetSCSIControllerModel(domainDef, qemuCaps, &model)) < 0) + return NULL; +@@ -6616,6 +6663,10 @@ qemuBuildRNGDevStr(virDomainDefPtr def, + goto error; + } + ++ if (!qemuCheckCCWS390AddressSupport(def, dev->info, qemuCaps, ++ dev->source.file)) ++ goto error; ++ + if (dev->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) + virBufferAsprintf(&buf, "virtio-rng-ccw,rng=obj%s,id=%s", + dev->info.alias, dev->info.alias); +diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h +index 6e0c3a3..8acbb3d 100644 +--- a/src/qemu/qemu_command.h ++++ b/src/qemu/qemu_command.h +@@ -311,4 +311,9 @@ int qemuCheckDiskConfig(virDomainDiskDefPtr disk); + + bool + qemuCheckFips(void); ++ ++bool qemuCheckCCWS390AddressSupport(virDomainDefPtr def, ++ virDomainDeviceInfo info, ++ virQEMUCapsPtr qemuCaps, ++ const char *devicename); + #endif /* __QEMU_COMMAND_H__*/ +diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c +index b79fc56..cfb071b 100644 +--- a/src/qemu/qemu_hotplug.c ++++ b/src/qemu/qemu_hotplug.c +@@ -331,6 +331,10 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, + disk->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; + else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) + disk->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390; ++ } else { ++ if (!qemuCheckCCWS390AddressSupport(vm->def, disk->info, priv->qemuCaps, ++ disk->dst)) ++ goto cleanup; + } + + for (i = 0; i < vm->def->ndisks; i++) { +@@ -448,6 +452,10 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver, + controller->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; + else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) + controller->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390; ++ } else { ++ if (!qemuCheckCCWS390AddressSupport(vm->def, controller->info, ++ priv->qemuCaps, "controller")) ++ goto cleanup; + } + + if (controller->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE || +@@ -1663,6 +1671,10 @@ qemuDomainAttachRNGDevice(virQEMUDriverPtr driver, + } else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) { + rng->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390; + } ++ } else { ++ if (!qemuCheckCCWS390AddressSupport(vm->def, rng->info, priv->qemuCaps, ++ rng->source.file)) ++ return -1; + } + + if (rng->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE || +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Prepare-support-for-arbitrary-migration-protocol.patch b/SOURCES/libvirt-qemu-Prepare-support-for-arbitrary-migration-protocol.patch deleted file mode 100644 index 0a8c503..0000000 --- a/SOURCES/libvirt-qemu-Prepare-support-for-arbitrary-migration-protocol.patch +++ /dev/null @@ -1,166 +0,0 @@ -From 01a7d6da44bbfe7719fbfe37dec840e05338dcc6 Mon Sep 17 00:00:00 2001 -Message-Id: <01a7d6da44bbfe7719fbfe37dec840e05338dcc6@dist-git> -From: Jiri Denemark -Date: Tue, 23 Sep 2014 15:47:55 +0200 -Subject: [PATCH] qemu: Prepare support for arbitrary migration protocol - -Currently we only support TCP protocol for native QEMU migration but -this is going to be changed. Let's make the code more general and remove -hardcoded TCP protocol from several places. - -https://bugzilla.redhat.com/show_bug.cgi?id=1013055 - -Signed-off-by: Jiri Denemark -(cherry picked from commit e16a39fcd3bda4021e953c817bfb62307785ab61) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 36 ++++++++++++++++++++++++------------ - src/qemu/qemu_monitor.c | 3 ++- - src/qemu/qemu_monitor.h | 1 + - 3 files changed, 27 insertions(+), 13 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index a66ea54..6b690b8 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -2457,6 +2457,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - virDomainDefPtr *def, - const char *origname, - virStreamPtr st, -+ const char *protocol, - unsigned short port, - bool autoPort, - const char *listenAddress, -@@ -2569,6 +2570,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - struct addrinfo *info = NULL; - struct addrinfo hints = { .ai_flags = AI_ADDRCONFIG, - .ai_socktype = SOCK_STREAM }; -+ const char *incFormat; - - if (getaddrinfo("::", NULL, &hints, &info) == 0) { - freeaddrinfo(info); -@@ -2605,21 +2607,27 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - } else { - /* listenAddress is a hostname */ - } -- } else { -+ } else if (qemuIPv6Capable && hostIPv6Capable) { - /* Listen on :: instead of 0.0.0.0 if QEMU understands it - * and there is at least one IPv6 address configured - */ -- listenAddress = qemuIPv6Capable && hostIPv6Capable ? -- encloseAddress = true, "::" : "0.0.0.0"; -+ listenAddress = "::"; -+ encloseAddress = true; -+ } else { -+ listenAddress = "0.0.0.0"; - } - -- /* QEMU will be started with -incoming []:port, -- * -incoming :port or -incoming :port -+ /* QEMU will be started with -+ * -incoming protocol:[]:port, -+ * -incoming protocol::port, or -+ * -incoming protocol::port - */ -- if ((encloseAddress && -- virAsprintf(&migrateFrom, "tcp:[%s]:%d", listenAddress, port) < 0) || -- (!encloseAddress && -- virAsprintf(&migrateFrom, "tcp:%s:%d", listenAddress, port) < 0)) -+ if (encloseAddress) -+ incFormat = "%s:[%s]:%d"; -+ else -+ incFormat = "%s:%s:%d"; -+ if (virAsprintf(&migrateFrom, incFormat, -+ protocol, listenAddress, port) < 0) - goto cleanup; - } - -@@ -2812,7 +2820,7 @@ qemuMigrationPrepareTunnel(virQEMUDriverPtr driver, - - ret = qemuMigrationPrepareAny(driver, dconn, cookiein, cookieinlen, - cookieout, cookieoutlen, def, origname, -- st, 0, false, NULL, flags); -+ st, NULL, 0, false, NULL, flags); - return ret; - } - -@@ -2955,7 +2963,8 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver, - - ret = qemuMigrationPrepareAny(driver, dconn, cookiein, cookieinlen, - cookieout, cookieoutlen, def, origname, -- NULL, port, autoPort, listenAddress, flags); -+ NULL, uri ? uri->scheme : "tcp", -+ port, autoPort, listenAddress, flags); - cleanup: - virURIFree(uri); - VIR_FREE(hostname); -@@ -3171,6 +3180,7 @@ struct _qemuMigrationSpec { - enum qemuMigrationDestinationType destType; - union { - struct { -+ const char *protocol; - const char *name; - int port; - } host; -@@ -3538,6 +3548,7 @@ qemuMigrationRun(virQEMUDriverPtr driver, - switch (spec->destType) { - case MIGRATION_DEST_HOST: - ret = qemuMonitorMigrateToHost(priv->mon, migrate_flags, -+ spec->dest.host.protocol, - spec->dest.host.name, - spec->dest.host.port); - break; -@@ -3678,7 +3689,7 @@ qemuMigrationRun(virQEMUDriverPtr driver, - goto cleanup; - } - --/* Perform migration using QEMU's native TCP migrate support, -+/* Perform migration using QEMU's native migrate support, - * not encrypted obviously - */ - static int doNativeMigrate(virQEMUDriverPtr driver, -@@ -3712,6 +3723,7 @@ static int doNativeMigrate(virQEMUDriverPtr driver, - spec.destType = MIGRATION_DEST_CONNECT_HOST; - else - spec.destType = MIGRATION_DEST_HOST; -+ spec.dest.host.protocol = uribits->scheme; - spec.dest.host.name = uribits->server; - spec.dest.host.port = uribits->port; - spec.fwdType = MIGRATION_FWD_DIRECT; -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index db2fe71..ab252fd 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -2209,6 +2209,7 @@ int qemuMonitorMigrateToFd(qemuMonitorPtr mon, - - int qemuMonitorMigrateToHost(qemuMonitorPtr mon, - unsigned int flags, -+ const char *protocol, - const char *hostname, - int port) - { -@@ -2224,7 +2225,7 @@ int qemuMonitorMigrateToHost(qemuMonitorPtr mon, - } - - -- if (virAsprintf(&uri, "tcp:%s:%d", hostname, port) < 0) -+ if (virAsprintf(&uri, "%s:%s:%d", protocol, hostname, port) < 0) - return -1; - - if (mon->json) -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index ed2cf71..ed96011 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -485,6 +485,7 @@ int qemuMonitorMigrateToFd(qemuMonitorPtr mon, - - int qemuMonitorMigrateToHost(qemuMonitorPtr mon, - unsigned int flags, -+ const char *protocol, - const char *hostname, - int port); - --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-Process-the-hostdev-rawio-setting.patch b/SOURCES/libvirt-qemu-Process-the-hostdev-rawio-setting.patch deleted file mode 100644 index 981f974..0000000 --- a/SOURCES/libvirt-qemu-Process-the-hostdev-rawio-setting.patch +++ /dev/null @@ -1,132 +0,0 @@ -From d5e4790ea5bb422fb12663362825e31b7350e6ec Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Fri, 19 Sep 2014 08:32:38 -0400 -Subject: [PATCH] qemu: Process the hostdev "rawio" setting - -https://bugzilla.redhat.com/show_bug.cgi?id=1103739 - -Mimic the "Disk" processing for 'rawio', but for a scsi_host hostdev -lun device. - -(cherry picked from commit 74eaa0918b7fa612e534bd7ddb2c6aac436fc50c) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 18 ++++++++++++++++++ - src/qemu/qemu_domain.h | 4 ++++ - src/qemu/qemu_driver.c | 1 + - src/qemu/qemu_process.c | 20 ++++++++++++++++++++ - 4 files changed, 43 insertions(+) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 9b3edd7..746625a 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -1944,6 +1944,10 @@ void qemuDomainObjCheckTaint(virQEMUDriverPtr driver, - for (i = 0; i < obj->def->ndisks; i++) - qemuDomainObjCheckDiskTaint(driver, obj, obj->def->disks[i], logFD); - -+ for (i = 0; i < obj->def->nhostdevs; i++) -+ qemuDomainObjCheckHostdevTaint(driver, obj, obj->def->hostdevs[i], -+ logFD); -+ - for (i = 0; i < obj->def->nnets; i++) - qemuDomainObjCheckNetTaint(driver, obj, obj->def->nets[i], logFD); - -@@ -1970,6 +1974,20 @@ void qemuDomainObjCheckDiskTaint(virQEMUDriverPtr driver, - } - - -+void qemuDomainObjCheckHostdevTaint(virQEMUDriverPtr driver, -+ virDomainObjPtr obj, -+ virDomainHostdevDefPtr hostdev, -+ int logFD) -+{ -+ virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; -+ -+ if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI && -+ scsisrc->rawio == VIR_TRISTATE_BOOL_YES) -+ qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_HIGH_PRIVILEGES, -+ logFD); -+} -+ -+ - void qemuDomainObjCheckNetTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - virDomainNetDefPtr net, -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 4ae2c57..d21acd7 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -301,6 +301,10 @@ void qemuDomainObjCheckDiskTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - virDomainDiskDefPtr disk, - int logFD); -+void qemuDomainObjCheckHostdevTaint(virQEMUDriverPtr driver, -+ virDomainObjPtr obj, -+ virDomainHostdevDefPtr disk, -+ int logFD); - void qemuDomainObjCheckNetTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - virDomainNetDefPtr net, -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 808d35f..6629946 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -6684,6 +6684,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm, - break; - - case VIR_DOMAIN_DEVICE_HOSTDEV: -+ qemuDomainObjCheckHostdevTaint(driver, vm, dev->data.hostdev, -1); - ret = qemuDomainAttachHostDevice(dom->conn, driver, vm, - dev->data.hostdev); - if (!ret) -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 528b6eb..5c3b3c8 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3981,6 +3981,7 @@ int qemuProcessStart(virConnectPtr conn, - struct qemuProcessHookData hookData; - unsigned long cur_balloon; - size_t i; -+ bool rawio_set = false; - char *nodeset = NULL; - virBitmapPtr nodemask = NULL; - unsigned int stop_flags; -@@ -4358,6 +4359,7 @@ int qemuProcessStart(virConnectPtr conn, - if (vm->def->disks[i]->rawio == 1) { - #ifdef CAP_SYS_RAWIO - virCommandAllowCap(cmd, CAP_SYS_RAWIO); -+ rawio_set = true; - #else - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Raw I/O is not supported on this platform")); -@@ -4374,6 +4376,24 @@ int qemuProcessStart(virConnectPtr conn, - goto cleanup; - } - -+ /* If rawio not already set, check hostdevs as well */ -+ if (!rawio_set) { -+ for (i = 0; i < vm->def->nhostdevs; i++) { -+ virDomainHostdevSubsysSCSIPtr scsisrc = -+ &vm->def->hostdevs[i]->source.subsys.u.scsi; -+ if (scsisrc->rawio == VIR_TRISTATE_BOOL_YES) { -+#ifdef CAP_SYS_RAWIO -+ virCommandAllowCap(cmd, CAP_SYS_RAWIO); -+ break; -+#else -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("Raw I/O is not supported on this platform")); -+ goto cleanup; -+#endif -+ } -+ } -+ } -+ - virCommandSetPreExecHook(cmd, qemuProcessHook, &hookData); - virCommandSetMaxProcesses(cmd, cfg->maxProcesses); - virCommandSetMaxFiles(cmd, cfg->maxFiles); --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-Propagate-QEMU-errors-during-incoming-migrations.patch b/SOURCES/libvirt-qemu-Propagate-QEMU-errors-during-incoming-migrations.patch deleted file mode 100644 index a1154e6..0000000 --- a/SOURCES/libvirt-qemu-Propagate-QEMU-errors-during-incoming-migrations.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 6b3269813159a2651bddee7113ba08eab948c7ff Mon Sep 17 00:00:00 2001 -Message-Id: <6b3269813159a2651bddee7113ba08eab948c7ff@dist-git> -From: Jiri Denemark -Date: Sat, 6 Sep 2014 01:16:20 +0200 -Subject: [PATCH] qemu: Propagate QEMU errors during incoming migrations - -When QEMU fails during incoming migration after we successfully started -it (i.e., during Perform or Finish phase), we report a rather unhelpful -message - - Unable to read from monitor: Connection reset by peer - -We already have a code that takes error messages from QEMU's error -output but we disable it once QEMU successfully starts. This patch -postpones this until the end of Finish phase during incoming migration -so that we can report a much better error message: - - internal error: early end of file from monitor: possible problem: - Unknown savevm section or instance '0000:00:05.0/virtio-balloon' 0 - load of migration failed - -https://bugzilla.redhat.com/show_bug.cgi?id=1090093 - -Signed-off-by: Jiri Denemark -(cherry picked from commit 03890605dc981f46ac72d17e4ac7db0da1b88e97) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 2 ++ - src/qemu/qemu_monitor.c | 12 +++++++++--- - src/qemu/qemu_process.c | 6 ++++-- - 3 files changed, 15 insertions(+), 5 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index a7aeca5..2726512 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -4689,6 +4689,8 @@ qemuMigrationFinish(virQEMUDriverPtr driver, - cleanup: - virPortAllocatorRelease(driver->migrationPorts, port); - if (vm) { -+ if (priv->mon) -+ qemuMonitorSetDomainLog(priv->mon, -1); - VIR_FREE(priv->origname); - virObjectUnlock(vm); - } -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 2edc19b..78f2a20 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -631,8 +631,11 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) - error = true; - } else { - if (events & VIR_EVENT_HANDLE_WRITABLE) { -- if (qemuMonitorIOWrite(mon) < 0) -+ if (qemuMonitorIOWrite(mon) < 0) { - error = true; -+ if (errno == ECONNRESET) -+ hangup = true; -+ } - events &= ~VIR_EVENT_HANDLE_WRITABLE; - } - -@@ -642,6 +645,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) - events &= ~VIR_EVENT_HANDLE_READABLE; - if (got < 0) { - error = true; -+ if (errno == ECONNRESET) -+ hangup = true; - } else if (got == 0) { - eof = true; - } else { -@@ -683,8 +688,9 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) - if (hangup) { - /* Check if an error message from qemu is available and if so, use - * it to overwrite the actual message. It's done only in early -- * startup phases where the message from qemu is certainly more -- * interesting than a "connection reset by peer" message. -+ * startup phases or during incoming migration when the message -+ * from qemu is certainly more interesting than a -+ * "connection reset by peer" message. - */ - char *qemuMessage; - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index f68dfbe..9395af1 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -4377,8 +4377,10 @@ int qemuProcessStart(virConnectPtr conn, - goto cleanup; - } - -- /* unset reporting errors from qemu log */ -- qemuMonitorSetDomainLog(priv->mon, -1); -+ /* Keep watching qemu log for errors during incoming migration, otherwise -+ * unset reporting errors from qemu log. */ -+ if (!migrateFrom) -+ qemuMonitorSetDomainLog(priv->mon, -1); - - virCommandFree(cmd); - VIR_FORCE_CLOSE(logfile); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Properly-check-for-incoming-migration-job.patch b/SOURCES/libvirt-qemu-Properly-check-for-incoming-migration-job.patch new file mode 100644 index 0000000..ce49dbd --- /dev/null +++ b/SOURCES/libvirt-qemu-Properly-check-for-incoming-migration-job.patch @@ -0,0 +1,37 @@ +From 1b5fbd7f3c62217601b062d55bfec70eec8a1b07 Mon Sep 17 00:00:00 2001 +Message-Id: <1b5fbd7f3c62217601b062d55bfec70eec8a1b07@dist-git> +From: Jiri Denemark +Date: Thu, 30 Jul 2015 15:53:41 +0200 +Subject: [PATCH] qemu: Properly check for incoming migration job + +In addition to checking the current asynchronous job +qemuMigrationJobIsActive reports an error if the current job does not +match the one we asked for. Let's just check the job directly since we +are not interested in the error in qemuProcessHandleMonitorEOF. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 40a6dd9c16f4760ae01919f7710476c4c9804f4f) + +https://bugzilla.redhat.com/show_bug.cgi?id=1242904 + +Signed-off-by: Jiri Denemark +--- + 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 35b6513..31315b1 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -310,7 +310,7 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + auditReason = "failed"; + } + +- if (qemuMigrationJobIsActive(vm, QEMU_ASYNC_JOB_MIGRATION_IN)) ++ if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) + qemuMigrationErrorSave(driver, vm->def->name, + qemuMonitorLastError(priv->mon)); + +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-RDMA-migration-support.patch b/SOURCES/libvirt-qemu-RDMA-migration-support.patch deleted file mode 100644 index 2171857..0000000 --- a/SOURCES/libvirt-qemu-RDMA-migration-support.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 298d5857152494dfd31f182ecc16f4aa16c5617f Mon Sep 17 00:00:00 2001 -Message-Id: <298d5857152494dfd31f182ecc16f4aa16c5617f@dist-git> -From: "Michael R. Hines" -Date: Tue, 23 Sep 2014 15:47:57 +0200 -Subject: [PATCH] qemu: RDMA migration support - -This patch adds support for RDMA protocol in migration URIs. - -USAGE: $ virsh migrate --live --migrateuri rdma://hostname domain qemu+ssh://hostname/system - -Since libvirt runs QEMU in a pretty restricted environment, several -files needs to be added to cgroup_device_acl (in qemu.conf) for QEMU to -be able to access the host's infiniband hardware. Full documenation of -the feature can be found on QEMU wiki: -http://wiki.qemu.org/Features/RDMALiveMigration - -https://bugzilla.redhat.com/show_bug.cgi?id=1013055 - -Signed-off-by: Michael R. Hines -Signed-off-by: Jiri Denemark -(cherry picked from commit ed22a4743437b6f646eb33659a212dd252a5b65d) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu.conf | 8 ++++++++ - src/qemu/qemu_command.c | 8 ++++++++ - src/qemu/qemu_migration.c | 39 +++++++++++++++++++++++++++++++++++++-- - 3 files changed, 53 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf -index 79bba36..92ca715 100644 ---- a/src/qemu/qemu.conf -+++ b/src/qemu/qemu.conf -@@ -274,6 +274,14 @@ - # "/dev/ptmx", "/dev/kvm", "/dev/kqemu", - # "/dev/rtc","/dev/hpet", "/dev/vfio/vfio" - #] -+# -+# RDMA migration requires the following extra files to be added to the list: -+# "/dev/infiniband/rdma_cm", -+# "/dev/infiniband/issm0", -+# "/dev/infiniband/issm1", -+# "/dev/infiniband/umad0", -+# "/dev/infiniband/umad1", -+# "/dev/infiniband/uverbs0" - - - # The default format for Qemu/KVM guest save images is raw; that is, the -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 05f328a..7d4f3cc 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -9475,6 +9475,14 @@ qemuBuildCommandLine(virConnectPtr conn, - goto error; - } - virCommandAddArg(cmd, migrateFrom); -+ } else if (STRPREFIX(migrateFrom, "rdma")) { -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MIGRATE_RDMA)) { -+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -+ _("incoming RDMA migration is not supported " -+ "with this QEMU binary")); -+ goto error; -+ } -+ virCommandAddArg(cmd, migrateFrom); - } else if (STREQ(migrateFrom, "stdio")) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD)) { - virCommandAddArgFormat(cmd, "fd:%d", migrateFd); -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 6b690b8..3433ec9 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -56,6 +56,7 @@ - #include "virhook.h" - #include "virstring.h" - #include "virtypedparam.h" -+#include "virprocess.h" - - #define VIR_FROM_THIS VIR_FROM_QEMU - -@@ -2653,6 +2654,13 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - QEMU_MIGRATION_COOKIE_NBD))) - goto cleanup; - -+ if (STREQ(protocol, "rdma") && !vm->def->mem.hard_limit) { -+ virReportError(VIR_ERR_OPERATION_INVALID, "%s", -+ _("cannot start RDMA migration with no memory hard " -+ "limit set")); -+ goto cleanup; -+ } -+ - if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN) < 0) - goto cleanup; - qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_PREPARE); -@@ -2696,6 +2704,11 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - QEMU_ASYNC_JOB_MIGRATION_IN) < 0) - goto stop; - -+ if (STREQ(protocol, "rdma") && -+ virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10) < 0) { -+ goto stop; -+ } -+ - if (mig->lockState) { - VIR_DEBUG("Received lockstate %s", mig->lockState); - VIR_FREE(priv->lockState); -@@ -2926,7 +2939,8 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver, - if (!(uri = qemuMigrationParseURI(uri_in, &well_formed_uri))) - goto cleanup; - -- if (STRNEQ(uri->scheme, "tcp")) { -+ if (STRNEQ(uri->scheme, "tcp") && -+ STRNEQ(uri->scheme, "rdma")) { - virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, - _("unsupported scheme %s in migration URI %s"), - uri->scheme, uri_in); -@@ -3547,6 +3561,11 @@ qemuMigrationRun(virQEMUDriverPtr driver, - - switch (spec->destType) { - case MIGRATION_DEST_HOST: -+ if (STREQ(spec->dest.host.protocol, "rdma") && -+ virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10) < 0) { -+ qemuDomainObjExitMonitor(driver, vm); -+ goto cleanup; -+ } - ret = qemuMonitorMigrateToHost(priv->mon, migrate_flags, - spec->dest.host.protocol, - spec->dest.host.name, -@@ -3719,7 +3738,23 @@ static int doNativeMigrate(virQEMUDriverPtr driver, - if (!(uribits = qemuMigrationParseURI(uri, NULL))) - return -1; - -- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD)) -+ if (STREQ(uribits->scheme, "rdma")) { -+ if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_RDMA)) { -+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -+ _("outgoing RDMA migration is not supported " -+ "with this QEMU binary")); -+ return -1; -+ } -+ if (!vm->def->mem.hard_limit) { -+ virReportError(VIR_ERR_OPERATION_INVALID, "%s", -+ _("cannot start RDMA migration with no memory hard " -+ "limit set")); -+ return -1; -+ } -+ } -+ -+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) && -+ STRNEQ(uribits->scheme, "rdma")) - spec.destType = MIGRATION_DEST_CONNECT_HOST; - else - spec.destType = MIGRATION_DEST_HOST; --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-Really-fix-crash-in-tunnelled-migration.patch b/SOURCES/libvirt-qemu-Really-fix-crash-in-tunnelled-migration.patch deleted file mode 100644 index b5a7bea..0000000 --- a/SOURCES/libvirt-qemu-Really-fix-crash-in-tunnelled-migration.patch +++ /dev/null @@ -1,33 +0,0 @@ -From df89cb75c6663d7b6245cc92a9f31bb1eae6bb66 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Thu, 20 Nov 2014 13:44:18 +0100 -Subject: [PATCH] qemu: Really fix crash in tunnelled migration - -Oops, I forgot to squash one more instance of the same check in the -previous commit (v1.2.10-144-g52691f9). - -https://bugzilla.redhat.com/show_bug.cgi?id=1147331 -Signed-off-by: Jiri Denemark -(cherry picked from commit 800454e45ec9ad1ee495bfa7ffe617453f349d3e) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 4b701d3..225aafd 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -2765,7 +2765,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - QEMU_ASYNC_JOB_MIGRATION_IN) < 0) - goto stop; - -- if (STREQ(protocol, "rdma") && -+ if (STREQ_NULLABLE(protocol, "rdma") && - virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10) < 0) { - goto stop; - } --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Recompute-downtime-and-total-time-when-migration-completes.patch b/SOURCES/libvirt-qemu-Recompute-downtime-and-total-time-when-migration-completes.patch deleted file mode 100644 index ca40d98..0000000 --- a/SOURCES/libvirt-qemu-Recompute-downtime-and-total-time-when-migration-completes.patch +++ /dev/null @@ -1,221 +0,0 @@ -From b03082de96085cbca052d979ce1679ca65ab1ede Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Thu, 28 Aug 2014 16:37:38 +0200 -Subject: [PATCH] qemu: Recompute downtime and total time when migration - completes - -Total time of a migration and total downtime transfered from a source to -a destination host do not count with the transfer time to the -destination host and with the time elapsed before guest CPUs are -resumed. Thus, source libvirtd remembers when migration started and when -guest CPUs were paused. Both timestamps are transferred to destination -libvirtd which uses them to compute total migration time and total -downtime. Obviously, this requires the time to be synchronized between -the two hosts. The reported times are useless otherwise but they would -be equally useless if we didn't do this recomputation so don't lose -anything by doing it. - -Signed-off-by: Jiri Denemark -(cherry picked from commit eaee338ae67e29fd93276563238633eae1097c82) - -https://bugzilla.redhat.com/show_bug.cgi?id=1063724 -Signed-off-by: Jiri Denemark ---- - src/libvirt.c | 5 ++++- - src/qemu/qemu_domain.c | 28 ++++++++++++++++++++++++++++ - src/qemu/qemu_domain.h | 3 +++ - src/qemu/qemu_migration.c | 15 ++++++++++++++- - src/qemu/qemu_process.c | 9 ++++++++- - tools/virsh.pod | 5 ++++- - 6 files changed, 61 insertions(+), 4 deletions(-) - -diff --git a/src/libvirt.c b/src/libvirt.c -index 6fa0a6b..61d0543 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -17581,7 +17581,10 @@ virDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info) - * return statistics about a recently completed job. Specifically, this - * flag may be used to query statistics of a completed incoming migration. - * Statistics of a completed job are automatically destroyed once read or -- * when libvirtd is restarted. -+ * when libvirtd is restarted. Note that time information returned for -+ * completed migrations may be completely irrelevant unless both source and -+ * destination hosts have synchronized time (i.e., NTP daemon is running on -+ * both of them). - * - * Returns 0 in case of success and -1 in case of failure. - */ -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 78d6e8c..c0306d7 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -222,11 +222,39 @@ qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo) - if (virTimeMillisNow(&now) < 0) - return -1; - -+ if (now < jobInfo->started) { -+ VIR_WARN("Async job starts in the future"); -+ jobInfo->started = 0; -+ return 0; -+ } -+ - jobInfo->timeElapsed = now - jobInfo->started; - return 0; - } - - int -+qemuDomainJobInfoUpdateDowntime(qemuDomainJobInfoPtr jobInfo) -+{ -+ unsigned long long now; -+ -+ if (!jobInfo->stopped) -+ return 0; -+ -+ if (virTimeMillisNow(&now) < 0) -+ return -1; -+ -+ if (now < jobInfo->stopped) { -+ VIR_WARN("Guest's CPUs stopped in the future"); -+ jobInfo->stopped = 0; -+ return 0; -+ } -+ -+ jobInfo->status.downtime = now - jobInfo->stopped; -+ jobInfo->status.downtime_set = true; -+ return 0; -+} -+ -+int - qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo, - virDomainJobInfoPtr info) - { -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 2e16cde..479b51f 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -105,6 +105,7 @@ typedef qemuDomainJobInfo *qemuDomainJobInfoPtr; - struct _qemuDomainJobInfo { - virDomainJobType type; - unsigned long long started; /* When the async job started */ -+ unsigned long long stopped; /* When the domain's CPUs were stopped */ - /* Computed values */ - unsigned long long timeElapsed; - unsigned long long timeRemaining; -@@ -391,6 +392,8 @@ bool qemuDomainAgentAvailable(qemuDomainObjPrivatePtr priv, - - int qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo) - ATTRIBUTE_NONNULL(1); -+int qemuDomainJobInfoUpdateDowntime(qemuDomainJobInfoPtr jobInfo) -+ ATTRIBUTE_NONNULL(1); - int qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo, - virDomainJobInfoPtr info) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 9b1e94b..c7a41b1 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -623,6 +623,9 @@ qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf, - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); - -+ virBufferAsprintf(buf, "%llu\n", jobInfo->started); -+ virBufferAsprintf(buf, "%llu\n", jobInfo->stopped); -+ - virBufferAsprintf(buf, "<%1$s>%2$llu\n", - VIR_DOMAIN_JOB_TIME_ELAPSED, - jobInfo->timeElapsed); -@@ -891,6 +894,9 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt) - status = &jobInfo->status; - jobInfo->type = VIR_DOMAIN_JOB_COMPLETED; - -+ virXPathULongLong("string(./started[1])", ctxt, &jobInfo->started); -+ virXPathULongLong("string(./stopped[1])", ctxt, &jobInfo->stopped); -+ - virXPathULongLong("string(./" VIR_DOMAIN_JOB_TIME_ELAPSED "[1])", - ctxt, &jobInfo->timeElapsed); - virXPathULongLong("string(./" VIR_DOMAIN_JOB_TIME_REMAINING "[1])", -@@ -2015,6 +2021,7 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, - } - - if (jobInfo->type == VIR_DOMAIN_JOB_COMPLETED) { -+ qemuDomainJobInfoUpdateDowntime(jobInfo); - VIR_FREE(priv->job.completed); - if (VIR_ALLOC(priv->job.completed) == 0) - *priv->job.completed = *jobInfo; -@@ -3597,8 +3604,10 @@ qemuMigrationRun(virQEMUDriverPtr driver, - VIR_FORCE_CLOSE(fd); - } - -- if (priv->job.completed) -+ if (priv->job.completed) { - qemuDomainJobInfoUpdateTime(priv->job.completed); -+ qemuDomainJobInfoUpdateDowntime(priv->job.completed); -+ } - - cookieFlags |= QEMU_MIGRATION_COOKIE_NETWORK | - QEMU_MIGRATION_COOKIE_STATS; -@@ -4811,6 +4820,10 @@ qemuMigrationFinish(virQEMUDriverPtr driver, - } - goto endjob; - } -+ if (priv->job.completed) { -+ qemuDomainJobInfoUpdateTime(priv->job.completed); -+ qemuDomainJobInfoUpdateDowntime(priv->job.completed); -+ } - } - - dom = virGetDomain(dconn, vm->def->name, vm->def->uuid); -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 9395af1..0f269b9 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -754,6 +754,9 @@ qemuProcessHandleStop(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - VIR_DEBUG("Transitioned guest %s to paused state", - vm->def->name); - -+ if (priv->job.current) -+ ignore_value(virTimeMillisNow(&priv->job.current->stopped)); -+ - virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_UNKNOWN); - event = virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_SUSPENDED, -@@ -2888,7 +2891,8 @@ qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm, - } - - --int qemuProcessStopCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm, -+int qemuProcessStopCPUs(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, - virDomainPausedReason reason, - qemuDomainAsyncJob asyncJob) - { -@@ -2906,6 +2910,9 @@ int qemuProcessStopCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm, - if (ret < 0) - goto cleanup; - -+ if (priv->job.current) -+ ignore_value(virTimeMillisNow(&priv->job.current->stopped)); -+ - virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, reason); - if (virDomainLockProcessPause(driver->lockManager, vm, &priv->lockState) < 0) - VIR_WARN("Unable to release lease on %s", vm->def->name); -diff --git a/tools/virsh.pod b/tools/virsh.pod -index aad40d5..b28677f 100644 ---- a/tools/virsh.pod -+++ b/tools/virsh.pod -@@ -1117,7 +1117,10 @@ Abort the currently running domain job. - Returns information about jobs running on a domain. I<--completed> tells - virsh to return information about a recently finished job. Statistics of - a completed job are automatically destroyed once read or when libvirtd --is restarted. -+is restarted. Note that time information returned for completed -+migrations may be completely irrelevant unless both source and -+destination hosts have synchronized time (i.e., NTP daemon is running -+on both of them). - - =item B I - --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Refactor-qemuBuildNetworkDriveURI-to-take-a-virStorageSourcePtr.patch b/SOURCES/libvirt-qemu-Refactor-qemuBuildNetworkDriveURI-to-take-a-virStorageSourcePtr.patch deleted file mode 100644 index f3c9dca..0000000 --- a/SOURCES/libvirt-qemu-Refactor-qemuBuildNetworkDriveURI-to-take-a-virStorageSourcePtr.patch +++ /dev/null @@ -1,306 +0,0 @@ -From ad0a3115376560248d7e1a5bfac20e8c5912c740 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Fri, 21 Nov 2014 15:04:06 +0100 -Subject: [PATCH] qemu: Refactor qemuBuildNetworkDriveURI to take a - virStorageSourcePtr - -https://bugzilla.redhat.com/show_bug.cgi?id=1164528 - -Instead of splitting out various fields, pass the complete structure and -let the function pick various things of it. - -As one of the callers isn't using virStorageSourcePtr to store the data, -this patch adds glue code that fills the data into a dummy -virStorageSourcePtr before calling the func. - -This change will help when adding new fields that need output processing -in the future. - -(cherry picked from commit dc0175f5359d995db955974457f3a00c92ffde35) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 129 +++++++++++++++++++++++------------------------- - 1 file changed, 62 insertions(+), 67 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index c161824..557c985 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -2939,11 +2939,7 @@ qemuNetworkDriveGetPort(int protocol, - #define QEMU_DEFAULT_NBD_PORT "10809" - - static char * --qemuBuildNetworkDriveURI(int protocol, -- const char *src, -- const char *volume, -- size_t nhosts, -- virStorageNetHostDefPtr hosts, -+qemuBuildNetworkDriveURI(virStorageSourcePtr src, - const char *username, - const char *secret) - { -@@ -2952,52 +2948,52 @@ qemuBuildNetworkDriveURI(int protocol, - virURIPtr uri = NULL; - size_t i; - -- switch ((virStorageNetProtocol) protocol) { -+ switch ((virStorageNetProtocol) src->protocol) { - case VIR_STORAGE_NET_PROTOCOL_NBD: -- if (nhosts != 1) { -+ if (src->nhosts != 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("protocol '%s' accepts only one host"), -- virStorageNetProtocolTypeToString(protocol)); -+ virStorageNetProtocolTypeToString(src->protocol)); - goto cleanup; - } - -- if (!((hosts->name && strchr(hosts->name, ':')) || -- (hosts->transport == VIR_STORAGE_NET_HOST_TRANS_TCP && -- !hosts->name) || -- (hosts->transport == VIR_STORAGE_NET_HOST_TRANS_UNIX && -- hosts->socket && -- hosts->socket[0] != '/'))) { -+ if (!((src->hosts->name && strchr(src->hosts->name, ':')) || -+ (src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_TCP && -+ !src->hosts->name) || -+ (src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_UNIX && -+ src->hosts->socket && -+ src->hosts->socket[0] != '/'))) { - - virBufferAddLit(&buf, "nbd:"); - -- switch (hosts->transport) { -+ switch (src->hosts->transport) { - case VIR_STORAGE_NET_HOST_TRANS_TCP: -- virBufferStrcat(&buf, hosts->name, NULL); -+ virBufferStrcat(&buf, src->hosts->name, NULL); - virBufferAsprintf(&buf, ":%s", -- hosts->port ? hosts->port : -+ src->hosts->port ? src->hosts->port : - QEMU_DEFAULT_NBD_PORT); - break; - - case VIR_STORAGE_NET_HOST_TRANS_UNIX: -- if (!hosts->socket) { -+ if (!src->hosts->socket) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("socket attribute required for " - "unix transport")); - goto cleanup; - } - -- virBufferAsprintf(&buf, "unix:%s", hosts->socket); -+ virBufferAsprintf(&buf, "unix:%s", src->hosts->socket); - break; - - default: - virReportError(VIR_ERR_INTERNAL_ERROR, - _("nbd does not support transport '%s'"), -- virStorageNetHostTransportTypeToString(hosts->transport)); -+ virStorageNetHostTransportTypeToString(src->hosts->transport)); - goto cleanup; - } - -- if (src) -- virBufferAsprintf(&buf, ":exportname=%s", src); -+ if (src->path) -+ virBufferAsprintf(&buf, ":exportname=%s", src->path); - - if (virBufferCheckError(&buf) < 0) - goto cleanup; -@@ -3015,45 +3011,45 @@ qemuBuildNetworkDriveURI(int protocol, - case VIR_STORAGE_NET_PROTOCOL_TFTP: - case VIR_STORAGE_NET_PROTOCOL_ISCSI: - case VIR_STORAGE_NET_PROTOCOL_GLUSTER: -- if (nhosts != 1) { -+ if (src->nhosts != 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("protocol '%s' accepts only one host"), -- virStorageNetProtocolTypeToString(protocol)); -+ virStorageNetProtocolTypeToString(src->protocol)); - goto cleanup; - } - - if (VIR_ALLOC(uri) < 0) - goto cleanup; - -- if (hosts->transport == VIR_STORAGE_NET_HOST_TRANS_TCP) { -+ if (src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_TCP) { - if (VIR_STRDUP(uri->scheme, -- virStorageNetProtocolTypeToString(protocol)) < 0) -+ virStorageNetProtocolTypeToString(src->protocol)) < 0) - goto cleanup; - } else { - if (virAsprintf(&uri->scheme, "%s+%s", -- virStorageNetProtocolTypeToString(protocol), -- virStorageNetHostTransportTypeToString(hosts->transport)) < 0) -+ virStorageNetProtocolTypeToString(src->protocol), -+ virStorageNetHostTransportTypeToString(src->hosts->transport)) < 0) - goto cleanup; - } - -- if ((uri->port = qemuNetworkDriveGetPort(protocol, hosts->port)) < 0) -+ if ((uri->port = qemuNetworkDriveGetPort(src->protocol, src->hosts->port)) < 0) - goto cleanup; - -- if (src) { -- if (volume) { -+ if (src->path) { -+ if (src->volume) { - if (virAsprintf(&uri->path, "/%s%s", -- volume, src) < 0) -+ src->volume, src->path) < 0) - goto cleanup; - } else { - if (virAsprintf(&uri->path, "%s%s", -- src[0] == '/' ? "" : "/", -- src) < 0) -+ src->path[0] == '/' ? "" : "/", -+ src->path) < 0) - goto cleanup; - } - } - -- if (hosts->socket && -- virAsprintf(&uri->query, "socket=%s", hosts->socket) < 0) -+ if (src->hosts->socket && -+ virAsprintf(&uri->query, "socket=%s", src->hosts->socket) < 0) - goto cleanup; - - if (username) { -@@ -3066,7 +3062,7 @@ qemuBuildNetworkDriveURI(int protocol, - } - } - -- if (VIR_STRDUP(uri->server, hosts->name) < 0) -+ if (VIR_STRDUP(uri->server, src->hosts->name) < 0) - goto cleanup; - - ret = virURIFormat(uri); -@@ -3074,20 +3070,20 @@ qemuBuildNetworkDriveURI(int protocol, - break; - - case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG: -- if (!src) { -+ if (!src->path) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing disk source for 'sheepdog' protocol")); - goto cleanup; - } - -- if (nhosts == 0) { -- if (virAsprintf(&ret, "sheepdog:%s", src) < 0) -+ if (src->nhosts == 0) { -+ if (virAsprintf(&ret, "sheepdog:%s", src->path) < 0) - goto cleanup; -- } else if (nhosts == 1) { -+ } else if (src->nhosts == 1) { - if (virAsprintf(&ret, "sheepdog:%s:%s:%s", -- hosts->name, -- hosts->port ? hosts->port : "7000", -- src) < 0) -+ src->hosts->name, -+ src->hosts->port ? src->hosts->port : "7000", -+ src->path) < 0) - goto cleanup; - } else { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -3098,14 +3094,14 @@ qemuBuildNetworkDriveURI(int protocol, - break; - - case VIR_STORAGE_NET_PROTOCOL_RBD: -- if (strchr(src, ':')) { -+ if (strchr(src->path, ':')) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("':' not allowed in RBD source volume name '%s'"), -- src); -+ src->path); - goto cleanup; - } - -- virBufferStrcat(&buf, "rbd:", src, NULL); -+ virBufferStrcat(&buf, "rbd:", src->path, NULL); - - if (username) { - virBufferEscape(&buf, '\\', ":", ":id=%s", username); -@@ -3116,20 +3112,21 @@ qemuBuildNetworkDriveURI(int protocol, - virBufferAddLit(&buf, ":auth_supported=none"); - } - -- if (nhosts > 0) { -+ if (src->nhosts > 0) { - virBufferAddLit(&buf, ":mon_host="); -- for (i = 0; i < nhosts; i++) { -+ for (i = 0; i < src->nhosts; i++) { - if (i) - virBufferAddLit(&buf, "\\;"); - - /* assume host containing : is ipv6 */ -- if (strchr(hosts[i].name, ':')) -- virBufferEscape(&buf, '\\', ":", "[%s]", hosts[i].name); -+ if (strchr(src->hosts[i].name, ':')) -+ virBufferEscape(&buf, '\\', ":", "[%s]", -+ src->hosts[i].name); - else -- virBufferAsprintf(&buf, "%s", hosts[i].name); -+ virBufferAsprintf(&buf, "%s", src->hosts[i].name); - -- if (hosts[i].port) -- virBufferAsprintf(&buf, "\\:%s", hosts[i].port); -+ if (src->hosts[i].port) -+ virBufferAsprintf(&buf, "\\:%s", src->hosts[i].port); - } - } - -@@ -3205,13 +3202,7 @@ qemuGetDriveSourceString(virStorageSourcePtr src, - break; - - case VIR_STORAGE_TYPE_NETWORK: -- if (!(*source = qemuBuildNetworkDriveURI(src->protocol, -- src->path, -- src->volume, -- src->nhosts, -- src->hosts, -- username, -- secret))) -+ if (!(*source = qemuBuildNetworkDriveURI(src, username, secret))) - goto cleanup; - break; - -@@ -5304,6 +5295,10 @@ qemuBuildSCSIiSCSIHostdevDrvStr(virConnectPtr conn, - char *source = NULL; - char *secret = NULL; - char *username = NULL; -+ virStorageSource src; -+ -+ memset(&src, 0, sizeof(src)); -+ - virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi; - -@@ -5319,13 +5314,13 @@ qemuBuildSCSIiSCSIHostdevDrvStr(virConnectPtr conn, - goto cleanup; - } - -+ src.protocol = VIR_STORAGE_NET_PROTOCOL_ISCSI; -+ src.path = iscsisrc->path; -+ src.hosts = iscsisrc->hosts; -+ src.nhosts = iscsisrc->nhosts; -+ - /* Rather than pull what we think we want - use the network disk code */ -- source = qemuBuildNetworkDriveURI(VIR_STORAGE_NET_PROTOCOL_ISCSI, -- iscsisrc->path, -- NULL, /* volume */ -- iscsisrc->nhosts, -- iscsisrc->hosts, -- username, secret); -+ source = qemuBuildNetworkDriveURI(&src, username, secret); - - cleanup: - VIR_FREE(secret); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Refactor-qemuCheckSharedDisk-to-create-qemuCheckUnprivSGIO.patch b/SOURCES/libvirt-qemu-Refactor-qemuCheckSharedDisk-to-create-qemuCheckUnprivSGIO.patch new file mode 100644 index 0000000..f457e2a --- /dev/null +++ b/SOURCES/libvirt-qemu-Refactor-qemuCheckSharedDisk-to-create-qemuCheckUnprivSGIO.patch @@ -0,0 +1,180 @@ +From a9dc408532244f476ace6ca0d524ca7e99324507 Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Thu, 9 Jul 2015 08:28:53 -0400 +Subject: [PATCH] qemu: Refactor qemuCheckSharedDisk to create + qemuCheckUnprivSGIO + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +Split out the current function in order to share the code with hostdev +in a future patch. Failure to match the expected sgio value against what +is stored will cause an error which the caller would need to handle since +only the caller has the disk (or eventually hostdev) specific data in +order to uniquely identify the disk in an error message. + +Signed-off-by: John Ferlan +(cherry picked from commit f6a5cbbfdcd1cd5354de40c923968235951dc879) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.c | 130 ++++++++++++++++++++++++++++++++------------------- + 1 file changed, 81 insertions(+), 49 deletions(-) + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index a761ec5..bf2ec1e 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1018,6 +1018,69 @@ qemuGetSharedDeviceKey(const char *device_path) + return key; + } + ++/* ++ * Make necessary checks for the need to check and for the current setting ++ * of the 'unpriv_sgio' value for the device_path passed. ++ * ++ * Returns: ++ * 0 - Success ++ * -1 - Some failure which would already have been messaged ++ * -2 - Mismatch with the "shared" sgio setting - needs to be messaged ++ * by caller since it has context of which type of disk resource is ++ * being used and in the future the hostdev information. ++ */ ++static int ++qemuCheckUnprivSGIO(virHashTablePtr sharedDevices, ++ const char *device_path, ++ int sgio) ++{ ++ char *sysfs_path = NULL; ++ char *key = NULL; ++ int val; ++ int ret = -1; ++ ++ if (!(sysfs_path = virGetUnprivSGIOSysfsPath(device_path, NULL))) ++ goto cleanup; ++ ++ /* It can't be conflict if unpriv_sgio is not supported by kernel. */ ++ if (!virFileExists(sysfs_path)) { ++ ret = 0; ++ goto cleanup; ++ } ++ ++ if (!(key = qemuGetSharedDeviceKey(device_path))) ++ goto cleanup; ++ ++ /* It can't be conflict if no other domain is sharing it. */ ++ if (!(virHashLookup(sharedDevices, key))) { ++ ret = 0; ++ goto cleanup; ++ } ++ ++ if (virGetDeviceUnprivSGIO(device_path, NULL, &val) < 0) ++ goto cleanup; ++ ++ /* Error message on failure needs to be handled in caller ++ * since there is more specific knowledge of device ++ */ ++ if (!((val == 0 && ++ (sgio == VIR_DOMAIN_DEVICE_SGIO_FILTERED || ++ sgio == VIR_DOMAIN_DEVICE_SGIO_DEFAULT)) || ++ (val == 1 && ++ sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED))) { ++ ret = -2; ++ goto cleanup; ++ } ++ ++ ret = 0; ++ ++ cleanup: ++ VIR_FREE(sysfs_path); ++ VIR_FREE(key); ++ return ret; ++} ++ ++ + /* Check if a shared device's setting conflicts with the conf + * used by other domain(s). Currently only checks the sgio + * setting. Note that this should only be called for disk with +@@ -1029,62 +1092,31 @@ static int + qemuCheckSharedDisk(virHashTablePtr sharedDevices, + virDomainDiskDefPtr disk) + { +- char *sysfs_path = NULL; +- char *key = NULL; +- int val; +- int ret = -1; ++ int ret; + + if (disk->device != VIR_DOMAIN_DISK_DEVICE_LUN) + return 0; + +- if (!(sysfs_path = virGetUnprivSGIOSysfsPath(disk->src->path, NULL))) +- goto cleanup; +- +- /* It can't be conflict if unpriv_sgio is not supported by kernel. */ +- if (!virFileExists(sysfs_path)) { +- ret = 0; +- goto cleanup; +- } +- +- if (!(key = qemuGetSharedDeviceKey(disk->src->path))) +- goto cleanup; +- +- /* It can't be conflict if no other domain is sharing it. */ +- if (!(virHashLookup(sharedDevices, key))) { +- ret = 0; +- goto cleanup; +- } +- +- if (virGetDeviceUnprivSGIO(disk->src->path, NULL, &val) < 0) +- goto cleanup; +- +- if (!((val == 0 && +- (disk->sgio == VIR_DOMAIN_DEVICE_SGIO_FILTERED || +- disk->sgio == VIR_DOMAIN_DEVICE_SGIO_DEFAULT)) || +- (val == 1 && +- disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED))) { +- +- if (virDomainDiskGetType(disk) == VIR_STORAGE_TYPE_VOLUME) { +- virReportError(VIR_ERR_OPERATION_INVALID, +- _("sgio of shared disk 'pool=%s' 'volume=%s' conflicts " +- "with other active domains"), +- disk->src->srcpool->pool, +- disk->src->srcpool->volume); +- } else { +- virReportError(VIR_ERR_OPERATION_INVALID, +- _("sgio of shared disk '%s' conflicts with other " +- "active domains"), disk->src->path); ++ if ((ret = qemuCheckUnprivSGIO(sharedDevices, disk->src->path, ++ disk->sgio)) < 0) { ++ if (ret == -2) { ++ if (virDomainDiskGetType(disk) == VIR_STORAGE_TYPE_VOLUME) { ++ virReportError(VIR_ERR_OPERATION_INVALID, ++ _("sgio of shared disk 'pool=%s' 'volume=%s' " ++ "conflicts with other active domains"), ++ disk->src->srcpool->pool, ++ disk->src->srcpool->volume); ++ } else { ++ virReportError(VIR_ERR_OPERATION_INVALID, ++ _("sgio of shared disk '%s' conflicts with " ++ "other active domains"), ++ disk->src->path); ++ } + } +- +- goto cleanup; ++ return -1; + } + +- ret = 0; +- +- cleanup: +- VIR_FREE(sysfs_path); +- VIR_FREE(key); +- return ret; ++ return 0; + } + + +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Refactor-qemuSetUnprivSGIO-return-values.patch b/SOURCES/libvirt-qemu-Refactor-qemuSetUnprivSGIO-return-values.patch new file mode 100644 index 0000000..40f4c13 --- /dev/null +++ b/SOURCES/libvirt-qemu-Refactor-qemuSetUnprivSGIO-return-values.patch @@ -0,0 +1,65 @@ +From d89912ddf6007ce5b8c3abef835b087dd5bfe359 Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Thu, 9 Jul 2015 08:28:55 -0400 +Subject: [PATCH] qemu: Refactor qemuSetUnprivSGIO return values + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +Set to ret = -1 and prove otherwise, like usual + +Signed-off-by: John Ferlan +(cherry picked from commit 931ac3cdb571b01968adc87bfddead67311677c2) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index cc40dcb..d41f166 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1434,7 +1434,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + char *sysfs_path = NULL; + const char *path = NULL; + int val = -1; +- int ret = 0; ++ int ret = -1; + + /* "sgio" is only valid for block disk; cdrom + * and floopy disk can have empty source. +@@ -1457,7 +1457,6 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("'sgio' is not supported for SCSI " + "generic device yet ")); +- ret = -1; + goto cleanup; + } + +@@ -1466,11 +1465,8 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + return 0; + } + +- sysfs_path = virGetUnprivSGIOSysfsPath(path, NULL); +- if (sysfs_path == NULL) { +- ret = -1; ++ if (!(sysfs_path = virGetUnprivSGIOSysfsPath(path, NULL))) + goto cleanup; +- } + + /* By default, filter the SG_IO commands, i.e. set unpriv_sgio to 0. */ + val = (disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED); +@@ -1481,7 +1477,9 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) + */ + if ((virFileExists(sysfs_path) || val == 1) && + virSetDeviceUnprivSGIO(path, NULL, val) < 0) +- ret = -1; ++ goto cleanup; ++ ++ ret = 0; + + cleanup: + VIR_FREE(sysfs_path); +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Refresh-memory-size-only-on-fresh-starts.patch b/SOURCES/libvirt-qemu-Refresh-memory-size-only-on-fresh-starts.patch new file mode 100644 index 0000000..a982351 --- /dev/null +++ b/SOURCES/libvirt-qemu-Refresh-memory-size-only-on-fresh-starts.patch @@ -0,0 +1,37 @@ +From 7211ae6c2efef89d0c708abe54ca2c402f2a91af Mon Sep 17 00:00:00 2001 +Message-Id: <7211ae6c2efef89d0c708abe54ca2c402f2a91af@dist-git> +From: Peter Krempa +Date: Wed, 23 Sep 2015 15:03:14 +0200 +Subject: [PATCH] qemu: Refresh memory size only on fresh starts + +Qemu unfortunately doesn't update internal state right after migration +and so the actual balloon size as returned by 'query-balloon' are +invalid for a while after the CPUs are started after migration. If we'd +refresh our internal state at this point we would report invalid current +memory size until the next balloon event would arrive. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1242940 +(cherry picked from commit d7a0386e229176ec67531aac1412b8a98914da8e) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_process.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 301b9bf..ed01bf4 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -5049,7 +5049,8 @@ int qemuProcessStart(virConnectPtr conn, + /* Since CPUs were not started yet, the balloon could not return the memory + * to the host and thus cur_balloon needs to be updated so that GetXMLdesc + * and friends return the correct size in case they can't grab the job */ +- if (qemuProcessRefreshBalloonState(driver, vm, asyncJob) < 0) ++ if (!migrateFrom && !snapshot && ++ qemuProcessRefreshBalloonState(driver, vm, asyncJob) < 0) + goto cleanup; + + VIR_DEBUG("Detecting actual memory size for video device"); +-- +2.5.3 + diff --git a/SOURCES/libvirt-qemu-Reject-migration-with-memory-hotplug-if-destination-doesn-t-support-it.patch b/SOURCES/libvirt-qemu-Reject-migration-with-memory-hotplug-if-destination-doesn-t-support-it.patch new file mode 100644 index 0000000..5781908 --- /dev/null +++ b/SOURCES/libvirt-qemu-Reject-migration-with-memory-hotplug-if-destination-doesn-t-support-it.patch @@ -0,0 +1,79 @@ +From 5f602085f03840e9cef0b53d01ab6e9eaf126382 Mon Sep 17 00:00:00 2001 +Message-Id: <5f602085f03840e9cef0b53d01ab6e9eaf126382@dist-git> +From: Peter Krempa +Date: Fri, 31 Jul 2015 15:19:26 +0200 +Subject: [PATCH] qemu: Reject migration with memory-hotplug if destination + doesn't support it + +If destination libvirt doesn't support memory hotplug since all the +support was introduced by adding new elements the destination would +attempt to start qemu with an invalid configuration. The worse part is +that qemu might hang in such situation. + +Fix this by sending a required migration feature called 'memory-hotplug' +to the destination. If the destination doesn't recognize it it will fail +the migration. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1248350 +(cherry picked from commit 136f3de4112c75af0b38fc1946f44e3658ed1890) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_migration.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index d789110..6386744 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -86,6 +86,7 @@ enum qemuMigrationCookieFlags { + QEMU_MIGRATION_COOKIE_FLAG_NETWORK, + QEMU_MIGRATION_COOKIE_FLAG_NBD, + QEMU_MIGRATION_COOKIE_FLAG_STATS, ++ QEMU_MIGRATION_COOKIE_FLAG_MEMORY_HOTPLUG, + + QEMU_MIGRATION_COOKIE_FLAG_LAST + }; +@@ -98,7 +99,8 @@ VIR_ENUM_IMPL(qemuMigrationCookieFlag, + "persistent", + "network", + "nbd", +- "statistics"); ++ "statistics", ++ "memory-hotplug"); + + enum qemuMigrationCookieFeatures { + QEMU_MIGRATION_COOKIE_GRAPHICS = (1 << QEMU_MIGRATION_COOKIE_FLAG_GRAPHICS), +@@ -107,6 +109,7 @@ enum qemuMigrationCookieFeatures { + QEMU_MIGRATION_COOKIE_NETWORK = (1 << QEMU_MIGRATION_COOKIE_FLAG_NETWORK), + QEMU_MIGRATION_COOKIE_NBD = (1 << QEMU_MIGRATION_COOKIE_FLAG_NBD), + QEMU_MIGRATION_COOKIE_STATS = (1 << QEMU_MIGRATION_COOKIE_FLAG_STATS), ++ QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG = (1 << QEMU_MIGRATION_COOKIE_FLAG_MEMORY_HOTPLUG), + }; + + typedef struct _qemuMigrationCookieGraphics qemuMigrationCookieGraphics; +@@ -1352,6 +1355,9 @@ qemuMigrationBakeCookie(qemuMigrationCookiePtr mig, + qemuMigrationCookieAddStatistics(mig, dom) < 0) + return -1; + ++ if (flags & QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG) ++ mig->flagsMandatory |= QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG; ++ + if (!(*cookieout = qemuMigrationCookieXMLFormatStr(driver, mig))) + return -1; + +@@ -2974,6 +2980,11 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver, + } + } + ++ if (vm->def->mem.max_memory || ++ (vm->newDef && ++ vm->newDef->mem.max_memory)) ++ cookieFlags |= QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG; ++ + if (!(mig = qemuMigrationEatCookie(driver, vm, NULL, 0, 0))) + goto cleanup; + +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Reject-updating-unsupported-disk-information.patch b/SOURCES/libvirt-qemu-Reject-updating-unsupported-disk-information.patch new file mode 100644 index 0000000..d623206 --- /dev/null +++ b/SOURCES/libvirt-qemu-Reject-updating-unsupported-disk-information.patch @@ -0,0 +1,216 @@ +From 3216788d3cd902dd31705cac5e91589b9b467543 Mon Sep 17 00:00:00 2001 +Message-Id: <3216788d3cd902dd31705cac5e91589b9b467543@dist-git> +From: Martin Kletzander +Date: Thu, 6 Aug 2015 13:10:54 +0200 +Subject: [PATCH] qemu: Reject updating unsupported disk information + +If one calls update-device with information that is not updatable, +libvirt reports success even though no data were updated. The example +used in the bug linked below uses updating device with +which, in my opinion, is a valid thing to request from user's +perspective. Mainly since we properly error out if user wants to update +such data on a network device for example. + +And since there are many things that might happen (update-device on disk +basically knows just how to change removable media), check for what's +changing and moreover, since the function might be usable in other +drivers (updating only disk path is a valid possibility) let's abstract +it for any two disks. + +We can't possibly check for everything since for many fields our code +does not properly differentiate between default and unspecified values. +Even though this could be changed, I don't feel like it's worth the +complexity so it's not the aim of this patch. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1007228 +(cherry picked from commit 717c99f3602354136ca97edca6afc8dce69aae85) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++ + src/conf/domain_conf.h | 2 + + src/libvirt_private.syms | 1 + + src/qemu/qemu_driver.c | 3 ++ + 4 files changed, 134 insertions(+) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 72d87dd..4fe38ae 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -5690,6 +5690,134 @@ virDomainDiskFindByBusAndDst(virDomainDefPtr def, + return NULL; + } + ++ ++/* ++ * Makes sure the @disk differs from @orig_disk only by the source ++ * path and nothing else. Fields that are being checked and the ++ * information whether they are nullable (may not be specified) or is ++ * taken from the virDomainDiskDefFormat() code. ++ */ ++bool ++virDomainDiskDiffersSourceOnly(virDomainDiskDefPtr disk, ++ virDomainDiskDefPtr orig_disk) ++{ ++#define CHECK_EQ(field, field_name, nullable) \ ++ do { \ ++ if (nullable && !disk->field) \ ++ break; \ ++ if (disk->field != orig_disk->field) { \ ++ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, \ ++ _("cannot modify field '%s' of the disk"), \ ++ field_name); \ ++ return false; \ ++ } \ ++ } while (0) ++ ++ CHECK_EQ(device, "device", false); ++ CHECK_EQ(cachemode, "cache", true); ++ CHECK_EQ(error_policy, "error_policy", true); ++ CHECK_EQ(rerror_policy, "rerror_policy", true); ++ CHECK_EQ(iomode, "io", true); ++ CHECK_EQ(ioeventfd, "ioeventfd", true); ++ CHECK_EQ(event_idx, "event_idx", true); ++ CHECK_EQ(copy_on_read, "copy_on_read", true); ++ CHECK_EQ(discard, "discard", true); ++ CHECK_EQ(iothread, "iothread", true); ++ ++ if (disk->geometry.cylinders && ++ disk->geometry.heads && ++ disk->geometry.sectors) { ++ CHECK_EQ(geometry.cylinders, "geometry cylinders", false); ++ CHECK_EQ(geometry.heads, "geometry heads", false); ++ CHECK_EQ(geometry.sectors, "geometry sectors", false); ++ CHECK_EQ(geometry.trans, "BIOS-translation-modus", true); ++ } ++ ++ CHECK_EQ(blockio.logical_block_size, ++ "blockio logical_block_size", false); ++ CHECK_EQ(blockio.physical_block_size, ++ "blockio physical_block_size", false); ++ ++ if (disk->bus == VIR_DOMAIN_DISK_BUS_USB) ++ CHECK_EQ(removable, "removable", true); ++ ++ CHECK_EQ(blkdeviotune.total_bytes_sec, ++ "blkdeviotune total_bytes_sec", ++ true); ++ CHECK_EQ(blkdeviotune.read_bytes_sec, ++ "blkdeviotune read_bytes_sec", ++ true); ++ CHECK_EQ(blkdeviotune.write_bytes_sec, ++ "blkdeviotune write_bytes_sec", ++ true); ++ CHECK_EQ(blkdeviotune.total_iops_sec, ++ "blkdeviotune total_iops_sec", ++ true); ++ CHECK_EQ(blkdeviotune.read_iops_sec, ++ "blkdeviotune read_iops_sec", ++ true); ++ CHECK_EQ(blkdeviotune.write_iops_sec, ++ "blkdeviotune write_iops_sec", ++ true); ++ CHECK_EQ(blkdeviotune.total_bytes_sec_max, ++ "blkdeviotune total_bytes_sec_max", ++ true); ++ CHECK_EQ(blkdeviotune.read_bytes_sec_max, ++ "blkdeviotune read_bytes_sec_max", ++ true); ++ CHECK_EQ(blkdeviotune.write_bytes_sec_max, ++ "blkdeviotune write_bytes_sec_max", ++ true); ++ CHECK_EQ(blkdeviotune.total_iops_sec_max, ++ "blkdeviotune total_iops_sec_max", ++ true); ++ CHECK_EQ(blkdeviotune.read_iops_sec_max, ++ "blkdeviotune read_iops_sec_max", ++ true); ++ CHECK_EQ(blkdeviotune.write_iops_sec_max, ++ "blkdeviotune write_iops_sec_max", ++ true); ++ CHECK_EQ(blkdeviotune.size_iops_sec, ++ "blkdeviotune size_iops_sec", ++ true); ++ ++ CHECK_EQ(transient, "transient", true); ++ ++ if (disk->serial && STRNEQ(disk->serial, orig_disk->serial)) { ++ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, ++ _("cannot modify field '%s' of the disk"), ++ "serial"); ++ return false; ++ } ++ ++ if (disk->wwn && STRNEQ(disk->wwn, orig_disk->wwn)) { ++ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, ++ _("cannot modify field '%s' of the disk"), ++ "wwn"); ++ return false; ++ } ++ ++ if (disk->vendor && STRNEQ(disk->vendor, orig_disk->vendor)) { ++ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, ++ _("cannot modify field '%s' of the disk"), ++ "vendor"); ++ return false; ++ } ++ ++ if (disk->product && STRNEQ(disk->product, orig_disk->product)) { ++ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, ++ _("cannot modify field '%s' of the disk"), ++ "product"); ++ return false; ++ } ++ ++ CHECK_EQ(info.bootIndex, "boot order", true); ++ ++#undef CHECK_EQ ++ ++ return true; ++} ++ + int + virDomainDiskDefAssignAddress(virDomainXMLOptionPtr xmlopt, + virDomainDiskDefPtr def) +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 604d0b8..1be8e63 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2474,6 +2474,8 @@ int virDomainDeviceFindControllerModel(virDomainDefPtr def, + virDomainDiskDefPtr virDomainDiskFindByBusAndDst(virDomainDefPtr def, + int bus, + char *dst); ++bool virDomainDiskDiffersSourceOnly(virDomainDiskDefPtr disk, ++ virDomainDiskDefPtr orig_disk); + void virDomainControllerDefFree(virDomainControllerDefPtr def); + void virDomainFSDefFree(virDomainFSDefPtr def); + void virDomainActualNetDefFree(virDomainActualNetDefPtr def); +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 46e535e..0517c24 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -249,6 +249,7 @@ virDomainDiskDefFree; + virDomainDiskDefNew; + virDomainDiskDefSourceParse; + virDomainDiskDeviceTypeToString; ++virDomainDiskDiffersSourceOnly; + virDomainDiskDiscardTypeToString; + virDomainDiskErrorPolicyTypeFromString; + virDomainDiskErrorPolicyTypeToString; +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index bb0dc7e..8d569fe 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -7940,6 +7940,9 @@ qemuDomainChangeDiskMediaLive(virConnectPtr conn, + goto end; + } + ++ if (!virDomainDiskDiffersSourceOnly(disk, orig_disk)) ++ goto end; ++ + /* Add the new disk src into shared disk hash table */ + if (qemuAddSharedDevice(driver, dev, vm->def->name) < 0) + goto end; +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Release-nbd-port-from-migrationPorts-instead-of-remotePorts.patch b/SOURCES/libvirt-qemu-Release-nbd-port-from-migrationPorts-instead-of-remotePorts.patch deleted file mode 100644 index 819a208..0000000 --- a/SOURCES/libvirt-qemu-Release-nbd-port-from-migrationPorts-instead-of-remotePorts.patch +++ /dev/null @@ -1,75 +0,0 @@ -From c93d91b3260e3211f19275380e773605af7681d2 Mon Sep 17 00:00:00 2001 -Message-Id: -From: weiwei li -Date: Fri, 31 Oct 2014 12:33:01 +0100 -Subject: [PATCH] qemu: Release nbd port from migrationPorts instead of - remotePorts -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -commit 3e1e16aa8d4238241a1806cb9bdb3b9ad60db777 (Use a port from the -migration range for NBD as well) changed ndb port allocation from -remotePorts to migrationPorts, but did not change the port releasing -process, which makes an error when migrating several times (above 64): -error: internal error: Unable to find an unused port in range -'migration' (49152-49215) - -https://bugzilla.redhat.com/show_bug.cgi?id=1159245 - -Signed-off-by: Weiwei Li -Signed-off-by: Ján Tomko -(cherry picked from commit be598c5ff84656d3498b950d473fafe5b86f87b4) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 6 +++--- - src/qemu/qemu_process.c | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 2b922fe..1998bc9 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -1389,7 +1389,7 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver, - cleanup: - VIR_FREE(diskAlias); - if (ret < 0) -- virPortAllocatorRelease(driver->remotePorts, port); -+ virPortAllocatorRelease(driver->migrationPorts, port); - return ret; - } - -@@ -1595,7 +1595,7 @@ qemuMigrationStopNBDServer(virQEMUDriverPtr driver, - - qemuDomainObjExitMonitor(driver, vm); - -- virPortAllocatorRelease(driver->remotePorts, priv->nbdPort); -+ virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort); - priv->nbdPort = 0; - } - -@@ -2821,7 +2821,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - VIR_FORCE_CLOSE(dataFD[1]); - if (vm) { - if (ret < 0) { -- virPortAllocatorRelease(driver->remotePorts, priv->nbdPort); -+ virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort); - priv->nbdPort = 0; - } - if (ret >= 0 || vm->persistent) -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 6565956..e711b5f 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -4794,7 +4794,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, - } - } - -- virPortAllocatorRelease(driver->remotePorts, priv->nbdPort); -+ virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort); - priv->nbdPort = 0; - - if (priv->agent) { --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Remember-incoming-migration-errors.patch b/SOURCES/libvirt-qemu-Remember-incoming-migration-errors.patch new file mode 100644 index 0000000..5d61d91 --- /dev/null +++ b/SOURCES/libvirt-qemu-Remember-incoming-migration-errors.patch @@ -0,0 +1,267 @@ +From c6f6fd0e71ca74d9e553bb059de1809a4c1789dd Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Thu, 2 Jul 2015 08:26:48 +0200 +Subject: [PATCH] qemu: Remember incoming migration errors + +If QEMU fails during incoming migration, the domain disappears including +a possibly useful error message read from QEMU log file. Let's remember +the error in virQEMUDriver so that Finish can report more than just "no +such domain". + +Signed-off-by: Jiri Denemark +(cherry picked from commit e68f395fcbae0267368f9974cc49f582cc83c752) + +https://bugzilla.redhat.com/show_bug.cgi?id=1090093 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.h | 3 +++ + src/qemu/qemu_driver.c | 31 ++++++++++++++++++------- + src/qemu/qemu_migration.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++- + src/qemu/qemu_migration.h | 7 ++++++ + src/qemu/qemu_monitor.c | 14 +++++++++++ + src/qemu/qemu_monitor.h | 2 ++ + src/qemu/qemu_process.c | 4 ++++ + 7 files changed, 111 insertions(+), 9 deletions(-) + +diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h +index b74c283..3f73929 100644 +--- a/src/qemu/qemu_conf.h ++++ b/src/qemu/qemu_conf.h +@@ -252,6 +252,9 @@ struct _virQEMUDriver { + + /* Immutable pointer, self-clocking APIs */ + virCloseCallbacksPtr closeCallbacks; ++ ++ /* Immutable pointer, self-locking APIs */ ++ virHashAtomicPtr migrationErrors; + }; + + typedef struct _qemuDomainCmdlineDef qemuDomainCmdlineDef; +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 063bedb..fb42dae 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -775,6 +775,9 @@ qemuStateInitialize(bool privileged, + if (!(qemu_driver->sharedDevices = virHashCreate(30, qemuSharedDeviceEntryFree))) + goto error; + ++ if (qemuMigrationErrorInit(qemu_driver) < 0) ++ goto error; ++ + if (privileged) { + char *channeldir; + +@@ -1091,6 +1094,7 @@ qemuStateCleanup(void) + virObjectUnref(qemu_driver->remotePorts); + virObjectUnref(qemu_driver->webSocketPorts); + virObjectUnref(qemu_driver->migrationPorts); ++ virObjectUnref(qemu_driver->migrationErrors); + + virObjectUnref(qemu_driver->xmlopt); + +@@ -12199,6 +12203,7 @@ qemuDomainMigrateFinish2(virConnectPtr dconn, + if (!vm) { + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching name '%s'"), dname); ++ qemuMigrationErrorReport(driver, dname); + goto cleanup; + } + +@@ -12648,11 +12653,16 @@ qemuDomainMigrateFinish3(virConnectPtr dconn, + + virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); + +- if (!dname || +- !(vm = virDomainObjListFindByName(driver->domains, dname))) { ++ if (!dname) { ++ virReportError(VIR_ERR_NO_DOMAIN, "%s", _("missing domain name")); ++ return NULL; ++ } ++ ++ vm = virDomainObjListFindByName(driver->domains, dname); ++ if (!vm) { + virReportError(VIR_ERR_NO_DOMAIN, +- _("no domain with matching name '%s'"), +- NULLSTR(dname)); ++ _("no domain with matching name '%s'"), dname); ++ qemuMigrationErrorReport(driver, dname); + return NULL; + } + +@@ -12691,11 +12701,16 @@ qemuDomainMigrateFinish3Params(virConnectPtr dconn, + &dname) < 0) + return NULL; + +- if (!dname || +- !(vm = virDomainObjListFindByName(driver->domains, dname))) { ++ if (!dname) { ++ virReportError(VIR_ERR_NO_DOMAIN, "%s", _("missing domain name")); ++ return NULL; ++ } ++ ++ vm = virDomainObjListFindByName(driver->domains, dname); ++ if (!vm) { + virReportError(VIR_ERR_NO_DOMAIN, +- _("no domain with matching name '%s'"), +- NULLSTR(dname)); ++ _("no domain with matching name '%s'"), dname); ++ qemuMigrationErrorReport(driver, dname); + return NULL; + } + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 7257182..58874ee 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -5543,8 +5543,10 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + if (!(caps = virQEMUDriverGetCapabilities(driver, false))) + goto cleanup; + +- if (!qemuMigrationJobIsActive(vm, QEMU_ASYNC_JOB_MIGRATION_IN)) ++ if (!qemuMigrationJobIsActive(vm, QEMU_ASYNC_JOB_MIGRATION_IN)) { ++ qemuMigrationErrorReport(driver, vm->def->name); + goto cleanup; ++ } + + qemuMigrationJobStartPhase(driver, vm, + v3proto ? QEMU_MIGRATION_PHASE_FINISH3 +@@ -5570,6 +5572,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + if (!virDomainObjIsActive(vm) && !(flags & VIR_MIGRATE_OFFLINE)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); ++ qemuMigrationErrorReport(driver, vm->def->name); + goto endjob; + } + +@@ -6094,3 +6097,57 @@ qemuMigrationJobFinish(virQEMUDriverPtr driver, virDomainObjPtr vm) + { + qemuDomainObjEndAsyncJob(driver, vm); + } ++ ++ ++static void ++qemuMigrationErrorFree(void *data, ++ const void *name ATTRIBUTE_UNUSED) ++{ ++ virErrorPtr err = data; ++ virFreeError(err); ++} ++ ++int ++qemuMigrationErrorInit(virQEMUDriverPtr driver) ++{ ++ driver->migrationErrors = virHashAtomicNew(64, qemuMigrationErrorFree); ++ if (driver->migrationErrors) ++ return 0; ++ else ++ return -1; ++} ++ ++/** ++ * This function consumes @err; the caller should consider the @err pointer ++ * invalid after calling this function. ++ */ ++void ++qemuMigrationErrorSave(virQEMUDriverPtr driver, ++ const char *name, ++ virErrorPtr err) ++{ ++ if (!err) ++ return; ++ ++ VIR_DEBUG("Saving incoming migration error for domain %s: %s", ++ name, err->message); ++ if (virHashAtomicUpdate(driver->migrationErrors, name, err) < 0) { ++ VIR_WARN("Failed to save migration error for domain '%s'", name); ++ virFreeError(err); ++ } ++} ++ ++void ++qemuMigrationErrorReport(virQEMUDriverPtr driver, ++ const char *name) ++{ ++ virErrorPtr err; ++ ++ if (!(err = virHashAtomicSteal(driver->migrationErrors, name))) ++ return; ++ ++ VIR_DEBUG("Restoring saved incoming migration error for domain %s: %s", ++ name, err->message); ++ virSetError(err); ++ virFreeError(err); ++} +diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h +index 48c2e8c..fa14274 100644 +--- a/src/qemu/qemu_migration.h ++++ b/src/qemu/qemu_migration.h +@@ -193,4 +193,11 @@ int qemuMigrationFetchJobStatus(virQEMUDriverPtr driver, + qemuDomainAsyncJob asyncJob, + qemuDomainJobInfoPtr jobInfo); + ++int qemuMigrationErrorInit(virQEMUDriverPtr driver); ++void qemuMigrationErrorSave(virQEMUDriverPtr driver, ++ const char *name, ++ virErrorPtr err); ++void qemuMigrationErrorReport(virQEMUDriverPtr driver, ++ const char *name); ++ + #endif /* __QEMU_MIGRATION_H__ */ +diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c +index dabe8e2..7545dbb 100644 +--- a/src/qemu/qemu_monitor.c ++++ b/src/qemu/qemu_monitor.c +@@ -1057,6 +1057,20 @@ qemuMonitorSend(qemuMonitorPtr mon, + } + + ++/** ++ * This function returns a new virError object; the caller is responsible ++ * for freeing it. ++ */ ++virErrorPtr ++qemuMonitorLastError(qemuMonitorPtr mon) ++{ ++ if (mon->lastError.code == VIR_ERR_OK) ++ return NULL; ++ ++ return virErrorCopyNew(&mon->lastError); ++} ++ ++ + virJSONValuePtr + qemuMonitorGetOptions(qemuMonitorPtr mon) + { +diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h +index 2ceba28..8ad3b2b 100644 +--- a/src/qemu/qemu_monitor.h ++++ b/src/qemu/qemu_monitor.h +@@ -240,6 +240,8 @@ qemuMonitorPtr qemuMonitorOpenFD(virDomainObjPtr vm, + + void qemuMonitorClose(qemuMonitorPtr mon); + ++virErrorPtr qemuMonitorLastError(qemuMonitorPtr mon); ++ + int qemuMonitorSetCapabilities(qemuMonitorPtr mon); + + int qemuMonitorSetLink(qemuMonitorPtr mon, +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index c5f467b..91ff5f8 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -310,6 +310,10 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + auditReason = "failed"; + } + ++ if (qemuMigrationJobIsActive(vm, QEMU_ASYNC_JOB_MIGRATION_IN)) ++ qemuMigrationErrorSave(driver, vm->def->name, ++ qemuMonitorLastError(priv->mon)); ++ + event = virDomainEventLifecycleNewFromObj(vm, + VIR_DOMAIN_EVENT_STOPPED, + eventReason); +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu-Remove-need-for-virConnectPtr-in-hotunplug-detach-host-net.patch b/SOURCES/libvirt-qemu-Remove-need-for-virConnectPtr-in-hotunplug-detach-host-net.patch deleted file mode 100644 index 39d24b4..0000000 --- a/SOURCES/libvirt-qemu-Remove-need-for-virConnectPtr-in-hotunplug-detach-host-net.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 56df0b93d70c961aab2216eaf587a57a87a3faf4 Mon Sep 17 00:00:00 2001 -Message-Id: <56df0b93d70c961aab2216eaf587a57a87a3faf4@dist-git> -From: John Ferlan -Date: Mon, 6 Oct 2014 11:14:33 -0400 -Subject: [PATCH] qemu: Remove need for virConnectPtr in hotunplug detach host, - net - -https://bugzilla.redhat.com/show_bug.cgi?id=1141732 - -Prior patch removed the need for the virConnectPtr in the unplug -detach host path which caused ripple effect to remove in multiple -callers. The previous patch just left things as ATTRIBUTE_UNUSED - -this patch will remove the variable. - -(cherry picked from commit 99186c4103cf1e035fed1de6baa575edac9ed53a) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 4 ++-- - src/qemu/qemu_hotplug.c | 20 ++++++++------------ - src/qemu/qemu_hotplug.h | 6 ++---- - 3 files changed, 12 insertions(+), 18 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 9586c43..4c57fcd 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -6804,10 +6804,10 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm, - ret = qemuDomainDetachLease(driver, vm, dev->data.lease); - break; - case VIR_DOMAIN_DEVICE_NET: -- ret = qemuDomainDetachNetDevice(dom->conn, driver, vm, dev); -+ ret = qemuDomainDetachNetDevice(driver, vm, dev); - break; - case VIR_DOMAIN_DEVICE_HOSTDEV: -- ret = qemuDomainDetachHostDevice(dom->conn, driver, vm, dev); -+ ret = qemuDomainDetachHostDevice(driver, vm, dev); - break; - case VIR_DOMAIN_DEVICE_CHR: - ret = qemuDomainDetachChrDevice(driver, vm, dev->data.chr); -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index fe4994a..bbfd3de 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -3325,8 +3325,7 @@ qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver, - } - - static int --qemuDomainDetachHostSCSIDevice(virConnectPtr conn ATTRIBUTE_UNUSED, -- virQEMUDriverPtr driver, -+qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr detach) - { -@@ -3360,8 +3359,7 @@ qemuDomainDetachHostSCSIDevice(virConnectPtr conn ATTRIBUTE_UNUSED, - } - - static int --qemuDomainDetachThisHostDevice(virConnectPtr conn, -- virQEMUDriverPtr driver, -+qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr detach) - { -@@ -3375,7 +3373,7 @@ qemuDomainDetachThisHostDevice(virConnectPtr conn, - ret = qemuDomainDetachHostUSBDevice(driver, vm, detach); - break; - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: -- ret = qemuDomainDetachHostSCSIDevice(conn, driver, vm, detach); -+ ret = qemuDomainDetachHostSCSIDevice(driver, vm, detach); - break; - default: - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -@@ -3398,8 +3396,7 @@ qemuDomainDetachThisHostDevice(virConnectPtr conn, - } - - /* search for a hostdev matching dev and detach it */ --int qemuDomainDetachHostDevice(virConnectPtr conn, -- virQEMUDriverPtr driver, -+int qemuDomainDetachHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) - { -@@ -3468,14 +3465,13 @@ int qemuDomainDetachHostDevice(virConnectPtr conn, - * function so that mac address / virtualport are reset - */ - if (detach->parent.type == VIR_DOMAIN_DEVICE_NET) -- return qemuDomainDetachNetDevice(conn, driver, vm, &detach->parent); -+ return qemuDomainDetachNetDevice(driver, vm, &detach->parent); - else -- return qemuDomainDetachThisHostDevice(conn, driver, vm, detach); -+ return qemuDomainDetachThisHostDevice(driver, vm, detach); - } - - int --qemuDomainDetachNetDevice(virConnectPtr conn, -- virQEMUDriverPtr driver, -+qemuDomainDetachNetDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) - { -@@ -3491,7 +3487,7 @@ qemuDomainDetachNetDevice(virConnectPtr conn, - - if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV) { - /* coverity[negative_returns] */ -- ret = qemuDomainDetachThisHostDevice(conn, driver, vm, -+ ret = qemuDomainDetachThisHostDevice(driver, vm, - virDomainNetGetActualHostdev(detach)); - goto cleanup; - } -diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h -index 55c9333..1c9ca8f 100644 ---- a/src/qemu/qemu_hotplug.h -+++ b/src/qemu/qemu_hotplug.h -@@ -78,12 +78,10 @@ int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver, - int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev); --int qemuDomainDetachNetDevice(virConnectPtr conn, -- virQEMUDriverPtr driver, -+int qemuDomainDetachNetDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev); --int qemuDomainDetachHostDevice(virConnectPtr conn, -- virQEMUDriverPtr driver, -+int qemuDomainDetachHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev); - int qemuDomainAttachLease(virQEMUDriverPtr driver, --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-Remove-possible-NULL-deref-in-debug-output.patch b/SOURCES/libvirt-qemu-Remove-possible-NULL-deref-in-debug-output.patch deleted file mode 100644 index 200e84f..0000000 --- a/SOURCES/libvirt-qemu-Remove-possible-NULL-deref-in-debug-output.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 41f6c2fa241ddd68564f537ae58af8016d75bf4e Mon Sep 17 00:00:00 2001 -Message-Id: <41f6c2fa241ddd68564f537ae58af8016d75bf4e@dist-git> -From: John Ferlan -Date: Tue, 28 Oct 2014 22:28:42 -0400 -Subject: [PATCH] qemu: Remove possible NULL deref in debug output - -Check for !dev->info.alias was done after a VIR_DEBUG() statement -that already tried to print - just flip sequence - -https://bugzilla.redhat.com/show_bug.cgi?id=1141621 - -(cherry picked from commit b7890a8c28f79e958e5146c85e366f1c69ca1304) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 14acac0..e5e5180 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -1886,14 +1886,14 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver, - int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; - -- VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate); -- - if (!dev->info.alias) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("can't change link state: device alias not found")); - return -1; - } - -+ VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate); -+ - qemuDomainObjEnterMonitor(driver, vm); - - ret = qemuMonitorSetLink(priv->mon, dev->info.alias, linkstate); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Remove-unnecessary-qemuSetupCgroupPostInit-function.patch b/SOURCES/libvirt-qemu-Remove-unnecessary-qemuSetupCgroupPostInit-function.patch deleted file mode 100644 index 5ae21a2..0000000 --- a/SOURCES/libvirt-qemu-Remove-unnecessary-qemuSetupCgroupPostInit-function.patch +++ /dev/null @@ -1,76 +0,0 @@ -From d04153f6a23a16505e9263cc0f4e13c32a8db8d2 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Martin Kletzander -Date: Thu, 15 Jan 2015 15:03:46 +0100 -Subject: [PATCH] qemu: Remove unnecessary qemuSetupCgroupPostInit function - -https://bugzilla.redhat.com/show_bug.cgi?id=1161540 - -Signed-off-by: Martin Kletzander -(cherry picked from commit f801a81208e113782c737f70171cbfe3e1e6f7dd) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_cgroup.c | 9 +-------- - src/qemu/qemu_cgroup.h | 4 ++-- - src/qemu/qemu_process.c | 2 +- - 3 files changed, 4 insertions(+), 11 deletions(-) - -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index 7609c0f..ac12f43 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -607,7 +607,7 @@ qemuSetupDevicesCgroup(virQEMUDriverPtr driver, - } - - --static int -+int - qemuSetupCpusetMems(virDomainObjPtr vm, - virBitmapPtr nodemask) - { -@@ -863,13 +863,6 @@ qemuSetupCgroup(virQEMUDriverPtr driver, - } - - int --qemuSetupCgroupPostInit(virDomainObjPtr vm, -- virBitmapPtr nodemask) --{ -- return qemuSetupCpusetMems(vm, nodemask); --} -- --int - qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, - unsigned long long period, - long long quota) -diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h -index 8a2c723..2ae16df 100644 ---- a/src/qemu/qemu_cgroup.h -+++ b/src/qemu/qemu_cgroup.h -@@ -47,8 +47,8 @@ int qemuConnectCgroup(virQEMUDriverPtr driver, - int qemuSetupCgroup(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virBitmapPtr nodemask); --int qemuSetupCgroupPostInit(virDomainObjPtr vm, -- virBitmapPtr nodemask); -+int qemuSetupCpusetMems(virDomainObjPtr vm, -+ virBitmapPtr nodemask); - int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, - unsigned long long period, - long long quota); -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index d965938..c055eb7 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -4796,7 +4796,7 @@ int qemuProcessStart(virConnectPtr conn, - goto cleanup; - - VIR_DEBUG("Setting up post-init cgroup restrictions"); -- if (qemuSetupCgroupPostInit(vm, nodemask) < 0) -+ if (qemuSetupCpusetMems(vm, nodemask) < 0) - goto cleanup; - - VIR_DEBUG("Detecting VCPU PIDs"); --- -2.2.1 - diff --git a/SOURCES/libvirt-qemu-Rename-DEFAULT_JOB_MASK-to-QEMU_DEFAULT_JOB_MASK.patch b/SOURCES/libvirt-qemu-Rename-DEFAULT_JOB_MASK-to-QEMU_DEFAULT_JOB_MASK.patch deleted file mode 100644 index 06f2cb1..0000000 --- a/SOURCES/libvirt-qemu-Rename-DEFAULT_JOB_MASK-to-QEMU_DEFAULT_JOB_MASK.patch +++ /dev/null @@ -1,93 +0,0 @@ -From c2e856d8cc824e86a386d1ff01034174cbb3ffbc Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Mon, 8 Sep 2014 13:24:16 +0200 -Subject: [PATCH] qemu: Rename DEFAULT_JOB_MASK to QEMU_DEFAULT_JOB_MASK - -https://bugzilla.redhat.com/show_bug.cgi?id=1134154 - -Be consistent with naming of private defines. Also line up code -correctly in few places where the macro is used. - -(cherry picked from commit 4be88556996c8472d569a611feb6051d05061700) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 2 +- - src/qemu/qemu_domain.h | 2 +- - src/qemu/qemu_driver.c | 8 ++++---- - src/qemu/qemu_migration.c | 6 +++--- - 4 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index e9506e0..306ff10 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -162,7 +162,7 @@ qemuDomainObjResetAsyncJob(qemuDomainObjPrivatePtr priv) - job->asyncJob = QEMU_ASYNC_JOB_NONE; - job->asyncOwner = 0; - job->phase = 0; -- job->mask = DEFAULT_JOB_MASK; -+ job->mask = QEMU_JOB_DEFAULT_MASK; - job->start = 0; - job->dump_memory_only = false; - job->asyncAbort = false; -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 8736889..f353d90 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -54,7 +54,7 @@ - # endif - - # define JOB_MASK(job) (1 << (job - 1)) --# define DEFAULT_JOB_MASK \ -+# define QEMU_JOB_DEFAULT_MASK \ - (JOB_MASK(QEMU_JOB_QUERY) | \ - JOB_MASK(QEMU_JOB_DESTROY) | \ - JOB_MASK(QEMU_JOB_ABORT)) -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index aceddb1..74d0477 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -13215,9 +13215,9 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - goto endjob; - - /* allow the migration job to be cancelled or the domain to be paused */ -- qemuDomainObjSetAsyncJobMask(vm, DEFAULT_JOB_MASK | -- JOB_MASK(QEMU_JOB_SUSPEND) | -- JOB_MASK(QEMU_JOB_MIGRATION_OP)); -+ qemuDomainObjSetAsyncJobMask(vm, (QEMU_JOB_DEFAULT_MASK | -+ JOB_MASK(QEMU_JOB_SUSPEND) | -+ JOB_MASK(QEMU_JOB_MIGRATION_OP))); - - cfg = virQEMUDriverGetConfig(driver); - if (cfg->snapshotImageFormat) { -@@ -13249,7 +13249,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - memory_unlink = true; - - /* forbid any further manipulation */ -- qemuDomainObjSetAsyncJobMask(vm, DEFAULT_JOB_MASK); -+ qemuDomainObjSetAsyncJobMask(vm, QEMU_JOB_DEFAULT_MASK); - } - - /* now the domain is now paused if: -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 9cfb77e..a7aeca5 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -4907,9 +4907,9 @@ qemuMigrationJobStart(virQEMUDriverPtr driver, - if (job == QEMU_ASYNC_JOB_MIGRATION_IN) { - qemuDomainObjSetAsyncJobMask(vm, QEMU_JOB_NONE); - } else { -- qemuDomainObjSetAsyncJobMask(vm, DEFAULT_JOB_MASK | -- JOB_MASK(QEMU_JOB_SUSPEND) | -- JOB_MASK(QEMU_JOB_MIGRATION_OP)); -+ qemuDomainObjSetAsyncJobMask(vm, (QEMU_JOB_DEFAULT_MASK | -+ JOB_MASK(QEMU_JOB_SUSPEND) | -+ JOB_MASK(QEMU_JOB_MIGRATION_OP))); - } - - priv->job.info.type = VIR_DOMAIN_JOB_UNBOUNDED; --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Report-all-supported-machine-types-in-capabilities.patch b/SOURCES/libvirt-qemu-Report-all-supported-machine-types-in-capabilities.patch deleted file mode 100644 index 398fcea..0000000 --- a/SOURCES/libvirt-qemu-Report-all-supported-machine-types-in-capabilities.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 778d5a7d8ee0f9d25e70fecf867934e9d54f6526 Mon Sep 17 00:00:00 2001 -Message-Id: <778d5a7d8ee0f9d25e70fecf867934e9d54f6526@dist-git> -From: Jiri Denemark -Date: Fri, 12 Jun 2015 14:36:51 +0200 -Subject: [PATCH] qemu: Report all supported machine types in capabilities - -Some machine types are only reported as canonical names for other -machine types, which make it a bit harder to find what machine types are -supported by a specific QEMU binary. Ideally, one would just use -/capabilities/guest/arch[@name='...']/machine/text() XPath to get a list -of all supported machine types, but it doesn't work right now. - -For example, we report - - pc - -in guest capabilities, but the corresponding - - pc-i440fx-2.3 - -is missing. - -This is a result of QMP probing. With "-machine ?" parsing QEMU sends -us two lines: - -pc Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.3) -pc-i440fx-2.3 Standard PC (i440FX + PIIX, 1996) (default) - -while query-machines QMP command reports both in the same entry: - -{"name": "pc-i440fx-2.3", "is-default": true, "cpu-max": 255, "alias": "pc"} - -Let's make sure we always report separate for both the -canonical name and its alias and using the canonical name as the default -machine type (i.e., inserting it before its alias) in case is-default is -true. - -https://bugzilla.redhat.com/show_bug.cgi?id=1229666 - -Signed-off-by: Jiri Denemark -(cherry picked from commit beca509e437b51b68ff42494cc67919d306876ea) - -https://bugzilla.redhat.com/show_bug.cgi?id=1263317 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 38 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 38 insertions(+) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index f827d3f..f16c1f5 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -2163,6 +2163,44 @@ int virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps, - mach->maxCpus = qemuCaps->machineMaxCpus[i]; - } - -+ /* Make sure all canonical machine types also have their own entry so that -+ * /capabilities/guest/arch[@name='...']/machine/text() XPath selects all -+ * supported machine types. -+ */ -+ i = 0; -+ while (i < *nmachines) { -+ size_t j; -+ bool found = false; -+ virCapsGuestMachinePtr machine = (*machines)[i]; -+ -+ if (!machine->canonical) { -+ i++; -+ continue; -+ } -+ -+ for (j = 0; j < *nmachines; j++) { -+ if (STREQ(machine->canonical, (*machines)[j]->name)) { -+ found = true; -+ break; -+ } -+ } -+ -+ if (!found) { -+ virCapsGuestMachinePtr mach; -+ if (VIR_ALLOC(mach) < 0) -+ goto error; -+ if (VIR_INSERT_ELEMENT_COPY(*machines, i, *nmachines, mach) < 0) { -+ VIR_FREE(mach); -+ goto error; -+ } -+ if (VIR_STRDUP(mach->name, machine->canonical) < 0) -+ goto error; -+ mach->maxCpus = machine->maxCpus; -+ i++; -+ } -+ i++; -+ } -+ - return 0; - - error: --- -2.5.3 - diff --git a/SOURCES/libvirt-qemu-Report-better-errors-from-broken-backing-chains.patch b/SOURCES/libvirt-qemu-Report-better-errors-from-broken-backing-chains.patch deleted file mode 100644 index bc7f4f2..0000000 --- a/SOURCES/libvirt-qemu-Report-better-errors-from-broken-backing-chains.patch +++ /dev/null @@ -1,201 +0,0 @@ -From 4dedf415bbbe7edef4c530e902be1fd266ba95b0 Mon Sep 17 00:00:00 2001 -Message-Id: <4dedf415bbbe7edef4c530e902be1fd266ba95b0@dist-git> -From: Peter Krempa -Date: Wed, 24 Sep 2014 11:01:29 +0200 -Subject: [PATCH] qemu: Report better errors from broken backing chains - -https://bugzilla.redhat.com/show_bug.cgi?id=1138231 - -Request erroring out from the backing chain traveller and drop qemu's -internal backing chain integrity tester. - -The backing chain traveller reports errors by itself with possibly more -detail than qemuDiskChainCheckBroken ever could. - -We also need to make sure that we reconnect to existing qemu instances -even at the cost of losing the backing chain info (this really should be -stored in the XML rather than reloaded from disk, but that needs some -work). - -(cherry picked from commit 639a00984a1b6b328093c2e89f2b329ed4f341e4) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 29 ++++------------------------- - src/qemu/qemu_domain.h | 3 ++- - src/qemu/qemu_driver.c | 11 ++++++----- - src/qemu/qemu_hotplug.c | 2 +- - src/qemu/qemu_process.c | 12 ++++++++---- - 5 files changed, 21 insertions(+), 36 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 3766ceb..ac70f62 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -2515,27 +2515,6 @@ qemuDomainCheckDiskStartupPolicy(virQEMUDriverPtr driver, - return -1; - } - --static int --qemuDiskChainCheckBroken(virDomainDiskDefPtr disk) --{ -- char *brokenFile = NULL; -- -- if (!virDomainDiskGetSource(disk)) -- return 0; -- -- if (virStorageFileChainGetBroken(disk->src, &brokenFile) < 0) -- return -1; -- -- if (brokenFile) { -- virReportError(VIR_ERR_INVALID_ARG, -- _("Backing file '%s' of image '%s' is missing."), -- brokenFile, virDomainDiskGetSource(disk)); -- VIR_FREE(brokenFile); -- return -1; -- } -- -- return 0; --} - - int - qemuDomainCheckDiskPresence(virQEMUDriverPtr driver, -@@ -2565,8 +2544,7 @@ qemuDomainCheckDiskPresence(virQEMUDriverPtr driver, - virFileExists(path)) - continue; - -- if (qemuDomainDetermineDiskChain(driver, vm, disk, false) >= 0 && -- qemuDiskChainCheckBroken(disk) >= 0) -+ if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) >= 0) - continue; - - if (disk->startupPolicy && -@@ -2711,7 +2689,8 @@ int - qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, -- bool force_probe) -+ bool force_probe, -+ bool report_broken) - { - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - int ret = 0; -@@ -2733,7 +2712,7 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, - if (virStorageFileGetMetadata(disk->src, - uid, gid, - cfg->allowDiskFormatProbing, -- false) < 0) -+ report_broken) < 0) - ret = -1; - - cleanup: -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index c1d1edf..845d3c7 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -370,7 +370,8 @@ int qemuDomainCheckDiskPresence(virQEMUDriverPtr driver, - int qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, -- bool force_probe); -+ bool force_probe, -+ bool report_broken); - - int qemuDomainStorageFileInit(virQEMUDriverPtr driver, - virDomainObjPtr vm, -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 6629946..46be72c 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -6793,7 +6793,7 @@ qemuDomainChangeDiskMediaLive(virConnectPtr conn, - if (virStorageTranslateDiskSourcePool(conn, disk) < 0) - goto end; - -- if (qemuDomainDetermineDiskChain(driver, vm, disk, false) < 0) -+ if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0) - goto end; - - switch (disk->device) { -@@ -13171,7 +13171,8 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, - for (i = 0; i < snap->def->ndisks; i++) { - if (snap->def->disks[i].snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) - continue; -- qemuDomainDetermineDiskChain(driver, vm, vm->def->disks[i], true); -+ ignore_value(qemuDomainDetermineDiskChain(driver, vm, vm->def->disks[i], -+ true, true)); - } - if (orig_err) { - virSetError(orig_err); -@@ -14980,7 +14981,7 @@ qemuDomainBlockPivot(virConnectPtr conn, - oldsrc = disk->src; - disk->src = disk->mirror; - -- if (qemuDomainDetermineDiskChain(driver, vm, disk, false) < 0) -+ if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0) - goto cleanup; - - if (disk->mirror->format && -@@ -15409,7 +15410,7 @@ qemuDomainBlockCopy(virDomainObjPtr vm, - goto endjob; - } - -- if (qemuDomainDetermineDiskChain(driver, vm, disk, false) < 0) -+ if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0) - goto endjob; - - if ((flags & VIR_DOMAIN_BLOCK_REBASE_SHALLOW) && -@@ -15647,7 +15648,7 @@ qemuDomainBlockCommit(virDomainPtr dom, - disk->dst); - goto endjob; - } -- if (qemuDomainDetermineDiskChain(driver, vm, disk, false) < 0) -+ if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0) - goto endjob; - - if (!top) -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index a364c52..33e2dff 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -779,7 +779,7 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn, - if (qemuSetUnprivSGIO(dev) < 0) - goto end; - -- if (qemuDomainDetermineDiskChain(driver, vm, disk, false) < 0) -+ if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0) - goto end; - - switch (disk->device) { -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 5c3b3c8..9294619 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -1089,7 +1089,8 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - save = disk->mirrorState != VIR_DOMAIN_DISK_MIRROR_STATE_NONE; - disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; - disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -- qemuDomainDetermineDiskChain(driver, vm, disk, true); -+ ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, -+ true, true)); - } else if (disk->mirror && - (type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY || - type == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT)) { -@@ -3428,9 +3429,12 @@ qemuProcessReconnect(void *opaque) - if (virStorageTranslateDiskSourcePool(conn, obj->def->disks[i]) < 0) - goto error; - -- /* XXX we should be able to restore all data from XML in the future */ -- if (qemuDomainDetermineDiskChain(driver, obj, -- obj->def->disks[i], true) < 0) -+ /* XXX we should be able to restore all data from XML in the future. -+ * This should be the only place that calls qemuDomainDetermineDiskChain -+ * with @report_broken == false to guarantee best-effort domain -+ * reconnect */ -+ if (qemuDomainDetermineDiskChain(driver, obj, obj->def->disks[i], -+ true, false) < 0) - goto error; - - dev.type = VIR_DOMAIN_DEVICE_DISK; --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-Report-error-if-per-VM-directory-cannot-be-created.patch b/SOURCES/libvirt-qemu-Report-error-if-per-VM-directory-cannot-be-created.patch new file mode 100644 index 0000000..0829311 --- /dev/null +++ b/SOURCES/libvirt-qemu-Report-error-if-per-VM-directory-cannot-be-created.patch @@ -0,0 +1,63 @@ +From 573518f61bbdffc5ee7fb4f55a145f19e7edc65f Mon Sep 17 00:00:00 2001 +Message-Id: <573518f61bbdffc5ee7fb4f55a145f19e7edc65f@dist-git> +From: Martin Kletzander +Date: Mon, 14 Sep 2015 10:15:25 +0200 +Subject: [PATCH] qemu: Report error if per-VM directory cannot be created + +Commit f1f68ca33433 did not report an error if virFileMakePath() +returned -1. Well, who would've guessed function with name starting +with 'vir' sets an errno instead of reporting an error the libvirt way. +Anyway, let's fix it, so the output changes from: + + $ virsh start arm + error: Failed to start domain arm + error: An error occurred, but the cause is unknown + +to: + + $ virsh start arm + error: Failed to start domain arm + error: Cannot create directory '/var/lib/libvirt/qemu/domain-arm': Not + a directory + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146886 + +Signed-off-by: Martin Kletzander +(cherry picked from commit 8370023730220fcf48f9b1fa0914b60c66452569) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_process.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 317ef78..d5b0fc0 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -4737,8 +4737,10 @@ int qemuProcessStart(virConnectPtr conn, + if (virAsprintf(&tmppath, "%s/domain-%s", cfg->libDir, vm->def->name) < 0) + goto cleanup; + +- if (virFileMakePath(tmppath) < 0) ++ if (virFileMakePath(tmppath) < 0) { ++ virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath); + goto cleanup; ++ } + + if (virSecurityManagerDomainSetDirLabel(driver->securityManager, + vm->def, tmppath) < 0) +@@ -4750,8 +4752,10 @@ int qemuProcessStart(virConnectPtr conn, + cfg->channelTargetDir, vm->def->name) < 0) + goto cleanup; + +- if (virFileMakePath(tmppath) < 0) ++ if (virFileMakePath(tmppath) < 0) { ++ virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath); + goto cleanup; ++ } + + if (virSecurityManagerDomainSetDirLabel(driver->securityManager, + vm->def, tmppath) < 0) +-- +2.5.2 + diff --git a/SOURCES/libvirt-qemu-Resolve-Coverity-FORWARD_NULL.patch b/SOURCES/libvirt-qemu-Resolve-Coverity-FORWARD_NULL.patch deleted file mode 100644 index c834ed3..0000000 --- a/SOURCES/libvirt-qemu-Resolve-Coverity-FORWARD_NULL.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 5f74be7990f83f8a8d3fe71c440c4d0e3dbc4d27 Mon Sep 17 00:00:00 2001 -Message-Id: <5f74be7990f83f8a8d3fe71c440c4d0e3dbc4d27@dist-git> -From: John Ferlan -Date: Mon, 15 Sep 2014 15:13:50 -0400 -Subject: [PATCH] qemu: Resolve Coverity FORWARD_NULL - -https://bugzilla.redhat.com/show_bug.cgi?id=1141209 - -If we jump to cleanup before allocating the 'result', then the call -to virBlkioDeviceArrayClear will deref result causing a problem. - -Signed-off-by: John Ferlan -(cherry picked from commit f28a31fcc42ec82fc60e409afd7d2f2220ae9d2d) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 04384fb..3c7f2ba 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -7688,8 +7688,10 @@ qemuDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - _("unable to parse blkio device '%s' '%s'"), - type, blkioDeviceStr); - cleanup: -- virBlkioDeviceArrayClear(result, ndevices); -- VIR_FREE(result); -+ if (result) { -+ virBlkioDeviceArrayClear(result, ndevices); -+ VIR_FREE(result); -+ } - return -1; - } - --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Resolve-Coverity-FORWARD_NULL_1.patch b/SOURCES/libvirt-qemu-Resolve-Coverity-FORWARD_NULL_1.patch deleted file mode 100644 index 1ee2a6d..0000000 --- a/SOURCES/libvirt-qemu-Resolve-Coverity-FORWARD_NULL_1.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 6bf8ed4ba21ebc1bb9f2a1619925cf6b1a95db36 Mon Sep 17 00:00:00 2001 -Message-Id: <6bf8ed4ba21ebc1bb9f2a1619925cf6b1a95db36@dist-git> -From: John Ferlan -Date: Mon, 15 Sep 2014 15:13:51 -0400 -Subject: [PATCH] qemu: Resolve Coverity FORWARD_NULL - -https://bugzilla.redhat.com/show_bug.cgi?id=1141209 - -If the qemuMigrationEatCookie() fails to set mig, we jump to cleanup: -which will call qemuMigrationCancelDriveMirror() without first checking -if mig == NULL - -Signed-off-by: John Ferlan -(cherry picked from commit e5baef83e131c75bda00bed59b7b2494675b4451) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 3934566..858794d 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -3614,7 +3614,8 @@ qemuMigrationRun(virQEMUDriverPtr driver, - orig_err = virSaveLastError(); - - /* cancel any outstanding NBD jobs */ -- qemuMigrationCancelDriveMirror(mig, driver, vm); -+ if (mig) -+ qemuMigrationCancelDriveMirror(mig, driver, vm); - - if (spec->fwdType != MIGRATION_FWD_DIRECT) { - if (iothread && qemuMigrationStopTunnel(iothread, ret < 0) < 0) --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Resolve-Coverity-NEGATIVE_RETURNS.patch b/SOURCES/libvirt-qemu-Resolve-Coverity-NEGATIVE_RETURNS.patch deleted file mode 100644 index 9585396..0000000 --- a/SOURCES/libvirt-qemu-Resolve-Coverity-NEGATIVE_RETURNS.patch +++ /dev/null @@ -1,34 +0,0 @@ -From b2e717c6c3c9463ee6ce727edf941a2d2ac7317f Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Mon, 15 Sep 2014 15:13:53 -0400 -Subject: [PATCH] qemu: Resolve Coverity NEGATIVE_RETURNS - -https://bugzilla.redhat.com/show_bug.cgi?id=1141209 - -Coverity notes that if qemuMonitorGetMachines() returns a negative -nmachines value, then the code at the cleanup label will have issues. - -Signed-off-by: John Ferlan -(cherry picked from commit b74a3fb307f5e3743bba846956bddab1002b55c9) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index c70a1a8..4e7c435 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -2285,7 +2285,7 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps, - size_t defIdx = 0; - - if ((nmachines = qemuMonitorGetMachines(mon, &machines)) < 0) -- goto cleanup; -+ return -1; - - if (VIR_ALLOC_N(qemuCaps->machineTypes, nmachines) < 0) - goto cleanup; --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Resolve-Coverity-NEGATIVE_RETURNS_1.patch b/SOURCES/libvirt-qemu-Resolve-Coverity-NEGATIVE_RETURNS_1.patch deleted file mode 100644 index 379416e..0000000 --- a/SOURCES/libvirt-qemu-Resolve-Coverity-NEGATIVE_RETURNS_1.patch +++ /dev/null @@ -1,41 +0,0 @@ -From cc6d53dc895fdf19ffe65d35b9dc2b802edbf2de Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Mon, 15 Sep 2014 15:13:54 -0400 -Subject: [PATCH] qemu: Resolve Coverity NEGATIVE_RETURNS - -https://bugzilla.redhat.com/show_bug.cgi?id=1141209 - -Coverity notes that if the virConnectListAllDomains returns a negative -value then the loop at the cleanup label that ends on numDomains will -have issues. - -Signed-off-by: John Ferlan -(cherry picked from commit 81a8fc34ad79386deb774f1e234797ae3641584c) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 3c7f2ba..a2b9901 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -1004,9 +1004,11 @@ qemuStateStop(void) - ret = -1; - - cleanup: -- for (i = 0; i < numDomains; i++) -- virDomainFree(domains[i]); -- VIR_FREE(domains); -+ if (domains) { -+ for (i = 0; i < numDomains; i++) -+ virDomainFree(domains[i]); -+ VIR_FREE(domains); -+ } - VIR_FREE(flags); - virObjectUnref(conn); - virObjectUnref(cfg); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Resolve-Coverity-REVERSE_INULL.patch b/SOURCES/libvirt-qemu-Resolve-Coverity-REVERSE_INULL.patch deleted file mode 100644 index 5b8fb50..0000000 --- a/SOURCES/libvirt-qemu-Resolve-Coverity-REVERSE_INULL.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 3ef826f1134ed311956c9b3d75e844565aea6578 Mon Sep 17 00:00:00 2001 -Message-Id: <3ef826f1134ed311956c9b3d75e844565aea6578@dist-git> -From: John Ferlan -Date: Sat, 13 Dec 2014 10:10:00 +0100 -Subject: [PATCH] qemu: Resolve Coverity REVERSE_INULL - -https://bugzilla.redhat.com/show_bug.cgi?id=1172570 - -Coverity complains that checking for !domlist after setting doms = domlist -and making a deref of doms just above - -It seems the call in question was intended to me made in the case that -'doms' was passed in and not when the virDomainObjListExport() call -allocated domlist and already called virConnectGetAllDomainStatsCheckACL(). - -Thus rather than check for !domlist - check that "doms != domlist" in -order to avoid the Coverity message. - -Signed-off-by: John Ferlan -(cherry picked from commit 9f845b1115f0b5be1554893f1b9ca2d5a3b8c7cd) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index fe5fe88..adf158a 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -18256,7 +18256,7 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, - if (!(dom = qemuDomObjFromDomain(doms[i]))) - continue; - -- if (!domlist && -+ if (doms != domlist && - !virConnectGetAllDomainStatsCheckACL(conn, dom->def)) - continue; - --- -2.2.0 - diff --git a/SOURCES/libvirt-qemu-Sanitize-argument-names-and-empty-disk-check-in-qemuDomainDetermineDiskChain.patch b/SOURCES/libvirt-qemu-Sanitize-argument-names-and-empty-disk-check-in-qemuDomainDetermineDiskChain.patch deleted file mode 100644 index 4253c78..0000000 --- a/SOURCES/libvirt-qemu-Sanitize-argument-names-and-empty-disk-check-in-qemuDomainDetermineDiskChain.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 44b0bb2f62a67823d30ec5ae2b3b77883fed5bdc Mon Sep 17 00:00:00 2001 -Message-Id: <44b0bb2f62a67823d30ec5ae2b3b77883fed5bdc@dist-git> -From: Peter Krempa -Date: Wed, 24 Sep 2014 11:01:28 +0200 -Subject: [PATCH] qemu: Sanitize argument names and empty disk check in - qemuDomainDetermineDiskChain - -https://bugzilla.redhat.com/show_bug.cgi?id=1138231 - -Reuse virStorageSourceIsEmpty and rename "force" argument to -"force_probe". - -(cherry picked from commit 172ca0e748714799bc0abec1144d7896e681728b) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 8 +++----- - src/qemu/qemu_domain.h | 2 +- - 2 files changed, 4 insertions(+), 6 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index e471af5..3766ceb 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -2711,20 +2711,18 @@ int - qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, -- bool force) -+ bool force_probe) - { - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - int ret = 0; - uid_t uid; - gid_t gid; -- int type = virStorageSourceGetActualType(disk->src); - -- if (type != VIR_STORAGE_TYPE_NETWORK && -- !disk->src->path) -+ if (virStorageSourceIsEmpty(disk->src)) - goto cleanup; - - if (disk->src->backingStore) { -- if (force) -+ if (force_probe) - virStorageSourceBackingStoreClear(disk->src); - else - goto cleanup; -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index d21acd7..c1d1edf 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -370,7 +370,7 @@ int qemuDomainCheckDiskPresence(virQEMUDriverPtr driver, - int qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, -- bool force); -+ bool force_probe); - - int qemuDomainStorageFileInit(virQEMUDriverPtr driver, - virDomainObjPtr vm, --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-Save-numad-advice-into-qemuDomainObjPrivate.patch b/SOURCES/libvirt-qemu-Save-numad-advice-into-qemuDomainObjPrivate.patch deleted file mode 100644 index d75543b..0000000 --- a/SOURCES/libvirt-qemu-Save-numad-advice-into-qemuDomainObjPrivate.patch +++ /dev/null @@ -1,264 +0,0 @@ -From 86d3bdb4d60def4336ac23f62d4ef3fcf49956bf Mon Sep 17 00:00:00 2001 -Message-Id: <86d3bdb4d60def4336ac23f62d4ef3fcf49956bf@dist-git> -From: Martin Kletzander -Date: Thu, 15 Jan 2015 15:03:47 +0100 -Subject: [PATCH] qemu: Save numad advice into qemuDomainObjPrivate - -https://bugzilla.redhat.com/show_bug.cgi?id=1161540 - -Thanks to that we don't need to drag the pointer everywhere and future -code will get cleaner. - -Signed-off-by: Martin Kletzander -(cherry picked from commit c74d58ad4770cb2e2060f81ce32bc78c8ed31e5a) -Signed-off-by: Martin Kletzander - -Conflicts: - src/qemu/qemu_cgroup.h -- 4882618e - src/qemu/qemu_process.c -- c63ef045 - -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_cgroup.c | 18 +++++++----------- - src/qemu/qemu_cgroup.h | 9 +++------ - src/qemu/qemu_domain.c | 1 + - src/qemu/qemu_domain.h | 1 + - src/qemu/qemu_process.c | 21 ++++++++++----------- - 5 files changed, 22 insertions(+), 28 deletions(-) - -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index ac12f43..fa94037 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -608,8 +608,7 @@ qemuSetupDevicesCgroup(virQEMUDriverPtr driver, - - - int --qemuSetupCpusetMems(virDomainObjPtr vm, -- virBitmapPtr nodemask) -+qemuSetupCpusetMems(virDomainObjPtr vm) - { - virCgroupPtr cgroup_temp = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; -@@ -620,7 +619,7 @@ qemuSetupCpusetMems(virDomainObjPtr vm, - return 0; - - if (virDomainNumatuneMaybeFormatNodeset(vm->def->numatune, -- nodemask, -+ priv->autoNodeset, - &mem_mask, -1) < 0) - goto cleanup; - -@@ -640,7 +639,6 @@ qemuSetupCpusetMems(virDomainObjPtr vm, - - static int - qemuSetupCpusetCgroup(virDomainObjPtr vm, -- virBitmapPtr nodemask, - virCapsPtr caps) - { - qemuDomainObjPrivatePtr priv = vm->privateData; -@@ -655,7 +653,7 @@ qemuSetupCpusetCgroup(virDomainObjPtr vm, - - if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) { - virBitmapPtr cpumap; -- if (!(cpumap = virCapabilitiesGetCpusForNodemask(caps, nodemask))) -+ if (!(cpumap = virCapabilitiesGetCpusForNodemask(caps, priv->autoNodeset))) - goto cleanup; - cpu_mask = virBitmapFormat(cpumap); - virBitmapFree(cpumap); -@@ -819,8 +817,7 @@ qemuConnectCgroup(virQEMUDriverPtr driver, - - int - qemuSetupCgroup(virQEMUDriverPtr driver, -- virDomainObjPtr vm, -- virBitmapPtr nodemask) -+ virDomainObjPtr vm) - { - qemuDomainObjPrivatePtr priv = vm->privateData; - virCapsPtr caps = NULL; -@@ -853,7 +850,7 @@ qemuSetupCgroup(virQEMUDriverPtr driver, - if (qemuSetupCpuCgroup(driver, vm) < 0) - goto cleanup; - -- if (qemuSetupCpusetCgroup(vm, nodemask, caps) < 0) -+ if (qemuSetupCpusetCgroup(vm, caps) < 0) - goto cleanup; - - ret = 0; -@@ -1040,8 +1037,7 @@ qemuSetupCgroupForVcpu(virDomainObjPtr vm) - - int - qemuSetupCgroupForEmulator(virQEMUDriverPtr driver, -- virDomainObjPtr vm, -- virBitmapPtr nodemask) -+ virDomainObjPtr vm) - { - virBitmapPtr cpumask = NULL; - virBitmapPtr cpumap = NULL; -@@ -1077,7 +1073,7 @@ qemuSetupCgroupForEmulator(virQEMUDriverPtr driver, - goto cleanup; - - if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) { -- if (!(cpumap = qemuPrepareCpumap(driver, nodemask))) -+ if (!(cpumap = qemuPrepareCpumap(driver, priv->autoNodeset))) - goto cleanup; - cpumask = cpumap; - } else if (def->cputune.emulatorpin) { -diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h -index 2ae16df..8d9de3c 100644 ---- a/src/qemu/qemu_cgroup.h -+++ b/src/qemu/qemu_cgroup.h -@@ -45,10 +45,8 @@ int qemuTeardownHostdevCgroup(virDomainObjPtr vm, - int qemuConnectCgroup(virQEMUDriverPtr driver, - virDomainObjPtr vm); - int qemuSetupCgroup(virQEMUDriverPtr driver, -- virDomainObjPtr vm, -- virBitmapPtr nodemask); --int qemuSetupCpusetMems(virDomainObjPtr vm, -- virBitmapPtr nodemask); -+ virDomainObjPtr vm); -+int qemuSetupCpusetMems(virDomainObjPtr vm); - int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, - unsigned long long period, - long long quota); -@@ -64,8 +62,7 @@ int qemuSetupCgroupIOThreadsPin(virCgroupPtr cgroup, - int qemuSetupCgroupForVcpu(virDomainObjPtr vm); - int qemuSetupCgroupForIOThreads(virDomainObjPtr vm); - int qemuSetupCgroupForEmulator(virQEMUDriverPtr driver, -- virDomainObjPtr vm, -- virBitmapPtr nodemask); -+ virDomainObjPtr vm); - int qemuRemoveCgroup(virDomainObjPtr vm); - int qemuAddToCgroup(virDomainObjPtr vm); - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 0cfc603..03ca663 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -461,6 +461,7 @@ qemuDomainObjPrivateFree(void *data) - qemuAgentClose(priv->agent); - } - VIR_FREE(priv->cleanupCallbacks); -+ virBitmapFree(priv->autoNodeset); - VIR_FREE(priv); - } - -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 9c94a65..53501f9 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -187,6 +187,7 @@ struct _qemuDomainObjPrivate { - char **qemuDevices; /* NULL-terminated list of devices aliases known to QEMU */ - - bool hookRun; /* true if there was a hook run over this domain */ -+ virBitmapPtr autoNodeset; - }; - - typedef enum { -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index c055eb7..90e45a8 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2373,12 +2373,12 @@ qemuPrepareCpumap(virQEMUDriverPtr driver, - */ - static int - qemuProcessInitCpuAffinity(virQEMUDriverPtr driver, -- virDomainObjPtr vm, -- virBitmapPtr nodemask) -+ virDomainObjPtr vm) - { - int ret = -1; - virBitmapPtr cpumap = NULL; - virBitmapPtr cpumapToSet = NULL; -+ qemuDomainObjPrivatePtr priv = vm->privateData; - - if (!vm->pid) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -2386,7 +2386,7 @@ qemuProcessInitCpuAffinity(virQEMUDriverPtr driver, - return -1; - } - -- if (!(cpumap = qemuPrepareCpumap(driver, nodemask))) -+ if (!(cpumap = qemuPrepareCpumap(driver, priv->autoNodeset))) - return -1; - - if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) { -@@ -3115,13 +3115,13 @@ struct qemuProcessHookData { - virConnectPtr conn; - virDomainObjPtr vm; - virQEMUDriverPtr driver; -- virBitmapPtr nodemask; - virQEMUDriverConfigPtr cfg; - }; - - static int qemuProcessHook(void *data) - { - struct qemuProcessHookData *h = data; -+ qemuDomainObjPrivatePtr priv = h->vm->privateData; - int ret = -1; - int fd; - /* This method cannot use any mutexes, which are not -@@ -3153,7 +3153,7 @@ static int qemuProcessHook(void *data) - if (virSecurityManagerClearSocketLabel(h->driver->securityManager, h->vm->def) < 0) - goto cleanup; - -- if (virNumaSetupMemoryPolicy(h->vm->def->numatune, h->nodemask) < 0) -+ if (virNumaSetupMemoryPolicy(h->vm->def->numatune, priv->autoNodeset) < 0) - goto cleanup; - - ret = 0; -@@ -4511,7 +4511,7 @@ int qemuProcessStart(virConnectPtr conn, - if (virBitmapParse(nodeset, 0, &nodemask, VIR_DOMAIN_CPUMASK_LEN) < 0) - goto cleanup; - } -- hookData.nodemask = nodemask; -+ priv->autoNodeset = nodemask; - - /* "volume" type disk's source must be translated before - * cgroup and security setting. -@@ -4715,13 +4715,13 @@ int qemuProcessStart(virConnectPtr conn, - } - - VIR_DEBUG("Setting up domain cgroup (if required)"); -- if (qemuSetupCgroup(driver, vm, nodemask) < 0) -+ if (qemuSetupCgroup(driver, vm) < 0) - goto cleanup; - - /* This must be done after cgroup placement to avoid resetting CPU - * affinity */ - if (!vm->def->cputune.emulatorpin && -- qemuProcessInitCpuAffinity(driver, vm, nodemask) < 0) -+ qemuProcessInitCpuAffinity(driver, vm) < 0) - goto cleanup; - - VIR_DEBUG("Setting domain security labels"); -@@ -4769,7 +4769,7 @@ int qemuProcessStart(virConnectPtr conn, - goto cleanup; - - VIR_DEBUG("Setting cgroup for emulator (if required)"); -- if (qemuSetupCgroupForEmulator(driver, vm, nodemask) < 0) -+ if (qemuSetupCgroupForEmulator(driver, vm) < 0) - goto cleanup; - - VIR_DEBUG("Setting affinity of emulator threads"); -@@ -4796,7 +4796,7 @@ int qemuProcessStart(virConnectPtr conn, - goto cleanup; - - VIR_DEBUG("Setting up post-init cgroup restrictions"); -- if (qemuSetupCpusetMems(vm, nodemask) < 0) -+ if (qemuSetupCpusetMems(vm) < 0) - goto cleanup; - - VIR_DEBUG("Detecting VCPU PIDs"); -@@ -4938,7 +4938,6 @@ int qemuProcessStart(virConnectPtr conn, - * if we failed to initialize the now running VM. kill it off and - * pretend we never started it */ - VIR_FREE(nodeset); -- virBitmapFree(nodemask); - virCommandFree(cmd); - VIR_FORCE_CLOSE(logfile); - if (priv->mon) --- -2.2.1 - diff --git a/SOURCES/libvirt-qemu-Silence-coverity-on-optional-migration-stats.patch b/SOURCES/libvirt-qemu-Silence-coverity-on-optional-migration-stats.patch deleted file mode 100644 index 20a6cca..0000000 --- a/SOURCES/libvirt-qemu-Silence-coverity-on-optional-migration-stats.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 40e7bc4ad1d7552a83bd9d8c19ee8fe650779b03 Mon Sep 17 00:00:00 2001 -Message-Id: <40e7bc4ad1d7552a83bd9d8c19ee8fe650779b03@dist-git> -From: Jiri Denemark -Date: Tue, 9 Sep 2014 10:17:46 +0200 -Subject: [PATCH] qemu: Silence coverity on optional migration stats - -Signed-off-by: Jiri Denemark -(cherry picked from commit 1ffff046ac7eef04f7591bbc73da7db8076d4a5f) - -https://bugzilla.redhat.com/show_bug.cgi?id=1063724 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor_json.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 2ae8ee0..106d807 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -2463,7 +2463,8 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply, - return -1; - } - -- virJSONValueObjectGetNumberUlong(ret, "total-time", &status->total_time); -+ ignore_value(virJSONValueObjectGetNumberUlong(ret, "total-time", -+ &status->total_time)); - if (status->status == QEMU_MONITOR_MIGRATION_STATUS_COMPLETED) { - rc = virJSONValueObjectGetNumberUlong(ret, "downtime", - &status->downtime); -@@ -2508,9 +2509,10 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply, - if (virJSONValueObjectGetNumberUlong(ram, "duplicate", - &status->ram_duplicate) == 0) - status->ram_duplicate_set = true; -- virJSONValueObjectGetNumberUlong(ram, "normal", &status->ram_normal); -- virJSONValueObjectGetNumberUlong(ram, "normal-bytes", -- &status->ram_normal_bytes); -+ ignore_value(virJSONValueObjectGetNumberUlong(ram, "normal", -+ &status->ram_normal)); -+ ignore_value(virJSONValueObjectGetNumberUlong(ram, "normal-bytes", -+ &status->ram_normal_bytes)); - - virJSONValuePtr disk = virJSONValueObjectGet(ret, "disk"); - if (disk) { --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Support-OVMF-on-armv7l-aarch64-guests.patch b/SOURCES/libvirt-qemu-Support-OVMF-on-armv7l-aarch64-guests.patch deleted file mode 100644 index 22189d6..0000000 --- a/SOURCES/libvirt-qemu-Support-OVMF-on-armv7l-aarch64-guests.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 38f1448f240c338003f595bd4cd99e47d0ab2501 Mon Sep 17 00:00:00 2001 -Message-Id: <38f1448f240c338003f595bd4cd99e47d0ab2501@dist-git> -From: Michal Privoznik -Date: Wed, 19 Nov 2014 18:59:14 +0100 -Subject: [PATCH] qemu: Support OVMF on armv7l aarch64 guests - -https://bugzilla.redhat.com/show_bug.cgi?id=1165782 - -Currently, we are whitelisting architectures, that we know how to run -OVMF on. So far, only x86_64 was enabled. However, looking at qemu -code, the same commandline can be used to enable OVMF for armv7l and -aarch64. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 6d8054b68407a3385b33c867a425ad8278b0b8f0) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 6c4a8b5..2b8eae0 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -7643,7 +7643,9 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd, - - case VIR_DOMAIN_LOADER_TYPE_PFLASH: - /* UEFI is supported only for x86_64 currently */ -- if (def->os.arch != VIR_ARCH_X86_64) { -+ if (def->os.arch != VIR_ARCH_X86_64 && -+ def->os.arch != VIR_ARCH_ARMV7L && -+ def->os.arch != VIR_ARCH_AARCH64) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("pflash is not supported for %s guest architecture"), - virArchToString(def->os.arch)); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Sync-BlkioDevice-values-when-setting-them-in-cgroups.patch b/SOURCES/libvirt-qemu-Sync-BlkioDevice-values-when-setting-them-in-cgroups.patch new file mode 100644 index 0000000..7d98526 --- /dev/null +++ b/SOURCES/libvirt-qemu-Sync-BlkioDevice-values-when-setting-them-in-cgroups.patch @@ -0,0 +1,137 @@ +From fa7357fcc523ba9e2f40ee80c769060f5772eacb Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Tue, 18 Aug 2015 17:28:02 -0700 +Subject: [PATCH] qemu: Sync BlkioDevice values when setting them in cgroups + +The problem here is that there are some values that kernel accepts, but +does not set them, for example 18446744073709551615 which acts the same +way as zero. Let's do the same thing we do with other tuning options +and re-read them right after they are set in order to keep our internal +structures up-to-date. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1165580 + +Signed-off-by: Martin Kletzander +(cherry picked from commit 7b5acf9461d3917cac12688fae9fbe5f67bf788b) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_cgroup.c | 20 +++++++++++++++----- + src/qemu/qemu_driver.c | 25 ++++++++++++++++++++----- + 2 files changed, 35 insertions(+), 10 deletions(-) + +diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c +index e1a2827..0da6c02 100644 +--- a/src/qemu/qemu_cgroup.c ++++ b/src/qemu/qemu_cgroup.c +@@ -436,27 +436,37 @@ qemuSetupBlkioCgroup(virDomainObjPtr vm) + virBlkioDevicePtr dev = &vm->def->blkio.devices[i]; + if (dev->weight && + (virCgroupSetBlkioDeviceWeight(priv->cgroup, dev->path, +- dev->weight) < 0)) ++ dev->weight) < 0 || ++ virCgroupGetBlkioDeviceWeight(priv->cgroup, dev->path, ++ &dev->weight) < 0)) + return -1; + + if (dev->riops && + (virCgroupSetBlkioDeviceReadIops(priv->cgroup, dev->path, +- dev->riops) < 0)) ++ dev->riops) < 0 || ++ virCgroupGetBlkioDeviceReadIops(priv->cgroup, dev->path, ++ &dev->riops) < 0)) + return -1; + + if (dev->wiops && + (virCgroupSetBlkioDeviceWriteIops(priv->cgroup, dev->path, +- dev->wiops) < 0)) ++ dev->wiops) < 0 || ++ virCgroupGetBlkioDeviceWriteIops(priv->cgroup, dev->path, ++ &dev->wiops) < 0)) + return -1; + + if (dev->rbps && + (virCgroupSetBlkioDeviceReadBps(priv->cgroup, dev->path, +- dev->rbps) < 0)) ++ dev->rbps) < 0 || ++ virCgroupGetBlkioDeviceReadBps(priv->cgroup, dev->path, ++ &dev->rbps) < 0)) + return -1; + + if (dev->wbps && + (virCgroupSetBlkioDeviceWriteBps(priv->cgroup, dev->path, +- dev->wbps) < 0)) ++ dev->wbps) < 0 || ++ virCgroupGetBlkioDeviceWriteBps(priv->cgroup, dev->path, ++ &dev->wbps) < 0)) + return -1; + } + } +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index e1ceb98..e85506e 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -9286,7 +9286,10 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, + for (j = 0; j < ndevices; j++) { + if (virCgroupSetBlkioDeviceWeight(priv->cgroup, + devices[j].path, +- devices[j].weight) < 0) { ++ devices[j].weight) < 0 || ++ virCgroupGetBlkioDeviceWeight(priv->cgroup, ++ devices[j].path, ++ &devices[j].weight) < 0) { + ret = -1; + break; + } +@@ -9295,7 +9298,10 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, + for (j = 0; j < ndevices; j++) { + if (virCgroupSetBlkioDeviceReadIops(priv->cgroup, + devices[j].path, +- devices[j].riops) < 0) { ++ devices[j].riops) < 0 || ++ virCgroupGetBlkioDeviceReadIops(priv->cgroup, ++ devices[j].path, ++ &devices[j].riops) < 0) { + ret = -1; + break; + } +@@ -9304,7 +9310,10 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, + for (j = 0; j < ndevices; j++) { + if (virCgroupSetBlkioDeviceWriteIops(priv->cgroup, + devices[j].path, +- devices[j].wiops) < 0) { ++ devices[j].wiops) < 0 || ++ virCgroupGetBlkioDeviceWriteIops(priv->cgroup, ++ devices[j].path, ++ &devices[j].wiops) < 0) { + ret = -1; + break; + } +@@ -9313,7 +9322,10 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, + for (j = 0; j < ndevices; j++) { + if (virCgroupSetBlkioDeviceReadBps(priv->cgroup, + devices[j].path, +- devices[j].rbps) < 0) { ++ devices[j].rbps) < 0 || ++ virCgroupGetBlkioDeviceReadBps(priv->cgroup, ++ devices[j].path, ++ &devices[j].rbps) < 0) { + ret = -1; + break; + } +@@ -9322,7 +9334,10 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, + for (j = 0; j < ndevices; j++) { + if (virCgroupSetBlkioDeviceWriteBps(priv->cgroup, + devices[j].path, +- devices[j].wbps) < 0) { ++ devices[j].wbps) < 0 || ++ virCgroupGetBlkioDeviceWriteBps(priv->cgroup, ++ devices[j].path, ++ &devices[j].wbps) < 0) { + ret = -1; + break; + } +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-Transfer-migration-statistics-to-destination.patch b/SOURCES/libvirt-qemu-Transfer-migration-statistics-to-destination.patch deleted file mode 100644 index 0cac564..0000000 --- a/SOURCES/libvirt-qemu-Transfer-migration-statistics-to-destination.patch +++ /dev/null @@ -1,310 +0,0 @@ -From b03557531795877c47dd9b0aaa6f4fb0c154c87a Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Thu, 28 Aug 2014 14:06:10 +0200 -Subject: [PATCH] qemu: Transfer migration statistics to destination - -When migrating a transient domain or with VIR_MIGRATE_UNDEFINE_SOURCE -flag, the domain may disappear from source host. And so will migration -statistics associated with the domain. We need to transfer the -statistics at the end of a migration so that they can be queried at the -destination host. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 5d6fb96338bb8fcb687e22afda2cd7db16b01165) - -https://bugzilla.redhat.com/show_bug.cgi?id=1063724 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 190 +++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 187 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index ba3ca66..9b1e94b 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -80,6 +80,7 @@ enum qemuMigrationCookieFlags { - QEMU_MIGRATION_COOKIE_FLAG_PERSISTENT, - QEMU_MIGRATION_COOKIE_FLAG_NETWORK, - QEMU_MIGRATION_COOKIE_FLAG_NBD, -+ QEMU_MIGRATION_COOKIE_FLAG_STATS, - - QEMU_MIGRATION_COOKIE_FLAG_LAST - }; -@@ -91,7 +92,8 @@ VIR_ENUM_IMPL(qemuMigrationCookieFlag, - "lockstate", - "persistent", - "network", -- "nbd"); -+ "nbd", -+ "statistics"); - - enum qemuMigrationCookieFeatures { - QEMU_MIGRATION_COOKIE_GRAPHICS = (1 << QEMU_MIGRATION_COOKIE_FLAG_GRAPHICS), -@@ -99,6 +101,7 @@ enum qemuMigrationCookieFeatures { - QEMU_MIGRATION_COOKIE_PERSISTENT = (1 << QEMU_MIGRATION_COOKIE_FLAG_PERSISTENT), - QEMU_MIGRATION_COOKIE_NETWORK = (1 << QEMU_MIGRATION_COOKIE_FLAG_NETWORK), - QEMU_MIGRATION_COOKIE_NBD = (1 << QEMU_MIGRATION_COOKIE_FLAG_NBD), -+ QEMU_MIGRATION_COOKIE_STATS = (1 << QEMU_MIGRATION_COOKIE_FLAG_STATS), - }; - - typedef struct _qemuMigrationCookieGraphics qemuMigrationCookieGraphics; -@@ -169,6 +172,9 @@ struct _qemuMigrationCookie { - - /* If (flags & QEMU_MIGRATION_COOKIE_NBD) */ - qemuMigrationCookieNBDPtr nbd; -+ -+ /* If (flags & QEMU_MIGRATION_COOKIE_STATS) */ -+ qemuDomainJobInfoPtr jobInfo; - }; - - static void qemuMigrationCookieGraphicsFree(qemuMigrationCookieGraphicsPtr grap) -@@ -533,6 +539,25 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig, - } - - -+static int -+qemuMigrationCookieAddStatistics(qemuMigrationCookiePtr mig, -+ virDomainObjPtr vm) -+{ -+ qemuDomainObjPrivatePtr priv = vm->privateData; -+ -+ if (!priv->job.completed) -+ return 0; -+ -+ if (!mig->jobInfo && VIR_ALLOC(mig->jobInfo) < 0) -+ return -1; -+ -+ *mig->jobInfo = *priv->job.completed; -+ mig->flags |= QEMU_MIGRATION_COOKIE_STATS; -+ -+ return 0; -+} -+ -+ - static void qemuMigrationCookieGraphicsXMLFormat(virBufferPtr buf, - qemuMigrationCookieGraphicsPtr grap) - { -@@ -589,6 +614,81 @@ qemuMigrationCookieNetworkXMLFormat(virBufferPtr buf, - } - - -+static void -+qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf, -+ qemuDomainJobInfoPtr jobInfo) -+{ -+ qemuMonitorMigrationStatus *status = &jobInfo->status; -+ -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_TIME_ELAPSED, -+ jobInfo->timeElapsed); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_TIME_REMAINING, -+ jobInfo->timeRemaining); -+ if (status->downtime_set) -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_DOWNTIME, -+ status->downtime); -+ -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_MEMORY_TOTAL, -+ status->ram_total); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_MEMORY_PROCESSED, -+ status->ram_transferred); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_MEMORY_REMAINING, -+ status->ram_remaining); -+ -+ if (status->ram_duplicate_set) { -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_MEMORY_CONSTANT, -+ status->ram_duplicate); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_MEMORY_NORMAL, -+ status->ram_normal); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES, -+ status->ram_normal_bytes); -+ } -+ -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_DISK_TOTAL, -+ status->disk_total); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_DISK_PROCESSED, -+ status->disk_transferred); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_DISK_REMAINING, -+ status->disk_remaining); -+ -+ if (status->xbzrle_set) { -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_COMPRESSION_CACHE, -+ status->xbzrle_cache_size); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_COMPRESSION_BYTES, -+ status->xbzrle_bytes); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_COMPRESSION_PAGES, -+ status->xbzrle_pages); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES, -+ status->xbzrle_cache_miss); -+ virBufferAsprintf(buf, "<%1$s>%2$llu\n", -+ VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW, -+ status->xbzrle_overflow); -+ } -+ -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+} -+ -+ - static int - qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver, - virBufferPtr buf, -@@ -650,6 +750,9 @@ qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver, - virBufferAddLit(buf, "/>\n"); - } - -+ if (mig->flags & QEMU_MIGRATION_COOKIE_STATS && mig->jobInfo) -+ qemuMigrationCookieStatisticsXMLFormat(buf, mig->jobInfo); -+ - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); - return 0; -@@ -772,6 +875,70 @@ qemuMigrationCookieNetworkXMLParse(xmlXPathContextPtr ctxt) - } - - -+static qemuDomainJobInfoPtr -+qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt) -+{ -+ qemuDomainJobInfoPtr jobInfo = NULL; -+ qemuMonitorMigrationStatus *status; -+ xmlNodePtr save_ctxt = ctxt->node; -+ -+ if (!(ctxt->node = virXPathNode("./statistics", ctxt))) -+ goto cleanup; -+ -+ if (VIR_ALLOC(jobInfo) < 0) -+ goto cleanup; -+ -+ status = &jobInfo->status; -+ jobInfo->type = VIR_DOMAIN_JOB_COMPLETED; -+ -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_TIME_ELAPSED "[1])", -+ ctxt, &jobInfo->timeElapsed); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_TIME_REMAINING "[1])", -+ ctxt, &jobInfo->timeRemaining); -+ if (virXPathULongLong("string(./" VIR_DOMAIN_JOB_DOWNTIME "[1])", -+ ctxt, &status->downtime) == 0) -+ status->downtime_set = true; -+ -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_TOTAL "[1])", -+ ctxt, &status->ram_total); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_PROCESSED "[1])", -+ ctxt, &status->ram_transferred); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_REMAINING "[1])", -+ ctxt, &status->ram_remaining); -+ -+ if (virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_CONSTANT "[1])", -+ ctxt, &status->ram_duplicate) == 0) -+ status->ram_duplicate_set = true; -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_NORMAL "[1])", -+ ctxt, &status->ram_normal); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES "[1])", -+ ctxt, &status->ram_normal_bytes); -+ -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_DISK_TOTAL "[1])", -+ ctxt, &status->disk_total); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_DISK_PROCESSED "[1])", -+ ctxt, &status->disk_transferred); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_DISK_REMAINING "[1])", -+ ctxt, &status->disk_remaining); -+ -+ if (virXPathULongLong("string(./" VIR_DOMAIN_JOB_COMPRESSION_CACHE "[1])", -+ ctxt, &status->xbzrle_cache_size) == 0) -+ status->xbzrle_set = true; -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_COMPRESSION_BYTES "[1])", -+ ctxt, &status->xbzrle_bytes); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_COMPRESSION_PAGES "[1])", -+ ctxt, &status->xbzrle_pages); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES "[1])", -+ ctxt, &status->xbzrle_cache_miss); -+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW "[1])", -+ ctxt, &status->xbzrle_overflow); -+ -+ cleanup: -+ ctxt->node = save_ctxt; -+ return jobInfo; -+} -+ -+ - static int - qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, -@@ -947,6 +1114,11 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, - VIR_FREE(port); - } - -+ if (flags & QEMU_MIGRATION_COOKIE_STATS && -+ virXPathBoolean("boolean(./statistics)", ctxt) && -+ (!(mig->jobInfo = qemuMigrationCookieStatisticsXMLParse(ctxt)))) -+ goto error; -+ - virObjectUnref(caps); - return 0; - -@@ -1017,6 +1189,10 @@ qemuMigrationBakeCookie(qemuMigrationCookiePtr mig, - qemuMigrationCookieAddNBD(mig, driver, dom) < 0) - return -1; - -+ if (flags & QEMU_MIGRATION_COOKIE_STATS && -+ qemuMigrationCookieAddStatistics(mig, dom) < 0) -+ return -1; -+ - if (!(*cookieout = qemuMigrationCookieXMLFormatStr(driver, mig))) - return -1; - -@@ -3424,7 +3600,8 @@ qemuMigrationRun(virQEMUDriverPtr driver, - if (priv->job.completed) - qemuDomainJobInfoUpdateTime(priv->job.completed); - -- cookieFlags |= QEMU_MIGRATION_COOKIE_NETWORK; -+ cookieFlags |= QEMU_MIGRATION_COOKIE_NETWORK | -+ QEMU_MIGRATION_COOKIE_STATS; - if (flags & VIR_MIGRATE_PERSIST_DEST) - cookieFlags |= QEMU_MIGRATION_COOKIE_PERSISTENT; - if (ret == 0 && -@@ -4508,8 +4685,10 @@ qemuMigrationFinish(virQEMUDriverPtr driver, - : QEMU_MIGRATION_PHASE_FINISH2); - - qemuDomainCleanupRemove(vm, qemuMigrationPrepareCleanup); -+ VIR_FREE(priv->job.completed); - -- cookie_flags = QEMU_MIGRATION_COOKIE_NETWORK; -+ cookie_flags = QEMU_MIGRATION_COOKIE_NETWORK | -+ QEMU_MIGRATION_COOKIE_STATS; - if (flags & VIR_MIGRATE_PERSIST_DEST) - cookie_flags |= QEMU_MIGRATION_COOKIE_PERSISTENT; - -@@ -4527,6 +4706,11 @@ qemuMigrationFinish(virQEMUDriverPtr driver, - goto endjob; - } - -+ if (mig->jobInfo) { -+ priv->job.completed = mig->jobInfo; -+ mig->jobInfo = NULL; -+ } -+ - if (!(flags & VIR_MIGRATE_OFFLINE)) { - if (qemuMigrationVPAssociatePortProfiles(vm->def) < 0) { - qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Transfer-recomputed-stats-back-to-source.patch b/SOURCES/libvirt-qemu-Transfer-recomputed-stats-back-to-source.patch deleted file mode 100644 index 48219af..0000000 --- a/SOURCES/libvirt-qemu-Transfer-recomputed-stats-back-to-source.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 39f02fffffa1d7686cedd9ba5fcdce05d312676d Mon Sep 17 00:00:00 2001 -Message-Id: <39f02fffffa1d7686cedd9ba5fcdce05d312676d@dist-git> -From: Jiri Denemark -Date: Thu, 28 Aug 2014 16:39:58 +0200 -Subject: [PATCH] qemu: Transfer recomputed stats back to source - -After the previous commit, migration statistics on the source and -destination hosts are not equal because the destination updated time -statistics. Let's send the result back so that the same data can be -queried on both sides of the migration. - -Signed-off-by: Jiri Denemark -(cherry picked from commit a1c0180d0eba1f29a2ff0b970b4dec470fd1c1ed) - -https://bugzilla.redhat.com/show_bug.cgi?id=1063724 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 23 +++++++++++++++++++++-- - 1 file changed, 21 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index c7a41b1..3934566 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -3019,9 +3019,27 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver, - ? QEMU_MIGRATION_PHASE_CONFIRM3 - : QEMU_MIGRATION_PHASE_CONFIRM3_CANCELLED); - -- if (!(mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen, 0))) -+ if (!(mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen, -+ QEMU_MIGRATION_COOKIE_STATS))) - goto cleanup; - -+ /* Update total times with the values sent by the destination daemon */ -+ if (mig->jobInfo) { -+ qemuDomainObjPrivatePtr priv = vm->privateData; -+ if (priv->job.completed) { -+ qemuDomainJobInfoPtr jobInfo = priv->job.completed; -+ if (mig->jobInfo->status.downtime_set) { -+ jobInfo->status.downtime = mig->jobInfo->status.downtime; -+ jobInfo->status.downtime_set = true; -+ } -+ if (mig->jobInfo->timeElapsed) -+ jobInfo->timeElapsed = mig->jobInfo->timeElapsed; -+ } else { -+ priv->job.completed = mig->jobInfo; -+ mig->jobInfo = NULL; -+ } -+ } -+ - if (flags & VIR_MIGRATE_OFFLINE) - goto done; - -@@ -4860,7 +4878,8 @@ qemuMigrationFinish(virQEMUDriverPtr driver, - VIR_DOMAIN_EVENT_STOPPED_FAILED); - } - -- if (qemuMigrationBakeCookie(mig, driver, vm, cookieout, cookieoutlen, 0) < 0) -+ if (qemuMigrationBakeCookie(mig, driver, vm, cookieout, cookieoutlen, -+ QEMU_MIGRATION_COOKIE_STATS) < 0) - VIR_WARN("Unable to encode migration cookie"); - - endjob: --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-Try-several-network-devices-when-looking-for-a-default.patch b/SOURCES/libvirt-qemu-Try-several-network-devices-when-looking-for-a-default.patch new file mode 100644 index 0000000..4dad1e7 --- /dev/null +++ b/SOURCES/libvirt-qemu-Try-several-network-devices-when-looking-for-a-default.patch @@ -0,0 +1,94 @@ +From 37d9c7b752e9bda93e5f15e1ac97dcb614e6b978 Mon Sep 17 00:00:00 2001 +Message-Id: <37d9c7b752e9bda93e5f15e1ac97dcb614e6b978@dist-git> +From: Andrea Bolognani +Date: Fri, 11 Sep 2015 17:00:20 +0200 +Subject: [PATCH] qemu: Try several network devices when looking for a default + +Up until now, the default has been rtl8139, but no check was in +place to make sure that device was actually available. + +Now we try rtl8139, e1000 and virtio-net in turn, checking for +availability before using any of them: this means we have a much +better chance for the guest to be able to boot. + +(cherry picked from commit 75036c69df7a64f97f3716396f34f78de027f38b) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1254044 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 66d8e3a..e4a9c55 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -1174,7 +1174,8 @@ qemuDomainDefPostParse(virDomainDefPtr def, + } + + static const char * +-qemuDomainDefaultNetModel(const virDomainDef *def) ++qemuDomainDefaultNetModel(const virDomainDef *def, ++ virQEMUCapsPtr qemuCaps) + { + if (ARCH_IS_S390(def->os.arch)) + return "virtio"; +@@ -1192,6 +1193,18 @@ qemuDomainDefaultNetModel(const virDomainDef *def) + return "lan9118"; + } + ++ /* Try several network devices in turn; each of these devices is ++ * less likely be supported out-of-the-box by the guest operating ++ * system than the previous one */ ++ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_RTL8139)) ++ return "rtl8139"; ++ else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_E1000)) ++ return "e1000"; ++ else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_NET)) ++ return "virtio"; ++ ++ /* We've had no luck detecting support for any network device, ++ * but we have to return something: might as well be rtl8139 */ + return "rtl8139"; + } + +@@ -1201,18 +1214,24 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque) + { +- int ret = -1; + virQEMUDriverPtr driver = opaque; ++ virQEMUCapsPtr qemuCaps = NULL; + virQEMUDriverConfigPtr cfg = NULL; ++ int ret = -1; + + if (driver) + cfg = virQEMUDriverGetConfig(driver); + ++ /* This condition is actually a (temporary) hack for test suite which ++ * does not create capabilities cache */ ++ if (driver && driver->qemuCapsCache) ++ qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator); ++ + if (dev->type == VIR_DOMAIN_DEVICE_NET && + dev->data.net->type != VIR_DOMAIN_NET_TYPE_HOSTDEV && + !dev->data.net->model) { + if (VIR_STRDUP(dev->data.net->model, +- qemuDomainDefaultNetModel(def)) < 0) ++ qemuDomainDefaultNetModel(def, qemuCaps)) < 0) + goto cleanup; + } + +@@ -1338,6 +1357,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, + ret = 0; + + cleanup: ++ virObjectUnref(qemuCaps); + virObjectUnref(cfg); + return ret; + } +-- +2.5.2 + diff --git a/SOURCES/libvirt-qemu-Update-fsfreeze-status-on-domain-state-transitions.patch b/SOURCES/libvirt-qemu-Update-fsfreeze-status-on-domain-state-transitions.patch deleted file mode 100644 index 1d5cc79..0000000 --- a/SOURCES/libvirt-qemu-Update-fsfreeze-status-on-domain-state-transitions.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 8e7c6d9bb776c793c352d94952079e96aedf9599 Mon Sep 17 00:00:00 2001 -Message-Id: <8e7c6d9bb776c793c352d94952079e96aedf9599@dist-git> -From: Michal Privoznik -Date: Tue, 18 Nov 2014 13:33:38 +0100 -Subject: [PATCH] qemu: Update fsfreeze status on domain state transitions - -https://bugzilla.redhat.com/show_bug.cgi?id=1160084 - -As of b6d4dad1 (1.2.5) libvirt keeps track if domain disks have been -frozen. However, this falls into that set of information which don't -survive domain restart. Therefore, we need to clear the flag upon some -state transitions. Moreover, once we clear the flag we must update the -status file too. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 6ea54769ba1816b382698c4311588d7d1a9cd095) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 10 +++++----- - src/qemu/qemu_process.c | 10 ++++++++++ - 2 files changed, 15 insertions(+), 5 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 6ed830c..ea45d89 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4041,11 +4041,6 @@ processGuestPanicEvent(virQEMUDriverPtr driver, - VIR_WARN("Unable to release lease on %s", vm->def->name); - VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState)); - -- if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) { -- VIR_WARN("Unable to save status on vm %s after state change", -- vm->def->name); -- } -- - switch (action) { - case VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_DESTROY: - if (doCoreDumpToAutoDumpPath(driver, vm, VIR_DUMP_MEMORY_ONLY) < 0) { -@@ -4103,6 +4098,11 @@ processGuestPanicEvent(virQEMUDriverPtr driver, - } - - cleanup: -+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) { -+ VIR_WARN("Unable to save status on vm %s after state change", -+ vm->def->name); -+ } -+ - virObjectUnref(cfg); - } - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 9c640f0..3eb1036 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -529,6 +529,7 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event; - qemuDomainObjPrivatePtr priv; -+ virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - - virObjectLock(vm); - -@@ -536,12 +537,20 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - priv = vm->privateData; - if (priv->agent) - qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_RESET); -+ /* Clear some domain runtime information. For instance, -+ * fsfreeze won't survive domain reset. This, however, -+ * required the domain status file to be rewritten onto disk. */ -+ priv->quiesced = false; -+ -+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) -+ VIR_WARN("Failed to save status on vm %s", vm->def->name); - - virObjectUnlock(vm); - - if (event) - qemuDomainEventQueue(driver, event); - -+ virObjectUnref(cfg); - return 0; - } - -@@ -4844,6 +4853,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, - - virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort); - priv->nbdPort = 0; -+ priv->quiesced = false; - - if (priv->agent) { - qemuAgentClose(priv->agent); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-Update-migration-state-according-to-MIGRATION-event.patch b/SOURCES/libvirt-qemu-Update-migration-state-according-to-MIGRATION-event.patch new file mode 100644 index 0000000..8946c16 --- /dev/null +++ b/SOURCES/libvirt-qemu-Update-migration-state-according-to-MIGRATION-event.patch @@ -0,0 +1,106 @@ +From cedb46fe3e884bd23b7ba504fac78e60265a8ea3 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Fri, 29 May 2015 08:37:59 +0200 +Subject: [PATCH] qemu: Update migration state according to MIGRATION event + +We don't need to call query-migrate every 50ms when we get the current +migration state via MIGRATION event. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 6d2edb6a42d0d41971fcf53c16cdc785d36c3ecc) + +https://bugzilla.redhat.com/show_bug.cgi?id=1212077 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_migration.c | 14 ++++++++++++-- + src/qemu/qemu_process.c | 31 +++++++++++++++++++++++++++++++ + 2 files changed, 43 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index a57a177..9a50923 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -2552,7 +2552,11 @@ qemuMigrationCheckJobStatus(virQEMUDriverPtr driver, + qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainJobInfoPtr jobInfo = priv->job.current; + +- if (qemuMigrationUpdateJobStatus(driver, vm, asyncJob) < 0) ++ bool events = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT); ++ ++ if (events) ++ qemuMigrationUpdateJobType(jobInfo); ++ else if (qemuMigrationUpdateJobStatus(driver, vm, asyncJob) < 0) + return -1; + + switch (jobInfo->type) { +@@ -2571,9 +2575,15 @@ qemuMigrationCheckJobStatus(virQEMUDriverPtr driver, + qemuMigrationJobName(vm), _("canceled by client")); + return -1; + ++ case VIR_DOMAIN_JOB_COMPLETED: ++ /* Fetch statistics of a completed migration */ ++ if (events && ++ qemuMigrationUpdateJobStatus(driver, vm, asyncJob) < 0) ++ return -1; ++ break; ++ + case VIR_DOMAIN_JOB_BOUNDED: + case VIR_DOMAIN_JOB_UNBOUNDED: +- case VIR_DOMAIN_JOB_COMPLETED: + case VIR_DOMAIN_JOB_LAST: + break; + } +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 1d223d3..577f309 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -1508,6 +1508,36 @@ qemuProcessHandleSpiceMigrated(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + } + + ++static int ++qemuProcessHandleMigrationStatus(qemuMonitorPtr mon ATTRIBUTE_UNUSED, ++ virDomainObjPtr vm, ++ int status, ++ void *opaque ATTRIBUTE_UNUSED) ++{ ++ qemuDomainObjPrivatePtr priv; ++ ++ virObjectLock(vm); ++ ++ VIR_DEBUG("Migration of domain %p %s changed state to %s", ++ vm, vm->def->name, ++ qemuMonitorMigrationStatusTypeToString(status)); ++ ++ priv = vm->privateData; ++ if (priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT && ++ priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_IN) { ++ VIR_DEBUG("got MIGRATION event without a migration job"); ++ goto cleanup; ++ } ++ ++ priv->job.current->status.status = status; ++ virDomainObjBroadcast(vm); ++ ++ cleanup: ++ virObjectUnlock(vm); ++ return 0; ++} ++ ++ + static qemuMonitorCallbacks monitorCallbacks = { + .eofNotify = qemuProcessHandleMonitorEOF, + .errorNotify = qemuProcessHandleMonitorError, +@@ -1532,6 +1562,7 @@ static qemuMonitorCallbacks monitorCallbacks = { + .domainNicRxFilterChanged = qemuProcessHandleNicRxFilterChanged, + .domainSerialChange = qemuProcessHandleSerialChanged, + .domainSpiceMigrated = qemuProcessHandleSpiceMigrated, ++ .domainMigrationStatus = qemuProcessHandleMigrationStatus, + }; + + static int +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu-Update-state-of-block-job-to-READY-only-if-it-actually-is-ready.patch b/SOURCES/libvirt-qemu-Update-state-of-block-job-to-READY-only-if-it-actually-is-ready.patch new file mode 100644 index 0000000..2fe11f1 --- /dev/null +++ b/SOURCES/libvirt-qemu-Update-state-of-block-job-to-READY-only-if-it-actually-is-ready.patch @@ -0,0 +1,125 @@ +From 14b6b01cce6316d9df09f473592de303dce94084 Mon Sep 17 00:00:00 2001 +Message-Id: <14b6b01cce6316d9df09f473592de303dce94084@dist-git> +From: Peter Krempa +Date: Tue, 21 Jul 2015 16:18:32 +0200 +Subject: [PATCH] qemu: Update state of block job to READY only if it actually + is ready + +https://bugzilla.redhat.com/show_bug.cgi?id=1227551 +https://bugzilla.redhat.com/show_bug.cgi?id=1197592 + +Few parts of the code looked at the current progress of and assumed that +a two phase blockjob is in the _READY state as soon as the progress +reached 100% (info.cur == info.end). In current versions of qemu this +assumption is invalid and qemu exposes a new flag 'ready' in the +query-block-jobs output that is set to true if the job is actually +finished. + +This patch adds internal data handling for reading the 'ready' flag and +acting appropriately as long as the flag is present. + +While this still doesn't fix the virsh client problem with two phase +block jobs and the --pivot option, it at least improves the error +message: + +$ virsh blockcommit --wait --verbose vm vda --base vda[1] --active --pivot +Block commit: [100 %]error: failed to pivot job for disk vda +error: internal error: unable to execute QEMU command 'block-job-complete': The active block job for device 'drive-virtio-disk0' cannot be completed + +to + +$ virsh blockcommit --wait --verbose VM vda --base vda[1] --active --pivot +Block commit: [100 %]error: failed to pivot job for disk vda +error: block copy still active: disk 'vda' not ready for pivot yet + +(cherry picked from commit eae59247c59aa02147b2b4a50177e8e877fdb218) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 10 ++++++++-- + src/qemu/qemu_monitor.h | 1 + + src/qemu/qemu_monitor_json.c | 7 +++++++ + 3 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 47889d9..204ed72 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -16170,8 +16170,12 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, + goto cleanup; + if (rc < 0) + goto cleanup; +- if (rc == 1 && info.cur == info.end && +- info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY) ++ if (rc == 1 && ++ (info.ready == 1 || ++ (info.ready == -1 && ++ info.end == info.cur && ++ (info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY || ++ info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT)))) + disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY; + } + +@@ -16569,6 +16573,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, + * hold the vm lock, so modifying the in-memory representation is + * safe, even if we are a query rather than a modify job. */ + if (ret == 1 && disk->mirror && ++ rawInfo.ready != 0 && + info->cur == info->end && !disk->mirrorState) { + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + +@@ -17199,6 +17204,7 @@ qemuDomainBlockCommit(virDomainPtr dom, + * thing if the user specified a relative name). Be prepared for + * a ready event to occur while locks are dropped. */ + if (mirror) { ++ disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; + disk->mirror = mirror; + disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT; + } +diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h +index 8ad3b2b..fc58638 100644 +--- a/src/qemu/qemu_monitor.h ++++ b/src/qemu/qemu_monitor.h +@@ -798,6 +798,7 @@ struct _qemuMonitorBlockJobInfo { + unsigned long long bandwidth; /* in bytes/s */ + virDomainBlockJobCursor cur; + virDomainBlockJobCursor end; ++ int ready; /* -1 if unknown, 0 if not ready, 1 if ready */ + }; + + virHashTablePtr qemuMonitorGetAllBlockJobInfo(qemuMonitorPtr mon); +diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c +index 4040ff0..d2a5374 100644 +--- a/src/qemu/qemu_monitor_json.c ++++ b/src/qemu/qemu_monitor_json.c +@@ -4136,6 +4136,7 @@ qemuMonitorJSONParseBlockJobInfo(virHashTablePtr blockJobs, + qemuMonitorBlockJobInfoPtr info = NULL; + const char *device; + const char *type; ++ bool ready; + + if (!(device = virJSONValueObjectGetString(entry, "device"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", +@@ -4151,6 +4152,9 @@ qemuMonitorJSONParseBlockJobInfo(virHashTablePtr blockJobs, + return -1; + } + ++ /* assume we don't know the state */ ++ info->ready = -1; ++ + if (!(type = virJSONValueObjectGetString(entry, "type"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("entry was missing 'type'")); +@@ -4183,6 +4187,9 @@ qemuMonitorJSONParseBlockJobInfo(virHashTablePtr blockJobs, + return -1; + } + ++ if (virJSONValueObjectGetBoolean(entry, "ready", &ready) == 0) ++ info->ready = ready; ++ + return 0; + } + +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Use-correct-flags-for-ABI-stability-check-in-SaveImageUpdateDef.patch b/SOURCES/libvirt-qemu-Use-correct-flags-for-ABI-stability-check-in-SaveImageUpdateDef.patch deleted file mode 100644 index 68a06b6..0000000 --- a/SOURCES/libvirt-qemu-Use-correct-flags-for-ABI-stability-check-in-SaveImageUpdateDef.patch +++ /dev/null @@ -1,69 +0,0 @@ -From b90b606deb02320044248c8ce6727dc6ddb0a939 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Fri, 21 Aug 2015 10:50:56 -0700 -Subject: [PATCH] qemu: Use correct flags for ABI stability check in - SaveImageUpdateDef - -https://bugzilla.redhat.com/show_bug.cgi?id=1183869 [7.2.0] -https://bugzilla.redhat.com/show_bug.cgi?id=1254164 [7.2.0] -https://bugzilla.redhat.com/show_bug.cgi?id=1255859 [7.1.z] - -Soo. you've successfully started yourself a domain. And since you want -to use it on your host exclusively you are confident enough to -passthrough the host CPU model, like this: - - - -Then, after a while, you want to save the domain into a file (e.g. -virsh save dom dom.save). And here comes the trouble. The file consist -of two parts: Libvirt header (containing domain XML among other -things), and qemu migration data. Now, the domain XML in the header is -formatted using special flags (VIR_DOMAIN_XML_SECURE | -VIR_DOMAIN_XML_UPDATE_CPU | VIR_DOMAIN_XML_INACTIVE | -VIR_DOMAIN_XML_MIGRATABLE). - -Then, on your way back from the bar, you think of changing something -in the XML in the saved file (we have a command for it after all), say -listen address for graphics console. So you successfully type in the -command: - - virsh save-image-edit dom.save - -Change all the bits, and exit the editor. But instead of success -you're left with sad error message: - - error: unsupported configuration: Target CPU model does not - match source Pentium Pro - -Sigh. Digging into the code you see lines, where we check for ABI -stability. The new XML you've produced is compared with the old one -from the saved file to see if qemu ABI will break or not. Wait, what? -We are using different flags to parse the XML you've provided so we -were just lucky it worked in some cases? Yep, that's right. - -Signed-off-by: Michal Privoznik -(cherry picked from commit cf2d4c603c37a58c7c6cacc87f0e78b45903ae7c) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 425cf90..299cf7b 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -5856,8 +5856,8 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, - - if (!(newdef_migr = qemuDomainDefCopy(driver, - newdef, -- VIR_DOMAIN_XML_MIGRATABLE | -- VIR_DOMAIN_XML_SECURE))) -+ QEMU_DOMAIN_FORMAT_LIVE_FLAGS || -+ VIR_DOMAIN_XML_MIGRATABLE))) - goto cleanup; - - if (!virDomainDefCheckABIStability(def, newdef_migr)) { --- -2.5.0 - diff --git a/SOURCES/libvirt-qemu-Use-error-from-Finish-instead-of-unexpectedly-failed.patch b/SOURCES/libvirt-qemu-Use-error-from-Finish-instead-of-unexpectedly-failed.patch new file mode 100644 index 0000000..dfcc0f5 --- /dev/null +++ b/SOURCES/libvirt-qemu-Use-error-from-Finish-instead-of-unexpectedly-failed.patch @@ -0,0 +1,124 @@ +From 9ac80cb260482543d02c9d8fd79162c05d684a74 Mon Sep 17 00:00:00 2001 +Message-Id: <9ac80cb260482543d02c9d8fd79162c05d684a74@dist-git> +From: Jiri Denemark +Date: Thu, 2 Jul 2015 21:46:56 +0200 +Subject: [PATCH] qemu: Use error from Finish instead of "unexpectedly failed" + +When QEMU exits on destination during migration, the source reports +either success (if the failure happened at the very end) or unhelpful +"unexpectedly failed" error message. However, the Finish API called on +the destination may report a real error so let's use it instead of the +generic one. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 2e7cea24355328102c40dd127329ddf47d55a3e2) + +https://bugzilla.redhat.com/show_bug.cgi?id=1090093 + +Signed-off-by: Jiri Denemark +--- + src/libvirt-domain.c | 30 ++++++++++++++++++++++++++++-- + src/qemu/qemu_migration.c | 39 +++++++++++++++++++++++++++++++++++++-- + 2 files changed, 65 insertions(+), 4 deletions(-) + +diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c +index 909c264..837933f 100644 +--- a/src/libvirt-domain.c ++++ b/src/libvirt-domain.c +@@ -3175,8 +3175,34 @@ virDomainMigrateVersion3Full(virDomainPtr domain, + (dconn, dname, cookiein, cookieinlen, &cookieout, &cookieoutlen, + NULL, uri, destflags, cancelled); + } +- if (cancelled && ddomain) +- VIR_ERROR(_("finish step ignored that migration was cancelled")); ++ ++ if (cancelled) { ++ if (ddomain) { ++ VIR_ERROR(_("finish step ignored that migration was cancelled")); ++ } else { ++ /* If Finish reported a useful error, use it instead of the ++ * original "migration unexpectedly failed" error. ++ * ++ * This is ugly but we can't do better with the APIs we have. We ++ * only replace the error if Finish was called with cancelled == 1 ++ * and reported a real error (old libvirt would report an error ++ * from RPC instead of MIGRATE_FINISH_OK), which only happens when ++ * the domain died on destination. To further reduce a possibility ++ * of false positives we also check that Perform returned ++ * VIR_ERR_OPERATION_FAILED. ++ */ ++ if (orig_err && ++ orig_err->domain == VIR_FROM_QEMU && ++ orig_err->code == VIR_ERR_OPERATION_FAILED) { ++ virErrorPtr err = virGetLastError(); ++ if (err->domain == VIR_FROM_QEMU && ++ err->code != VIR_ERR_MIGRATE_FINISH_OK) { ++ virFreeError(orig_err); ++ orig_err = NULL; ++ } ++ } ++ } ++ } + + /* If ddomain is NULL, then we were unable to start + * the guest on the target, and must restart on the +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index a9cbada..d789110 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -4982,8 +4982,34 @@ doPeer2PeerMigrate3(virQEMUDriverPtr driver, + dconnuri, uri, destflags, cancelled); + qemuDomainObjExitRemote(vm); + } +- if (cancelled && ddomain) +- VIR_ERROR(_("finish step ignored that migration was cancelled")); ++ ++ if (cancelled) { ++ if (ddomain) { ++ VIR_ERROR(_("finish step ignored that migration was cancelled")); ++ } else { ++ /* If Finish reported a useful error, use it instead of the ++ * original "migration unexpectedly failed" error. ++ * ++ * This is ugly but we can't do better with the APIs we have. We ++ * only replace the error if Finish was called with cancelled == 1 ++ * and reported a real error (old libvirt would report an error ++ * from RPC instead of MIGRATE_FINISH_OK), which only happens when ++ * the domain died on destination. To further reduce a possibility ++ * of false positives we also check that Perform returned ++ * VIR_ERR_OPERATION_FAILED. ++ */ ++ if (orig_err && ++ orig_err->domain == VIR_FROM_QEMU && ++ orig_err->code == VIR_ERR_OPERATION_FAILED) { ++ virErrorPtr err = virGetLastError(); ++ if (err->domain == VIR_FROM_QEMU && ++ err->code != VIR_ERR_MIGRATE_FINISH_OK) { ++ virFreeError(orig_err); ++ orig_err = NULL; ++ } ++ } ++ } ++ } + + /* If ddomain is NULL, then we were unable to start + * the guest on the target, and must restart on the +@@ -5719,6 +5745,15 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + /* Guest is successfully running, so cancel previous auto destroy */ + qemuProcessAutoDestroyRemove(driver, vm); + } else if (!(flags & VIR_MIGRATE_OFFLINE)) { ++ qemuDomainJobInfo info; ++ ++ /* Check for a possible error on the monitor in case Finish was called ++ * earlier than monitor EOF handler got a chance to process the error ++ */ ++ qemuMigrationFetchJobStatus(driver, vm, ++ QEMU_ASYNC_JOB_MIGRATION_IN, ++ &info); ++ + qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, + VIR_QEMU_PROCESS_STOP_MIGRATED); + virDomainAuditStop(vm, "failed"); +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu-Use-memory-backing-file-only-when-needed.patch b/SOURCES/libvirt-qemu-Use-memory-backing-file-only-when-needed.patch new file mode 100644 index 0000000..7fbd329 --- /dev/null +++ b/SOURCES/libvirt-qemu-Use-memory-backing-file-only-when-needed.patch @@ -0,0 +1,110 @@ +From 22c900d292345ae1b4a0babc75b0b30bfea6f10f Mon Sep 17 00:00:00 2001 +Message-Id: <22c900d292345ae1b4a0babc75b0b30bfea6f10f@dist-git> +From: Martin Kletzander +Date: Tue, 6 Oct 2015 15:20:35 +0200 +Subject: [PATCH] qemu: Use memory-backing-file only when needed + +We are using memory-backing-file even when it's not needed, for example +if user requests hugepages for memory backing, but does not specify any +pagesize or memory node pinning. This causes migrations to fail when +migrating from older libvirt that did not do this. So similarly to +commit 7832fac84741d65e851dbdbfaf474785cbfdcf3c which does it for +memory-backend-ram, this commit makes is more generic and +backend-agnostic, so the backend is not used if there is no specific +pagesize of hugepages requested, no nodeset the memory node should be +bound to, no memory access change required, and so on. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1266856 + +Signed-off-by: Martin Kletzander +(cherry picked from commit 41c2aa729f0af084ede95ee9a06219a2dd5fb5df) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 35 ++++++++++------------ + .../qemuxml2argv-hugepages-numa.args | 6 ++-- + 2 files changed, 19 insertions(+), 22 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 1d020d2..9c80e0c 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -4835,12 +4835,6 @@ qemuBuildMemoryBackendStr(unsigned long long size, + } + + if (pagesize || hugepage) { +- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("this qemu doesn't support hugepage memory backing")); +- goto cleanup; +- } +- + if (pagesize) { + /* Now lets see, if the huge page we want to use is even mounted + * and ready to use */ +@@ -4919,29 +4913,32 @@ qemuBuildMemoryBackendStr(unsigned long long size, + goto cleanup; + } + +- if (!hugepage && !pagesize) { +- +- if ((userNodeset || nodeSpecified || force) && +- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM)) { ++ /* If none of the following is requested... */ ++ if (!pagesize && !userNodeset && !memAccess && !nodeSpecified && !force) { ++ /* report back that using the new backend is not necessary ++ * to achieve the desired configuration */ ++ ret = 1; ++ } else { ++ /* otherwise check the required capability */ ++ if (STREQ(*backendType, "memory-backend-file") && ++ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("this qemu doesn't support the " ++ "memory-backend-file object")); ++ goto cleanup; ++ } else if (STREQ(*backendType, "memory-backend-ram") && ++ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this qemu doesn't support the " + "memory-backend-ram object")); + goto cleanup; + } + +- /* report back that using the new backend is not necessary to achieve +- * the desired configuration */ +- if (!userNodeset && !nodeSpecified) { +- *backendProps = props; +- props = NULL; +- ret = 1; +- goto cleanup; +- } ++ ret = 0; + } + + *backendProps = props; + props = NULL; +- ret = 0; + + cleanup: + virJSONValueFree(props); +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args +index 37511b1..3496cf1 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args +@@ -4,9 +4,9 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \ + -M pc-i440fx-2.3 \ + -m size=1048576k,slots=16,maxmem=1099511627776k \ + -smp 2 \ +--object memory-backend-file,id=ram-node0,prealloc=yes,\ +-mem-path=/dev/hugepages2M/libvirt/qemu,size=1073741824 \ +--numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \ ++-mem-prealloc \ ++-mem-path /dev/hugepages2M/libvirt/qemu \ ++-numa node,nodeid=0,cpus=0-1,mem=1024 \ + -object memory-backend-file,id=memdimm0,prealloc=yes,\ + mem-path=/dev/hugepages1G/libvirt/qemu,size=1073741824,host-nodes=1-3,policy=bind \ + -device pc-dimm,node=0,memdev=memdimm0,id=dimm0 \ +-- +2.6.1 + diff --git a/SOURCES/libvirt-qemu-Use-numad-information-when-getting-pin-information.patch b/SOURCES/libvirt-qemu-Use-numad-information-when-getting-pin-information.patch new file mode 100644 index 0000000..61028c8 --- /dev/null +++ b/SOURCES/libvirt-qemu-Use-numad-information-when-getting-pin-information.patch @@ -0,0 +1,80 @@ +From 739c64c914deae4be776f255540187793a3dc1de Mon Sep 17 00:00:00 2001 +Message-Id: <739c64c914deae4be776f255540187793a3dc1de@dist-git> +From: Martin Kletzander +Date: Thu, 13 Aug 2015 15:11:48 +0200 +Subject: [PATCH] qemu: Use numad information when getting pin information + +Pinning information returned for emulatorpin and vcpupin calls is being +returned from our data without querying cgroups for some time. However, +not all the data were utilized. When automatic placement is used the +information is not returned for the calls mentioned above. Since the +numad hint in private data is properly saved/restored, we can safely use +it to return true information. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1162947 + +Signed-off-by: Martin Kletzander +(cherry picked from commit 776924e37649f2d47acd805746d5fd9325212ea5) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 48857ce..748f16a 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -5244,6 +5244,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom, + int ret = -1; + int hostcpus, vcpu; + virBitmapPtr allcpumap = NULL; ++ qemuDomainObjPrivatePtr priv = NULL; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG, -1); +@@ -5264,6 +5265,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom, + goto cleanup; + + virBitmapSetAll(allcpumap); ++ priv = vm->privateData; + + /* Clamp to actual number of vcpus */ + if (ncpumaps > def->vcpus) +@@ -5282,6 +5284,9 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom, + + if (pininfo && pininfo->cpumask) + bitmap = pininfo->cpumask; ++ else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO && ++ priv->autoCpuset) ++ bitmap = priv->autoCpuset; + else + bitmap = allcpumap; + +@@ -5432,6 +5437,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, + int hostcpus; + virBitmapPtr cpumask = NULL; + virBitmapPtr bitmap = NULL; ++ qemuDomainObjPrivatePtr priv = NULL; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG, -1); +@@ -5448,10 +5454,15 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, + if ((hostcpus = nodeGetCPUCount(NULL)) < 0) + goto cleanup; + ++ priv = vm->privateData; ++ + if (def->cputune.emulatorpin) { + cpumask = def->cputune.emulatorpin; + } else if (def->cpumask) { + cpumask = def->cpumask; ++ } else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO && ++ priv->autoCpuset) { ++ cpumask = priv->autoCpuset; + } else { + if (!(bitmap = virBitmapNew(hostcpus))) + goto cleanup; +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-Wait-for-migration-events-on-domain-condition.patch b/SOURCES/libvirt-qemu-Wait-for-migration-events-on-domain-condition.patch new file mode 100644 index 0000000..7d57f2f --- /dev/null +++ b/SOURCES/libvirt-qemu-Wait-for-migration-events-on-domain-condition.patch @@ -0,0 +1,160 @@ +From c08ee284b60c8c52faba6b0b4586fc9fdf018ddb Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Fri, 29 May 2015 08:38:44 +0200 +Subject: [PATCH] qemu: Wait for migration events on domain condition + +Since we already support the MIGRATION event, we just need to make sure +the domain condition is signalled whenever a p2p connection drops or the +domain is paused due to IO error and we can avoid waking up every 50 ms +to check whether something happened. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 3409f5bc4e0ea870982f4eee3bb6f97fe9f9f883) + +https://bugzilla.redhat.com/show_bug.cgi?id=1212077 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.h | 3 +++ + src/qemu/qemu_migration.c | 45 +++++++++++++++++++++++++++++++++++++++------ + src/qemu/qemu_process.c | 3 +++ + 3 files changed, 45 insertions(+), 6 deletions(-) + +diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h +index 66dbcf5..2af7c59 100644 +--- a/src/qemu/qemu_domain.h ++++ b/src/qemu/qemu_domain.h +@@ -199,6 +199,9 @@ struct _qemuDomainObjPrivate { + /* Bitmaps below hold data from the auto NUMA feature */ + virBitmapPtr autoNodeset; + virBitmapPtr autoCpuset; ++ ++ bool signalIOError; /* true if the domain condition should be signalled on ++ I/O error */ + }; + + # define QEMU_DOMAIN_DISK_PRIVATE(disk) \ +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 9a50923..7257182 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -2661,20 +2661,28 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, + { + qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainJobInfoPtr jobInfo = priv->job.current; ++ bool events = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT); + int rv; + + jobInfo->type = VIR_DOMAIN_JOB_UNBOUNDED; + while ((rv = qemuMigrationCompleted(driver, vm, asyncJob, dconn, + abort_on_error, storage)) != 1) { +- /* Poll every 50ms for progress & to allow cancellation */ +- struct timespec ts = { .tv_sec = 0, .tv_nsec = 50 * 1000 * 1000ull }; +- + if (rv < 0) + return rv; + +- virObjectUnlock(vm); +- nanosleep(&ts, NULL); +- virObjectLock(vm); ++ if (events) { ++ if (virDomainObjWait(vm) < 0) { ++ jobInfo->type = VIR_DOMAIN_JOB_FAILED; ++ return -2; ++ } ++ } else { ++ /* Poll every 50ms for progress & to allow cancellation */ ++ struct timespec ts = { .tv_sec = 0, .tv_nsec = 50 * 1000 * 1000ull }; ++ ++ virObjectUnlock(vm); ++ nanosleep(&ts, NULL); ++ virObjectLock(vm); ++ } + } + + qemuDomainJobInfoUpdateDowntime(jobInfo); +@@ -4148,6 +4156,7 @@ qemuMigrationRun(virQEMUDriverPtr driver, + virErrorPtr orig_err = NULL; + unsigned int cookieFlags = 0; + bool abort_on_error = !!(flags & VIR_MIGRATE_ABORT_ON_ERROR); ++ bool events = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT); + int rc; + + VIR_DEBUG("driver=%p, vm=%p, cookiein=%s, cookieinlen=%d, " +@@ -4178,6 +4187,9 @@ qemuMigrationRun(virQEMUDriverPtr driver, + return -1; + } + ++ if (events) ++ priv->signalIOError = abort_on_error; ++ + mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen, + cookieFlags | QEMU_MIGRATION_COOKIE_GRAPHICS); + if (!mig) +@@ -4387,6 +4399,9 @@ qemuMigrationRun(virQEMUDriverPtr driver, + + qemuMigrationCookieFree(mig); + ++ if (events) ++ priv->signalIOError = false; ++ + if (orig_err) { + virSetError(orig_err); + virFreeError(orig_err); +@@ -5029,6 +5044,18 @@ doPeer2PeerMigrate3(virQEMUDriverPtr driver, + } + + ++static void ++qemuMigrationConnectionClosed(virConnectPtr conn, ++ int reason, ++ void *opaque) ++{ ++ virDomainObjPtr vm = opaque; ++ ++ VIR_DEBUG("conn=%p, reason=%d, vm=%s", conn, reason, vm->def->name); ++ virDomainObjBroadcast(vm); ++} ++ ++ + static int virConnectCredType[] = { + VIR_CRED_AUTHNAME, + VIR_CRED_PASSPHRASE, +@@ -5104,6 +5131,11 @@ static int doPeer2PeerMigrate(virQEMUDriverPtr driver, + cfg->keepAliveCount) < 0) + goto cleanup; + ++ if (virConnectRegisterCloseCallback(dconn, qemuMigrationConnectionClosed, ++ vm, NULL) < 0) { ++ goto cleanup; ++ } ++ + qemuDomainObjEnterRemote(vm); + p2p = VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn, + VIR_DRV_FEATURE_MIGRATION_P2P); +@@ -5169,6 +5201,7 @@ static int doPeer2PeerMigrate(virQEMUDriverPtr driver, + cleanup: + orig_err = virSaveLastError(); + qemuDomainObjEnterRemote(vm); ++ virConnectUnregisterCloseCallback(dconn, qemuMigrationConnectionClosed); + virObjectUnref(dconn); + qemuDomainObjExitRemote(vm); + if (orig_err) { +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 577f309..7abeaae 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -952,6 +952,9 @@ qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + qemuDomainObjPrivatePtr priv = vm->privateData; + VIR_DEBUG("Transitioned guest %s to paused state due to IO error", vm->def->name); + ++ if (priv->signalIOError) ++ virDomainObjBroadcast(vm); ++ + virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_IOERROR); + lifecycleEvent = virDomainEventLifecycleNewFromObj(vm, + VIR_DOMAIN_EVENT_SUSPENDED, +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu-Wait-until-destination-QEMU-consumes-all-migration-data.patch b/SOURCES/libvirt-qemu-Wait-until-destination-QEMU-consumes-all-migration-data.patch new file mode 100644 index 0000000..bc05891 --- /dev/null +++ b/SOURCES/libvirt-qemu-Wait-until-destination-QEMU-consumes-all-migration-data.patch @@ -0,0 +1,64 @@ +From 1bf327f3bea0116dabef57a58fb9127d7e3b0de5 Mon Sep 17 00:00:00 2001 +Message-Id: <1bf327f3bea0116dabef57a58fb9127d7e3b0de5@dist-git> +From: Jiri Denemark +Date: Fri, 2 Oct 2015 12:08:26 +0200 +Subject: [PATCH] qemu: Wait until destination QEMU consumes all migration data + +Even though QEMU on the source host reports completed migration and thus +we move to the Finish phase, QEMU on the destination host may still be +processing migration data. Thus before we can start guest CPUs on the +destination, we have to wait for a completed migration event. + +https://bugzilla.redhat.com/show_bug.cgi?id=1265902 + +Signed-off-by: Jiri Denemark +(cherry picked from commit be5347bb7223cab0a9f0713ed9c4bf5738a7e0ea) +Signed-off-by: Jiri Denemark + +Conflicts: + src/qemu/qemu_migration.c - missing qemuMigrationFinish + refactoring +--- + src/qemu/qemu_migration.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 83614f5..d3e024e 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -5710,6 +5710,32 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + event = NULL; + } + ++ /* We need to wait for QEMU to process all data sent by the source ++ * before starting guest CPUs. ++ */ ++ if (!(flags & VIR_MIGRATE_OFFLINE) && ++ virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT)) { ++ int rv; ++ VIR_DEBUG("Waiting for migration to complete"); ++ while ((rv = qemuMigrationCompleted(driver, vm, ++ QEMU_ASYNC_JOB_MIGRATION_IN, ++ NULL, 0)) != 1) { ++ if (rv < 0 || virDomainObjWait(vm) < 0) { ++ /* There's not much we can do for v2 protocol since the ++ * original domain on the source host is already gone. ++ */ ++ if (v3proto) { ++ qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, ++ VIR_QEMU_PROCESS_STOP_MIGRATED); ++ virDomainAuditStop(vm, "failed"); ++ goto endjob; ++ } else { ++ break; ++ } ++ } ++ } ++ } ++ + if (!(flags & VIR_MIGRATE_PAUSED) && !(flags & VIR_MIGRATE_OFFLINE)) { + /* run 'cont' on the destination, which allows migration on qemu + * >= 0.10.6 to work properly. This isn't strictly necessary on +-- +2.6.1 + diff --git a/SOURCES/libvirt-qemu-add-a-qemuInterfaceStopDevices-called-when-guest-CPUs-stop.patch b/SOURCES/libvirt-qemu-add-a-qemuInterfaceStopDevices-called-when-guest-CPUs-stop.patch deleted file mode 100644 index fc19a41..0000000 --- a/SOURCES/libvirt-qemu-add-a-qemuInterfaceStopDevices-called-when-guest-CPUs-stop.patch +++ /dev/null @@ -1,174 +0,0 @@ -From 9957213b20eb24113a8cf1d939674e4bb3d6a3b7 Mon Sep 17 00:00:00 2001 -Message-Id: <9957213b20eb24113a8cf1d939674e4bb3d6a3b7@dist-git> -From: Laine Stump -Date: Sun, 14 Dec 2014 23:44:51 -0500 -Subject: [PATCH] qemu: add a qemuInterfaceStopDevices(), called when guest - CPUs stop - -This patch is a part of a more complete fix for: - - https://bugzilla.redhat.com/show_bug.cgi?id=1081461 - -We now have a qemuInterfaceStartDevices() which does the final -activation needed for the host-side tap/macvtap devices that are used -for qemu network connections. It will soon make sense to have the -converse qemuInterfaceStopDevices() which will undo whatever was done -during qemuInterfaceStartDevices(). - -A function to "stop" a single device has also been added, and is -called from the appropriate place in qemuDomainDetachNetDevice(), -although this is currently unnecessary - the device is going to -immediately be deleted anyway, so any extra "deactivation" will be for -naught. The call is included for completeness, though, in anticipation -that in the future there may be some required action that *isn't* -nullified by deleting the device. - -(cherry picked from commit c5a54917d5ae97653d29dbfe4995f2efcf5717d6) - -Conflicts: - src/qemu/qemu_hotplug.c - - again context around chunk changed due to centralization of - bandwidth setting upstream. - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 8 ++++++ - src/qemu/qemu_interface.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++- - src/qemu/qemu_interface.h | 2 ++ - src/qemu/qemu_process.c | 3 ++ - 4 files changed, 82 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index aaa7e21..84d2218 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -3551,6 +3551,14 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver, - goto cleanup; - } - -+ /* deactivate the tap/macvtap device on the host (currently this -+ * isn't necessary, as everything done in -+ * qemuInterfaceStopDevice() is made meaningless when the device -+ * is deleted anyway, but in the future it may be important, and -+ * doesn't hurt anything for now) -+ */ -+ ignore_value(qemuInterfaceStopDevice(detach)); -+ - qemuDomainMarkDeviceForRemoval(vm, &detach->info); - - qemuDomainObjEnterMonitor(driver, vm); -diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c -index b0f0c5d..2d33075 100644 ---- a/src/qemu/qemu_interface.c -+++ b/src/qemu/qemu_interface.c -@@ -41,8 +41,9 @@ int - qemuInterfaceStartDevice(virDomainNetDefPtr net) - { - int ret = -1; -+ virDomainNetType actualType = virDomainNetGetActualType(net); - -- switch (virDomainNetGetActualType(net)) { -+ switch (actualType) { - case VIR_DOMAIN_NET_TYPE_BRIDGE: - case VIR_DOMAIN_NET_TYPE_NETWORK: - break; -@@ -98,3 +99,70 @@ qemuInterfaceStartDevices(virDomainDefPtr def) - } - return 0; - } -+ -+ -+/** -+ * qemuInterfaceStopDevice: -+ * @net: net device to stop -+ * -+ * Based upon the type of device provided, perform the appropriate -+ * work to deactivate the device so that packets aren't forwarded to -+ * it from the rest of the network. -+ */ -+int -+qemuInterfaceStopDevice(virDomainNetDefPtr net) -+{ -+ int ret = -1; -+ virDomainNetType actualType = virDomainNetGetActualType(net); -+ -+ switch (actualType) { -+ case VIR_DOMAIN_NET_TYPE_BRIDGE: -+ case VIR_DOMAIN_NET_TYPE_NETWORK: -+ break; -+ -+ case VIR_DOMAIN_NET_TYPE_DIRECT: -+ /* macvtap interfaces need to be marked !IFF_UP (ie "down") to -+ * prevent any host-generated traffic sent from this interface -+ * from putting bad info into the arp caches of other machines -+ * on this network. -+ */ -+ if (virNetDevSetOnline(net->ifname, false) < 0) -+ goto cleanup; -+ break; -+ -+ case VIR_DOMAIN_NET_TYPE_USER: -+ case VIR_DOMAIN_NET_TYPE_ETHERNET: -+ case VIR_DOMAIN_NET_TYPE_VHOSTUSER: -+ case VIR_DOMAIN_NET_TYPE_SERVER: -+ case VIR_DOMAIN_NET_TYPE_CLIENT: -+ case VIR_DOMAIN_NET_TYPE_MCAST: -+ case VIR_DOMAIN_NET_TYPE_INTERNAL: -+ case VIR_DOMAIN_NET_TYPE_HOSTDEV: -+ case VIR_DOMAIN_NET_TYPE_LAST: -+ /* these types all require no action */ -+ break; -+ } -+ -+ ret = 0; -+ cleanup: -+ return ret; -+} -+ -+/** -+ * qemuInterfaceStopDevices: -+ * @def: domain definition -+ * -+ * Make all interfaces associated with this domain inaccessible from -+ * the rest of the network. -+ */ -+int -+qemuInterfaceStopDevices(virDomainDefPtr def) -+{ -+ size_t i; -+ -+ for (i = 0; i < def->nnets; i++) { -+ if (qemuInterfaceStopDevice(def->nets[i]) < 0) -+ return -1; -+ } -+ return 0; -+} -diff --git a/src/qemu/qemu_interface.h b/src/qemu/qemu_interface.h -index d040f52..b4c1efc 100644 ---- a/src/qemu/qemu_interface.h -+++ b/src/qemu/qemu_interface.h -@@ -28,5 +28,7 @@ - - int qemuInterfaceStartDevice(virDomainNetDefPtr net); - int qemuInterfaceStartDevices(virDomainDefPtr def); -+int qemuInterfaceStopDevice(virDomainNetDefPtr net); -+int qemuInterfaceStopDevices(virDomainDefPtr def); - - #endif /* __QEMU_INTERFACE_H__ */ -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 627755d..d7b2688 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3170,6 +3170,9 @@ int qemuProcessStopCPUs(virQEMUDriverPtr driver, - if (ret < 0) - goto cleanup; - -+ /* de-activate netdevs after stopping CPUs */ -+ ignore_value(qemuInterfaceStopDevices(vm->def)); -+ - if (priv->job.current) - ignore_value(virTimeMillisNow(&priv->job.current->stopped)); - --- -2.2.0 - diff --git a/SOURCES/libvirt-qemu-add-capability-probing-for-ivshmem-device.patch b/SOURCES/libvirt-qemu-add-capability-probing-for-ivshmem-device.patch deleted file mode 100644 index 3fbc142..0000000 --- a/SOURCES/libvirt-qemu-add-capability-probing-for-ivshmem-device.patch +++ /dev/null @@ -1,186 +0,0 @@ -From c6b22fdc32c38b487b4d8748251f697d30e1fe48 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Maxime Leroy -Date: Fri, 3 Oct 2014 22:54:56 +0200 -Subject: [PATCH] qemu: add capability probing for ivshmem device - -https://bugzilla.redhat.com/show_bug.cgi?id=1126991 - -Ivshmem is supported by QEMU since 0.13 release. - -Signed-off-by: Maxime Leroy -Signed-off-by: Martin Kletzander -(cherry picked from commit e3d478eb51c1a60a2f52392a81031b477098e2bc) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 2 ++ - src/qemu/qemu_capabilities.h | 1 + - tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 + - tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 + - tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 + - tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 + - tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 + - tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 + - tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 + - tests/qemuhelptest.c | 15 ++++++++++----- - 10 files changed, 20 insertions(+), 5 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index ca112e9..ea1250d 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -270,6 +270,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "splash-timeout", /* 175 */ - "iothread", - "migrate-rdma", -+ "ivshmem", - ); - - -@@ -1500,6 +1501,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { - { "memory-backend-file", QEMU_CAPS_OBJECT_MEMORY_FILE }, - { "usb-audio", QEMU_CAPS_OBJECT_USB_AUDIO }, - { "iothread", QEMU_CAPS_OBJECT_IOTHREAD}, -+ { "ivshmem", QEMU_CAPS_DEVICE_IVSHMEM }, - }; - - static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = { -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index b15b9f1..d3a9a0a 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -217,6 +217,7 @@ typedef enum { - QEMU_CAPS_SPLASH_TIMEOUT = 175, /* -boot splash-time */ - QEMU_CAPS_OBJECT_IOTHREAD = 176, /* -object iothread */ - QEMU_CAPS_MIGRATE_RDMA = 177, /* have rdma migration */ -+ QEMU_CAPS_DEVICE_IVSHMEM = 178, /* -device ivshmem */ - - QEMU_CAPS_LAST, /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps -index 3b1b699..fc8dfc1 100644 ---- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps -@@ -115,4 +115,5 @@ - - - -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps -index 4b7651e..f4f0397 100644 ---- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps -@@ -129,4 +129,5 @@ - - - -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps -index d146bf9..e6659e4 100644 ---- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps -@@ -130,4 +130,5 @@ - - - -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps -index c220b46..9716cf5 100644 ---- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps -@@ -139,4 +139,5 @@ - - - -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps -index 21d4320..a820cd4 100644 ---- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps -@@ -145,4 +145,5 @@ - - - -+ - -diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps -index 44f7b0c..f65b3f4 100644 ---- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps -+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps -@@ -145,4 +145,5 @@ - - - -+ - -diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps -index 71d2459..7fc654d 100644 ---- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps -+++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps -@@ -159,4 +159,5 @@ - - - -+ - -diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c -index 975edf3..7e62a50 100644 ---- a/tests/qemuhelptest.c -+++ b/tests/qemuhelptest.c -@@ -518,7 +518,8 @@ mymain(void) - QEMU_CAPS_DEVICE_SCSI_GENERIC, - QEMU_CAPS_DEVICE_USB_KBD, - QEMU_CAPS_DEVICE_USB_STORAGE, -- QEMU_CAPS_HOST_PCI_MULTIDOMAIN); -+ QEMU_CAPS_HOST_PCI_MULTIDOMAIN, -+ QEMU_CAPS_DEVICE_IVSHMEM); - DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0, - QEMU_CAPS_VNC_COLON, - QEMU_CAPS_NO_REBOOT, -@@ -746,7 +747,8 @@ mymain(void) - QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX, - QEMU_CAPS_DEVICE_USB_KBD, - QEMU_CAPS_DEVICE_USB_STORAGE, -- QEMU_CAPS_SPLASH_TIMEOUT); -+ QEMU_CAPS_SPLASH_TIMEOUT, -+ QEMU_CAPS_DEVICE_IVSHMEM); - DO_TEST("qemu-1.1.0", 1001000, 0, 0, - QEMU_CAPS_VNC_COLON, - QEMU_CAPS_NO_REBOOT, -@@ -845,7 +847,8 @@ mymain(void) - QEMU_CAPS_DEVICE_USB_KBD, - QEMU_CAPS_DEVICE_USB_STORAGE, - QEMU_CAPS_OBJECT_USB_AUDIO, -- QEMU_CAPS_SPLASH_TIMEOUT); -+ QEMU_CAPS_SPLASH_TIMEOUT, -+ QEMU_CAPS_DEVICE_IVSHMEM); - DO_TEST("qemu-1.2.0", 1002000, 0, 0, - QEMU_CAPS_VNC_COLON, - QEMU_CAPS_NO_REBOOT, -@@ -956,7 +959,8 @@ mymain(void) - QEMU_CAPS_DEVICE_USB_KBD, - QEMU_CAPS_USB_STORAGE_REMOVABLE, - QEMU_CAPS_OBJECT_USB_AUDIO, -- QEMU_CAPS_SPLASH_TIMEOUT); -+ QEMU_CAPS_SPLASH_TIMEOUT, -+ QEMU_CAPS_DEVICE_IVSHMEM); - DO_TEST("qemu-kvm-1.2.0", 1002000, 1, 0, - QEMU_CAPS_VNC_COLON, - QEMU_CAPS_NO_REBOOT, -@@ -1072,7 +1076,8 @@ mymain(void) - QEMU_CAPS_DEVICE_USB_KBD, - QEMU_CAPS_USB_STORAGE_REMOVABLE, - QEMU_CAPS_OBJECT_USB_AUDIO, -- QEMU_CAPS_SPLASH_TIMEOUT); -+ QEMU_CAPS_SPLASH_TIMEOUT, -+ QEMU_CAPS_DEVICE_IVSHMEM); - - return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; - } --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-add-remove-bridge-fdb-entries-as-guest-CPUs-are-started-stopped.patch b/SOURCES/libvirt-qemu-add-remove-bridge-fdb-entries-as-guest-CPUs-are-started-stopped.patch deleted file mode 100644 index 107a3e2..0000000 --- a/SOURCES/libvirt-qemu-add-remove-bridge-fdb-entries-as-guest-CPUs-are-started-stopped.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 585d2ac01d34da0ce729ac889eae0a56608f86be Mon Sep 17 00:00:00 2001 -Message-Id: <585d2ac01d34da0ce729ac889eae0a56608f86be@dist-git> -From: Laine Stump -Date: Mon, 15 Dec 2014 10:51:32 -0500 -Subject: [PATCH] qemu: add/remove bridge fdb entries as guest CPUs are - started/stopped - -This is part of the fix for: - - https://bugzilla.redhat.com/show_bug.cgi?id=1099210 - -When libvirt is managing a bridge's forwarding database (FDB) -(macTableManager='libvirt'), if we add FDB entries for a new guest -interface even before the qemu process is created, then in the case of -a migration any other guest attached to the "destination" bridge will -have its traffic immediately sent to the destination of the migration -even while the source domain is still running (and the destination, of -course, isn't). To make sure that traffic from other guests on the new -host continues flowing to the old guest until the new one is ready, we -have to wait until the new guest CPUs are started to add the FDB -entries. - -Conversely, we need to remove the FDB entries from the bridge any time -the guest CPUs are stopped; among other things, this will assure -proper operation during a post-copy migration (which is just the -opposite of the problem described in the previous paragraph). - -(cherry picked from commit 44292e48a0ffa76badf84d42ad33f885e67d30e9) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 10 +++------- - src/qemu/qemu_interface.c | 26 ++++++++++++++++++++++++++ - 2 files changed, 29 insertions(+), 7 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index a9c4271..ed66cea 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -355,18 +355,14 @@ qemuNetworkIfaceConnect(virDomainDefPtr def, - /* libvirt is managing the FDB of the bridge this device - * is attaching to, so we need to turn off learning and - * unicast_flood on the device to prevent the kernel from -- * adding any FDB entries for it, then add an fdb entry -- * outselves, using the MAC address from the interface -- * config. -+ * adding any FDB entries for it. We will add add an fdb -+ * entry ourselves (during qemuInterfaceStartDevices(), -+ * using the MAC address from the interface config. - */ - if (virNetDevBridgePortSetLearning(brname, net->ifname, false) < 0) - goto cleanup; - if (virNetDevBridgePortSetUnicastFlood(brname, net->ifname, false) < 0) - goto cleanup; -- if (virNetDevBridgeFDBAdd(&net->mac, net->ifname, -- VIR_NETDEVBRIDGE_FDB_FLAG_MASTER | -- VIR_NETDEVBRIDGE_FDB_FLAG_TEMP) < 0) -- goto cleanup; - } - } else { - if (qemuCreateInBridgePortWithHelper(cfg, brname, -diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c -index 2d33075..201a7dd 100644 ---- a/src/qemu/qemu_interface.c -+++ b/src/qemu/qemu_interface.c -@@ -23,10 +23,12 @@ - - #include - -+#include "network_conf.h" - #include "qemu_interface.h" - #include "virnetdev.h" - #include "virnetdevtap.h" - #include "virnetdevmacvlan.h" -+#include "virnetdevbridge.h" - #include "virnetdevvportprofile.h" - - /** -@@ -46,6 +48,20 @@ qemuInterfaceStartDevice(virDomainNetDefPtr net) - switch (actualType) { - case VIR_DOMAIN_NET_TYPE_BRIDGE: - case VIR_DOMAIN_NET_TYPE_NETWORK: -+ if (virDomainNetGetActualBridgeMACTableManager(net) -+ == VIR_NETWORK_BRIDGE_MAC_TABLE_MANAGER_LIBVIRT) { -+ /* libvirt is managing the FDB of the bridge this device -+ * is attaching to, so we have turned off learning and -+ * unicast_flood on the device to prevent the kernel from -+ * adding any FDB entries for it. This means we need to -+ * add an fdb entry ourselves, using the MAC address from -+ * the interface config. -+ */ -+ if (virNetDevBridgeFDBAdd(&net->mac, net->ifname, -+ VIR_NETDEVBRIDGE_FDB_FLAG_MASTER | -+ VIR_NETDEVBRIDGE_FDB_FLAG_TEMP) < 0) -+ goto cleanup; -+ } - break; - case VIR_DOMAIN_NET_TYPE_DIRECT: - /* macvtap devices share their MAC address with the guest -@@ -118,6 +134,16 @@ qemuInterfaceStopDevice(virDomainNetDefPtr net) - switch (actualType) { - case VIR_DOMAIN_NET_TYPE_BRIDGE: - case VIR_DOMAIN_NET_TYPE_NETWORK: -+ if (virDomainNetGetActualBridgeMACTableManager(net) -+ == VIR_NETWORK_BRIDGE_MAC_TABLE_MANAGER_LIBVIRT) { -+ /* remove the FDB entries that were added during -+ * qemuInterfaceStartDevices() -+ */ -+ if (virNetDevBridgeFDBDel(&net->mac, net->ifname, -+ VIR_NETDEVBRIDGE_FDB_FLAG_MASTER | -+ VIR_NETDEVBRIDGE_FDB_FLAG_TEMP) < 0) -+ goto cleanup; -+ } - break; - - case VIR_DOMAIN_NET_TYPE_DIRECT: --- -2.2.0 - diff --git a/SOURCES/libvirt-qemu-add-short-document-on-qemu-event-handlers.patch b/SOURCES/libvirt-qemu-add-short-document-on-qemu-event-handlers.patch deleted file mode 100644 index 7f0f1c5..0000000 --- a/SOURCES/libvirt-qemu-add-short-document-on-qemu-event-handlers.patch +++ /dev/null @@ -1,107 +0,0 @@ -From ff87b8626006538a4f681cfe68ef336d861e2d4d Mon Sep 17 00:00:00 2001 -Message-Id: -From: Laine Stump -Date: Mon, 3 Nov 2014 10:00:19 -0500 -Subject: [PATCH] qemu: add short document on qemu event handlers - -https://bugzilla.redhat.com/show_bug.cgi?id=848199 - -This text was in the commit log for the patch that added the event -handler for NIC_RX_FILTER_CHANGED, and John Ferlan expressed a desire -that the information not be "lost", so I've put it into a file in the -qemu directory, hoping that it might catch the attention of future -writers of handlers for qemu events. - -(cherry picked from commit ac4f8be422521875b64f51bcea953a6d1c6bfb09) - -Signed-off-by: Jiri Denemark ---- - src/qemu/EVENTHANDLERS.txt | 76 ++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 76 insertions(+) - create mode 100644 src/qemu/EVENTHANDLERS.txt - -diff --git a/src/qemu/EVENTHANDLERS.txt b/src/qemu/EVENTHANDLERS.txt -new file mode 100644 -index 0000000..79c1505 ---- /dev/null -+++ b/src/qemu/EVENTHANDLERS.txt -@@ -0,0 +1,76 @@ -+This is a short description of how an example qemu event can be used -+to trigger handler code that is called from the context of a worker -+thread, rather than directly from the event thread (which should -+itself never block, and can't do things like send qemu monitor -+commands, etc). -+ -+In this case (the NIC_RX_FILTER_CHANGED event) the event is handled by -+calling a qemu monitor command to get the current RX filter state, -+then executing ioctls/sending netlink messages on the host in response -+to changes in that filter state. This event is *not* propagated to the -+libvirt API (but if someone wants to add details of how to handle that -+to the end of this document, please do!). -+ -+Hopefully this narration will be helpful when adding handlers for -+other qemu events in the future. -+ -+---------------------------------------------------- -+ -+Any event emitted by qemu is received by -+qemu_monitor_json.c:qemuMonitorJSONProcessEvent(). It looks up the -+event by name in the table eventHandlers (in the same file), which -+should have an entry like this for each event that libvirt -+understands: -+ -+ { "NIC_RX_FILTER_CHANGED", qemuMonitorJSONHandleNicRxFilterChanged, }, -+ -+ NB: This table is searched with bsearch, so it *must* be -+ alphabetically sorted. -+ -+qemuMonitorJSONProcessEvent calls the function listed in -+eventHandlers, e.g.: -+ -+ qemu_monitor_json.c:qemuMonitorJSONHandleNicRxFilterChanged() -+ -+which extracts any required data from the JSON ("name" in this case), -+and calls: -+ -+ qemu_monitor.c:qemuMonitorEmitNicRxFilterChanged() -+ -+which uses QEMU_MONITOR_CALLBACK() to call -+mon->cb->domainNicRxFilterChanged(). domainNicRxFilterChanged is one -+in a list of function pointers in qemu_process.c:monitorCallbacks. For -+our example, it has been set to: -+ -+ qemuProcessHandleNicRxFilterChanged() -+ -+This function allocates a qemuProcessEvent object, and queues an event -+named QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED (you'll want to add an -+enum to qemu_domain.h:qemuProcessEventType for your event) for a -+worker thread to handle. -+ -+(Everything up to this point has happened in the context of the thread -+that is reading events from qemu, so it should do as little as -+possible, never block, and never call back into the qemu -+monitor. Everything after this is handled in the context of a worker -+thread, so it has more freedom to make qemu monitor calls and blocking -+system calls on the host.) -+ -+When the worker thread gets the event, it calls -+ -+ qemuProcessEventHandler() -+ -+which switches on the eventType (in our example, -+QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED) and decides to call: -+ -+ processNicRxFilterChangedEvent() -+ -+and *that* is where the actual work will be done (and any -+event-specific memory allocated during qemuProcessHandleXXX() will be -+freed). Note that this function must do proper refcounting of the -+domain object, and assure that the domain is still active prior to -+performing any operations - it is possible that the domain could have -+been destroyed between the time the event was received and the time -+that it is processed, and it is also possible that the domain could be -+destroyed *during* the event processing if it doesn't get properly -+referenced by the handler. --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-add-support-for-shared-memory-mapping.patch b/SOURCES/libvirt-qemu-add-support-for-shared-memory-mapping.patch deleted file mode 100644 index 0406b59..0000000 --- a/SOURCES/libvirt-qemu-add-support-for-shared-memory-mapping.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 18f90b67fa48a0af423c76ffd414dc0f471e6e3b Mon Sep 17 00:00:00 2001 -Message-Id: <18f90b67fa48a0af423c76ffd414dc0f471e6e3b@dist-git> -From: Martin Kletzander -Date: Wed, 17 Sep 2014 16:17:57 +0200 -Subject: [PATCH] qemu: add support for shared memory mapping - -https://bugzilla.redhat.com/show_bug.cgi?id=1133144 - -Signed-off-by: Martin Kletzander -(cherry picked from commit c7abf2c856fab318adef0f89e8387200dd95daa3) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 29 ++++++++++++++++++++++ - .../qemuxml2argv-hugepages-shared.args | 16 ++++++++++++ - tests/qemuxml2argvtest.c | 5 ++++ - 3 files changed, 50 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.args - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 718533b..ce5daae 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -6544,6 +6544,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - for (i = 0; i < def->cpu->ncells; i++) { - int cellmem = VIR_DIV_UP(def->cpu->cells[i].mem, 1024); - def->cpu->cells[i].mem = cellmem * 1024; -+ virTristateSwitch memAccess = def->cpu->cells[i].memAccess; - - VIR_FREE(cpumask); - VIR_FREE(nodemask); -@@ -6622,7 +6623,28 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - virBufferAsprintf(&buf, - "memory-backend-file,prealloc=yes,mem-path=%s", - mem_path); -+ -+ switch (memAccess) { -+ case VIR_MEM_ACCESS_SHARED: -+ virBufferAddLit(&buf, ",share=on"); -+ break; -+ -+ case VIR_MEM_ACCESS_PRIVATE: -+ virBufferAddLit(&buf, ",share=off"); -+ break; -+ -+ case VIR_MEM_ACCESS_DEFAULT: -+ case VIR_MEM_ACCESS_LAST: -+ break; -+ } -+ - } else { -+ if (memAccess) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("Shared memory mapping is supported " -+ "only with hugepages")); -+ goto cleanup; -+ } - virBufferAddLit(&buf, "memory-backend-ram"); - } - -@@ -6653,6 +6675,13 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - - virCommandAddArg(cmd, "-object"); - virCommandAddArgBuffer(cmd, &buf); -+ } else { -+ if (memAccess) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("Shared memory mapping is not supported " -+ "with this QEMU")); -+ goto cleanup; -+ } - } - - virCommandAddArg(cmd, "-numa"); -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.args -new file mode 100644 -index 0000000..a7c7d92 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.args -@@ -0,0 +1,16 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 4096 -smp 4 \ -+-object memory-backend-file,prealloc=yes,mem-path=/dev/hugepages1G/libvirt/qemu,\ -+size=1024M,id=ram-node0,host-nodes=0-3,policy=bind \ -+-numa node,nodeid=0,cpus=0,memdev=ram-node0 \ -+-object memory-backend-file,prealloc=yes,mem-path=/dev/hugepages2M/libvirt/qemu,\ -+share=on,size=1024M,id=ram-node1,host-nodes=0-3,policy=bind \ -+-numa node,nodeid=1,cpus=1,memdev=ram-node1 \ -+-object memory-backend-file,prealloc=yes,mem-path=/dev/hugepages1G/libvirt/qemu,\ -+share=off,size=1024M,id=ram-node2,host-nodes=0-3,policy=bind \ -+-numa node,nodeid=2,cpus=2,memdev=ram-node2 \ -+-object memory-backend-file,prealloc=yes,mem-path=/dev/hugepages1G/libvirt/qemu,\ -+size=1024M,id=ram-node3,host-nodes=3,policy=bind \ -+-numa node,nodeid=3,cpus=3,memdev=ram-node3 \ -+-nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 5c28253..515058e 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -684,6 +684,8 @@ mymain(void) - QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST("hugepages-pages3", QEMU_CAPS_MEM_PATH, QEMU_CAPS_OBJECT_MEMORY_RAM, - QEMU_CAPS_OBJECT_MEMORY_FILE); -+ DO_TEST("hugepages-shared", QEMU_CAPS_MEM_PATH, QEMU_CAPS_OBJECT_MEMORY_RAM, -+ QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST("nosharepages", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MEM_MERGE); - DO_TEST("disk-cdrom", NONE); - DO_TEST("disk-cdrom-network-http", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE, -@@ -1207,6 +1209,9 @@ mymain(void) - DO_TEST_PARSE_ERROR("cpu-numa3", NONE); - DO_TEST_FAILURE("cpu-numa-disjoint", NONE); - DO_TEST("cpu-numa-disjoint", QEMU_CAPS_NUMA); -+ DO_TEST_FAILURE("cpu-numa-memshared", QEMU_CAPS_SMP_TOPOLOGY, -+ QEMU_CAPS_OBJECT_MEMORY_RAM); -+ DO_TEST_FAILURE("cpu-numa-memshared", QEMU_CAPS_SMP_TOPOLOGY); - DO_TEST("cpu-host-model", NONE); - skipLegacyCPUs = true; - DO_TEST("cpu-host-model-fallback", NONE); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-add-the-missing-jobinfo-type-in-qemuDomainGetJobInfo.patch b/SOURCES/libvirt-qemu-add-the-missing-jobinfo-type-in-qemuDomainGetJobInfo.patch deleted file mode 100644 index 33ff722..0000000 --- a/SOURCES/libvirt-qemu-add-the-missing-jobinfo-type-in-qemuDomainGetJobInfo.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 4d07d05042b45aea07e2458021a88af24b3be225 Mon Sep 17 00:00:00 2001 -Message-Id: <4d07d05042b45aea07e2458021a88af24b3be225@dist-git> -From: Wang Rui -Date: Tue, 25 Nov 2014 19:51:45 +0800 -Subject: [PATCH] qemu: add the missing jobinfo type in qemuDomainGetJobInfo - -Commit 6fcddfcd refactored job statistics but missed the jobinfo type updated -in qemuDomainGetJobInfo. After this patch, we can use virDomainGetJobInfo to -get jobinfo type again. - -https://bugzilla.redhat.com/show_bug.cgi?id=1167883 - -Signed-off-by: Wang Rui -Signed-off-by: Jiri Denemark -(cherry picked from commit 64b84911cecb82afa7ec08ce206eb1b71f76e04d) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index f61593b..d248d5b 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -258,6 +258,7 @@ int - qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo, - virDomainJobInfoPtr info) - { -+ info->type = jobInfo->type; - info->timeElapsed = jobInfo->timeElapsed; - info->timeRemaining = jobInfo->timeRemaining; - --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-always-call-qemuInterfaceStartDevices-when-starting-CPUs.patch b/SOURCES/libvirt-qemu-always-call-qemuInterfaceStartDevices-when-starting-CPUs.patch deleted file mode 100644 index 03fbd15..0000000 --- a/SOURCES/libvirt-qemu-always-call-qemuInterfaceStartDevices-when-starting-CPUs.patch +++ /dev/null @@ -1,61 +0,0 @@ -From d901bf4a3f8da16ab50ddf2dc955e6d40cbe451f Mon Sep 17 00:00:00 2001 -Message-Id: -From: Laine Stump -Date: Sun, 14 Dec 2014 23:44:50 -0500 -Subject: [PATCH] qemu: always call qemuInterfaceStartDevices() when starting - CPUs - -The patch that added qemuInterfaceStartDevices() (upstream commit -82977058f5b1d143a355079900029e9cbfee2fe4) had an extra conditional to -prevent calling it if the reason for starting the CPUs was -VIR_DOMAIN_RUNNING_UNPAUSED or VIR_DOMAIN_RUNNING_SAVE_CANCELED. This -was put in by the author as the result of a reviewer asking if it was -necessary to ifup the interfaces in *all* occasions (because these -were the two cases where the CPU would have already been started (and -stopped) once, so the interface would already be ifup'ed). - -It turns out that, as long as there is no corresponding -qemuInterfaceStopDevices() to ifdown the interfaces anytime the CPUs -are stopped, neglecting to ifup when reason is RUNNING_UNPAUSED or -RUNNING_SAVE_CANCELED doesn't cause any problems (because it just -happens that the interface will have already been ifup'ed by a prior -call when the CPU was previously started for some other reason). - -However, it also doesn't *help*, and there will soon be a -qemuInterfaceStopDevices() function which *will* ifdown these -interfaces when the guest CPUs are stopped, and once that is done, the -interfaces will be left down in some cases when they should be up (for -example, if a domain is paused and then unpaused). - -So, this patch is removing the condition in favor of always calling -qemuInterfaeStartDevices() when the guest CPUs are started. - -This patch (and the aforementioned patch) resolve: - - https://bugzilla.redhat.com/show_bug.cgi?id=1081461 - -(cherry picked from commit 879c13d6cc92b6c3d97168e822201e5d00c4a1bc) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index dd74432..627755d 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3114,9 +3114,7 @@ qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm, - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - - /* Bring up netdevs before starting CPUs */ -- if (reason != VIR_DOMAIN_RUNNING_UNPAUSED && -- reason != VIR_DOMAIN_RUNNING_SAVE_CANCELED && -- qemuInterfaceStartDevices(vm->def) < 0) -+ if (qemuInterfaceStartDevices(vm->def) < 0) - goto cleanup; - - VIR_DEBUG("Using lock state '%s'", NULLSTR(priv->lockState)); --- -2.2.0 - diff --git a/SOURCES/libvirt-qemu-attach-Assign-device-aliases.patch b/SOURCES/libvirt-qemu-attach-Assign-device-aliases.patch deleted file mode 100644 index 96ca9b8..0000000 --- a/SOURCES/libvirt-qemu-attach-Assign-device-aliases.patch +++ /dev/null @@ -1,39 +0,0 @@ -From b25d3689c715af6f7d39194d273fb5ebcb0dccc2 Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Tue, 28 Oct 2014 22:28:49 -0400 -Subject: [PATCH] qemu-attach: Assign device aliases - -https://bugzilla.redhat.com/show_bug.cgi?id=1141621 - -As part of attach processing, assign the device aliases by calling -qemuAssignDeviceAliases during qemuDomainQemuAttach once all the devices -are found after the qemuParseCommandLinePid processing. - -This will alleviate a symptom that caused a libvirtd crash during an -attempted device detach. - -(cherry picked from commit e3a52afcfcc3478b553dca38140394fd93f90a2c) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 88a1895..c158f64 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -14793,6 +14793,9 @@ static virDomainPtr qemuDomainQemuAttach(virConnectPtr conn, - if (qemuCanonicalizeMachine(def, qemuCaps) < 0) - goto cleanup; - -+ if (qemuAssignDeviceAliases(def, qemuCaps) < 0) -+ goto cleanup; -+ - if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0) - goto cleanup; - --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-avoid-rare-race-when-undefining-domain.patch b/SOURCES/libvirt-qemu-avoid-rare-race-when-undefining-domain.patch deleted file mode 100644 index dfcd3af..0000000 --- a/SOURCES/libvirt-qemu-avoid-rare-race-when-undefining-domain.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 0e943a1b117ea13b530236f94a0bc22a831eefeb Mon Sep 17 00:00:00 2001 -Message-Id: <0e943a1b117ea13b530236f94a0bc22a831eefeb@dist-git> -From: Martin Kletzander -Date: Tue, 4 Nov 2014 11:02:52 +0100 -Subject: [PATCH] qemu: avoid rare race when undefining domain - -When one domain is being undefined and at the same time started, for -example, there is a possibility of a rare problem occuring. - - - Thread 1 does virDomainUndefine(), has the lock, checks that the - domain is active and because it's not, calls - virDomainObjListRemove(). - - - Thread 2 does virDomainCreate() and tries to lock the domain. - - - Thread 1 needs to lock domain list in order to remove the domain from - it, but must unlock domain first (proper order is to lock domain list - first and the domain itself second). - - - Thread 2 grabs the lock, starts the domain and releases the lock. - - - Thread 1 grabs the lock and removes the domain from list. - -With this patch: - - - qemuDomainRemoveInactive() creates a QEMU_JOB_MODIFY if that's - possible, but since it must remove the domain from list either way, - it continues even when starting the job failed. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1150505 - -Signed-off-by: Martin Kletzander -(cherry picked from commit b629c64e5e0a32ef439b8eeb3a697e2cd76f3248) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 72d7279..d166269 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -2391,9 +2391,13 @@ void - qemuDomainRemoveInactive(virQEMUDriverPtr driver, - virDomainObjPtr vm) - { -+ bool haveJob = true; - char *snapDir; - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - -+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -+ haveJob = false; -+ - /* Remove any snapshot metadata prior to removing the domain */ - if (qemuDomainSnapshotDiscardAllMetadata(driver, vm) < 0) { - VIR_WARN("unable to remove all snapshots for domain %s", -@@ -2410,6 +2414,9 @@ qemuDomainRemoveInactive(virQEMUDriverPtr driver, - } - virDomainObjListRemove(driver->domains, vm); - virObjectUnref(cfg); -+ -+ if (haveJob) -+ ignore_value(qemuDomainObjEndJob(driver, vm)); - } - - void --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-avoid-rare-race-when-undefining-domain_1.patch b/SOURCES/libvirt-qemu-avoid-rare-race-when-undefining-domain_1.patch deleted file mode 100644 index 43ff415..0000000 --- a/SOURCES/libvirt-qemu-avoid-rare-race-when-undefining-domain_1.patch +++ /dev/null @@ -1,115 +0,0 @@ -From eeb166cea4a966f01d9241eba1d465d8466e7768 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Martin Kletzander -Date: Sat, 13 Dec 2014 10:10:52 +0100 -Subject: [PATCH] qemu: avoid rare race when undefining domain - -When one domain is being undefined and at the same time started, for -example, there is a possibility of a rare problem occuring. - - - Thread 1 does virDomainUndefine(), has the lock, checks that the - domain is active and because it's not, calls - virDomainObjListRemove(). - - - Thread 2 does virDomainCreate() and tries to lock the domain. - - - Thread 1 needs to lock domain list in order to remove the domain from - it, but must unlock domain first (proper order is to lock domain list - first and the domain itself second). - - - Thread 2 grabs the lock, starts the domain and releases the lock. - - - Thread 1 grabs the lock and removes the domain from list. - -With this patch: - - - The undefining domain gets marked as "to undefine" before it is - unlocked. - - - If domain is found in any of the search APIs, it's returned only if - it is not marked as "to undefine". The check is done while the - domain is locked. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1150505 - -Signed-off-by: Martin Kletzander -(cherry picked from commit c7d1c139ca3402e875002753952e80ce8054374e) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 22 +++++++++++++++++++--- - src/conf/domain_conf.h | 1 + - 2 files changed, 20 insertions(+), 3 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 25f20f8..20ae4e7 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1056,8 +1056,13 @@ virDomainObjPtr virDomainObjListFindByID(virDomainObjListPtr doms, - virDomainObjPtr obj; - virObjectLock(doms); - obj = virHashSearch(doms->objs, virDomainObjListSearchID, &id); -- if (obj) -+ if (obj) { - virObjectLock(obj); -+ if (obj->removing) { -+ virObjectUnlock(obj); -+ obj = NULL; -+ } -+ } - virObjectUnlock(doms); - return obj; - } -@@ -1073,8 +1078,13 @@ virDomainObjPtr virDomainObjListFindByUUID(virDomainObjListPtr doms, - virUUIDFormat(uuid, uuidstr); - - obj = virHashLookup(doms->objs, uuidstr); -- if (obj) -+ if (obj) { - virObjectLock(obj); -+ if (obj->removing) { -+ virObjectUnlock(obj); -+ obj = NULL; -+ } -+ } - virObjectUnlock(doms); - return obj; - } -@@ -1099,8 +1109,13 @@ virDomainObjPtr virDomainObjListFindByName(virDomainObjListPtr doms, - virDomainObjPtr obj; - virObjectLock(doms); - obj = virHashSearch(doms->objs, virDomainObjListSearchName, name); -- if (obj) -+ if (obj) { - virObjectLock(obj); -+ if (obj->removing) { -+ virObjectUnlock(obj); -+ obj = NULL; -+ } -+ } - virObjectUnlock(doms); - return obj; - } -@@ -2537,6 +2552,7 @@ void virDomainObjListRemove(virDomainObjListPtr doms, - { - char uuidstr[VIR_UUID_STRING_BUFLEN]; - -+ dom->removing = true; - virUUIDFormat(dom->def->uuid, uuidstr); - virObjectRef(dom); - virObjectUnlock(dom); -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 04cee80..01d5aeb 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2149,6 +2149,7 @@ struct _virDomainObj { - unsigned int autostart : 1; - unsigned int persistent : 1; - unsigned int updated : 1; -+ unsigned int removing : 1; - - virDomainDefPtr def; /* The current definition */ - virDomainDefPtr newDef; /* New definition to activate at shutdown */ --- -2.2.0 - diff --git a/SOURCES/libvirt-qemu-better-error-message-when-block-job-can-t-succeed.patch b/SOURCES/libvirt-qemu-better-error-message-when-block-job-can-t-succeed.patch deleted file mode 100644 index 37b9a01..0000000 --- a/SOURCES/libvirt-qemu-better-error-message-when-block-job-can-t-succeed.patch +++ /dev/null @@ -1,84 +0,0 @@ -From b514fee67a81636d71e4598ab8a1bcc64459f7b2 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Eric Blake -Date: Wed, 29 Oct 2014 15:15:23 -0600 -Subject: [PATCH] qemu: better error message when block job can't succeed - -https://bugzilla.redhat.com/show_bug.cgi?id=1140981 reports that -the qemu-kvm shipped as part of RHEL 7.0 intentionally[1] cripples -block jobs by removing the 'block-stream' QMP command, while still -leaving 'block-job-cancel' as an unusable no-op. Meanwhile, we -already had existing code that checked whether block jobs were -completely missing (such as qemu 0.15), old style (cancel is -synchronous, and all commands spelled with '_'), or new style -(cancel is asynchronous, and all commands spelled with '-'), and -used that three-way probe to give decent error messages. At the -time that code was added, all existing qemu versions fell in one -of three buckets, and the code was using the presence of -'block-job-cancel' as the witness of which of the three buckets. -But now that RHEL qemu has shipped with intentionally crippled -'block-stream', we have a fourth bucket, which results in ugly -error messages when trying 'virsh blockpull': - - error: Requested operation is not valid: Command 'block-stream' is not found - -In reality, the fourth bucket should be treated the same as the -first bucket (no block job support); we can do that by realizing -that no existing build of qemu has working block-stream while -lacking block-job-cancel, so it is easiest to change our witness -to the command that starts a job rather than ends one. We still -act correctly regarding command spelling and whether cancel is -asynchronous. And on crippled RHEL builds, we now get the desired: - - error: unsupported configuration: block jobs not supported with this qemu binary - -[1] The intentional cripple is limited to qemu-kvm of RHEL; when using -qemu-kvm-rhev of RHEV, block job functionality is supported. Don't ask -me to explain the "why" behind it all - I'm just dealing with fallout -from someone else's decision. - -* src/qemu/qemu_capabilities.h (QEMU_CAPS_BLOCKJOB_SYNC): Tweak comment. -* src/qemu/qemu_capabilities.c (virQEMUCapsCommands): Look for stream -rather than cancel when determining the flavor of block jobs supported. - -Signed-off-by: Eric Blake -(cherry picked from commit 00331bfbc9626ee9e94352453087b521943236ca) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 4 ++-- - src/qemu/qemu_capabilities.h | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index bb804d3..683b882 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -1422,8 +1422,8 @@ struct virQEMUCapsStringFlags { - struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { - { "system_wakeup", QEMU_CAPS_WAKEUP }, - { "transaction", QEMU_CAPS_TRANSACTION }, -- { "block_job_cancel", QEMU_CAPS_BLOCKJOB_SYNC }, -- { "block-job-cancel", QEMU_CAPS_BLOCKJOB_ASYNC }, -+ { "block_stream", QEMU_CAPS_BLOCKJOB_SYNC }, -+ { "block-stream", QEMU_CAPS_BLOCKJOB_ASYNC }, - { "dump-guest-memory", QEMU_CAPS_DUMP_GUEST_MEMORY }, - { "query-spice", QEMU_CAPS_SPICE }, - { "query-kvm", QEMU_CAPS_KVM }, -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index d3a9a0a..08c531d 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -127,8 +127,8 @@ typedef enum { - QEMU_CAPS_SCSI_DISK_CHANNEL = 87, /* Is scsi-disk.channel available? */ - QEMU_CAPS_SCSI_BLOCK = 88, /* -device scsi-block */ - QEMU_CAPS_TRANSACTION = 89, /* transaction monitor command */ -- QEMU_CAPS_BLOCKJOB_SYNC = 90, /* RHEL 6.2 block_job_cancel */ -- QEMU_CAPS_BLOCKJOB_ASYNC = 91, /* qemu 1.1 block-job-cancel */ -+ QEMU_CAPS_BLOCKJOB_SYNC = 90, /* old block_job_cancel, block_stream */ -+ QEMU_CAPS_BLOCKJOB_ASYNC = 91, /* new block-job-cancel, block-stream */ - QEMU_CAPS_SCSI_CD = 92, /* -device scsi-cd */ - QEMU_CAPS_IDE_CD = 93, /* -device ide-cd */ - QEMU_CAPS_NO_USER_CONFIG = 94, /* -no-user-config */ --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-block-commit-Mark-disk-in-block-jobs-only-on-successful-command.patch b/SOURCES/libvirt-qemu-block-commit-Mark-disk-in-block-jobs-only-on-successful-command.patch deleted file mode 100644 index 2f1d9e9..0000000 --- a/SOURCES/libvirt-qemu-block-commit-Mark-disk-in-block-jobs-only-on-successful-command.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 826bf4c001e1190982e500c6d88c0513d3e507ce Mon Sep 17 00:00:00 2001 -Message-Id: <826bf4c001e1190982e500c6d88c0513d3e507ce@dist-git> -From: Peter Krempa -Date: Tue, 17 Mar 2015 13:13:54 +0100 -Subject: [PATCH] qemu: block-commit: Mark disk in block jobs only on - successful command - -https://bugzilla.redhat.com/show_bug.cgi?id=1202719 - -Patch 51f9f03a4ca50b070c0fbfb29748d49f583e15e1 introduces a regression -where if a blockCommit operation fails the disk is still marked as being -part of a block job but can't be unmarked later. - -(cherry picked from commit ee744b5b387b5123ee40683c52ab40783ffc3020) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 2bd4a1d..9dc243a 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -16354,7 +16354,8 @@ qemuDomainBlockCommit(virDomainPtr dom, - bandwidth); - qemuDomainObjExitMonitor(driver, vm); - -- disk->blockjob = true; -+ if (ret == 0) -+ disk->blockjob = true; - - if (mirror) { - if (ret == 0) { --- -2.3.3 - diff --git a/SOURCES/libvirt-qemu-blockjob-Synchronously-update-backing-chain-in-XML-on-ABORT-PIVOT.patch b/SOURCES/libvirt-qemu-blockjob-Synchronously-update-backing-chain-in-XML-on-ABORT-PIVOT.patch deleted file mode 100644 index d7b4f55..0000000 --- a/SOURCES/libvirt-qemu-blockjob-Synchronously-update-backing-chain-in-XML-on-ABORT-PIVOT.patch +++ /dev/null @@ -1,231 +0,0 @@ -From a0cfb6daa757761c0397dc0ceb211b64891a1983 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Thu, 2 Apr 2015 11:27:59 +0200 -Subject: [PATCH] qemu: blockjob: Synchronously update backing chain in XML on - ABORT/PIVOT - -https://bugzilla.redhat.com/show_bug.cgi?id=1208021 - -When the synchronous pivot option is selected, libvirt would not update -the backing chain until the job was exitted. Some applications then -received invalid data as their job serialized first. - -This patch removes polling to wait for the ABORT/PIVOT job completion -and replaces it with a condition. If a synchronous operation is -requested the update of the XML is executed in the job of the caller of -the synchronous request. Otherwise the monitor event callback uses a -separate worker to update the backing chain with a new job. - -This is a regression since 1a92c719101e5bfa6fe2b78006ad04c7f075ea28 -(downstream commit 12fdae1ebb74296a4db3b191f16dfda757024b8f) - -When the ABORT job is finished synchronously you get the following call -stack: - #0 qemuBlockJobEventProcess - #1 qemuDomainBlockJobImpl - #2 qemuDomainBlockJobAbort - #3 virDomainBlockJobAbort - -While previously or while using the _ASYNC flag you'd get: - #0 qemuBlockJobEventProcess - #1 processBlockJobEvent - #2 qemuProcessEventHandler - #3 virThreadPoolWorker - -(cherry picked from commit 630ee5ac6cf4e3be3f3e986897a289865dd2604b) - -Conflicts: - src/qemu/qemu_driver.c - context: The deleted hunk that was - polling for the block job state was not yet converted to the new - locking scheme downstream. - -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 16 +++++++++++++++- - src/conf/domain_conf.h | 6 ++++++ - src/qemu/qemu_driver.c | 45 +++++++++++++++++++-------------------------- - src/qemu/qemu_process.c | 38 +++++++++++++++++++++++++------------- - 4 files changed, 65 insertions(+), 40 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 9bfffd0..c7059d2 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1238,9 +1238,22 @@ virDomainDiskDefNew(void) - - if (VIR_ALLOC(ret) < 0) - return NULL; -+ - if (VIR_ALLOC(ret->src) < 0) -- VIR_FREE(ret); -+ goto error; -+ -+ if (virCondInit(&ret->blockJobSyncCond) < 0) { -+ virReportSystemError(errno, "%s", _("Failed to initialize condition")); -+ goto error; -+ } -+ - return ret; -+ -+ error: -+ virStorageSourceFree(ret->src); -+ VIR_FREE(ret); -+ -+ return NULL; - } - - -@@ -1258,6 +1271,7 @@ virDomainDiskDefFree(virDomainDiskDefPtr def) - VIR_FREE(def->vendor); - VIR_FREE(def->product); - virDomainDeviceInfoClear(&def->info); -+ virCondDestroy(&def->blockJobSyncCond); - - VIR_FREE(def); - } -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 654c27d..d672294 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -644,6 +644,12 @@ struct _virDomainDiskDef { - int mirrorState; /* enum virDomainDiskMirrorState */ - int mirrorJob; /* virDomainBlockJobType */ - -+ /* for some synchronous block jobs, we need to notify the owner */ -+ virCond blockJobSyncCond; -+ int blockJobType; /* type of the block job from the event */ -+ int blockJobStatus; /* status of the finished block job */ -+ bool blockJobSync; /* the block job needs synchronized termination */ -+ - struct { - unsigned int cylinders; - unsigned int heads; -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 490650e..5f7fedc 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -15693,6 +15693,12 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm, - goto endjob; - - if (mode == BLOCK_JOB_ABORT) { -+ if (async && !(flags & VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC)) { -+ /* prepare state for event delivery */ -+ disk->blockJobStatus = -1; -+ disk->blockJobSync = true; -+ } -+ - if ((flags & VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT) && - !(async && disk->mirror)) { - virReportError(VIR_ERR_OPERATION_INVALID, -@@ -15802,36 +15808,23 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm, - status); - event2 = virDomainEventBlockJob2NewFromObj(vm, disk->dst, type, - status); -- } else if (!(flags & VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC)) { -+ } else if (disk->blockJobSync) { - /* XXX If the event reports failure, we should reflect - * that back into the return status of this API call. */ -- while (1) { -- /* Poll every 50ms */ -- static struct timespec ts = { .tv_sec = 0, -- .tv_nsec = 50 * 1000 * 1000ull }; -- virDomainBlockJobInfo dummy; -- -- qemuDomainObjEnterMonitor(driver, vm); -- ret = qemuMonitorBlockJob(priv->mon, device, NULL, NULL, 0, -- &dummy, BLOCK_JOB_INFO, async); -- qemuDomainObjExitMonitor(driver, vm); -- -- if (ret <= 0) -- break; -- -- virObjectUnlock(vm); -- -- nanosleep(&ts, NULL); -- -- virObjectLock(vm); -- -- if (!virDomainObjIsActive(vm)) { -- virReportError(VIR_ERR_OPERATION_INVALID, "%s", -- _("domain is not running")); -- ret = -1; -- break; -+ while (disk->blockJobStatus == -1 && disk->blockJobSync) { -+ if (virCondWait(&disk->blockJobSyncCond, &vm->parent.lock) < 0) { -+ virReportSystemError(errno, "%s", -+ _("Unable to wait on block job sync " -+ "condition")); -+ disk->blockJobSync = false; -+ goto endjob; - } - } -+ -+ qemuBlockJobEventProcess(driver, vm, disk, -+ disk->blockJobType, -+ disk->blockJobStatus); -+ disk->blockJobSync = false; - } - } - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 83a59a1..49b5df4 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -1025,28 +1025,40 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - { - virQEMUDriverPtr driver = opaque; - struct qemuProcessEvent *processEvent = NULL; -- char *data; -+ virDomainDiskDefPtr disk; -+ char *data = NULL; - - virObjectLock(vm); - - VIR_DEBUG("Block job for device %s (domain: %p,%s) type %d status %d", - diskAlias, vm, vm->def->name, type, status); - -- if (VIR_ALLOC(processEvent) < 0) -+ if (!(disk = qemuProcessFindDomainDiskByAlias(vm, diskAlias))) - goto error; - -- processEvent->eventType = QEMU_PROCESS_EVENT_BLOCK_JOB; -- if (VIR_STRDUP(data, diskAlias) < 0) -- goto error; -- processEvent->data = data; -- processEvent->vm = vm; -- processEvent->action = type; -- processEvent->status = status; -+ if (disk->blockJobSync) { -+ disk->blockJobType = type; -+ disk->blockJobStatus = status; -+ /* We have an SYNC API waiting for this event, dispatch it back */ -+ virCondSignal(&disk->blockJobSyncCond); -+ } else { -+ /* there is no waiting SYNC API, dispatch the update to a thread */ -+ if (VIR_ALLOC(processEvent) < 0) -+ goto error; - -- virObjectRef(vm); -- if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) { -- ignore_value(virObjectUnref(vm)); -- goto error; -+ processEvent->eventType = QEMU_PROCESS_EVENT_BLOCK_JOB; -+ if (VIR_STRDUP(data, diskAlias) < 0) -+ goto error; -+ processEvent->data = data; -+ processEvent->vm = vm; -+ processEvent->action = type; -+ processEvent->status = status; -+ -+ virObjectRef(vm); -+ if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) { -+ ignore_value(virObjectUnref(vm)); -+ goto error; -+ } - } - - cleanup: --- -2.3.5 - diff --git a/SOURCES/libvirt-qemu-bulk-stats-Fix-logic-in-monitor-handling.patch b/SOURCES/libvirt-qemu-bulk-stats-Fix-logic-in-monitor-handling.patch deleted file mode 100644 index 0d0e9d9..0000000 --- a/SOURCES/libvirt-qemu-bulk-stats-Fix-logic-in-monitor-handling.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 9186d0bb6d56bdf61836bc0e425252346ea16b6a Mon Sep 17 00:00:00 2001 -Message-Id: <9186d0bb6d56bdf61836bc0e425252346ea16b6a@dist-git> -From: Francesco Romani -Date: Sat, 13 Dec 2014 10:10:02 +0100 -Subject: [PATCH] qemu: bulk stats: Fix logic in monitor handling - -https://bugzilla.redhat.com/show_bug.cgi?id=1172570 - -A logic bug in qemuConnectGetAllDomainStats makes the code mark the -monitor as available when qemuDomainObjBeginJob fails, instead of when -it succeeds, as the correct flow requires. - -This patch fixes the check and updates the code documentation -accordingly. - -Broken by commit 57023c0a3af4af1c547189c1f6712ed5edeb0c0b. - -Signed-off-by: Francesco Romani -(cherry picked from commit cb104ef734dfea12cb8826dba7e2c98912c4b7e1) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 1625ddd..4498194 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -18264,9 +18264,9 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, - } - - if (HAVE_JOB(privflags) && -- qemuDomainObjBeginJob(driver, dom, QEMU_JOB_QUERY) < 0) -- /* As it was never requested. Gather as much as possible anyway. */ -+ qemuDomainObjBeginJob(driver, dom, QEMU_JOB_QUERY) == 0) - domflags |= QEMU_DOMAIN_STATS_HAVE_JOB; -+ /* else: without a job it's still possible to gather some data */ - - if (qemuDomainGetStats(conn, dom, stats, &tmp, domflags) < 0) - goto endjob; --- -2.2.0 - diff --git a/SOURCES/libvirt-qemu-bulk-stats-add-block-allocation-information.patch b/SOURCES/libvirt-qemu-bulk-stats-add-block-allocation-information.patch deleted file mode 100644 index f2b8059..0000000 --- a/SOURCES/libvirt-qemu-bulk-stats-add-block-allocation-information.patch +++ /dev/null @@ -1,253 +0,0 @@ -From bcdc18a163fe888c98eda477eb265541ed12357a Mon Sep 17 00:00:00 2001 -Message-Id: -From: Francesco Romani -Date: Wed, 1 Oct 2014 11:20:24 +0200 -Subject: [PATCH] qemu: bulk stats: add block allocation information - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -Management software wants to be able to allocate disk space on demand. -To support this they need keep track of the space occupation of the -block device. This information is reported by qemu as part of block -stats. - -This patch extend the block information in the bulk stats with the -allocation information. - -To keep the same behaviour a helper is extracted from -qemuMonitorJSONGetBlockExtent in order to get per-device allocation -information. - -Signed-off-by: Francesco Romani -Signed-off-by: Peter Krempa -(cherry picked from commit 7557ddf8be79f9687bc8f69946aba71c4c29d7d5) -Signed-off-by: Jiri Denemark ---- - src/libvirt.c | 6 +++ - src/qemu/qemu_driver.c | 27 +++++++++++++ - src/qemu/qemu_monitor.h | 1 + - src/qemu/qemu_monitor_json.c | 91 ++++++++++++++++++++++++++++++++++---------- - 4 files changed, 105 insertions(+), 20 deletions(-) - -diff --git a/src/libvirt.c b/src/libvirt.c -index af89aa2..5c086c8 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21615,6 +21615,12 @@ virConnectGetDomainCapabilities(virConnectPtr conn, - * unsigned long long. - * "block..errors" - Xen only: the 'oo_req' value as - * unsigned long long. -+ * "block..allocation" - offset of the highest written sector -+ * as unsigned long long. -+ * "block..capacity" - logical size in bytes of the block device backing -+ * image as unsigned long long. -+ * "block..physical" - physical size in bytes of the container of the -+ * backing image as unsigned long long. - * - * Note that entire stats groups or individual stat fields may be missing from - * the output in case they are not supported by the given hypervisor, are not -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 1a16da7..9586c43 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17705,6 +17705,19 @@ do { \ - goto cleanup; \ - } while (0) - -+#define QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, num, name, value) \ -+do { \ -+ char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; \ -+ snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, \ -+ "block.%zu.%s", num, name); \ -+ if (virTypedParamsAddULLong(&(record)->params, \ -+ &(record)->nparams, \ -+ maxparams, \ -+ param_name, \ -+ value) < 0) \ -+ goto cleanup; \ -+} while (0) -+ - static int - qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - virDomainObjPtr dom, -@@ -17723,6 +17736,7 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - - qemuDomainObjEnterMonitor(driver, dom); - rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats); -+ ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats)); - qemuDomainObjExitMonitor(driver, dom); - - if (rc < 0) { -@@ -17759,6 +17773,17 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - "fl.reqs", entry->flush_req); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, - "fl.times", entry->flush_total_times); -+ -+ QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, i, -+ "allocation", entry->wr_highest_offset); -+ -+ if (entry->capacity) -+ QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, i, -+ "capacity", entry->capacity); -+ if (entry->physical) -+ QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, i, -+ "physical", entry->physical); -+ - } - - ret = 0; -@@ -17770,6 +17795,8 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - - #undef QEMU_ADD_BLOCK_PARAM_LL - -+#undef QEMU_ADD_BLOCK_PARAM_ULL -+ - #undef QEMU_ADD_NAME_PARAM - - #undef QEMU_ADD_COUNT_PARAM -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index 9c798cf..5bffca8 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -360,6 +360,7 @@ struct _qemuBlockStats { - long long flush_total_times; - unsigned long long capacity; - unsigned long long physical; -+ unsigned long long wr_highest_offset; - }; - - int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index b0a9c99..afb713d 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -1756,6 +1756,40 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - } - - -+typedef enum { -+ QEMU_MONITOR_BLOCK_EXTENT_ERROR_OK, -+ QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOPARENT, -+ QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOSTATS, -+ QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOOFFSET, -+} qemuMonitorBlockExtentError; -+ -+ -+static int -+qemuMonitorJSONDevGetBlockExtent(virJSONValuePtr dev, -+ unsigned long long *extent) -+{ -+ virJSONValuePtr stats; -+ virJSONValuePtr parent; -+ -+ if ((parent = virJSONValueObjectGet(dev, "parent")) == NULL || -+ parent->type != VIR_JSON_TYPE_OBJECT) { -+ return QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOPARENT; -+ } -+ -+ if ((stats = virJSONValueObjectGet(parent, "stats")) == NULL || -+ stats->type != VIR_JSON_TYPE_OBJECT) { -+ return QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOSTATS; -+ } -+ -+ if (virJSONValueObjectGetNumberUlong(stats, "wr_highest_offset", -+ extent) < 0) { -+ return QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOOFFSET; -+ } -+ -+ return QEMU_MONITOR_BLOCK_EXTENT_ERROR_OK; -+} -+ -+ - int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - virHashTablePtr *ret_stats) - { -@@ -1881,6 +1915,9 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - goto cleanup; - } - -+ /* it's ok to not have this information here. Just skip silently. */ -+ qemuMonitorJSONDevGetBlockExtent(dev, &bstats->wr_highest_offset); -+ - if (virHashAddEntry(hash, dev_name, bstats) < 0) - goto cleanup; - bstats = NULL; -@@ -2050,6 +2087,36 @@ int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon, - return ret; - } - -+ -+static int -+qemuMonitorJSONReportBlockExtentError(qemuMonitorBlockExtentError error) -+{ -+ switch (error) { -+ case QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOPARENT: -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("blockstats parent entry was not in " -+ "expected format")); -+ break; -+ -+ case QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOSTATS: -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("blockstats stats entry was not in " -+ "expected format")); -+ -+ case QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOOFFSET: -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("cannot read %s statistic"), -+ "wr_highest_offset"); -+ break; -+ -+ case QEMU_MONITOR_BLOCK_EXTENT_ERROR_OK: -+ return 0; -+ } -+ -+ return -1; -+} -+ -+ - int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon, - const char *dev_name, - unsigned long long *extent) -@@ -2084,9 +2151,8 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon, - - for (i = 0; i < virJSONValueArraySize(devices); i++) { - virJSONValuePtr dev = virJSONValueArrayGet(devices, i); -- virJSONValuePtr stats; -- virJSONValuePtr parent; - const char *thisdev; -+ int err; - if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats device entry was not in expected format")); -@@ -2110,24 +2176,9 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon, - continue; - - found = true; -- if ((parent = virJSONValueObjectGet(dev, "parent")) == NULL || -- parent->type != VIR_JSON_TYPE_OBJECT) { -- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("blockstats parent entry was not in expected format")); -- goto cleanup; -- } -- -- if ((stats = virJSONValueObjectGet(parent, "stats")) == NULL || -- stats->type != VIR_JSON_TYPE_OBJECT) { -- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("blockstats stats entry was not in expected format")); -- goto cleanup; -- } -- -- if (virJSONValueObjectGetNumberUlong(stats, "wr_highest_offset", extent) < 0) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("cannot read %s statistic"), -- "wr_highest_offset"); -+ if ((err = qemuMonitorJSONDevGetBlockExtent(dev, extent)) != -+ QEMU_MONITOR_BLOCK_EXTENT_ERROR_OK) { -+ qemuMonitorJSONReportBlockExtentError(err); - goto cleanup; - } - } --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-bulk-stats-extend-internal-collection-API.patch b/SOURCES/libvirt-qemu-bulk-stats-extend-internal-collection-API.patch deleted file mode 100644 index a4c47af..0000000 --- a/SOURCES/libvirt-qemu-bulk-stats-extend-internal-collection-API.patch +++ /dev/null @@ -1,175 +0,0 @@ -From 5f9e238175a43da530e2bfc7946cd81659bad915 Mon Sep 17 00:00:00 2001 -Message-Id: <5f9e238175a43da530e2bfc7946cd81659bad915@dist-git> -From: Francesco Romani -Date: Wed, 1 Oct 2014 11:20:11 +0200 -Subject: [PATCH] qemu: bulk stats: extend internal collection API - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -Future patches which will implement more bulk stats groups for QEMU will -need to access the connection object. - -To accommodate that, a few changes are needed: - -* enrich internal prototype to pass qemu driver object - -* add per-group flag to mark if one collector needs monitor access or not - -* If at least one collector of the requested stats needs monitor access - we must start a query job for each domain. The specific collectors - will run nested monitor jobs inside that. - -* If the job can't be acquired we pass flags to the collector so - specific collectors that need monitor access can be skipped in order - to gather as much data as is possible. - -Signed-off-by: Francesco Romani -Signed-off-by: Peter Krempa -(cherry picked from commit 1f4831ee6ecc17d0f2008d7db15bfd9bc3b1d685) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 63 +++++++++++++++++++++++++++++++++++++++++++------- - 1 file changed, 55 insertions(+), 8 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 08f0142..1d94330 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17412,7 +17412,8 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, - - - static int --qemuDomainGetStatsState(virDomainObjPtr dom, -+qemuDomainGetStatsState(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, -+ virDomainObjPtr dom, - virDomainStatsRecordPtr record, - int *maxparams, - unsigned int privflags ATTRIBUTE_UNUSED) -@@ -17435,8 +17436,18 @@ qemuDomainGetStatsState(virDomainObjPtr dom, - } - - -+typedef enum { -+ QEMU_DOMAIN_STATS_HAVE_JOB = (1 << 0), /* job is entered, monitor can be -+ accessed */ -+} qemuDomainStatsFlags; -+ -+ -+#define HAVE_JOB(flags) ((flags) & QEMU_DOMAIN_STATS_HAVE_JOB) -+ -+ - typedef int --(*qemuDomainGetStatsFunc)(virDomainObjPtr dom, -+(*qemuDomainGetStatsFunc)(virQEMUDriverPtr driver, -+ virDomainObjPtr dom, - virDomainStatsRecordPtr record, - int *maxparams, - unsigned int flags); -@@ -17444,11 +17455,12 @@ typedef int - struct qemuDomainGetStatsWorker { - qemuDomainGetStatsFunc func; - unsigned int stats; -+ bool monitor; - }; - - static struct qemuDomainGetStatsWorker qemuDomainGetStatsWorkers[] = { -- { qemuDomainGetStatsState, VIR_DOMAIN_STATS_STATE}, -- { NULL, 0 } -+ { qemuDomainGetStatsState, VIR_DOMAIN_STATS_STATE, false }, -+ { NULL, 0, false } - }; - - -@@ -17480,6 +17492,20 @@ qemuDomainGetStatsCheckSupport(unsigned int *stats, - } - - -+static bool -+qemuDomainGetStatsNeedMonitor(unsigned int stats) -+{ -+ size_t i; -+ -+ for (i = 0; qemuDomainGetStatsWorkers[i].func; i++) -+ if (stats & qemuDomainGetStatsWorkers[i].stats && -+ qemuDomainGetStatsWorkers[i].monitor) -+ return true; -+ -+ return false; -+} -+ -+ - static int - qemuDomainGetStats(virConnectPtr conn, - virDomainObjPtr dom, -@@ -17497,8 +17523,8 @@ qemuDomainGetStats(virConnectPtr conn, - - for (i = 0; qemuDomainGetStatsWorkers[i].func; i++) { - if (stats & qemuDomainGetStatsWorkers[i].stats) { -- if (qemuDomainGetStatsWorkers[i].func(dom, tmp, &maxparams, -- flags) < 0) -+ if (qemuDomainGetStatsWorkers[i].func(conn->privateData, dom, tmp, -+ &maxparams, flags) < 0) - goto cleanup; - } - } -@@ -17537,6 +17563,8 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, - int nstats = 0; - size_t i; - int ret = -1; -+ unsigned int privflags = 0; -+ unsigned int domflags = 0; - - if (ndoms) - virCheckFlags(VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, -1); -@@ -17571,7 +17599,11 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, - if (VIR_ALLOC_N(tmpstats, ndoms + 1) < 0) - goto cleanup; - -+ if (qemuDomainGetStatsNeedMonitor(stats)) -+ privflags |= QEMU_DOMAIN_STATS_HAVE_JOB; -+ - for (i = 0; i < ndoms; i++) { -+ domflags = privflags; - virDomainStatsRecordPtr tmp = NULL; - - if (!(dom = qemuDomObjFromDomain(doms[i]))) -@@ -17581,12 +17613,22 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, - !virConnectGetAllDomainStatsCheckACL(conn, dom->def)) - continue; - -- if (qemuDomainGetStats(conn, dom, stats, &tmp, flags) < 0) -- goto cleanup; -+ if (HAVE_JOB(domflags) && -+ qemuDomainObjBeginJob(driver, dom, QEMU_JOB_QUERY) < 0) -+ /* As it was never requested. Gather as much as possible anyway. */ -+ domflags &= ~QEMU_DOMAIN_STATS_HAVE_JOB; -+ -+ if (qemuDomainGetStats(conn, dom, stats, &tmp, domflags) < 0) -+ goto endjob; - - if (tmp) - tmpstats[nstats++] = tmp; - -+ if (HAVE_JOB(domflags) && !qemuDomainObjEndJob(driver, dom)) { -+ dom = NULL; -+ continue; -+ } -+ - virObjectUnlock(dom); - dom = NULL; - } -@@ -17596,6 +17638,11 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, - - ret = nstats; - -+ endjob: -+ if (HAVE_JOB(domflags) && dom) -+ if (!qemuDomainObjEndJob(driver, dom)) -+ dom = NULL; -+ - cleanup: - if (dom) - virObjectUnlock(dom); --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-bulk-stats-implement-CPU-stats-group.patch b/SOURCES/libvirt-qemu-bulk-stats-implement-CPU-stats-group.patch deleted file mode 100644 index 807f698..0000000 --- a/SOURCES/libvirt-qemu-bulk-stats-implement-CPU-stats-group.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 8d1fbc8b00507f0874106b40fe9b72f4779ba7de Mon Sep 17 00:00:00 2001 -Message-Id: <8d1fbc8b00507f0874106b40fe9b72f4779ba7de@dist-git> -From: Francesco Romani -Date: Wed, 1 Oct 2014 11:20:12 +0200 -Subject: [PATCH] qemu: bulk stats: implement CPU stats group - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -This patch implements the VIR_DOMAIN_STATS_CPU_TOTAL group of -statistics. - -Signed-off-by: Francesco Romani -Signed-off-by: Peter Krempa -(cherry picked from commit 9ebbb8699eab6f9115b8ecbe171ee687a5dee198) -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 1 + - src/libvirt.c | 8 ++++++++ - src/qemu/qemu_driver.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 53 insertions(+) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 972bdfa..349ae93 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -2514,6 +2514,7 @@ struct _virDomainStatsRecord { - - typedef enum { - VIR_DOMAIN_STATS_STATE = (1 << 0), /* return domain state */ -+ VIR_DOMAIN_STATS_CPU_TOTAL = (1 << 1), /* return domain CPU info */ - } virDomainStatsTypes; - - typedef enum { -diff --git a/src/libvirt.c b/src/libvirt.c -index d0fdf11..70644bc 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21555,6 +21555,14 @@ virConnectGetDomainCapabilities(virConnectPtr conn, - * "state.reason" - reason for entering given state, returned as int from - * virDomain*Reason enum corresponding to given state. - * -+ * VIR_DOMAIN_STATS_CPU_TOTAL: Return CPU statistics and usage information. -+ * The typed parameter keys are in this format: -+ * "cpu.time" - total cpu time spent for this domain in nanoseconds -+ * as unsigned long long. -+ * "cpu.user" - user cpu time spent in nanoseconds as unsigned long long. -+ * "cpu.system" - system cpu time spent in nanoseconds as unsigned long long. -+ * -+ * - * Using 0 for @stats returns all stats groups supported by the given - * hypervisor. - * -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 1d94330..ea06a0d 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -96,6 +96,7 @@ - #include "storage/storage_driver.h" - #include "virhostdev.h" - #include "domain_capabilities.h" -+#include "vircgroup.h" - - #define VIR_FROM_THIS VIR_FROM_QEMU - -@@ -17445,6 +17446,48 @@ typedef enum { - #define HAVE_JOB(flags) ((flags) & QEMU_DOMAIN_STATS_HAVE_JOB) - - -+static int -+qemuDomainGetStatsCpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, -+ virDomainObjPtr dom, -+ virDomainStatsRecordPtr record, -+ int *maxparams, -+ unsigned int privflags ATTRIBUTE_UNUSED) -+{ -+ qemuDomainObjPrivatePtr priv = dom->privateData; -+ unsigned long long cpu_time = 0; -+ unsigned long long user_time = 0; -+ unsigned long long sys_time = 0; -+ int err = 0; -+ -+ if (!priv->cgroup) -+ return 0; -+ -+ err = virCgroupGetCpuacctUsage(priv->cgroup, &cpu_time); -+ if (!err && virTypedParamsAddULLong(&record->params, -+ &record->nparams, -+ maxparams, -+ "cpu.time", -+ cpu_time) < 0) -+ return -1; -+ -+ err = virCgroupGetCpuacctStat(priv->cgroup, &user_time, &sys_time); -+ if (!err && virTypedParamsAddULLong(&record->params, -+ &record->nparams, -+ maxparams, -+ "cpu.user", -+ user_time) < 0) -+ return -1; -+ if (!err && virTypedParamsAddULLong(&record->params, -+ &record->nparams, -+ maxparams, -+ "cpu.system", -+ sys_time) < 0) -+ return -1; -+ -+ return 0; -+} -+ -+ - typedef int - (*qemuDomainGetStatsFunc)(virQEMUDriverPtr driver, - virDomainObjPtr dom, -@@ -17460,6 +17503,7 @@ struct qemuDomainGetStatsWorker { - - static struct qemuDomainGetStatsWorker qemuDomainGetStatsWorkers[] = { - { qemuDomainGetStatsState, VIR_DOMAIN_STATS_STATE, false }, -+ { qemuDomainGetStatsCpu, VIR_DOMAIN_STATS_CPU_TOTAL, false }, - { NULL, 0, false } - }; - --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-bulk-stats-implement-VCPU-group.patch b/SOURCES/libvirt-qemu-bulk-stats-implement-VCPU-group.patch deleted file mode 100644 index 1c2245e..0000000 --- a/SOURCES/libvirt-qemu-bulk-stats-implement-VCPU-group.patch +++ /dev/null @@ -1,304 +0,0 @@ -From 3b2c6fae4d780e5b1f9b4bc206492a9f6a92e18e Mon Sep 17 00:00:00 2001 -Message-Id: <3b2c6fae4d780e5b1f9b4bc206492a9f6a92e18e@dist-git> -From: Francesco Romani -Date: Wed, 1 Oct 2014 11:20:14 +0200 -Subject: [PATCH] qemu: bulk stats: implement VCPU group - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -This patch implements the VIR_DOMAIN_STATS_VCPU group of statistics. To -do so, this patch also extracts a helper to gather the vCPU information. - -Signed-off-by: Francesco Romani -Signed-off-by: Peter Krempa -(cherry picked from commit 74c066df4d8d9d49eee6a4416752440cdfaa8005) -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 1 + - src/libvirt.c | 12 +++ - src/qemu/qemu_driver.c | 205 +++++++++++++++++++++++++++++-------------- - 3 files changed, 154 insertions(+), 64 deletions(-) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 48ecea8..8754e1b 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -2516,6 +2516,7 @@ typedef enum { - VIR_DOMAIN_STATS_STATE = (1 << 0), /* return domain state */ - VIR_DOMAIN_STATS_CPU_TOTAL = (1 << 1), /* return domain CPU info */ - VIR_DOMAIN_STATS_BALLOON = (1 << 2), /* return domain balloon info */ -+ VIR_DOMAIN_STATS_VCPU = (1 << 3), /* return domain virtual CPU info */ - } virDomainStatsTypes; - - typedef enum { -diff --git a/src/libvirt.c b/src/libvirt.c -index 64ef74b..f2f6f43 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21569,6 +21569,18 @@ virConnectGetDomainCapabilities(virConnectPtr conn, - * "balloon.maximum" - the maximum memory in kiB allowed - * as unsigned long long. - * -+ * VIR_DOMAIN_STATS_VCPU: Return virtual CPU statistics. -+ * Due to VCPU hotplug, the vcpu..* array could be sparse. -+ * The actual size of the array corresponds to "vcpu.current". -+ * The array size will never exceed "vcpu.maximum". -+ * The typed parameter keys are in this format: -+ * "vcpu.current" - current number of online virtual CPUs as unsigned int. -+ * "vcpu.maximum" - maximum number of online virtual CPUs as unsigned int. -+ * "vcpu..state" - state of the virtual CPU , as int -+ * from virVcpuState enum. -+ * "vcpu..time" - virtual cpu time spent by virtual CPU -+ * as unsigned long long. -+ * - * Using 0 for @stats returns all stats groups supported by the given - * hypervisor. - * -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 71a0e0e..ef2e401 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -1382,6 +1382,76 @@ qemuGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, long *vm_rss, - } - - -+static int -+qemuDomainHelperGetVcpus(virDomainObjPtr vm, virVcpuInfoPtr info, int maxinfo, -+ unsigned char *cpumaps, int maplen) -+{ -+ int maxcpu, hostcpus; -+ size_t i, v; -+ qemuDomainObjPrivatePtr priv = vm->privateData; -+ -+ if ((hostcpus = nodeGetCPUCount()) < 0) -+ return -1; -+ -+ maxcpu = maplen * 8; -+ if (maxcpu > hostcpus) -+ maxcpu = hostcpus; -+ -+ /* Clamp to actual number of vcpus */ -+ if (maxinfo > priv->nvcpupids) -+ maxinfo = priv->nvcpupids; -+ -+ if (maxinfo >= 1) { -+ if (info != NULL) { -+ memset(info, 0, sizeof(*info) * maxinfo); -+ for (i = 0; i < maxinfo; i++) { -+ info[i].number = i; -+ info[i].state = VIR_VCPU_RUNNING; -+ -+ if (priv->vcpupids != NULL && -+ qemuGetProcessInfo(&(info[i].cpuTime), -+ &(info[i].cpu), -+ NULL, -+ vm->pid, -+ priv->vcpupids[i]) < 0) { -+ virReportSystemError(errno, "%s", -+ _("cannot get vCPU placement & pCPU time")); -+ return -1; -+ } -+ } -+ } -+ -+ if (cpumaps != NULL) { -+ memset(cpumaps, 0, maplen * maxinfo); -+ if (priv->vcpupids != NULL) { -+ for (v = 0; v < maxinfo; v++) { -+ unsigned char *cpumap = VIR_GET_CPUMAP(cpumaps, maplen, v); -+ virBitmapPtr map = NULL; -+ unsigned char *tmpmap = NULL; -+ int tmpmapLen = 0; -+ -+ if (virProcessGetAffinity(priv->vcpupids[v], -+ &map, maxcpu) < 0) -+ return -1; -+ virBitmapToData(map, &tmpmap, &tmpmapLen); -+ if (tmpmapLen > maplen) -+ tmpmapLen = maplen; -+ memcpy(cpumap, tmpmap, tmpmapLen); -+ -+ VIR_FREE(tmpmap); -+ virBitmapFree(map); -+ } -+ } else { -+ virReportError(VIR_ERR_OPERATION_INVALID, -+ "%s", _("cpu affinity is not available")); -+ return -1; -+ } -+ } -+ } -+ return maxinfo; -+} -+ -+ - static virDomainPtr qemuDomainLookupByID(virConnectPtr conn, - int id) - { -@@ -5005,10 +5075,7 @@ qemuDomainGetVcpus(virDomainPtr dom, - int maplen) - { - virDomainObjPtr vm; -- size_t i; -- int v, maxcpu, hostcpus; - int ret = -1; -- qemuDomainObjPrivatePtr priv; - - if (!(vm = qemuDomObjFromDomain(dom))) - goto cleanup; -@@ -5023,67 +5090,7 @@ qemuDomainGetVcpus(virDomainPtr dom, - goto cleanup; - } - -- priv = vm->privateData; -- -- if ((hostcpus = nodeGetCPUCount()) < 0) -- goto cleanup; -- -- maxcpu = maplen * 8; -- if (maxcpu > hostcpus) -- maxcpu = hostcpus; -- -- /* Clamp to actual number of vcpus */ -- if (maxinfo > priv->nvcpupids) -- maxinfo = priv->nvcpupids; -- -- if (maxinfo >= 1) { -- if (info != NULL) { -- memset(info, 0, sizeof(*info) * maxinfo); -- for (i = 0; i < maxinfo; i++) { -- info[i].number = i; -- info[i].state = VIR_VCPU_RUNNING; -- -- if (priv->vcpupids != NULL && -- qemuGetProcessInfo(&(info[i].cpuTime), -- &(info[i].cpu), -- NULL, -- vm->pid, -- priv->vcpupids[i]) < 0) { -- virReportSystemError(errno, "%s", -- _("cannot get vCPU placement & pCPU time")); -- goto cleanup; -- } -- } -- } -- -- if (cpumaps != NULL) { -- memset(cpumaps, 0, maplen * maxinfo); -- if (priv->vcpupids != NULL) { -- for (v = 0; v < maxinfo; v++) { -- unsigned char *cpumap = VIR_GET_CPUMAP(cpumaps, maplen, v); -- virBitmapPtr map = NULL; -- unsigned char *tmpmap = NULL; -- int tmpmapLen = 0; -- -- if (virProcessGetAffinity(priv->vcpupids[v], -- &map, maxcpu) < 0) -- goto cleanup; -- virBitmapToData(map, &tmpmap, &tmpmapLen); -- if (tmpmapLen > maplen) -- tmpmapLen = maplen; -- memcpy(cpumap, tmpmap, tmpmapLen); -- -- VIR_FREE(tmpmap); -- virBitmapFree(map); -- } -- } else { -- virReportError(VIR_ERR_OPERATION_INVALID, -- "%s", _("cpu affinity is not available")); -- goto cleanup; -- } -- } -- } -- ret = maxinfo; -+ ret = qemuDomainHelperGetVcpus(vm, info, maxinfo, cpumaps, maplen); - - cleanup: - if (vm) -@@ -17524,6 +17531,75 @@ qemuDomainGetStatsBalloon(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - return 0; - } - -+ -+static int -+qemuDomainGetStatsVcpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, -+ virDomainObjPtr dom, -+ virDomainStatsRecordPtr record, -+ int *maxparams, -+ unsigned int privflags ATTRIBUTE_UNUSED) -+{ -+ size_t i; -+ int ret = -1; -+ char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; -+ virVcpuInfoPtr cpuinfo = NULL; -+ -+ if (virTypedParamsAddUInt(&record->params, -+ &record->nparams, -+ maxparams, -+ "vcpu.current", -+ (unsigned) dom->def->vcpus) < 0) -+ return -1; -+ -+ if (virTypedParamsAddUInt(&record->params, -+ &record->nparams, -+ maxparams, -+ "vcpu.maximum", -+ (unsigned) dom->def->maxvcpus) < 0) -+ return -1; -+ -+ if (VIR_ALLOC_N(cpuinfo, dom->def->vcpus) < 0) -+ return -1; -+ -+ if (qemuDomainHelperGetVcpus(dom, cpuinfo, dom->def->vcpus, -+ NULL, 0) < 0) { -+ virResetLastError(); -+ ret = 0; /* it's ok to be silent and go ahead */ -+ goto cleanup; -+ } -+ -+ for (i = 0; i < dom->def->vcpus; i++) { -+ snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, -+ "vcpu.%zu.state", i); -+ if (virTypedParamsAddInt(&record->params, -+ &record->nparams, -+ maxparams, -+ param_name, -+ cpuinfo[i].state) < 0) -+ goto cleanup; -+ -+ /* stats below are available only if the VM is alive */ -+ if (!virDomainObjIsActive(dom)) -+ continue; -+ -+ snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, -+ "vcpu.%zu.time", i); -+ if (virTypedParamsAddULLong(&record->params, -+ &record->nparams, -+ maxparams, -+ param_name, -+ cpuinfo[i].cpuTime) < 0) -+ goto cleanup; -+ } -+ -+ ret = 0; -+ -+ cleanup: -+ VIR_FREE(cpuinfo); -+ return ret; -+} -+ -+ - typedef int - (*qemuDomainGetStatsFunc)(virQEMUDriverPtr driver, - virDomainObjPtr dom, -@@ -17541,6 +17617,7 @@ static struct qemuDomainGetStatsWorker qemuDomainGetStatsWorkers[] = { - { qemuDomainGetStatsState, VIR_DOMAIN_STATS_STATE, false }, - { qemuDomainGetStatsCpu, VIR_DOMAIN_STATS_CPU_TOTAL, false }, - { qemuDomainGetStatsBalloon, VIR_DOMAIN_STATS_BALLOON, true }, -+ { qemuDomainGetStatsVcpu, VIR_DOMAIN_STATS_VCPU, false }, - { NULL, 0, false } - }; - --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-bulk-stats-implement-balloon-group.patch b/SOURCES/libvirt-qemu-bulk-stats-implement-balloon-group.patch deleted file mode 100644 index 8627f1f..0000000 --- a/SOURCES/libvirt-qemu-bulk-stats-implement-balloon-group.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 570e9ebae2d7f64e43f7ec2b95c3a3679c3688b2 Mon Sep 17 00:00:00 2001 -Message-Id: <570e9ebae2d7f64e43f7ec2b95c3a3679c3688b2@dist-git> -From: Francesco Romani -Date: Wed, 1 Oct 2014 11:20:13 +0200 -Subject: [PATCH] qemu: bulk stats: implement balloon group - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -This patch implements the VIR_DOMAIN_STATS_BALLOON group of statistics. - -Signed-off-by: Francesco Romani -(cherry picked from commit 2a9bd4a8736fcb90e231b9f7109aa66d9108b286) -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 1 + - src/libvirt.c | 6 ++++++ - src/qemu/qemu_driver.c | 37 +++++++++++++++++++++++++++++++++++++ - 3 files changed, 44 insertions(+) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 349ae93..48ecea8 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -2515,6 +2515,7 @@ struct _virDomainStatsRecord { - typedef enum { - VIR_DOMAIN_STATS_STATE = (1 << 0), /* return domain state */ - VIR_DOMAIN_STATS_CPU_TOTAL = (1 << 1), /* return domain CPU info */ -+ VIR_DOMAIN_STATS_BALLOON = (1 << 2), /* return domain balloon info */ - } virDomainStatsTypes; - - typedef enum { -diff --git a/src/libvirt.c b/src/libvirt.c -index 70644bc..64ef74b 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21562,6 +21562,12 @@ virConnectGetDomainCapabilities(virConnectPtr conn, - * "cpu.user" - user cpu time spent in nanoseconds as unsigned long long. - * "cpu.system" - system cpu time spent in nanoseconds as unsigned long long. - * -+ * VIR_DOMAIN_STATS_BALLOON: Return memory balloon device information. -+ * The typed parameter keys are in this format: -+ * "balloon.current" - the memory in kiB currently used -+ * as unsigned long long. -+ * "balloon.maximum" - the maximum memory in kiB allowed -+ * as unsigned long long. - * - * Using 0 for @stats returns all stats groups supported by the given - * hypervisor. -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index ea06a0d..71a0e0e 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17487,6 +17487,42 @@ qemuDomainGetStatsCpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - return 0; - } - -+static int -+qemuDomainGetStatsBalloon(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, -+ virDomainObjPtr dom, -+ virDomainStatsRecordPtr record, -+ int *maxparams, -+ unsigned int privflags ATTRIBUTE_UNUSED) -+{ -+ qemuDomainObjPrivatePtr priv = dom->privateData; -+ unsigned long long cur_balloon = 0; -+ int err = 0; -+ -+ if (dom->def->memballoon && -+ dom->def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_NONE) { -+ cur_balloon = dom->def->mem.max_balloon; -+ } else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BALLOON_EVENT)) { -+ cur_balloon = dom->def->mem.cur_balloon; -+ } else { -+ err = -1; -+ } -+ -+ if (!err && virTypedParamsAddULLong(&record->params, -+ &record->nparams, -+ maxparams, -+ "balloon.current", -+ cur_balloon) < 0) -+ return -1; -+ -+ if (virTypedParamsAddULLong(&record->params, -+ &record->nparams, -+ maxparams, -+ "balloon.maximum", -+ dom->def->mem.max_balloon) < 0) -+ return -1; -+ -+ return 0; -+} - - typedef int - (*qemuDomainGetStatsFunc)(virQEMUDriverPtr driver, -@@ -17504,6 +17540,7 @@ struct qemuDomainGetStatsWorker { - static struct qemuDomainGetStatsWorker qemuDomainGetStatsWorkers[] = { - { qemuDomainGetStatsState, VIR_DOMAIN_STATS_STATE, false }, - { qemuDomainGetStatsCpu, VIR_DOMAIN_STATS_CPU_TOTAL, false }, -+ { qemuDomainGetStatsBalloon, VIR_DOMAIN_STATS_BALLOON, true }, - { NULL, 0, false } - }; - --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-bulk-stats-implement-block-group.patch b/SOURCES/libvirt-qemu-bulk-stats-implement-block-group.patch deleted file mode 100644 index c2ab761..0000000 --- a/SOURCES/libvirt-qemu-bulk-stats-implement-block-group.patch +++ /dev/null @@ -1,493 +0,0 @@ -From 59a6145c0f1fe4e7ef35970578b8eb9837145bc0 Mon Sep 17 00:00:00 2001 -Message-Id: <59a6145c0f1fe4e7ef35970578b8eb9837145bc0@dist-git> -From: Francesco Romani -Date: Wed, 1 Oct 2014 11:20:16 +0200 -Subject: [PATCH] qemu: bulk stats: implement block group - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -This patch implements the VIR_DOMAIN_STATS_BLOCK group of statistics. - -To do so, a helper function to get the block stats of all the disks of -a domain is added. - -Signed-off-by: Francesco Romani -Signed-off-by: Peter Krempa -(cherry picked from commit 290e3c6b07a273444f681de198d2416ccd2d4702) -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 1 + - src/libvirt.c | 21 +++++++ - src/qemu/qemu_driver.c | 81 ++++++++++++++++++++++++++ - src/qemu/qemu_monitor.c | 26 +++++++++ - src/qemu/qemu_monitor.h | 20 +++++++ - src/qemu/qemu_monitor_json.c | 136 +++++++++++++++++++++++++++++-------------- - src/qemu/qemu_monitor_json.h | 4 ++ - 7 files changed, 246 insertions(+), 43 deletions(-) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 72aa47d..60b3e0b 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -2518,6 +2518,7 @@ typedef enum { - VIR_DOMAIN_STATS_BALLOON = (1 << 2), /* return domain balloon info */ - VIR_DOMAIN_STATS_VCPU = (1 << 3), /* return domain virtual CPU info */ - VIR_DOMAIN_STATS_INTERFACE = (1 << 4), /* return domain interfaces info */ -+ VIR_DOMAIN_STATS_BLOCK = (1 << 5), /* return domain block info */ - } virDomainStatsTypes; - - typedef enum { -diff --git a/src/libvirt.c b/src/libvirt.c -index 46d3e22..f62ecf7 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21595,6 +21595,27 @@ virConnectGetDomainCapabilities(virConnectPtr conn, - * "net..tx.errs" - transmission errors as unsigned long long. - * "net..tx.drop" - transmit packets dropped as unsigned long long. - * -+ * VIR_DOMAIN_STATS_BLOCK: Return block devices statistics. -+ * The typed parameter keys are in this format: -+ * "block.count" - number of block devices on this domain -+ * as unsigned int. -+ * "block..name" - name of the block device as string. -+ * matches the target name (vda/sda/hda) of the -+ * block device. -+ * "block..rd.reqs" - number of read requests as unsigned long long. -+ * "block..rd.bytes" - number of read bytes as unsigned long long. -+ * "block..rd.times" - total time (ns) spent on reads as -+ * unsigned long long. -+ * "block..wr.reqs" - number of write requests as unsigned long long. -+ * "block..wr.bytes" - number of written bytes as unsigned long long. -+ * "block..wr.times" - total time (ns) spent on writes as -+ * unsigned long long. -+ * "block..fl.reqs" - total flush requests as unsigned long long. -+ * "block..fl.times" - total time (ns) spent on cache flushing as -+ * unsigned long long. -+ * "block..errors" - Xen only: the 'oo_req' value as -+ * unsigned long long. -+ * - * Using 0 for @stats returns all stats groups supported by the given - * hypervisor. - * -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 3a46c6d..8e90cc6 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -9866,6 +9866,7 @@ qemuDomainBlockStats(virDomainPtr dom, - return ret; - } - -+ - static int - qemuDomainBlockStatsFlags(virDomainPtr dom, - const char *path, -@@ -17690,6 +17691,85 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - - #undef QEMU_ADD_NET_PARAM - -+/* expects a LL, but typed parameter must be ULL */ -+#define QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, num, name, value) \ -+do { \ -+ char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; \ -+ snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, \ -+ "block.%zu.%s", num, name); \ -+ if (value >= 0 && virTypedParamsAddULLong(&(record)->params, \ -+ &(record)->nparams, \ -+ maxparams, \ -+ param_name, \ -+ value) < 0) \ -+ goto cleanup; \ -+} while (0) -+ -+static int -+qemuDomainGetStatsBlock(virQEMUDriverPtr driver, -+ virDomainObjPtr dom, -+ virDomainStatsRecordPtr record, -+ int *maxparams, -+ unsigned int privflags) -+{ -+ size_t i; -+ int ret = -1; -+ int nstats = dom->def->ndisks; -+ qemuBlockStatsPtr stats = NULL; -+ qemuDomainObjPrivatePtr priv = dom->privateData; -+ -+ if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom)) -+ return 0; /* it's ok, just go ahead silently */ -+ -+ if (VIR_ALLOC_N(stats, nstats) < 0) -+ return -1; -+ -+ qemuDomainObjEnterMonitor(driver, dom); -+ -+ nstats = qemuMonitorGetAllBlockStatsInfo(priv->mon, NULL, -+ stats, nstats); -+ -+ qemuDomainObjExitMonitor(driver, dom); -+ -+ if (nstats < 0) { -+ virResetLastError(); -+ ret = 0; /* still ok, again go ahead silently */ -+ goto cleanup; -+ } -+ -+ QEMU_ADD_COUNT_PARAM(record, maxparams, "block", dom->def->ndisks); -+ -+ for (i = 0; i < nstats; i++) { -+ QEMU_ADD_NAME_PARAM(record, maxparams, -+ "block", i, dom->def->disks[i]->dst); -+ -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -+ "rd.reqs", stats[i].rd_req); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -+ "rd.bytes", stats[i].rd_bytes); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -+ "rd.times", stats[i].rd_total_times); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -+ "wr.reqs", stats[i].wr_req); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -+ "wr.bytes", stats[i].wr_bytes); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -+ "wr.times", stats[i].wr_total_times); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -+ "fl.reqs", stats[i].flush_req); -+ QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -+ "fl.times", stats[i].flush_total_times); -+ } -+ -+ ret = 0; -+ -+ cleanup: -+ VIR_FREE(stats); -+ return ret; -+} -+ -+#undef QEMU_ADD_BLOCK_PARAM_LL -+ - #undef QEMU_ADD_NAME_PARAM - - #undef QEMU_ADD_COUNT_PARAM -@@ -17713,6 +17793,7 @@ static struct qemuDomainGetStatsWorker qemuDomainGetStatsWorkers[] = { - { qemuDomainGetStatsBalloon, VIR_DOMAIN_STATS_BALLOON, true }, - { qemuDomainGetStatsVcpu, VIR_DOMAIN_STATS_VCPU, false }, - { qemuDomainGetStatsInterface, VIR_DOMAIN_STATS_INTERFACE, false }, -+ { qemuDomainGetStatsBlock, VIR_DOMAIN_STATS_BLOCK, true }, - { NULL, 0, false } - }; - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index fea551d..afe7959 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -1760,6 +1760,32 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon, - return ret; - } - -+/* Fills the first 'nstats' block stats. 'stats' must be an array. -+ * Returns <0 on error, otherwise the number of block stats retrieved. -+ * if 'dev_name' is != NULL, look for this device only and skip -+ * any other. In that case return value cannot be greater than 1. -+ */ -+int -+qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, -+ const char *dev_name, -+ qemuBlockStatsPtr stats, -+ int nstats) -+{ -+ int ret; -+ VIR_DEBUG("mon=%p dev=%s", mon, dev_name); -+ -+ if (mon->json) { -+ ret = qemuMonitorJSONGetAllBlockStatsInfo(mon, dev_name, -+ stats, nstats); -+ } else { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("unable to query all block stats with this QEMU")); -+ return -1; -+ } -+ -+ return ret; -+} -+ - /* Return 0 and update @nparams with the number of block stats - * QEMU supports if success. Return -1 if failure. - */ -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index 62c9f2e..b7f9fd1 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -346,6 +346,26 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon, - long long *flush_req, - long long *flush_total_times, - long long *errs); -+ -+typedef struct _qemuBlockStats qemuBlockStats; -+typedef qemuBlockStats *qemuBlockStatsPtr; -+struct _qemuBlockStats { -+ long long rd_req; -+ long long rd_bytes; -+ long long wr_req; -+ long long wr_bytes; -+ long long rd_total_times; -+ long long wr_total_times; -+ long long flush_req; -+ long long flush_total_times; -+}; -+ -+int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, -+ const char *dev_name, -+ qemuBlockStatsPtr stats, -+ int nstats) -+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); -+ - int qemuMonitorGetBlockStatsParamsNumber(qemuMonitorPtr mon, - int *nparams); - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 17b082c..c013d49 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -1708,13 +1708,8 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - long long *flush_total_times, - long long *errs) - { -- int ret; -- size_t i; -- bool found = false; -- virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-blockstats", -- NULL); -- virJSONValuePtr reply = NULL; -- virJSONValuePtr devices; -+ qemuBlockStats stats; -+ int ret = -1; - - *rd_req = *rd_bytes = -1; - *wr_req = *wr_bytes = *errs = -1; -@@ -1728,9 +1723,49 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - if (flush_total_times) - *flush_total_times = -1; - -+ if (qemuMonitorJSONGetAllBlockStatsInfo(mon, dev_name, &stats, 1) != 1) -+ goto cleanup; -+ -+ *rd_req = stats.rd_req; -+ *rd_bytes = stats.rd_bytes; -+ *wr_req = stats.wr_req; -+ *wr_bytes = stats.wr_bytes; -+ *errs = -1; /* QEMU does not have this */ -+ -+ if (rd_total_times) -+ *rd_total_times = stats.rd_total_times; -+ if (wr_total_times) -+ *wr_total_times = stats.wr_total_times; -+ if (flush_req) -+ *flush_req = stats.flush_req; -+ if (flush_total_times) -+ *flush_total_times = stats.flush_total_times; -+ -+ ret = 0; -+ -+ cleanup: -+ return ret; -+} -+ -+ -+int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, -+ const char *dev_name, -+ qemuBlockStatsPtr bstats, -+ int nstats) -+{ -+ int ret, count; -+ size_t i; -+ virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-blockstats", -+ NULL); -+ virJSONValuePtr reply = NULL; -+ virJSONValuePtr devices; -+ - if (!cmd) - return -1; - -+ if (!bstats || nstats <= 0) -+ return -1; -+ - ret = qemuMonitorJSONCommand(mon, cmd, &reply); - - if (ret == 0) -@@ -1746,108 +1781,123 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - goto cleanup; - } - -- for (i = 0; i < virJSONValueArraySize(devices); i++) { -+ count = 0; -+ for (i = 0; i < virJSONValueArraySize(devices) && count < nstats; i++) { - virJSONValuePtr dev = virJSONValueArrayGet(devices, i); - virJSONValuePtr stats; -- const char *thisdev; - if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("blockstats device entry was not in expected format")); -+ _("blockstats device entry was not " -+ "in expected format")); - goto cleanup; - } - -- if ((thisdev = virJSONValueObjectGetString(dev, "device")) == NULL) { -- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("blockstats device entry was not in expected format")); -- goto cleanup; -- } -- -- /* New QEMU has separate names for host & guest side of the disk -- * and libvirt gives the host side a 'drive-' prefix. The passed -- * in dev_name is the guest side though -+ /* If dev_name is specified, we are looking for a specific device, -+ * so we must be stricter. - */ -- if (STRPREFIX(thisdev, QEMU_DRIVE_HOST_PREFIX)) -- thisdev += strlen(QEMU_DRIVE_HOST_PREFIX); -+ if (dev_name) { -+ const char *thisdev = virJSONValueObjectGetString(dev, "device"); -+ if (!thisdev) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("blockstats device entry was not " -+ "in expected format")); -+ goto cleanup; -+ } - -- if (STRNEQ(thisdev, dev_name)) -- continue; -+ /* New QEMU has separate names for host & guest side of the disk -+ * and libvirt gives the host side a 'drive-' prefix. The passed -+ * in dev_name is the guest side though -+ */ -+ if (STRPREFIX(thisdev, QEMU_DRIVE_HOST_PREFIX)) -+ thisdev += strlen(QEMU_DRIVE_HOST_PREFIX); -+ -+ if (STRNEQ(thisdev, dev_name)) -+ continue; -+ } - -- found = true; - if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL || - stats->type != VIR_JSON_TYPE_OBJECT) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("blockstats stats entry was not in expected format")); -+ _("blockstats stats entry was not " -+ "in expected format")); - goto cleanup; - } - -- if (virJSONValueObjectGetNumberLong(stats, "rd_bytes", rd_bytes) < 0) { -+ if (virJSONValueObjectGetNumberLong(stats, "rd_bytes", -+ &bstats->rd_bytes) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "rd_bytes"); - goto cleanup; - } -- if (virJSONValueObjectGetNumberLong(stats, "rd_operations", rd_req) < 0) { -+ if (virJSONValueObjectGetNumberLong(stats, "rd_operations", -+ &bstats->rd_req) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "rd_operations"); - goto cleanup; - } -- if (rd_total_times && -- virJSONValueObjectHasKey(stats, "rd_total_time_ns") && -+ if (virJSONValueObjectHasKey(stats, "rd_total_time_ns") && - (virJSONValueObjectGetNumberLong(stats, "rd_total_time_ns", -- rd_total_times) < 0)) { -+ &bstats->rd_total_times) < 0)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "rd_total_time_ns"); - goto cleanup; - } -- if (virJSONValueObjectGetNumberLong(stats, "wr_bytes", wr_bytes) < 0) { -+ if (virJSONValueObjectGetNumberLong(stats, "wr_bytes", -+ &bstats->wr_bytes) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "wr_bytes"); - goto cleanup; - } -- if (virJSONValueObjectGetNumberLong(stats, "wr_operations", wr_req) < 0) { -+ if (virJSONValueObjectGetNumberLong(stats, "wr_operations", -+ &bstats->wr_req) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "wr_operations"); - goto cleanup; - } -- if (wr_total_times && -- virJSONValueObjectHasKey(stats, "wr_total_time_ns") && -+ if (virJSONValueObjectHasKey(stats, "wr_total_time_ns") && - (virJSONValueObjectGetNumberLong(stats, "wr_total_time_ns", -- wr_total_times) < 0)) { -+ &bstats->wr_total_times) < 0)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "wr_total_time_ns"); - goto cleanup; - } -- if (flush_req && -- virJSONValueObjectHasKey(stats, "flush_operations") && -+ if (virJSONValueObjectHasKey(stats, "flush_operations") && - (virJSONValueObjectGetNumberLong(stats, "flush_operations", -- flush_req) < 0)) { -+ &bstats->flush_req) < 0)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "flush_operations"); - goto cleanup; - } -- if (flush_total_times && -- virJSONValueObjectHasKey(stats, "flush_total_time_ns") && -+ if (virJSONValueObjectHasKey(stats, "flush_total_time_ns") && - (virJSONValueObjectGetNumberLong(stats, "flush_total_time_ns", -- flush_total_times) < 0)) { -+ &bstats->flush_total_times) < 0)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "flush_total_time_ns"); - goto cleanup; - } -+ -+ count++; -+ bstats++; -+ -+ if (dev_name && count) -+ break; - } - -- if (!found) { -+ if (dev_name && !count) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find statistics for device '%s'"), dev_name); - goto cleanup; - } -- ret = 0; -+ -+ ret = count; - - cleanup: - virJSONValueFree(cmd); -diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index c4e795c..2402b5a 100644 ---- a/src/qemu/qemu_monitor_json.h -+++ b/src/qemu/qemu_monitor_json.h -@@ -79,6 +79,10 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - long long *flush_req, - long long *flush_total_times, - long long *errs); -+int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, -+ const char *dev_name, -+ qemuBlockStatsPtr stats, -+ int nstats); - int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon, - int *nparams); - int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon, --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-bulk-stats-implement-interface-group.patch b/SOURCES/libvirt-qemu-bulk-stats-implement-interface-group.patch deleted file mode 100644 index b9c3a2a..0000000 --- a/SOURCES/libvirt-qemu-bulk-stats-implement-interface-group.patch +++ /dev/null @@ -1,174 +0,0 @@ -From c491890f920ac0549ec62cc354aea84165714c23 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Francesco Romani -Date: Wed, 1 Oct 2014 11:20:15 +0200 -Subject: [PATCH] qemu: bulk stats: implement interface group - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -This patch implements the VIR_DOMAIN_STATS_INTERFACE group of -statistics. - -Signed-off-by: Francesco Romani -Signed-off-by: Peter Krempa -(cherry picked from commit c8e523722ecfced8e937f106b0a07be6c32febdb) -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt.h.in | 1 + - src/libvirt.c | 14 +++++++ - src/qemu/qemu_driver.c | 95 ++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 110 insertions(+) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 8754e1b..72aa47d 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -2517,6 +2517,7 @@ typedef enum { - VIR_DOMAIN_STATS_CPU_TOTAL = (1 << 1), /* return domain CPU info */ - VIR_DOMAIN_STATS_BALLOON = (1 << 2), /* return domain balloon info */ - VIR_DOMAIN_STATS_VCPU = (1 << 3), /* return domain virtual CPU info */ -+ VIR_DOMAIN_STATS_INTERFACE = (1 << 4), /* return domain interfaces info */ - } virDomainStatsTypes; - - typedef enum { -diff --git a/src/libvirt.c b/src/libvirt.c -index f2f6f43..46d3e22 100644 ---- a/src/libvirt.c -+++ b/src/libvirt.c -@@ -21581,6 +21581,20 @@ virConnectGetDomainCapabilities(virConnectPtr conn, - * "vcpu..time" - virtual cpu time spent by virtual CPU - * as unsigned long long. - * -+ * VIR_DOMAIN_STATS_INTERFACE: Return network interface statistics. -+ * The typed parameter keys are in this format: -+ * "net.count" - number of network interfaces on this domain -+ * as unsigned int. -+ * "net..name" - name of the interface as string. -+ * "net..rx.bytes" - bytes received as unsigned long long. -+ * "net..rx.pkts" - packets received as unsigned long long. -+ * "net..rx.errs" - receive errors as unsigned long long. -+ * "net..rx.drop" - receive packets dropped as unsigned long long. -+ * "net..tx.bytes" - bytes transmitted as unsigned long long. -+ * "net..tx.pkts" - packets transmitted as unsigned long long. -+ * "net..tx.errs" - transmission errors as unsigned long long. -+ * "net..tx.drop" - transmit packets dropped as unsigned long long. -+ * - * Using 0 for @stats returns all stats groups supported by the given - * hypervisor. - * -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index ef2e401..3a46c6d 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17599,6 +17599,100 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - return ret; - } - -+#define QEMU_ADD_COUNT_PARAM(record, maxparams, type, count) \ -+do { \ -+ char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; \ -+ snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, "%s.count", type); \ -+ if (virTypedParamsAddUInt(&(record)->params, \ -+ &(record)->nparams, \ -+ maxparams, \ -+ param_name, \ -+ count) < 0) \ -+ return -1; \ -+} while (0) -+ -+#define QEMU_ADD_NAME_PARAM(record, maxparams, type, num, name) \ -+do { \ -+ char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; \ -+ snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, \ -+ "%s.%zu.name", type, num); \ -+ if (virTypedParamsAddString(&(record)->params, \ -+ &(record)->nparams, \ -+ maxparams, \ -+ param_name, \ -+ name) < 0) \ -+ return -1; \ -+} while (0) -+ -+#define QEMU_ADD_NET_PARAM(record, maxparams, num, name, value) \ -+do { \ -+ char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; \ -+ snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, \ -+ "net.%zu.%s", num, name); \ -+ if (value >= 0 && virTypedParamsAddULLong(&(record)->params, \ -+ &(record)->nparams, \ -+ maxparams, \ -+ param_name, \ -+ value) < 0) \ -+ return -1; \ -+} while (0) -+ -+static int -+qemuDomainGetStatsInterface(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, -+ virDomainObjPtr dom, -+ virDomainStatsRecordPtr record, -+ int *maxparams, -+ unsigned int privflags ATTRIBUTE_UNUSED) -+{ -+ size_t i; -+ struct _virDomainInterfaceStats tmp; -+ -+ if (!virDomainObjIsActive(dom)) -+ return 0; -+ -+ QEMU_ADD_COUNT_PARAM(record, maxparams, "net", dom->def->nnets); -+ -+ /* Check the path is one of the domain's network interfaces. */ -+ for (i = 0; i < dom->def->nnets; i++) { -+ if (!dom->def->nets[i]->ifname) -+ continue; -+ -+ memset(&tmp, 0, sizeof(tmp)); -+ -+ QEMU_ADD_NAME_PARAM(record, maxparams, -+ "net", i, dom->def->nets[i]->ifname); -+ -+ if (virNetInterfaceStats(dom->def->nets[i]->ifname, &tmp) < 0) { -+ virResetLastError(); -+ continue; -+ } -+ -+ QEMU_ADD_NET_PARAM(record, maxparams, i, -+ "rx.bytes", tmp.rx_bytes); -+ QEMU_ADD_NET_PARAM(record, maxparams, i, -+ "rx.pkts", tmp.rx_packets); -+ QEMU_ADD_NET_PARAM(record, maxparams, i, -+ "rx.errs", tmp.rx_errs); -+ QEMU_ADD_NET_PARAM(record, maxparams, i, -+ "rx.drop", tmp.rx_drop); -+ QEMU_ADD_NET_PARAM(record, maxparams, i, -+ "tx.bytes", tmp.tx_bytes); -+ QEMU_ADD_NET_PARAM(record, maxparams, i, -+ "tx.pkts", tmp.tx_packets); -+ QEMU_ADD_NET_PARAM(record, maxparams, i, -+ "tx.errs", tmp.tx_errs); -+ QEMU_ADD_NET_PARAM(record, maxparams, i, -+ "tx.drop", tmp.tx_drop); -+ } -+ -+ return 0; -+} -+ -+#undef QEMU_ADD_NET_PARAM -+ -+#undef QEMU_ADD_NAME_PARAM -+ -+#undef QEMU_ADD_COUNT_PARAM - - typedef int - (*qemuDomainGetStatsFunc)(virQEMUDriverPtr driver, -@@ -17618,6 +17712,7 @@ static struct qemuDomainGetStatsWorker qemuDomainGetStatsWorkers[] = { - { qemuDomainGetStatsCpu, VIR_DOMAIN_STATS_CPU_TOTAL, false }, - { qemuDomainGetStatsBalloon, VIR_DOMAIN_STATS_BALLOON, true }, - { qemuDomainGetStatsVcpu, VIR_DOMAIN_STATS_VCPU, false }, -+ { qemuDomainGetStatsInterface, VIR_DOMAIN_STATS_INTERFACE, false }, - { NULL, 0, false } - }; - --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-call-qemuDomainObjBeginJob-qemuDomainObjEndJob-in-qemuDomainSetInterfaceParameters.patch b/SOURCES/libvirt-qemu-call-qemuDomainObjBeginJob-qemuDomainObjEndJob-in-qemuDomainSetInterfaceParameters.patch deleted file mode 100644 index 1319ac4..0000000 --- a/SOURCES/libvirt-qemu-call-qemuDomainObjBeginJob-qemuDomainObjEndJob-in-qemuDomainSetInterfaceParameters.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 62a0658c8081f1b42b532265379404803d979d0a Mon Sep 17 00:00:00 2001 -Message-Id: <62a0658c8081f1b42b532265379404803d979d0a@dist-git> -From: Shanzhi Yu -Date: Wed, 22 Oct 2014 09:54:37 +0200 -Subject: [PATCH] qemu: call qemuDomainObjBeginJob/qemuDomainObjEndJob in - qemuDomainSetInterfaceParameters - -add call qemuDomainObjBeginJob/qemuDomainObjEndJob in -qemuDomainSetInterfaceParameters - -Signed-off-by: Shanzhi Yu -(cherry picked from commit 99fe8755b919a4df9e48b6994da4c0c2907dfc83) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146511 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 30 +++++++++++++++++++----------- - 1 file changed, 19 insertions(+), 11 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 12a32ec..90f81a0 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -10140,16 +10140,19 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; - -+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -+ goto cleanup; -+ - if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags, - &persistentDef) < 0) -- goto cleanup; -+ goto endjob; - - if (flags & VIR_DOMAIN_AFFECT_LIVE) { - net = virDomainNetFind(vm->def, device); - if (!net) { - virReportError(VIR_ERR_INVALID_ARG, - _("Can't find device %s"), device); -- goto cleanup; -+ goto endjob; - } - } - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { -@@ -10157,14 +10160,14 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, - if (!persistentNet) { - virReportError(VIR_ERR_INVALID_ARG, - _("Can't find device %s"), device); -- goto cleanup; -+ goto endjob; - } - } - - if ((VIR_ALLOC(bandwidth) < 0) || - (VIR_ALLOC(bandwidth->in) < 0) || - (VIR_ALLOC(bandwidth->out) < 0)) -- goto cleanup; -+ goto endjob; - - for (i = 0; i < nparams; i++) { - virTypedParameterPtr param = ¶ms[i]; -@@ -10198,7 +10201,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, - - if (flags & VIR_DOMAIN_AFFECT_LIVE) { - if (VIR_ALLOC(newBandwidth) < 0) -- goto cleanup; -+ goto endjob; - - /* virNetDevBandwidthSet() will clear any previous value of - * bandwidth parameters, so merge with old bandwidth parameters -@@ -10206,7 +10209,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, - if (bandwidth->in || - (!inboundSpecified && net->bandwidth && net->bandwidth->in)) { - if (VIR_ALLOC(newBandwidth->in) < 0) -- goto cleanup; -+ goto endjob; - - memcpy(newBandwidth->in, - bandwidth->in ? bandwidth->in : net->bandwidth->in, -@@ -10215,7 +10218,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, - if (bandwidth->out || - (!outboundSpecified && net->bandwidth && net->bandwidth->out)) { - if (VIR_ALLOC(newBandwidth->out) < 0) -- goto cleanup; -+ goto endjob; - - memcpy(newBandwidth->out, - bandwidth->out ? bandwidth->out : net->bandwidth->out, -@@ -10223,7 +10226,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, - } - - if (virNetDevBandwidthSet(net->ifname, newBandwidth, false) < 0) -- goto cleanup; -+ goto endjob; - - virNetDevBandwidthFree(net->bandwidth); - if (newBandwidth->in || newBandwidth->out) { -@@ -10237,11 +10240,11 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, - virNetDevBandwidthFree(net->data.network.actual->bandwidth); - if (virNetDevBandwidthCopy(&net->data.network.actual->bandwidth, - net->bandwidth) < 0) -- goto cleanup; -+ goto endjob; - } - - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) -- goto cleanup; -+ goto endjob; - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { -@@ -10266,10 +10269,15 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, - } - - if (virDomainSaveConfig(cfg->configDir, persistentDef) < 0) -- goto cleanup; -+ goto endjob; - } - - ret = 0; -+ -+ endjob: -+ if (!qemuDomainObjEndJob(driver, vm)) -+ vm = NULL; -+ - cleanup: - virNetDevBandwidthFree(bandwidth); - virNetDevBandwidthFree(newBandwidth); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-change-macvtap-device-MAC-address-in-response-to-NIC_RX_FILTER_CHANGED.patch b/SOURCES/libvirt-qemu-change-macvtap-device-MAC-address-in-response-to-NIC_RX_FILTER_CHANGED.patch deleted file mode 100644 index f66fa3f..0000000 --- a/SOURCES/libvirt-qemu-change-macvtap-device-MAC-address-in-response-to-NIC_RX_FILTER_CHANGED.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 68e16ab92310206b28471434ff80f90b4fcf987b Mon Sep 17 00:00:00 2001 -Message-Id: <68e16ab92310206b28471434ff80f90b4fcf987b@dist-git> -From: Laine Stump -Date: Mon, 3 Nov 2014 10:00:21 -0500 -Subject: [PATCH] qemu: change macvtap device MAC address in response to - NIC_RX_FILTER_CHANGED - -https://bugzilla.redhat.com/show_bug.cgi?id=848199 - -This patch fills in the functionality of -processNicRxFilterChangedEvent(). It now checks if it is appropriate -to respond to the NIC_RX_FILTER_CHANGED event (based on device type -and configuration) and takes appropriate action. Currently it checks -if the guest interface has been configured with -trustGuestRxFilters='yes', and if the host side device is macvtap. If -so, and the MAC address on the guest has changed, the MAC address of -the macvtap device is changed to match. - -The result of this is that networking from the guest will continue to -work if the mac address of a macvtap-connected network device is -changed from within the guest, as long as trustGuestRxFilters='yes' -(previously changing the MAC address in the guest would break -networking). - -(cherry picked from commit db6b738dde047c9b38ed41add5d00bbbdb7c5daa) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 50 insertions(+) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 29deb76..229836f 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4153,8 +4153,13 @@ processNicRxFilterChangedEvent(virQEMUDriverPtr driver, - char *devAlias) - { - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); -+ qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDeviceDef dev; - virDomainNetDefPtr def; -+ virNetDevRxFilterPtr filter = NULL; -+ virMacAddr oldMAC; -+ char newMacStr[VIR_MAC_STRING_BUFLEN]; -+ int ret; - - VIR_DEBUG("Received NIC_RX_FILTER_CHANGED event for device %s " - "from domain %p %s", -@@ -4182,11 +4187,55 @@ processNicRxFilterChangedEvent(virQEMUDriverPtr driver, - } - def = dev.data.net; - -+ if (!virDomainNetGetActualTrustGuestRxFilters(def)) { -+ VIR_WARN("ignore NIC_RX_FILTER_CHANGED event for network " -+ "device %s in domain %s", -+ def->info.alias, vm->def->name); -+ /* not sending "query-rx-filter" will also suppress any -+ * further NIC_RX_FILTER_CHANGED events for this device -+ */ -+ goto endjob; -+ } -+ - /* handle the event - send query-rx-filter and respond to it. */ - - VIR_DEBUG("process NIC_RX_FILTER_CHANGED event for network " - "device %s in domain %s", def->info.alias, vm->def->name); - -+ qemuDomainObjEnterMonitor(driver, vm); -+ ret = qemuMonitorQueryRxFilter(priv->mon, devAlias, &filter); -+ qemuDomainObjExitMonitor(driver, vm); -+ if (ret < 0) -+ goto endjob; -+ -+ virMacAddrFormat(&filter->mac, newMacStr); -+ -+ if (virDomainNetGetActualType(def) == VIR_DOMAIN_NET_TYPE_DIRECT) { -+ -+ /* For macvtap connections, set the macvtap device's MAC -+ * address to match that of the guest device. -+ */ -+ -+ if (virNetDevGetMAC(def->ifname, &oldMAC) < 0) { -+ VIR_WARN("Couldn't get current MAC address of device %s " -+ "while responding to NIC_RX_FILTER_CHANGED", -+ def->ifname); -+ goto endjob; -+ } -+ -+ if (virMacAddrCmp(&oldMAC, &filter->mac)) { -+ /* set new MAC address from guest to associated macvtap device */ -+ if (virNetDevSetMAC(def->ifname, &filter->mac) < 0) { -+ VIR_WARN("Couldn't set new MAC address %s to device %s " -+ "while responding to NIC_RX_FILTER_CHANGED", -+ newMacStr, def->ifname); -+ } else { -+ VIR_DEBUG("device %s MAC address set to %s", -+ def->ifname, newMacStr); -+ } -+ } -+ } -+ - endjob: - /* We had an extra reference to vm before starting a new job so ending the - * job is guaranteed not to remove the last reference. -@@ -4194,6 +4243,7 @@ processNicRxFilterChangedEvent(virQEMUDriverPtr driver, - ignore_value(qemuDomainObjEndJob(driver, vm)); - - cleanup: -+ virNetDevRxFilterFree(filter); - VIR_FREE(devAlias); - virObjectUnref(cfg); - } --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-change-macvtap-multicast-list-in-response-to-NIC_RX_FILTER_CHANGED.patch b/SOURCES/libvirt-qemu-change-macvtap-multicast-list-in-response-to-NIC_RX_FILTER_CHANGED.patch deleted file mode 100644 index 210d041..0000000 --- a/SOURCES/libvirt-qemu-change-macvtap-multicast-list-in-response-to-NIC_RX_FILTER_CHANGED.patch +++ /dev/null @@ -1,204 +0,0 @@ -From b470923607cb80c282b2484de081b15781faeb7c Mon Sep 17 00:00:00 2001 -Message-Id: -From: Tony Krowiak -Date: Mon, 3 Nov 2014 10:00:23 -0500 -Subject: [PATCH] qemu: change macvtap multicast list in response to - NIC_RX_FILTER_CHANGED - -https://bugzilla.redhat.com/show_bug.cgi?id=848199 - -This patch adds functionality to processNicRxFilterChangedEvent(). -The old and new multicast lists are compared and the filters in -the macvtap are programmed to match the guest's filters. - -Signed-off-by: Tony Krowiak -(cherry picked from commit d70cc1fa7219b347a301e132bb927f41958b372d) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 138 ++++++++++++++++++++++++++++++++++++++++--------- - 1 file changed, 114 insertions(+), 24 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 229836f..3812615 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4148,6 +4148,106 @@ processDeviceDeletedEvent(virQEMUDriverPtr driver, - - - static void -+syncNicRxFilterMacAddr(char *ifname, virNetDevRxFilterPtr guestFilter, -+ virNetDevRxFilterPtr hostFilter) -+{ -+ char newMacStr[VIR_MAC_STRING_BUFLEN]; -+ -+ if (virMacAddrCmp(&hostFilter->mac, &guestFilter->mac)) { -+ virMacAddrFormat(&guestFilter->mac, newMacStr); -+ -+ /* set new MAC address from guest to associated macvtap device */ -+ if (virNetDevSetMAC(ifname, &guestFilter->mac) < 0) { -+ VIR_WARN("Couldn't set new MAC address %s to device %s " -+ "while responding to NIC_RX_FILTER_CHANGED", -+ newMacStr, ifname); -+ } else { -+ VIR_DEBUG("device %s MAC address set to %s", ifname, newMacStr); -+ } -+ } -+} -+ -+ -+static void -+syncNicRxFilterGuestMulticast(char *ifname, virNetDevRxFilterPtr guestFilter, -+ virNetDevRxFilterPtr hostFilter) -+{ -+ size_t i, j; -+ bool found; -+ char macstr[VIR_MAC_STRING_BUFLEN]; -+ -+ for (i = 0; i < guestFilter->multicast.nTable; i++) { -+ found = false; -+ -+ for (j = 0; j < hostFilter->multicast.nTable; j++) { -+ if (virMacAddrCmp(&guestFilter->multicast.table[i], -+ &hostFilter->multicast.table[j]) == 0) { -+ found = true; -+ break; -+ } -+ } -+ -+ if (!found) { -+ virMacAddrFormat(&guestFilter->multicast.table[i], macstr); -+ -+ if (virNetDevAddMulti(ifname, &guestFilter->multicast.table[i]) < 0) { -+ VIR_WARN("Couldn't add new multicast MAC address %s to " -+ "device %s while responding to NIC_RX_FILTER_CHANGED", -+ macstr, ifname); -+ } else { -+ VIR_DEBUG("Added multicast MAC %s to %s interface", -+ macstr, ifname); -+ } -+ } -+ } -+} -+ -+ -+static void -+syncNicRxFilterHostMulticast(char *ifname, virNetDevRxFilterPtr guestFilter, -+ virNetDevRxFilterPtr hostFilter) -+{ -+ size_t i, j; -+ bool found; -+ char macstr[VIR_MAC_STRING_BUFLEN]; -+ -+ for (i = 0; i < hostFilter->multicast.nTable; i++) { -+ found = false; -+ -+ for (j = 0; j < guestFilter->multicast.nTable; j++) { -+ if (virMacAddrCmp(&hostFilter->multicast.table[i], -+ &guestFilter->multicast.table[j]) == 0) { -+ found = true; -+ break; -+ } -+ } -+ -+ if (!found) { -+ virMacAddrFormat(&hostFilter->multicast.table[i], macstr); -+ -+ if (virNetDevDelMulti(ifname, &hostFilter->multicast.table[i]) < 0) { -+ VIR_WARN("Couldn't delete multicast MAC address %s from " -+ "device %s while responding to NIC_RX_FILTER_CHANGED", -+ macstr, ifname); -+ } else { -+ VIR_DEBUG("Deleted multicast MAC %s from %s interface", -+ macstr, ifname); -+ } -+ } -+ } -+} -+ -+ -+static void -+syncNicRxFilterMulticast(char *ifname, -+ virNetDevRxFilterPtr guestFilter, -+ virNetDevRxFilterPtr hostFilter) -+{ -+ syncNicRxFilterGuestMulticast(ifname, guestFilter, hostFilter); -+ syncNicRxFilterHostMulticast(ifname, guestFilter, hostFilter); -+} -+ -+static void - processNicRxFilterChangedEvent(virQEMUDriverPtr driver, - virDomainObjPtr vm, - char *devAlias) -@@ -4156,9 +4256,8 @@ processNicRxFilterChangedEvent(virQEMUDriverPtr driver, - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDeviceDef dev; - virDomainNetDefPtr def; -- virNetDevRxFilterPtr filter = NULL; -- virMacAddr oldMAC; -- char newMacStr[VIR_MAC_STRING_BUFLEN]; -+ virNetDevRxFilterPtr guestFilter = NULL; -+ virNetDevRxFilterPtr hostFilter = NULL; - int ret; - - VIR_DEBUG("Received NIC_RX_FILTER_CHANGED event for device %s " -@@ -4203,37 +4302,27 @@ processNicRxFilterChangedEvent(virQEMUDriverPtr driver, - "device %s in domain %s", def->info.alias, vm->def->name); - - qemuDomainObjEnterMonitor(driver, vm); -- ret = qemuMonitorQueryRxFilter(priv->mon, devAlias, &filter); -+ ret = qemuMonitorQueryRxFilter(priv->mon, devAlias, &guestFilter); - qemuDomainObjExitMonitor(driver, vm); - if (ret < 0) - goto endjob; - -- virMacAddrFormat(&filter->mac, newMacStr); -- - if (virDomainNetGetActualType(def) == VIR_DOMAIN_NET_TYPE_DIRECT) { - -- /* For macvtap connections, set the macvtap device's MAC -- * address to match that of the guest device. -- */ -- -- if (virNetDevGetMAC(def->ifname, &oldMAC) < 0) { -- VIR_WARN("Couldn't get current MAC address of device %s " -+ if (virNetDevGetRxFilter(def->ifname, &hostFilter)) { -+ VIR_WARN("Couldn't get current RX filter for device %s " - "while responding to NIC_RX_FILTER_CHANGED", - def->ifname); - goto endjob; - } - -- if (virMacAddrCmp(&oldMAC, &filter->mac)) { -- /* set new MAC address from guest to associated macvtap device */ -- if (virNetDevSetMAC(def->ifname, &filter->mac) < 0) { -- VIR_WARN("Couldn't set new MAC address %s to device %s " -- "while responding to NIC_RX_FILTER_CHANGED", -- newMacStr, def->ifname); -- } else { -- VIR_DEBUG("device %s MAC address set to %s", -- def->ifname, newMacStr); -- } -- } -+ /* For macvtap connections, set the following macvtap network device -+ * attributes to match those of the guest network device: -+ * - MAC address -+ * - Multicast MAC address table -+ */ -+ syncNicRxFilterMacAddr(def->ifname, guestFilter, hostFilter); -+ syncNicRxFilterMulticast(def->ifname, guestFilter, hostFilter); - } - - endjob: -@@ -4243,7 +4332,8 @@ processNicRxFilterChangedEvent(virQEMUDriverPtr driver, - ignore_value(qemuDomainObjEndJob(driver, vm)); - - cleanup: -- virNetDevRxFilterFree(filter); -+ virNetDevRxFilterFree(hostFilter); -+ virNetDevRxFilterFree(guestFilter); - VIR_FREE(devAlias); - virObjectUnref(cfg); - } --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-chardev-Extract-more-information-about-character-devices.patch b/SOURCES/libvirt-qemu-chardev-Extract-more-information-about-character-devices.patch deleted file mode 100644 index 93d2073..0000000 --- a/SOURCES/libvirt-qemu-chardev-Extract-more-information-about-character-devices.patch +++ /dev/null @@ -1,352 +0,0 @@ -From ec6edfd4fa89b918348318eeb3bca982a9f39ba2 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Mon, 24 Nov 2014 17:51:16 +0100 -Subject: [PATCH] qemu: chardev: Extract more information about character - devices - -https://bugzilla.redhat.com/show_bug.cgi?id=1146944 - -Improve the monitor function to also retrieve the guest state of -character device (if provided) so that we can refresh the state of -virtio-serial channels and perhaps react to changes in the state in -future patches. - -This patch changes the returned data from qemuMonitorGetChardevInfo to -return a structure containing the pty path and the state for all the -character devices. - -The change to the testsuite makes sure that the data is parsed -correctly. - -(cherry picked from commit 4d7eb903119ef61b58ced29432f4933b372e00ab) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor.c | 13 ++++++++++- - src/qemu/qemu_monitor.h | 6 ++++++ - src/qemu/qemu_monitor_json.c | 51 +++++++++++++++++++++++++++++--------------- - src/qemu/qemu_monitor_text.c | 17 ++++++++++----- - src/qemu/qemu_process.c | 8 +++---- - tests/qemumonitorjsontest.c | 41 +++++++++++++++++++++++++++++------ - 6 files changed, 103 insertions(+), 33 deletions(-) - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 55a0542..38399ba 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -2986,6 +2986,17 @@ qemuMonitorQueryRxFilter(qemuMonitorPtr mon, const char *alias, - } - - -+static void -+qemuMonitorChardevInfoFree(void *data, -+ const void *name ATTRIBUTE_UNUSED) -+{ -+ qemuMonitorChardevInfoPtr info = data; -+ -+ VIR_FREE(info->ptyPath); -+ VIR_FREE(info); -+} -+ -+ - int - qemuMonitorGetChardevInfo(qemuMonitorPtr mon, - virHashTablePtr *retinfo) -@@ -3001,7 +3012,7 @@ qemuMonitorGetChardevInfo(qemuMonitorPtr mon, - goto error; - } - -- if (!(info = virHashCreate(10, virHashValueFree))) -+ if (!(info = virHashCreate(10, qemuMonitorChardevInfoFree))) - goto error; - - if (mon->json) -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index 8ae0dbe..d1dc242 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -649,6 +649,12 @@ int qemuMonitorRemoveNetdev(qemuMonitorPtr mon, - int qemuMonitorQueryRxFilter(qemuMonitorPtr mon, const char *alias, - virNetDevRxFilterPtr *filter); - -+typedef struct _qemuMonitorChardevInfo qemuMonitorChardevInfo; -+typedef qemuMonitorChardevInfo *qemuMonitorChardevInfoPtr; -+struct _qemuMonitorChardevInfo { -+ char *ptyPath; -+ virDomainChrDeviceState state; -+}; - int qemuMonitorGetChardevInfo(qemuMonitorPtr mon, - virHashTablePtr *retinfo); - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index e5f49ef..34fb91f 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -3557,7 +3557,7 @@ qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias, - * - * {"return": [ - * {"filename": "stdio", "label": "monitor"}, -- * {"filename": "pty:/dev/pts/6", "label": "serial0"}, -+ * {"filename": "pty:/dev/pts/6", "label": "serial0", "frontend-open": true}, - * {"filename": "pty:/dev/pts/7", "label": "parallel0"} - * ]} - * -@@ -3569,6 +3569,7 @@ qemuMonitorJSONExtractChardevInfo(virJSONValuePtr reply, - virJSONValuePtr data; - int ret = -1; - size_t i; -+ qemuMonitorChardevInfoPtr entry = NULL; - - if (!(data = virJSONValueObjectGet(reply, "return"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -3583,44 +3584,60 @@ qemuMonitorJSONExtractChardevInfo(virJSONValuePtr reply, - } - - for (i = 0; i < virJSONValueArraySize(data); i++) { -- virJSONValuePtr entry = virJSONValueArrayGet(data, i); -+ virJSONValuePtr chardev = virJSONValueArrayGet(data, i); - const char *type; -- const char *id; -- if (!entry) { -+ const char *alias; -+ bool connected; -+ -+ if (!chardev) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("character device information was missing array element")); - goto cleanup; - } - -- if (!(type = virJSONValueObjectGetString(entry, "filename"))) { -+ if (!(alias = virJSONValueObjectGetString(chardev, "label"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("character device information was missing filename")); -+ _("character device information was missing label")); - goto cleanup; - } - -- if (!(id = virJSONValueObjectGetString(entry, "label"))) { -+ if (!(type = virJSONValueObjectGetString(chardev, "filename"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("character device information was missing filename")); - goto cleanup; - } - -- if (STRPREFIX(type, "pty:")) { -- char *path; -- if (VIR_STRDUP(path, type + strlen("pty:")) < 0) -- goto cleanup; -+ if (VIR_ALLOC(entry) < 0) -+ goto cleanup; -+ -+ if (STRPREFIX(type, "pty:") && -+ VIR_STRDUP(entry->ptyPath, type + strlen("pty:")) < 0) -+ goto cleanup; -+ -+ if (virJSONValueObjectGetBoolean(chardev, "frontend-open", &connected) == 0) { -+ if (connected) -+ entry->state = VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED; -+ else -+ entry->state = VIR_DOMAIN_CHR_DEVICE_STATE_DISCONNECTED; -+ } - -- if (virHashAddEntry(info, id, path) < 0) { -- virReportError(VIR_ERR_OPERATION_FAILED, -- _("failed to save chardev path '%s'"), path); -- VIR_FREE(path); -- goto cleanup; -- } -+ if (virHashAddEntry(info, alias, entry) < 0) { -+ virReportError(VIR_ERR_OPERATION_FAILED, -+ _("failed to add chardev '%s' info"), alias); -+ goto cleanup; - } -+ -+ entry = NULL; - } - - ret = 0; - - cleanup: -+ if (entry) { -+ VIR_FREE(entry->ptyPath); -+ VIR_FREE(entry); -+ } -+ - return ret; - } - -diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c -index 634f9f3..aee9f35 100644 ---- a/src/qemu/qemu_monitor_text.c -+++ b/src/qemu/qemu_monitor_text.c -@@ -2176,6 +2176,7 @@ int qemuMonitorTextGetChardevInfo(qemuMonitorPtr mon, - virHashTablePtr info) - { - char *reply = NULL; -+ qemuMonitorChardevInfoPtr entry = NULL; - int ret = -1; - - if (qemuMonitorHMPCommand(mon, "info chardev", &reply) < 0) -@@ -2220,17 +2221,22 @@ int qemuMonitorTextGetChardevInfo(qemuMonitorPtr mon, - - /* Path is everything after needle to the end of the line */ - *eol = '\0'; -- char *path; -- if (VIR_STRDUP(path, needle + strlen(NEEDLE)) < 0) -+ -+ if (VIR_ALLOC(entry) < 0) -+ goto cleanup; -+ -+ if (VIR_STRDUP(entry->ptyPath, needle + strlen(NEEDLE)) < 0) - goto cleanup; - -- if (virHashAddEntry(info, id, path) < 0) { -+ if (virHashAddEntry(info, id, entry) < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, - _("failed to save chardev path '%s'"), -- path); -- VIR_FREE(path); -+ entry->ptyPath); -+ VIR_FREE(entry->ptyPath); - goto cleanup; - } -+ -+ entry = NULL; - #undef NEEDLE - } - -@@ -2238,6 +2244,7 @@ int qemuMonitorTextGetChardevInfo(qemuMonitorPtr mon, - - cleanup: - VIR_FREE(reply); -+ VIR_FREE(entry); - return ret; - } - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 7e1b9a2..ebcd5e8 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -1919,15 +1919,15 @@ qemuProcessLookupPTYs(virDomainDefPtr def, - - if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) { - char id[32]; -- const char *path; -+ qemuMonitorChardevInfoPtr entry; - - if (snprintf(id, sizeof(id), "%s%s", - chardevfmt ? "char" : "", - chr->info.alias) >= sizeof(id)) - return -1; - -- path = (const char *) virHashLookup(info, id); -- if (path == NULL) { -+ entry = virHashLookup(info, id); -+ if (!entry || !entry->ptyPath) { - if (chr->source.data.file.path == NULL) { - /* neither the log output nor 'info chardev' had a - * pty path for this chardev, report an error -@@ -1944,7 +1944,7 @@ qemuProcessLookupPTYs(virDomainDefPtr def, - } - - VIR_FREE(chr->source.data.file.path); -- if (VIR_STRDUP(chr->source.data.file.path, path) < 0) -+ if (VIR_STRDUP(chr->source.data.file.path, entry->ptyPath) < 0) - return -1; - } - } -diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c -index afa2561..46c5f40 100644 ---- a/tests/qemumonitorjsontest.c -+++ b/tests/qemumonitorjsontest.c -@@ -1759,11 +1759,28 @@ testQemuMonitorJSONqemuMonitorJSONGetSpiceMigrationStatus(const void *data) - } - - static int --testHashEqualString(const void *value1, const void *value2) -+testHashEqualChardevInfo(const void *value1, const void *value2) - { -- return strcmp(value1, value2); -+ const qemuMonitorChardevInfo *info1 = value1; -+ const qemuMonitorChardevInfo *info2 = value2; -+ -+ if (info1->state != info2->state) -+ goto error; -+ -+ if (STRNEQ_NULLABLE(info1->ptyPath, info2->ptyPath)) -+ goto error; -+ -+ return 0; -+ -+ error: -+ fprintf(stderr, "\n" -+ "info1->state: %d info2->state: %d\n" -+ "info1->ptyPath: %s info2->ptyPath: %s\n", -+ info1->state, info2->state, info1->ptyPath, info2->ptyPath); -+ return -1; - } - -+ - static int - testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *data) - { -@@ -1771,6 +1788,10 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *data) - qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt); - int ret = -1; - virHashTablePtr info = NULL, expectedInfo = NULL; -+ qemuMonitorChardevInfo info0 = { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT }; -+ qemuMonitorChardevInfo info1 = { (char *) "/dev/pts/21", VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED }; -+ qemuMonitorChardevInfo info2 = { (char *) "/dev/pts/20", VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT }; -+ qemuMonitorChardevInfo info3 = { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_DISCONNECTED }; - - if (!test) - return -1; -@@ -1779,8 +1800,10 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *data) - !(expectedInfo = virHashCreate(32, NULL))) - goto cleanup; - -- if (virHashAddEntry(expectedInfo, "charserial1", (void *) "/dev/pts/21") < 0 || -- virHashAddEntry(expectedInfo, "charserial0", (void *) "/dev/pts/20") < 0) { -+ if (virHashAddEntry(expectedInfo, "charserial1", &info1) < 0 || -+ virHashAddEntry(expectedInfo, "charserial0", &info2) < 0 || -+ virHashAddEntry(expectedInfo, "charmonitor", &info0) < 0 || -+ virHashAddEntry(expectedInfo, "charserial2", &info3) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - "Unable to create expectedInfo hash table"); - goto cleanup; -@@ -1791,7 +1814,8 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *data) - " \"return\": [" - " {" - " \"filename\": \"pty:/dev/pts/21\"," -- " \"label\": \"charserial1\"" -+ " \"label\": \"charserial1\"," -+ " \"frontend-open\": true" - " }," - " {" - " \"filename\": \"pty:/dev/pts/20\"," -@@ -1800,6 +1824,11 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *data) - " {" - " \"filename\": \"unix:/var/lib/libvirt/qemu/gentoo.monitor,server\"," - " \"label\": \"charmonitor\"" -+ " }," -+ " {" -+ " \"filename\": \"unix:/path/to/socket,server\"," -+ " \"label\": \"charserial2\"," -+ " \"frontend-open\": false" - " }" - " ]," - " \"id\": \"libvirt-15\"" -@@ -1810,7 +1839,7 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *data) - info) < 0) - goto cleanup; - -- if (!virHashEqual(info, expectedInfo, testHashEqualString)) { -+ if (!virHashEqual(info, expectedInfo, testHashEqualChardevInfo)) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - "Hashtable is different to the expected one"); - goto cleanup; --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-command-Align-memory-sizes-only-on-fresh-starts.patch b/SOURCES/libvirt-qemu-command-Align-memory-sizes-only-on-fresh-starts.patch new file mode 100644 index 0000000..f83cbd7 --- /dev/null +++ b/SOURCES/libvirt-qemu-command-Align-memory-sizes-only-on-fresh-starts.patch @@ -0,0 +1,50 @@ +From f03a1cb15b60d56f8f85bcd4a9823aac68682d56 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:46 +0200 +Subject: [PATCH] qemu: command: Align memory sizes only on fresh starts + +When we are starting a qemu process for an incomming migration or +snapshot reloading we should not modify the memory sizes in the domain +since we could potentially change the guest ABI that was tediously +checked before. Additionally the function now updates the initial memory +size according to the NUMA node size, which should not happen if we are +restoring state. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1252685 +(cherry picked from commit c7d7ba85a6242d789ba3f4dae313e950fbb638c5) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 3 ++- + tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 701ccc3..6314976 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9040,7 +9040,8 @@ qemuBuildCommandLine(virConnectPtr conn, + if (qemuBuildDomainLoaderCommandLine(cmd, def, qemuCaps) < 0) + goto error; + +- if (qemuDomainAlignMemorySizes(def) < 0) ++ if (!migrateFrom && !snapshot && ++ qemuDomainAlignMemorySizes(def) < 0) + goto error; + + virCommandAddArg(cmd, "-m"); +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args b/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args +index 5c67702..458c015 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args +@@ -1,5 +1,5 @@ + LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ + /usr/bin/qemu -S -M \ +-pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \ ++pc -m 213 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \ + -no-acpi -boot c -usb -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel \ + none -incoming stdio +-- +2.5.3 + diff --git a/SOURCES/libvirt-qemu-command-introduce-new-vgamem-attribute-for-QXL-video-device.patch b/SOURCES/libvirt-qemu-command-introduce-new-vgamem-attribute-for-QXL-video-device.patch deleted file mode 100644 index d517497..0000000 --- a/SOURCES/libvirt-qemu-command-introduce-new-vgamem-attribute-for-QXL-video-device.patch +++ /dev/null @@ -1,398 +0,0 @@ -From 0c854d5840c6c7546628f578f5c9c3595c9eef60 Mon Sep 17 00:00:00 2001 -Message-Id: <0c854d5840c6c7546628f578f5c9c3595c9eef60@dist-git> -From: Pavel Hrdina -Date: Tue, 25 Nov 2014 10:53:03 +0100 -Subject: [PATCH] qemu-command: introduce new vgamem attribute for QXL video - device - -Add attribute to set vgamem_mb parameter of QXL device for QEMU. This -value sets the size of VGA framebuffer for QXL device. Default value in -QEMU is 8MB so reuse it also in libvirt to not break things. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 742d49fa170bf72ec1fee516fda9f6797b1124f9) -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 5 ++++- - docs/schemas/domaincommon.rng | 5 +++++ - src/conf/domain_conf.c | 26 ++++++++++++++++++++++ - src/conf/domain_conf.h | 1 + - src/qemu/qemu_command.c | 22 ++++++++++++++++-- - src/qemu/qemu_domain.c | 19 ++++++++++++++++ - .../qemuxml2argv-graphics-spice-compression.xml | 4 ++-- - .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 ++-- - .../qemuxml2argv-graphics-spice.xml | 4 ++-- - .../qemuxml2argv-pcihole64-q35.xml | 2 +- - tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- - .../qemuxml2argv-serial-spiceport.xml | 2 +- - .../qemuxml2argv-video-qxl-device-vgamem.args | 4 ++-- - .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 6 ++--- - tests/qemuxml2argvtest.c | 6 +++-- - tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- - 16 files changed, 94 insertions(+), 20 deletions(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 4755e01..122e21f 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -4689,7 +4689,10 @@ qemu-kvm -net nic,model=? /dev/null - only and specifies the size of the primary bar, while the optional - attribute vram specifies the secondary bar size. - If "ram" or "vram" are not supplied a default value is used. The ram -- should also be rounded to power of two as vram. -+ should also be rounded to power of two as vram. There is also optional -+ attribute vgamem (since 1.2.11 (QEMU -+ only)) to set the size of VGA framebuffer for fallback mode of -+ QXL device. -

-
- -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 4e917b1..55f49c6 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -2868,6 +2868,11 @@ - - - -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 0b0200b..09ddc25 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -10114,6 +10114,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, - char *heads = NULL; - char *vram = NULL; - char *ram = NULL; -+ char *vgamem = NULL; - char *primary = NULL; - - if (VIR_ALLOC(def) < 0) -@@ -10127,6 +10128,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, - type = virXMLPropString(cur, "type"); - ram = virXMLPropString(cur, "ram"); - vram = virXMLPropString(cur, "vram"); -+ vgamem = virXMLPropString(cur, "vgamem"); - heads = virXMLPropString(cur, "heads"); - - if ((primary = virXMLPropString(cur, "primary")) != NULL) { -@@ -10180,6 +10182,19 @@ virDomainVideoDefParseXML(xmlNodePtr node, - def->vram = virDomainVideoDefaultRAM(dom, def->type); - } - -+ if (vgamem) { -+ if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("vgamem attribute only supported for type of qxl")); -+ goto error; -+ } -+ if (virStrToLong_ui(vgamem, NULL, 10, &def->vgamem) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("cannot parse video vgamem '%s'"), vgamem); -+ goto error; -+ } -+ } -+ - if (heads) { - if (virStrToLong_ui(heads, NULL, 10, &def->heads) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, -@@ -10196,6 +10211,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, - VIR_FREE(type); - VIR_FREE(ram); - VIR_FREE(vram); -+ VIR_FREE(vgamem); - VIR_FREE(heads); - - return def; -@@ -10205,6 +10221,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, - VIR_FREE(type); - VIR_FREE(ram); - VIR_FREE(vram); -+ VIR_FREE(vgamem); - VIR_FREE(heads); - return NULL; - } -@@ -14528,6 +14545,13 @@ virDomainVideoDefCheckABIStability(virDomainVideoDefPtr src, - return false; - } - -+ if (src->vgamem != dst->vgamem) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Target video card vgamem %u does not match source %u"), -+ dst->vgamem, src->vgamem); -+ return false; -+ } -+ - if (src->heads != dst->heads) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Target video card heads %u does not match source %u"), -@@ -17802,6 +17826,8 @@ virDomainVideoDefFormat(virBufferPtr buf, - virBufferAsprintf(buf, " ram='%u'", def->ram); - if (def->vram) - virBufferAsprintf(buf, " vram='%u'", def->vram); -+ if (def->vgamem) -+ virBufferAsprintf(buf, " vgamem='%u'", def->vgamem); - if (def->heads) - virBufferAsprintf(buf, " heads='%u'", def->heads); - if (def->primary) -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index ae46467..04cee80 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -1284,6 +1284,7 @@ struct _virDomainVideoDef { - int type; - unsigned int ram; /* kibibytes (multiples of 1024) */ - unsigned int vram; /* kibibytes (multiples of 1024) */ -+ unsigned int vgamem; /* kibibytes (multiples of 1024) */ - unsigned int heads; - bool primary; - virDomainVideoAccelDefPtr accel; -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index e44f114..70730ce 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -4853,6 +4853,12 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, - /* QEMU accepts bytes for vram_size. */ - virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); - } -+ -+ if ((primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) || -+ (!primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM))) { -+ /* QEMU accepts mebibytes for vgamem_mb. */ -+ virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024); -+ } - } else if (video->vram && - ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || -@@ -9139,6 +9145,7 @@ qemuBuildCommandLine(virConnectPtr conn, - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { - unsigned int ram = def->videos[0]->ram; - unsigned int vram = def->videos[0]->vram; -+ unsigned int vgamem = def->videos[0]->vgamem; - - if (vram > (UINT_MAX / 1024)) { - virReportError(VIR_ERR_OVERFLOW, -@@ -9163,6 +9170,12 @@ qemuBuildCommandLine(virConnectPtr conn, - virCommandAddArgFormat(cmd, "%s.vram_size=%u", - dev, vram * 1024); - } -+ if (vgamem && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) { -+ virCommandAddArg(cmd, "-global"); -+ virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", -+ dev, vgamem / 1024); -+ } - } - - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) && -@@ -12169,8 +12182,13 @@ qemuParseCommandLine(virCapsPtr qemuCaps, - else - vid->type = video; - vid->vram = virDomainVideoDefaultRAM(def, vid->type); -- vid->ram = vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL ? -- virDomainVideoDefaultRAM(def, vid->type) : 0; -+ if (vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { -+ vid->ram = virDomainVideoDefaultRAM(def, vid->type); -+ vid->vgamem = 8 * 1024; -+ } else { -+ vid->ram = 0; -+ vid->vgamem = 0; -+ } - vid->heads = 1; - - if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, vid) < 0) { -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index d166269..f61593b 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -1176,6 +1176,25 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, - goto cleanup; - } - -+ if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && -+ dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { -+ if (dev->data.video->vgamem) { -+ if (dev->data.video->vgamem < 1024) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("value for 'vgamem' must be at least 1 MiB " -+ "(1024 KiB)")); -+ goto cleanup; -+ } -+ if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("value for 'vgamem' must be power of two")); -+ goto cleanup; -+ } -+ } else { -+ dev->data.video->vgamem = 8 * 1024; -+ } -+ } -+ - ret = 0; - - cleanup: -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml -index 5c9683f..c13327a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml -@@ -33,10 +33,10 @@ - - - - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml -index acf3019..ac705f3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml -@@ -30,10 +30,10 @@ - - - - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml -index 335ce69..0c61ee5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml -@@ -37,10 +37,10 @@ - - - - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml -index 168b2701..ef9cd4f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml -@@ -26,7 +26,7 @@ - - - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml -index 02df713..05967a4 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml -@@ -23,7 +23,7 @@ - - - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml -index 905924e..1127db1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml -@@ -37,7 +37,7 @@ - - - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -index c9eb535..5398ffe 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -@@ -2,5 +2,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ - /usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ - -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ - -hda /var/lib/libvirt/images/QEMUGuest1 \ ---device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0\ --,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\ -+,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -index 5fc41bb..82aa0a9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -@@ -2,7 +2,7 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ - /usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ - -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ - -hda /var/lib/libvirt/images/QEMUGuest1 \ ---device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0\ --,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0\ --,addr=0x4 \ -+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\ -+,bus=pci.0,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864\ -+,vgamem_mb=8,bus=pci.0,addr=0x4 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 24e9740..967760a 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1331,13 +1331,15 @@ mymain(void) - DO_TEST("video-qxl-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA, - QEMU_CAPS_DEVICE_VIDEO_PRIMARY); - DO_TEST("video-qxl-device-vgamem", QEMU_CAPS_DEVICE, -- QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); -+ QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, -+ QEMU_CAPS_QXL_VGA_VGAMEM); - DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL); - DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA, - QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); - DO_TEST("video-qxl-sec-device-vgamem", QEMU_CAPS_DEVICE, - QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, -- QEMU_CAPS_DEVICE_VIDEO_PRIMARY); -+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_QXL_VGA_VGAMEM, -+ QEMU_CAPS_QXL_VGAMEM); - - DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIRTIO_RNG, - QEMU_CAPS_OBJECT_RNG_RANDOM); -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml -index 752c7d5..9dd4162 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml -@@ -24,7 +24,7 @@ - - - - - --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-command-use-vram-attribute-for-all-video-devices.patch b/SOURCES/libvirt-qemu-command-use-vram-attribute-for-all-video-devices.patch deleted file mode 100644 index 1e3400a..0000000 --- a/SOURCES/libvirt-qemu-command-use-vram-attribute-for-all-video-devices.patch +++ /dev/null @@ -1,574 +0,0 @@ -From 76499cca14e0a71564408618fdd148c6d194606e Mon Sep 17 00:00:00 2001 -Message-Id: <76499cca14e0a71564408618fdd148c6d194606e@dist-git> -From: Pavel Hrdina -Date: Tue, 25 Nov 2014 10:53:02 +0100 -Subject: [PATCH] qemu-command: use vram attribute for all video devices - -So far we didn't have any option to set video memory size for qemu video -devices. There was only the vram (ram for QXL) attribute but it was valid -only for the QXL video device. - -To provide this feature to users QEMU has a dedicated device attribute -called 'vgamem_mb' to set the video memory size. We will use the 'vram' -attribute for setting video memory size for other QEMU video devices. - -For the cirrus device we will ignore the vram value because it has -hardcoded video size in QEMU. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 24c6ca860e2cf25aa28b33e19c318296b291e42c) -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 36 +++++++++++++++++++++- - .../qemuxml2argv-video-qxl-device-vgamem.args | 6 ++++ - .../qemuxml2argv-video-qxl-device-vgamem.xml | 29 +++++++++++++++++ - .../qemuxml2argv-video-qxl-device.args | 6 ++++ - .../qemuxml2argv-video-qxl-device.xml | 29 +++++++++++++++++ - .../qemuxml2argv-video-qxl-nodevice.args | 5 +++ - .../qemuxml2argv-video-qxl-nodevice.xml | 29 +++++++++++++++++ - .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 8 +++++ - .../qemuxml2argv-video-qxl-sec-device-vgamem.xml | 32 +++++++++++++++++++ - .../qemuxml2argv-video-qxl-sec-device.args | 7 +++++ - .../qemuxml2argv-video-qxl-sec-device.xml | 32 +++++++++++++++++++ - .../qemuxml2argv-video-qxl-sec-nodevice.xml | 32 +++++++++++++++++++ - .../qemuxml2argv-video-vga-device-vgamem.args | 6 ++++ - .../qemuxml2argv-video-vga-device-vgamem.xml | 29 +++++++++++++++++ - .../qemuxml2argv-video-vga-device.args | 6 ++++ - .../qemuxml2argv-video-vga-device.xml | 29 +++++++++++++++++ - .../qemuxml2argv-video-vga-nodevice.args | 5 +++ - .../qemuxml2argv-video-vga-nodevice.xml | 29 +++++++++++++++++ - tests/qemuxml2argvtest.c | 16 ++++++++++ - 19 files changed, 370 insertions(+), 1 deletion(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.xml - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index c75d3b0..e44f114 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -4853,6 +4853,20 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, - /* QEMU accepts bytes for vram_size. */ - virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); - } -+ } else if (video->vram && -+ ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || -+ (video->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { -+ -+ if (video->vram < 1024) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ "%s", _("value for 'vram' must be at least 1 MiB " -+ "(1024 KiB)")); -+ goto error; -+ } -+ -+ virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vram / 1024); - } - - if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0) -@@ -7417,7 +7431,7 @@ qemuBuildShmemDevCmd(virCommandPtr cmd, - } - if (shmem->size < 1024 * 1024) { - virReportError(VIR_ERR_XML_ERROR, "%s", -- _("shmem size must be at least 1 MiB")); -+ _("shmem size must be at least 1 MiB (1024 KiB)")); - goto error; - } - virBufferAsprintf(&buf, ",size=%llum", shmem->size >> 20); -@@ -9150,6 +9164,26 @@ qemuBuildCommandLine(virConnectPtr conn, - dev, vram * 1024); - } - } -+ -+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) && -+ def->videos[0]->vram && -+ ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || -+ (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { -+ unsigned int vram = def->videos[0]->vram; -+ -+ if (vram < 1024) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ "%s", _("value for 'vgamem' must be at " -+ "least 1 MiB (1024 KiB)")); -+ goto error; -+ } -+ -+ virCommandAddArg(cmd, "-global"); -+ virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", -+ dev, vram / 1024); -+ } - } - - if (def->nvideos > 1) { -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -new file mode 100644 -index 0000000..c9eb535 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -@@ -0,0 +1,6 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /var/lib/libvirt/images/QEMUGuest1 \ -+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0\ -+,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.xml -new file mode 100644 -index 0000000..9fc42af ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.xml -@@ -0,0 +1,29 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args -new file mode 100644 -index 0000000..c9eb535 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args -@@ -0,0 +1,6 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /var/lib/libvirt/images/QEMUGuest1 \ -+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0\ -+,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.xml -new file mode 100644 -index 0000000..9fc42af ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.xml -@@ -0,0 +1,29 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args -new file mode 100644 -index 0000000..a6ac6d8 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args -@@ -0,0 +1,5 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /var/lib/libvirt/images/QEMUGuest1 -net none -serial none -parallel none \ -+-vga qxl -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.xml -new file mode 100644 -index 0000000..9fc42af ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.xml -@@ -0,0 +1,29 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -new file mode 100644 -index 0000000..5fc41bb ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -@@ -0,0 +1,8 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /var/lib/libvirt/images/QEMUGuest1 \ -+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0\ -+,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0\ -+,addr=0x4 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml -new file mode 100644 -index 0000000..0868f39 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml -@@ -0,0 +1,32 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args -new file mode 100644 -index 0000000..208408e ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args -@@ -0,0 +1,7 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /var/lib/libvirt/images/QEMUGuest1 \ -+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0\ -+,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0\ -+,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.xml -new file mode 100644 -index 0000000..0868f39 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.xml -@@ -0,0 +1,32 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml -new file mode 100644 -index 0000000..0868f39 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml -@@ -0,0 +1,32 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args -new file mode 100644 -index 0000000..81e4aec ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args -@@ -0,0 +1,6 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /var/lib/libvirt/images/QEMUGuest1 \ -+-device VGA,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.xml -new file mode 100644 -index 0000000..9b1ddfc ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.xml -@@ -0,0 +1,29 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args -new file mode 100644 -index 0000000..f822280 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args -@@ -0,0 +1,6 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /var/lib/libvirt/images/QEMUGuest1 \ -+-device VGA,id=video0,bus=pci.0,addr=0x2 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.xml -new file mode 100644 -index 0000000..9b1ddfc ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.xml -@@ -0,0 +1,29 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args -new file mode 100644 -index 0000000..7b5f151 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args -@@ -0,0 +1,5 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /var/lib/libvirt/images/QEMUGuest1 -net none -serial none -parallel none \ -+-vga std -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.xml -new file mode 100644 -index 0000000..9b1ddfc ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.xml -@@ -0,0 +1,29 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu -+ -+ -+ -+ -+
-+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 97af90a..24e9740 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1322,6 +1322,22 @@ mymain(void) - QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_QXL_VGA, - QEMU_CAPS_DEVICE_PCI_BRIDGE); -+ DO_TEST("video-vga-nodevice", QEMU_CAPS_VGA); -+ DO_TEST("video-vga-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VGA, -+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY); -+ DO_TEST("video-vga-device-vgamem", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VGA, -+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_VGAMEM); -+ DO_TEST("video-qxl-nodevice", QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL); -+ DO_TEST("video-qxl-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA, -+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY); -+ DO_TEST("video-qxl-device-vgamem", QEMU_CAPS_DEVICE, -+ QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); -+ DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL); -+ DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA, -+ QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); -+ DO_TEST("video-qxl-sec-device-vgamem", QEMU_CAPS_DEVICE, -+ QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, -+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY); - - DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIRTIO_RNG, - QEMU_CAPS_OBJECT_RNG_RANDOM); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-don-t-setup-cpuset.mems-if-memory-mode-in-numatune-is-not-strict.patch b/SOURCES/libvirt-qemu-don-t-setup-cpuset.mems-if-memory-mode-in-numatune-is-not-strict.patch deleted file mode 100644 index 3db24bd..0000000 --- a/SOURCES/libvirt-qemu-don-t-setup-cpuset.mems-if-memory-mode-in-numatune-is-not-strict.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 957c2c3adaee341fdd33e4eff598a215d0034b2f Mon Sep 17 00:00:00 2001 -Message-Id: <957c2c3adaee341fdd33e4eff598a215d0034b2f@dist-git> -From: Wang Rui -Date: Tue, 27 Jan 2015 11:40:08 +0100 -Subject: [PATCH] qemu: don't setup cpuset.mems if memory mode in numatune is - not 'strict' - -https://bugzilla.redhat.com/show_bug.cgi?id=1186094 - -If the memory mode in numatune is specified as 'preferred' with one node -(such as nodeset='0'), domain's memory is not all in node 0 absolutely. -Assumption that node 0 doesn't have enough memory, memory can be allocated -on node 1 when qemu process startup. Then if we set cpuset.mems to '0', -it may invoke OOM. - -Commit 1a7be8c600905aa07ac2d78293336ba8523ad48e changed the former logic of -checking memory mode in virDomainNumatuneGetNodeset. This patch adds the -check as before. - -Signed-off-by: Wang Rui -(cherry picked from commit 38a0f6df6473edb62e9ce25df5a0a81e8ac81d77) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_cgroup.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index 8824426..af5b59e 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -619,6 +619,10 @@ qemuSetupCpusetMems(virDomainObjPtr vm) - if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) - return 0; - -+ if (virDomainNumatuneGetMode(vm->def->numatune, -1) != -+ VIR_DOMAIN_NUMATUNE_MEM_STRICT) -+ return 0; -+ - if (virDomainNumatuneMaybeFormatNodeset(vm->def->numatune, - priv->autoNodeset, - &mem_mask, -1) < 0) --- -2.2.2 - diff --git a/SOURCES/libvirt-qemu-don-t-use-initialized-ret-in-qemuRemoveSharedDevice.patch b/SOURCES/libvirt-qemu-don-t-use-initialized-ret-in-qemuRemoveSharedDevice.patch new file mode 100644 index 0000000..22a7c3d --- /dev/null +++ b/SOURCES/libvirt-qemu-don-t-use-initialized-ret-in-qemuRemoveSharedDevice.patch @@ -0,0 +1,37 @@ +From f1ae475d996a4943d25ad7a540364be6d4f6fa32 Mon Sep 17 00:00:00 2001 +Message-Id: +From: =?UTF-8?q?Guido=20G=C3=BCnther?= +Date: Thu, 9 Jul 2015 19:08:49 +0200 +Subject: [PATCH] qemu: don't use initialized ret in qemuRemoveSharedDevice + +This fixes + + CC qemu/libvirt_driver_qemu_impl_la-qemu_conf.lo + qemu/qemu_conf.c: In function 'qemuRemoveSharedDevice': + qemu/qemu_conf.c:1384:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] + +(cherry picked from commit c6f9ddf9099d08732acf2501b73c6817d8feb882) + +https://bugzilla.redhat.com/show_bug.cgi?id=1072736 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_conf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index 965d34d..030261e 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1396,7 +1396,7 @@ qemuRemoveSharedHostdev(virQEMUDriverPtr driver, + { + char *dev_path = NULL; + char *key = NULL; +- int ret; ++ int ret = -1; + + if (!qemuIsSharedHostdev(hostdev)) + return 0; +-- +2.5.1 + diff --git a/SOURCES/libvirt-qemu-event-Don-t-fiddle-with-disk-backing-trees-without-a-job.patch b/SOURCES/libvirt-qemu-event-Don-t-fiddle-with-disk-backing-trees-without-a-job.patch deleted file mode 100644 index 1daff8b..0000000 --- a/SOURCES/libvirt-qemu-event-Don-t-fiddle-with-disk-backing-trees-without-a-job.patch +++ /dev/null @@ -1,363 +0,0 @@ -From 12fdae1ebb74296a4db3b191f16dfda757024b8f Mon Sep 17 00:00:00 2001 -Message-Id: <12fdae1ebb74296a4db3b191f16dfda757024b8f@dist-git> -From: Peter Krempa -Date: Tue, 17 Mar 2015 13:13:52 +0100 -Subject: [PATCH] qemu: event: Don't fiddle with disk backing trees without a - job - -https://bugzilla.redhat.com/show_bug.cgi?id=1202719 - -Surprisingly we did not grab a VM job when a block job finished and we'd -happily rewrite the backing chain data. This made it possible to crash -libvirt when queueing two backing chains tightly and other badness. - -To fix it, add yet another handler to the helper thread that handles -monitor events that require a job. - -(cherry picked from commit 1a92c719101e5bfa6fe2b78006ad04c7f075ea28) - - Changes: src/qemu/qemu_driver.c: qemuDomainObjEndJob() needs it's - return value to be ignored as the locking was not refactored yet. - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.h | 2 + - src/qemu/qemu_driver.c | 142 ++++++++++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_process.c | 129 ++++++++----------------------------------- - 3 files changed, 168 insertions(+), 105 deletions(-) - -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index bf37e26..76054ec 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -196,6 +196,7 @@ typedef enum { - QEMU_PROCESS_EVENT_DEVICE_DELETED, - QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED, - QEMU_PROCESS_EVENT_SERIAL_CHANGED, -+ QEMU_PROCESS_EVENT_BLOCK_JOB, - - QEMU_PROCESS_EVENT_LAST - } qemuProcessEventType; -@@ -204,6 +205,7 @@ struct qemuProcessEvent { - virDomainObjPtr vm; - qemuProcessEventType eventType; - int action; -+ int status; - void *data; - }; - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index c25c5ac..a19281d 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4401,6 +4401,141 @@ processSerialChangedEvent(virQEMUDriverPtr driver, - } - - -+static void -+processBlockJobEvent(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ char *diskAlias, -+ int type, -+ int status) -+{ -+ virObjectEventPtr event = NULL; -+ virObjectEventPtr event2 = NULL; -+ const char *path; -+ virDomainDiskDefPtr disk; -+ virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); -+ virDomainDiskDefPtr persistDisk = NULL; -+ bool save = false; -+ -+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -+ goto cleanup; -+ -+ if (!virDomainObjIsActive(vm)) { -+ VIR_DEBUG("Domain is not running"); -+ goto endjob; -+ } -+ -+ disk = qemuProcessFindDomainDiskByAlias(vm, diskAlias); -+ -+ if (disk) { -+ /* Have to generate two variants of the event for old vs. new -+ * client callbacks */ -+ if (type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT && -+ disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT) -+ type = disk->mirrorJob; -+ path = virDomainDiskGetSource(disk); -+ event = virDomainEventBlockJobNewFromObj(vm, path, type, status); -+ event2 = virDomainEventBlockJob2NewFromObj(vm, disk->dst, type, -+ status); -+ -+ /* If we completed a block pull or commit, then update the XML -+ * to match. */ -+ switch ((virConnectDomainEventBlockJobStatus) status) { -+ case VIR_DOMAIN_BLOCK_JOB_COMPLETED: -+ if (disk->mirrorState == VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT) { -+ if (vm->newDef) { -+ int indx = virDomainDiskIndexByName(vm->newDef, disk->dst, -+ false); -+ virStorageSourcePtr copy = NULL; -+ -+ if (indx >= 0) { -+ persistDisk = vm->newDef->disks[indx]; -+ copy = virStorageSourceCopy(disk->mirror, false); -+ if (virStorageSourceInitChainElement(copy, -+ persistDisk->src, -+ true) < 0) { -+ VIR_WARN("Unable to update persistent definition " -+ "on vm %s after block job", -+ vm->def->name); -+ virStorageSourceFree(copy); -+ copy = NULL; -+ persistDisk = NULL; -+ } -+ } -+ if (copy) { -+ virStorageSourceFree(persistDisk->src); -+ persistDisk->src = copy; -+ } -+ } -+ -+ /* XXX We want to revoke security labels and disk -+ * lease, as well as audit that revocation, before -+ * dropping the original source. But it gets tricky -+ * if both source and mirror share common backing -+ * files (we want to only revoke the non-shared -+ * portion of the chain); so for now, we leak the -+ * access to the original. */ -+ virStorageSourceFree(disk->src); -+ disk->src = disk->mirror; -+ } else { -+ virStorageSourceFree(disk->mirror); -+ } -+ -+ /* Recompute the cached backing chain to match our -+ * updates. Better would be storing the chain ourselves -+ * rather than reprobing, but we haven't quite completed -+ * that conversion to use our XML tracking. */ -+ disk->mirror = NULL; -+ save = disk->mirrorState != VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -+ disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -+ disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -+ ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, -+ true, true)); -+ break; -+ -+ case VIR_DOMAIN_BLOCK_JOB_READY: -+ disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY; -+ save = true; -+ break; -+ -+ case VIR_DOMAIN_BLOCK_JOB_FAILED: -+ case VIR_DOMAIN_BLOCK_JOB_CANCELED: -+ virStorageSourceFree(disk->mirror); -+ disk->mirror = NULL; -+ disk->mirrorState = status == VIR_DOMAIN_BLOCK_JOB_FAILED ? -+ VIR_DOMAIN_DISK_MIRROR_STATE_ABORT : VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -+ disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -+ save = true; -+ break; -+ -+ case VIR_DOMAIN_BLOCK_JOB_LAST: -+ break; -+ } -+ } -+ -+ if (save) { -+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) -+ VIR_WARN("Unable to save status on vm %s after block job", -+ vm->def->name); -+ if (persistDisk && virDomainSaveConfig(cfg->configDir, -+ vm->newDef) < 0) -+ VIR_WARN("Unable to update persistent definition on vm %s " -+ "after block job", vm->def->name); -+ } -+ virObjectUnlock(vm); -+ virObjectUnref(cfg); -+ -+ if (event) -+ qemuDomainEventQueue(driver, event); -+ if (event2) -+ qemuDomainEventQueue(driver, event2); -+ -+ endjob: -+ ignore_value(qemuDomainObjEndJob(driver, vm)); -+ cleanup: -+ VIR_FREE(diskAlias); -+} -+ -+ - static void qemuProcessEventHandler(void *data, void *opaque) - { - struct qemuProcessEvent *processEvent = data; -@@ -4427,6 +4562,13 @@ static void qemuProcessEventHandler(void *data, void *opaque) - case QEMU_PROCESS_EVENT_SERIAL_CHANGED: - processSerialChangedEvent(driver, vm, processEvent->data, - processEvent->action); -+ break; -+ case QEMU_PROCESS_EVENT_BLOCK_JOB: -+ processBlockJobEvent(driver, vm, -+ processEvent->data, -+ processEvent->action, -+ processEvent->status); -+ break; - case QEMU_PROCESS_EVENT_LAST: - break; - } -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index ffba29d..83a59a1 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -1024,123 +1024,42 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - void *opaque) - { - virQEMUDriverPtr driver = opaque; -- virObjectEventPtr event = NULL; -- virObjectEventPtr event2 = NULL; -- const char *path; -- virDomainDiskDefPtr disk; -- virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); -- virDomainDiskDefPtr persistDisk = NULL; -- bool save = false; -+ struct qemuProcessEvent *processEvent = NULL; -+ char *data; - - virObjectLock(vm); -- disk = qemuProcessFindDomainDiskByAlias(vm, diskAlias); - -- if (disk) { -- /* Have to generate two variants of the event for old vs. new -- * client callbacks */ -- if (type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT && -- disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT) -- type = disk->mirrorJob; -- path = virDomainDiskGetSource(disk); -- event = virDomainEventBlockJobNewFromObj(vm, path, type, status); -- event2 = virDomainEventBlockJob2NewFromObj(vm, disk->dst, type, -- status); -+ VIR_DEBUG("Block job for device %s (domain: %p,%s) type %d status %d", -+ diskAlias, vm, vm->def->name, type, status); - -- /* If we completed a block pull or commit, then update the XML -- * to match. */ -- switch ((virConnectDomainEventBlockJobStatus) status) { -- case VIR_DOMAIN_BLOCK_JOB_COMPLETED: -- if (disk->mirrorState == VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT) { -- if (vm->newDef) { -- int indx = virDomainDiskIndexByName(vm->newDef, disk->dst, -- false); -- virStorageSourcePtr copy = NULL; -+ if (VIR_ALLOC(processEvent) < 0) -+ goto error; - -- if (indx >= 0) { -- persistDisk = vm->newDef->disks[indx]; -- copy = virStorageSourceCopy(disk->mirror, false); -- if (virStorageSourceInitChainElement(copy, -- persistDisk->src, -- true) < 0) { -- VIR_WARN("Unable to update persistent definition " -- "on vm %s after block job", -- vm->def->name); -- virStorageSourceFree(copy); -- copy = NULL; -- persistDisk = NULL; -- } -- } -- if (copy) { -- virStorageSourceFree(persistDisk->src); -- persistDisk->src = copy; -- } -- } -+ processEvent->eventType = QEMU_PROCESS_EVENT_BLOCK_JOB; -+ if (VIR_STRDUP(data, diskAlias) < 0) -+ goto error; -+ processEvent->data = data; -+ processEvent->vm = vm; -+ processEvent->action = type; -+ processEvent->status = status; - -- /* XXX We want to revoke security labels and disk -- * lease, as well as audit that revocation, before -- * dropping the original source. But it gets tricky -- * if both source and mirror share common backing -- * files (we want to only revoke the non-shared -- * portion of the chain); so for now, we leak the -- * access to the original. */ -- virStorageSourceFree(disk->src); -- disk->src = disk->mirror; -- } else { -- virStorageSourceFree(disk->mirror); -- } -- -- /* Recompute the cached backing chain to match our -- * updates. Better would be storing the chain ourselves -- * rather than reprobing, but we haven't quite completed -- * that conversion to use our XML tracking. */ -- disk->mirror = NULL; -- save = disk->mirrorState != VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -- disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -- disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -- ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, -- true, true)); -- break; -- -- case VIR_DOMAIN_BLOCK_JOB_READY: -- disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY; -- save = true; -- break; -- -- case VIR_DOMAIN_BLOCK_JOB_FAILED: -- case VIR_DOMAIN_BLOCK_JOB_CANCELED: -- virStorageSourceFree(disk->mirror); -- disk->mirror = NULL; -- disk->mirrorState = status == VIR_DOMAIN_BLOCK_JOB_FAILED ? -- VIR_DOMAIN_DISK_MIRROR_STATE_ABORT : VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -- disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -- save = true; -- break; -- -- case VIR_DOMAIN_BLOCK_JOB_LAST: -- break; -- } -+ virObjectRef(vm); -+ if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) { -+ ignore_value(virObjectUnref(vm)); -+ goto error; - } - -- if (save) { -- if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) -- VIR_WARN("Unable to save status on vm %s after block job", -- vm->def->name); -- if (persistDisk && virDomainSaveConfig(cfg->configDir, -- vm->newDef) < 0) -- VIR_WARN("Unable to update persistent definition on vm %s " -- "after block job", vm->def->name); -- } -+ cleanup: - virObjectUnlock(vm); -- virObjectUnref(cfg); -- -- if (event) -- qemuDomainEventQueue(driver, event); -- if (event2) -- qemuDomainEventQueue(driver, event2); -- - return 0; -+ error: -+ if (processEvent) -+ VIR_FREE(processEvent->data); -+ VIR_FREE(processEvent); -+ goto cleanup; - } - -+ - static int - qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - virDomainObjPtr vm, --- -2.3.3 - diff --git a/SOURCES/libvirt-qemu-fail-on-attempts-to-use-filterref-for-non-tap-network-connections.patch b/SOURCES/libvirt-qemu-fail-on-attempts-to-use-filterref-for-non-tap-network-connections.patch new file mode 100644 index 0000000..0f32bf0 --- /dev/null +++ b/SOURCES/libvirt-qemu-fail-on-attempts-to-use-filterref-for-non-tap-network-connections.patch @@ -0,0 +1,75 @@ +From 78ec2a308afb0becf048571091cc76e6ee5059a5 Mon Sep 17 00:00:00 2001 +Message-Id: <78ec2a308afb0becf048571091cc76e6ee5059a5@dist-git> +From: Laine Stump +Date: Mon, 10 Aug 2015 13:42:53 -0400 +Subject: [PATCH] qemu: fail on attempts to use for non-tap network + connections + +nwfilter uses iptables and ebtables, which only work properly on +tap-based network connections (*not* on macvtap, for example), but we +just ignore any elements for other types of networks, +potentially giving users a false sense of security. + +This patch checks the network type and fails/logs an error if any +domain has a when the connection isn't using a +tap device. + +This resolves: + + https://bugzilla.redhat.com/show_bug.cgi?id=1180011 + +(cherry picked from commit f4f1d18dc464a4fd436ce9cdd18d6f06fa7494e5) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 11 +++++++++++ + src/qemu/qemu_hotplug.c | 11 +++++++++++ + 2 files changed, 22 insertions(+) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 1e5e244..d28063c 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -8347,6 +8347,17 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd, + return -1; + } + ++ /* and only TAP devices support nwfilter rules */ ++ if (net->filter && ++ !(actualType == VIR_DOMAIN_NET_TYPE_NETWORK || ++ actualType == VIR_DOMAIN_NET_TYPE_BRIDGE)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("filterref is not supported for " ++ "network interfaces of type %s"), ++ virDomainNetTypeToString(actualType)); ++ return -1; ++ } ++ + if (net->backend.tap && + !(actualType == VIR_DOMAIN_NET_TYPE_NETWORK || + actualType == VIR_DOMAIN_NET_TYPE_BRIDGE)) { +diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c +index 1ea397f..aabdb78 100644 +--- a/src/qemu/qemu_hotplug.c ++++ b/src/qemu/qemu_hotplug.c +@@ -910,6 +910,17 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, + return -1; + } + ++ /* and only TAP devices support nwfilter rules */ ++ if (net->filter && ++ !(actualType == VIR_DOMAIN_NET_TYPE_NETWORK || ++ actualType == VIR_DOMAIN_NET_TYPE_BRIDGE)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("filterref is not supported for " ++ "network interfaces of type %s"), ++ virDomainNetTypeToString(actualType)); ++ return -1; ++ } ++ + if (actualType == VIR_DOMAIN_NET_TYPE_BRIDGE || + actualType == VIR_DOMAIN_NET_TYPE_NETWORK) { + tapfdSize = vhostfdSize = net->driver.virtio.queues; +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-fix-block-commit-copy-abort-handling.patch b/SOURCES/libvirt-qemu-fix-block-commit-copy-abort-handling.patch deleted file mode 100644 index b2c3b67..0000000 --- a/SOURCES/libvirt-qemu-fix-block-commit-copy-abort-handling.patch +++ /dev/null @@ -1,39 +0,0 @@ -From fc6343d89ff8c0a14d07ccfa538e11c82ae266bd Mon Sep 17 00:00:00 2001 -Message-Id: -From: Erik Skultety -Date: Thu, 27 Nov 2014 13:29:42 +0100 -Subject: [PATCH] qemu: fix block{commit,copy} abort handling - -When a block{commit,copy} job was aborted on a domain, block job handler -did not process it correctly, leaving a phantom job in the background. -Any further calls to any blockjob causes "block still active" -error. This patch fixes the blockjob handler so that it checks not only -for VIR_DOMAIN_BLOCK_JOB_FAILED status, but VIR_DOMAIN_BLOCK_JOB_CANCELED -status as well, followed by our existing cleanup routine. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1135169 - -Signed-off-by: Jiri Denemark -(cherry picked from commit 8e23e0e977fbcc4a7880e187a63c509d6e6879c6) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 1125f4c..904af95 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -1103,7 +1103,8 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - if (status == VIR_DOMAIN_BLOCK_JOB_READY) { - disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY; - save = true; -- } else if (status == VIR_DOMAIN_BLOCK_JOB_FAILED) { -+ } else if (status == VIR_DOMAIN_BLOCK_JOB_FAILED || -+ status == VIR_DOMAIN_BLOCK_JOB_CANCELED) { - virStorageSourceFree(disk->mirror); - disk->mirror = NULL; - disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-fix-cannot-set-graphic-passwd-via-qemuDomainSaveImageDefineXML.patch b/SOURCES/libvirt-qemu-fix-cannot-set-graphic-passwd-via-qemuDomainSaveImageDefineXML.patch deleted file mode 100644 index 2ec35c2..0000000 --- a/SOURCES/libvirt-qemu-fix-cannot-set-graphic-passwd-via-qemuDomainSaveImageDefineXML.patch +++ /dev/null @@ -1,42 +0,0 @@ -From ee6247cad53bf0af3a681de82931a5da67868881 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Luyao Huang -Date: Fri, 21 Aug 2015 10:50:55 -0700 -Subject: [PATCH] qemu: fix cannot set graphic passwd via - qemuDomainSaveImageDefineXML - -https://bugzilla.redhat.com/show_bug.cgi?id=1183890 [7.2.0] -https://bugzilla.redhat.com/show_bug.cgi?id=1254164 [7.2.0] -https://bugzilla.redhat.com/show_bug.cgi?id=1255859 [7.1.z] - -When we try to update a xml to a image file, we will clear the -graphics passwd settings, because we do not pass VIR_DOMAIN_XML_SECURE -to qemuDomainDefCopy, qemuDomainDefFormatBuf won't format the passwd. - -Add VIR_DOMAIN_XML_SECURE flag when we call qemuDomainDefCopy -in qemuDomainSaveImageUpdateDef. - -Signed-off-by: Luyao Huang -(cherry picked from commit f76df311e8896957b92d0e0c5251ee3e6754d9ac) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 5f7fedc..425cf90 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -5856,7 +5856,8 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, - - if (!(newdef_migr = qemuDomainDefCopy(driver, - newdef, -- VIR_DOMAIN_XML_MIGRATABLE))) -+ VIR_DOMAIN_XML_MIGRATABLE | -+ VIR_DOMAIN_XML_SECURE))) - goto cleanup; - - if (!virDomainDefCheckABIStability(def, newdef_migr)) { --- -2.5.0 - diff --git a/SOURCES/libvirt-qemu-fix-crash-with-shared-disks.patch b/SOURCES/libvirt-qemu-fix-crash-with-shared-disks.patch deleted file mode 100644 index a4a81c8..0000000 --- a/SOURCES/libvirt-qemu-fix-crash-with-shared-disks.patch +++ /dev/null @@ -1,94 +0,0 @@ -From dc201f5982fafc2727a2206536c4afe1b1a9017d Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 18 Sep 2014 09:18:43 +0200 -Subject: [PATCH] qemu: fix crash with shared disks - -Commit f36a94f introduced a double free on all success paths -in qemuSharedDeviceEntryInsert. - -Only call qemuSharedDeviceEntryFree on the error path and -set entry to NULL before jumping there if the entry already -is in the hash table. - -https://bugzilla.redhat.com/show_bug.cgi?id=1142722 -(cherry picked from commit 540ee872494316ef5bfc17ef3dd4338080c3e513) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_conf.c | 26 ++++++++++++-------------- - src/qemu/qemu_conf.h | 3 +-- - 2 files changed, 13 insertions(+), 16 deletions(-) - -diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c -index ac10b64..adc6caf 100644 ---- a/src/qemu/qemu_conf.c -+++ b/src/qemu/qemu_conf.c -@@ -1011,38 +1011,36 @@ qemuSharedDeviceEntryInsert(virQEMUDriverPtr driver, - const char *name) - { - qemuSharedDeviceEntry *entry = NULL; -- int ret = -1; - - if ((entry = virHashLookup(driver->sharedDevices, key))) { - /* Nothing to do if the shared scsi host device is already - * recorded in the table. - */ -- if (qemuSharedDeviceEntryDomainExists(entry, name, NULL)) { -- ret = 0; -- goto cleanup; -+ if (!qemuSharedDeviceEntryDomainExists(entry, name, NULL)) { -+ if (VIR_EXPAND_N(entry->domains, entry->ref, 1) < 0 || -+ VIR_STRDUP(entry->domains[entry->ref - 1], name) < 0) { -+ /* entry is owned by the hash table here */ -+ entry = NULL; -+ goto error; -+ } - } -- -- if (VIR_EXPAND_N(entry->domains, entry->ref, 1) < 0 || -- VIR_STRDUP(entry->domains[entry->ref - 1], name) < 0) -- goto cleanup; - } else { - if (VIR_ALLOC(entry) < 0 || - VIR_ALLOC_N(entry->domains, 1) < 0 || - VIR_STRDUP(entry->domains[0], name) < 0) -- goto cleanup; -+ goto error; - - entry->ref = 1; - - if (virHashAddEntry(driver->sharedDevices, key, entry)) -- goto cleanup; -+ goto error; - } - -- ret = 0; -+ return 0; - -- cleanup: -+ error: - qemuSharedDeviceEntryFree(entry, NULL); -- -- return ret; -+ return -1; - } - - -diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h -index 1f521e5..cb01fb6 100644 ---- a/src/qemu/qemu_conf.h -+++ b/src/qemu/qemu_conf.h -@@ -294,8 +294,7 @@ bool qemuSharedDeviceEntryDomainExists(qemuSharedDeviceEntryPtr entry, - char *qemuGetSharedDeviceKey(const char *disk_path) - ATTRIBUTE_NONNULL(1); - --void qemuSharedDeviceEntryFree(void *payload, const void *name) -- ATTRIBUTE_NONNULL(1); -+void qemuSharedDeviceEntryFree(void *payload, const void *name); - - int qemuAddSharedDevice(virQEMUDriverPtr driver, - virDomainDeviceDefPtr dev, --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-fix-domain-startup-failing-with-strict-mode-in-numatune.patch b/SOURCES/libvirt-qemu-fix-domain-startup-failing-with-strict-mode-in-numatune.patch deleted file mode 100644 index f7dacea..0000000 --- a/SOURCES/libvirt-qemu-fix-domain-startup-failing-with-strict-mode-in-numatune.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 3dfa22b502f065f5171475b6459a4cc18d74c125 Mon Sep 17 00:00:00 2001 -Message-Id: <3dfa22b502f065f5171475b6459a4cc18d74c125@dist-git> -From: Wang Rui -Date: Fri, 28 Nov 2014 14:36:26 +0100 -Subject: [PATCH] qemu: fix domain startup failing with 'strict' mode in - numatune - -https://bugzilla.redhat.com/show_bug.cgi?id=1168866 - -If the memory mode is specified as 'strict' and with one node, we -get the following error when starting domain. - -error: Unable to write to '$cgroup_path/cpuset.mems': Device or resource busy - -XML is configured with numatune as follows: - - - - -It's broken by Commit 411cea638f6ec8503b7142a31e58b1cd85dbeaba -which moved qemuSetupCgroupForEmulator() before setting cpuset.mems -in qemuSetupCgroupPostInit. - -Directory '$cgroup_path/emulator/' is created in qemuSetupCgroupForEmulator. -But '$cgroup_path/emulator/cpuset.mems' it not set and has a default value -(all nodes, such as 0-1). Then we setup '$cgroup_path/cpuset.mems' to the -nodemask (in this case it's '0') in qemuSetupCgroupPostInit. It must fail. - -This patch makes '$cgroup_path/emulator/cpuset.mems' is set before -'$cgroup_path/cpuset.mems'. The action is similar with that in -qemuDomainSetNumaParamsLive. - -Signed-off-by: Wang Rui -(cherry picked from commit c6e90248676126c209b3b6017ad27cf6c6a0ab8f) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_cgroup.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index bd22b7f..7609c0f 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -611,6 +611,7 @@ static int - qemuSetupCpusetMems(virDomainObjPtr vm, - virBitmapPtr nodemask) - { -+ virCgroupPtr cgroup_temp = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; - char *mem_mask = NULL; - int ret = -1; -@@ -623,13 +624,16 @@ qemuSetupCpusetMems(virDomainObjPtr vm, - &mem_mask, -1) < 0) - goto cleanup; - -- if (mem_mask && -- virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0) -- goto cleanup; -+ if (mem_mask) -+ if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0 || -+ virCgroupSetCpusetMems(cgroup_temp, mem_mask) < 0 || -+ virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0) -+ goto cleanup; - - ret = 0; - cleanup: - VIR_FREE(mem_mask); -+ virCgroupFree(&cgroup_temp); - return ret; - } - --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-fix-some-api-cannot-work-when-disable-cpuset-in-conf.patch b/SOURCES/libvirt-qemu-fix-some-api-cannot-work-when-disable-cpuset-in-conf.patch new file mode 100644 index 0000000..329c1d4 --- /dev/null +++ b/SOURCES/libvirt-qemu-fix-some-api-cannot-work-when-disable-cpuset-in-conf.patch @@ -0,0 +1,105 @@ +From 3f53107a34adf39f8e380a1036eda619b3460a2c Mon Sep 17 00:00:00 2001 +Message-Id: <3f53107a34adf39f8e380a1036eda619b3460a2c@dist-git> +From: Luyao Huang +Date: Thu, 6 Aug 2015 13:08:35 +0200 +Subject: [PATCH] qemu: fix some api cannot work when disable cpuset in conf + +If cpuset is disabled or not available, it libvirt must not use it. +Mainly for actions that do not need it and can use sched_setaffinity() +or numa_membind() instead, because they will fail without good reason. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1244664 + +Signed-off-by: Luyao Huang +(cherry picked from commit 1439eb32afc9f97378d1d121c0b5c80d2f84896c) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_cgroup.c | 16 ++++++++-------- + src/qemu/qemu_driver.c | 10 +++++++--- + 2 files changed, 15 insertions(+), 11 deletions(-) + +diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c +index ab21e12..e1a2827 100644 +--- a/src/qemu/qemu_cgroup.c ++++ b/src/qemu/qemu_cgroup.c +@@ -1025,10 +1025,6 @@ qemuSetupCgroupForVcpu(virDomainObjPtr vm) + if (virCgroupAddTask(cgroup_vcpu, priv->vcpupids[i]) < 0) + goto cleanup; + +- if (mem_mask && +- virCgroupSetCpusetMems(cgroup_vcpu, mem_mask) < 0) +- goto cleanup; +- + if (period || quota) { + if (qemuSetupCgroupVcpuBW(cgroup_vcpu, period, quota) < 0) + goto cleanup; +@@ -1038,6 +1034,10 @@ qemuSetupCgroupForVcpu(virDomainObjPtr vm) + if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) { + virBitmapPtr cpumap = NULL; + ++ if (mem_mask && ++ virCgroupSetCpusetMems(cgroup_vcpu, mem_mask) < 0) ++ goto cleanup; ++ + /* try to use the default cpu maps */ + if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) + cpumap = priv->autoCpuset; +@@ -1202,15 +1202,15 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm) + goto cleanup; + } + +- if (mem_mask && +- virCgroupSetCpusetMems(cgroup_iothread, mem_mask) < 0) +- goto cleanup; +- + /* Set iothreadpin in cgroup if iothreadpin xml is provided */ + if (virCgroupHasController(priv->cgroup, + VIR_CGROUP_CONTROLLER_CPUSET)) { + virBitmapPtr cpumask = NULL; + ++ if (mem_mask && ++ virCgroupSetCpusetMems(cgroup_iothread, mem_mask) < 0) ++ goto cleanup; ++ + if (def->iothreadids[i]->cpumask) + cpumask = def->iothreadids[i]->cpumask; + else if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 6b715bf..bb0dc7e 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -4613,7 +4613,9 @@ qemuDomainAddCgroupForThread(virCgroupPtr cgroup, + if (virCgroupNewThread(cgroup, nameval, idx, true, &new_cgroup) < 0) + return NULL; + +- if (mem_mask && virCgroupSetCpusetMems(new_cgroup, mem_mask) < 0) ++ if (mem_mask && ++ virCgroupHasController(cgroup, VIR_CGROUP_CONTROLLER_CPUSET) && ++ virCgroupSetCpusetMems(new_cgroup, mem_mask) < 0) + goto error; + + /* Add pid/thread to the cgroup */ +@@ -4669,7 +4671,8 @@ qemuDomainHotplugPinThread(virBitmapPtr cpumask, + { + int ret = -1; + +- if (cgroup) { ++ if (cgroup && ++ virCgroupHasController(cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) { + if (qemuSetupCgroupCpusetCpus(cgroup, cpumask) < 0) { + virReportError(VIR_ERR_OPERATION_INVALID, + _("failed to set cpuset.cpus in cgroup for id %d"), +@@ -4912,7 +4915,8 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, + if (virDomainObjGetDefs(vm, flags, &def, &persistentDef) < 0) + goto endjob; + +- if (def && !(flags & VIR_DOMAIN_VCPU_GUEST) && virNumaIsAvailable()) { ++ if (def && !(flags & VIR_DOMAIN_VCPU_GUEST) && virNumaIsAvailable() && ++ virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) { + if (virCgroupNewThread(priv->cgroup, VIR_CGROUP_THREAD_EMULATOR, 0, + false, &cgroup_temp) < 0) + goto endjob; +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-forbid-second-blockcommit-during-active-commit.patch b/SOURCES/libvirt-qemu-forbid-second-blockcommit-during-active-commit.patch deleted file mode 100644 index 36d97d2..0000000 --- a/SOURCES/libvirt-qemu-forbid-second-blockcommit-during-active-commit.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 6e4847fa4fd206e8954d07eebda809568d2fa2a4 Mon Sep 17 00:00:00 2001 -Message-Id: <6e4847fa4fd206e8954d07eebda809568d2fa2a4@dist-git> -From: Eric Blake -Date: Tue, 13 Jan 2015 08:31:58 -0700 -Subject: [PATCH] qemu: forbid second blockcommit during active commit - -https://bugzilla.redhat.com/show_bug.cgi?id=1135339 documents some -confusing behavior when a user tries to start an inactive block -commit in a second connection while there is already an on-going -active commit from a first connection. Eventually, qemu will -support multiple simultaneous block jobs, but as of now, it does -not; furthermore, libvirt also needs an overhaul before we can -support simultaneous jobs. So, the best way to avoid confusing -ourselves is to quit relying on qemu to tell us about the situation -(where we risk getting in weird states) and instead forbid a -duplicate block commit ourselves. - -Note that we are still relying on qemu to diagnose attempts to -interrupt an inactive commit (since we only track XML of an active -commit), but as inactive commit is less confusing for libvirt to -manage, there is less that can go wrong by leaving that detection -up to qemu. - -* src/qemu/qemu_driver.c (qemuDomainBlockCommit): Hoist check for -active commit to occur earlier outside of conditions. - -Signed-off-by: Eric Blake -(cherry picked from commit e1125cebfc057059f444894c6cedf1f29379bca3) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 77f8cac..8830e04 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -1,7 +1,7 @@ - /* - * qemu_driver.c: core driver methods for managing qemu guests - * -- * Copyright (C) 2006-2014 Red Hat, Inc. -+ * Copyright (C) 2006-2015 Red Hat, Inc. - * Copyright (C) 2006 Daniel P. Berrange - * - * This library is free software; you can redistribute it and/or -@@ -16027,6 +16027,12 @@ qemuDomainBlockCommit(virDomainPtr dom, - disk->dst); - goto endjob; - } -+ if (disk->mirror) { -+ virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, -+ _("disk '%s' already in active block job"), -+ disk->dst); -+ goto endjob; -+ } - if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0) - goto endjob; - -@@ -16051,12 +16057,6 @@ qemuDomainBlockCommit(virDomainPtr dom, - disk->dst); - goto endjob; - } -- if (disk->mirror) { -- virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, -- _("disk '%s' already in active block job"), -- disk->dst); -- goto endjob; -- } - } else if (flags & VIR_DOMAIN_BLOCK_COMMIT_ACTIVE) { - virReportError(VIR_ERR_INVALID_ARG, - _("active commit requested but '%s' is not active"), --- -2.2.1 - diff --git a/SOURCES/libvirt-qemu-forbid-snapshot-delete-children-only-on-external-snapshot.patch b/SOURCES/libvirt-qemu-forbid-snapshot-delete-children-only-on-external-snapshot.patch deleted file mode 100644 index ec38d5f..0000000 --- a/SOURCES/libvirt-qemu-forbid-snapshot-delete-children-only-on-external-snapshot.patch +++ /dev/null @@ -1,58 +0,0 @@ -From b028739e4fce3d1b8e1ac5009f2e2def2f53f2e2 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Eric Blake -Date: Tue, 28 Oct 2014 08:21:17 -0600 -Subject: [PATCH] qemu: forbid snapshot-delete --children-only on external - snapshot - -https://bugzilla.redhat.com/show_bug.cgi?id=956506 documents that -given a domain where an internal snapshot parent has an external -snapshot child, we lacked a safety check when trying to use the ---children-only option to snapshot-delete: - -$ virsh start dom -$ virsh snapshot-create-as dom internal -$ virsh snapshot-create-as dom external --disk-only -$ virsh snapshot-delete dom external -error: Failed to delete snapshot external -error: unsupported configuration: deletion of 1 external disk snapshots not supported yet -$ virsh snapshot-delete dom internal --children -error: Failed to delete snapshot internal -error: unsupported configuration: deletion of 1 external disk snapshots not supported yet -$ virsh snapshot-delete dom internal --children-only -Domain snapshot internal children deleted - -While I'd still like to see patches that actually do proper external -snapshot deletion, we should at least fix the inconsistency in the -meantime. With this patch: - -$ virsh snapshot-delete dom internal --children-only -error: Failed to delete snapshot internal -error: unsupported configuration: deletion of 1 external disk snapshots not supported yet - -* src/qemu/qemu_driver.c (qemuDomainSnapshotDelete): Fix condition. - -Signed-off-by: Eric Blake -(cherry picked from commit 2086a9905aac877d1618f96c7eea8e3d6a01fd9a) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 3c1d2f5..88a1895 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -14612,7 +14612,8 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, - if (!(flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) && - virDomainSnapshotIsExternal(snap)) - external++; -- if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN) -+ if (flags & (VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN | -+ VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY)) - virDomainSnapshotForEachDescendant(snap, - qemuDomainSnapshotCountExternal, - &external); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-hook-Provide-hook-when-restoring-a-domain-save-image.patch b/SOURCES/libvirt-qemu-hook-Provide-hook-when-restoring-a-domain-save-image.patch deleted file mode 100644 index 47b7ad5..0000000 --- a/SOURCES/libvirt-qemu-hook-Provide-hook-when-restoring-a-domain-save-image.patch +++ /dev/null @@ -1,212 +0,0 @@ -From daa6ee36e4fc3e17119231f110b4de770ffd2b6c Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Mon, 22 Sep 2014 17:52:40 +0200 -Subject: [PATCH] qemu: hook: Provide hook when restoring a domain save image - -https://bugzilla.redhat.com/show_bug.cgi?id=1142693 - -(cherry picked from commit 4f3c2e39e5c898c533ddf58b62b452a674df794d) - -Signed-off-by: Jiri Denemark ---- - docs/hooks.html.in | 11 ++++++++ - src/qemu/qemu_driver.c | 70 +++++++++++++++++++++++++++++++++++++++++++++----- - src/util/virhook.c | 3 ++- - src/util/virhook.h | 1 + - 4 files changed, 78 insertions(+), 7 deletions(-) - -diff --git a/docs/hooks.html.in b/docs/hooks.html.in -index 07b9d49..1aae00c 100644 ---- a/docs/hooks.html.in -+++ b/docs/hooks.html.in -@@ -177,6 +177,17 @@ - script returns failure or the output XML is not valid, incoming - migration will be canceled. This hook may be used, e.g., to change - location of disk images for incoming domains. -+
  • Since 1.2.9, the qemu hook script is -+ also called when restoring a saved image either via the API or -+ automatically when restoring a managed save machine. It is called -+ as:
    /etc/libvirt/hooks/qemu guest_name restore begin -
    -+ with domain XML sent to standard input of the script. In this case, -+ the script acts as a filter and is supposed to modify the domain -+ XML and print it out on its standard output. Empty output is -+ identical to copying the input XML without changing it. In case the -+ script returns failure or the output XML is not valid, restore of the -+ image will be aborted. This hook may be used, e.g., to change -+ location of disk images for restored domains.
  • -
  • Since 0.9.13, the qemu hook script - is also called when the libvirtd daemon restarts and reconnects - to previously running QEMU processes. If the script fails, the -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 580ac17..8f655e5 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -5643,20 +5643,24 @@ qemuDomainRestoreFlags(virConnectPtr conn, - unsigned int flags) - { - virQEMUDriverPtr driver = conn->privateData; -+ qemuDomainObjPrivatePtr priv = NULL; - virDomainDefPtr def = NULL; -- virDomainDefPtr newdef = NULL; - virDomainObjPtr vm = NULL; -+ char *xml = NULL; -+ char *xmlout = NULL; -+ const char *newxml = dxml; - int fd = -1; - int ret = -1; - virQEMUSaveHeader header; - virFileWrapperFdPtr wrapperFd = NULL; -+ bool hook_taint = false; - - virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE | - VIR_DOMAIN_SAVE_RUNNING | - VIR_DOMAIN_SAVE_PAUSED, -1); - - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &header, &xml, - (flags & VIR_DOMAIN_SAVE_BYPASS_CACHE) != 0, - &wrapperFd, false, false); - if (fd < 0) -@@ -5665,12 +5669,31 @@ qemuDomainRestoreFlags(virConnectPtr conn, - if (virDomainRestoreFlagsEnsureACL(conn, def) < 0) - goto cleanup; - -- if (dxml) { -- if (!(newdef = qemuDomainSaveImageUpdateDef(driver, def, dxml))) -+ if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { -+ int hookret; -+ -+ if ((hookret = virHookCall(VIR_HOOK_DRIVER_QEMU, def->name, -+ VIR_HOOK_QEMU_OP_RESTORE, -+ VIR_HOOK_SUBOP_BEGIN, -+ NULL, -+ dxml ? dxml : xml, -+ &xmlout)) < 0) -+ goto cleanup; -+ -+ if (hookret == 0 && xmlout) { -+ VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout); -+ hook_taint = true; -+ newxml = xmlout; -+ } -+ } -+ -+ if (newxml) { -+ virDomainDefPtr tmp; -+ if (!(tmp = qemuDomainSaveImageUpdateDef(driver, def, newxml))) - goto cleanup; - - virDomainDefFree(def); -- def = newdef; -+ def = tmp; - } - - if (!(vm = virDomainObjListAdd(driver->domains, def, -@@ -5686,6 +5709,11 @@ qemuDomainRestoreFlags(virConnectPtr conn, - else if (flags & VIR_DOMAIN_SAVE_PAUSED) - header.was_running = 0; - -+ if (hook_taint) { -+ priv = vm->privateData; -+ priv->hookRun = true; -+ } -+ - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) - goto cleanup; - -@@ -5704,6 +5732,8 @@ qemuDomainRestoreFlags(virConnectPtr conn, - cleanup: - virDomainDefFree(def); - VIR_FORCE_CLOSE(fd); -+ VIR_FREE(xml); -+ VIR_FREE(xmlout); - virFileWrapperFdFree(wrapperFd); - if (vm) - virObjectUnlock(vm); -@@ -5841,12 +5871,15 @@ qemuDomainObjRestore(virConnectPtr conn, - bool bypass_cache) - { - virDomainDefPtr def = NULL; -+ qemuDomainObjPrivatePtr priv = vm->privateData; - int fd = -1; - int ret = -1; -+ char *xml = NULL; -+ char *xmlout = NULL; - virQEMUSaveHeader header; - virFileWrapperFdPtr wrapperFd = NULL; - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &header, &xml, - bypass_cache, &wrapperFd, false, true); - if (fd < 0) { - if (fd == -3) -@@ -5854,6 +5887,29 @@ qemuDomainObjRestore(virConnectPtr conn, - goto cleanup; - } - -+ if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { -+ int hookret; -+ -+ if ((hookret = virHookCall(VIR_HOOK_DRIVER_QEMU, def->name, -+ VIR_HOOK_QEMU_OP_RESTORE, -+ VIR_HOOK_SUBOP_BEGIN, -+ NULL, xml, &xmlout)) < 0) -+ goto cleanup; -+ -+ if (hookret == 0 && xmlout) { -+ virDomainDefPtr tmp; -+ -+ VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout); -+ -+ if (!(tmp = qemuDomainSaveImageUpdateDef(driver, def, xmlout))) -+ goto cleanup; -+ -+ virDomainDefFree(def); -+ def = tmp; -+ priv->hookRun = true; -+ } -+ } -+ - if (STRNEQ(vm->def->name, def->name) || - memcmp(vm->def->uuid, def->uuid, VIR_UUID_BUFLEN)) { - char vm_uuidstr[VIR_UUID_STRING_BUFLEN]; -@@ -5877,6 +5933,8 @@ qemuDomainObjRestore(virConnectPtr conn, - VIR_WARN("Failed to close %s", path); - - cleanup: -+ VIR_FREE(xml); -+ VIR_FREE(xmlout); - virDomainDefFree(def); - VIR_FORCE_CLOSE(fd); - virFileWrapperFdFree(wrapperFd); -diff --git a/src/util/virhook.c b/src/util/virhook.c -index ac7b40f..25d0783 100644 ---- a/src/util/virhook.c -+++ b/src/util/virhook.c -@@ -77,7 +77,8 @@ VIR_ENUM_IMPL(virHookQemuOp, VIR_HOOK_QEMU_OP_LAST, - "migrate", - "started", - "reconnect", -- "attach") -+ "attach", -+ "restore") - - VIR_ENUM_IMPL(virHookLxcOp, VIR_HOOK_LXC_OP_LAST, - "start", -diff --git a/src/util/virhook.h b/src/util/virhook.h -index 5bc0a5f..550ef84 100644 ---- a/src/util/virhook.h -+++ b/src/util/virhook.h -@@ -60,6 +60,7 @@ typedef enum { - VIR_HOOK_QEMU_OP_STARTED, /* domain has started */ - VIR_HOOK_QEMU_OP_RECONNECT, /* domain is being reconnected by libvirt */ - VIR_HOOK_QEMU_OP_ATTACH, /* domain is being attached to be libvirt */ -+ VIR_HOOK_QEMU_OP_RESTORE, /* domain is being restored */ - - VIR_HOOK_QEMU_OP_LAST, - } virHookQemuOpType; --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-hotplug-Properly-clean-up-drive-backend-if-frontend-hotplug-fails.patch b/SOURCES/libvirt-qemu-hotplug-Properly-clean-up-drive-backend-if-frontend-hotplug-fails.patch new file mode 100644 index 0000000..d278810 --- /dev/null +++ b/SOURCES/libvirt-qemu-hotplug-Properly-clean-up-drive-backend-if-frontend-hotplug-fails.patch @@ -0,0 +1,70 @@ +From 8819ee8472dce467407ad40b4a60eb16d16aef66 Mon Sep 17 00:00:00 2001 +Message-Id: <8819ee8472dce467407ad40b4a60eb16d16aef66@dist-git> +From: Peter Krempa +Date: Mon, 14 Sep 2015 09:50:40 +0200 +Subject: [PATCH] qemu: hotplug: Properly clean up drive backend if frontend + hotplug fails + +Commit 8125113c added code that should remove the disk backend if the +fronted hotplug failed for any reason. The code had a bug though as it +used the disk string for unplug rather than the backend alias. Fix the +code by pre-creating an alias string and using it instead of the disk +string. In cases where qemu does not support QEMU_CAPS_DEVICE, we ignore +the unplug of the backend since we can't really create an alias in that +case. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1262399 +(cherry picked from commit 64c6695f1ad72f0a99faace5deb1caf7effa2275) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_hotplug.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c +index cfb071b..31c56ae 100644 +--- a/src/qemu/qemu_hotplug.c ++++ b/src/qemu/qemu_hotplug.c +@@ -321,6 +321,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, + qemuDomainObjPrivatePtr priv = vm->privateData; + char *devstr = NULL; + char *drivestr = NULL; ++ char *drivealias = NULL; + bool releaseaddr = false; + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + const char *src = virDomainDiskGetSource(disk); +@@ -365,6 +366,9 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, + if (!(drivestr = qemuBuildDriveStr(conn, disk, false, priv->qemuCaps))) + goto error; + ++ if (!(drivealias = qemuDeviceDriveHostAlias(disk, priv->qemuCaps))) ++ goto error; ++ + if (!(devstr = qemuBuildDriveDevStr(vm->def, disk, 0, priv->qemuCaps))) + goto error; + } +@@ -379,10 +383,11 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, + ret = qemuMonitorAddDevice(priv->mon, devstr); + if (ret < 0) { + virErrorPtr orig_err = virSaveLastError(); +- if (qemuMonitorDriveDel(priv->mon, drivestr) < 0) { ++ if (!drivealias || ++ qemuMonitorDriveDel(priv->mon, drivealias) < 0) { + VIR_WARN("Unable to remove drive %s (%s) after failed " + "qemuMonitorAddDevice", +- drivestr, devstr); ++ NULLSTR(drivealias), drivestr); + } + if (orig_err) { + virSetError(orig_err); +@@ -415,6 +420,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, + cleanup: + VIR_FREE(devstr); + VIR_FREE(drivestr); ++ VIR_FREE(drivealias); + virObjectUnref(cfg); + return ret; + +-- +2.5.2 + diff --git a/SOURCES/libvirt-qemu-improve-error-message-for-invalid-blkiotune-settings.patch b/SOURCES/libvirt-qemu-improve-error-message-for-invalid-blkiotune-settings.patch deleted file mode 100644 index 5c8ca23..0000000 --- a/SOURCES/libvirt-qemu-improve-error-message-for-invalid-blkiotune-settings.patch +++ /dev/null @@ -1,111 +0,0 @@ -From d53999b3390985bb623c568206f50c85a63cdc25 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Martin Kletzander -Date: Tue, 4 Nov 2014 11:00:51 +0100 -Subject: [PATCH] qemu: improve error message for invalid blkiotune settings - -Before: - $ virsh blkiotune dummy --device-read-bytes-sec /dev/sda,-1 - error: Unable to change blkio parameters - error: invalid argument: unable to parse blkio device - 'device_read_bytes_sec' '/dev/sda,-1' - -After: - $ virsh blkiotune dummy --device-read-bytes-sec /dev/sda,-1 - error: Unable to change blkio parameters - error: invalid argument: invalid value '-1' for parameter - 'device_read_bytes_sec' of device '/dev/sda' - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1131306 - -Signed-off-by: Martin Kletzander -(cherry picked from commit 278bf0acbfe9d468dceafde580ecce97ba9cc4e5) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 29 +++++++++++++++++++---------- - 1 file changed, 19 insertions(+), 10 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 3812615..0f68abc 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -7997,7 +7997,7 @@ qemuDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - /* A valid string must have even number of fields, hence an odd - * number of commas. */ - if (!(nsep & 1)) -- goto error; -+ goto parse_error; - - ndevices = (nsep + 1) / 2; - -@@ -8012,7 +8012,7 @@ qemuDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - /* device path */ - p = strchr(p, ','); - if (!p) -- goto error; -+ goto parse_error; - - if (VIR_STRNDUP(result[i].path, temp, p - temp) < 0) - goto cleanup; -@@ -8022,21 +8022,23 @@ qemuDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - - if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT)) { - if (virStrToLong_uip(temp, &p, 10, &result[i].weight) < 0) -- goto error; -+ goto number_error; - } else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS)) { - if (virStrToLong_uip(temp, &p, 10, &result[i].riops) < 0) -- goto error; -+ goto number_error; - } else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS)) { - if (virStrToLong_uip(temp, &p, 10, &result[i].wiops) < 0) -- goto error; -+ goto number_error; - } else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_READ_BPS)) { - if (virStrToLong_ullp(temp, &p, 10, &result[i].rbps) < 0) -- goto error; -+ goto number_error; - } else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS)) { - if (virStrToLong_ullp(temp, &p, 10, &result[i].wbps) < 0) -- goto error; -+ goto number_error; - } else { -- goto error; -+ virReportError(VIR_ERR_INVALID_ARG, -+ _("unknown parameter '%s'"), type); -+ goto cleanup; - } - - i++; -@@ -8044,7 +8046,7 @@ qemuDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - if (*p == '\0') - break; - else if (*p != ',') -- goto error; -+ goto parse_error; - temp = p + 1; - } - -@@ -8056,10 +8058,17 @@ qemuDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - - return 0; - -- error: -+ parse_error: - virReportError(VIR_ERR_INVALID_ARG, - _("unable to parse blkio device '%s' '%s'"), - type, blkioDeviceStr); -+ goto cleanup; -+ -+ number_error: -+ virReportError(VIR_ERR_INVALID_ARG, -+ _("invalid value '%s' for parameter '%s' of device '%s'"), -+ temp, type, result[i].path); -+ - cleanup: - if (result) { - virBlkioDeviceArrayClear(result, ndevices); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-json-Fix-missing-break-in-error-reporting-function.patch b/SOURCES/libvirt-qemu-json-Fix-missing-break-in-error-reporting-function.patch deleted file mode 100644 index 1743dc6..0000000 --- a/SOURCES/libvirt-qemu-json-Fix-missing-break-in-error-reporting-function.patch +++ /dev/null @@ -1,34 +0,0 @@ -From ee92f1ba8fda2eaff8e94d315a33c9a9746b5650 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Wed, 1 Oct 2014 15:23:05 +0200 -Subject: [PATCH] qemu: json: Fix missing break in error reporting function - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -Otherwise we'd report a different error. - -Reported by John Ferlan's coverity run. - -(cherry picked from commit 58699b77eee9e45cbf8c9f08291fc298aae37eea) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor_json.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index afb713d..2227744 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -2102,6 +2102,7 @@ qemuMonitorJSONReportBlockExtentError(qemuMonitorBlockExtentError error) - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats stats entry was not in " - "expected format")); -+ break; - - case QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOOFFSET: - virReportError(VIR_ERR_INTERNAL_ERROR, --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-make-advice-from-numad-available-when-building-commandline.patch b/SOURCES/libvirt-qemu-make-advice-from-numad-available-when-building-commandline.patch deleted file mode 100644 index 1a880ab..0000000 --- a/SOURCES/libvirt-qemu-make-advice-from-numad-available-when-building-commandline.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 3640c2a3c884829af460409e428fc3a439b2fdf2 Mon Sep 17 00:00:00 2001 -Message-Id: <3640c2a3c884829af460409e428fc3a439b2fdf2@dist-git> -From: Martin Kletzander -Date: Tue, 4 Nov 2014 11:04:26 +0100 -Subject: [PATCH] qemu: make advice from numad available when building - commandline - -Particularly in qemuBuildNumaArgStr(), there was a need for the advice -due to memory backing, which needs to know the nodeset it will be pinned -to. With newer qemu this caused the following error when starting -domain: - - error: internal error: Advice from numad is needed in case of - automatic numa placement - -even when starting perfectly valid domain, e.g.: - - ... - 4 - - - - - - - - - - ... - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1138545 - -Signed-off-by: Martin Kletzander -(cherry picked from commit 11a48758a7d6c946062c130b6186ae3eadd58e39) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 10 ++++++---- - src/qemu/qemu_command.h | 3 ++- - src/qemu/qemu_driver.c | 3 ++- - src/qemu/qemu_process.c | 3 ++- - tests/qemuxml2argvtest.c | 3 ++- - tests/qemuxmlnstest.c | 2 +- - 6 files changed, 15 insertions(+), 9 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index e4962ee..6c4a8b5 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -6605,7 +6605,8 @@ static int - qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - const virDomainDef *def, - virCommandPtr cmd, -- virQEMUCapsPtr qemuCaps) -+ virQEMUCapsPtr qemuCaps, -+ virBitmapPtr nodeset) - { - size_t i, j; - virBuffer buf = VIR_BUFFER_INITIALIZER; -@@ -6765,7 +6766,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - - virBufferAsprintf(&buf, ",size=%dM,id=ram-node%zu", cellmem, i); - -- if (virDomainNumatuneMaybeFormatNodeset(def->numatune, NULL, -+ if (virDomainNumatuneMaybeFormatNodeset(def->numatune, nodeset, - &nodemask, i) < 0) - goto cleanup; - -@@ -7733,7 +7734,8 @@ qemuBuildCommandLine(virConnectPtr conn, - virNetDevVPortProfileOp vmop, - qemuBuildCommandLineCallbacksPtr callbacks, - bool standalone, -- bool enableFips) -+ bool enableFips, -+ virBitmapPtr nodeset) - { - virErrorPtr originalError = NULL; - size_t i, j; -@@ -7950,7 +7952,7 @@ qemuBuildCommandLine(virConnectPtr conn, - } - - if (def->cpu && def->cpu->ncells) -- if (qemuBuildNumaArgStr(cfg, def, cmd, qemuCaps) < 0) -+ if (qemuBuildNumaArgStr(cfg, def, cmd, qemuCaps, nodeset) < 0) - goto error; - - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_UUID)) -diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h -index aa40c9e..f7d3c2d 100644 ---- a/src/qemu/qemu_command.h -+++ b/src/qemu/qemu_command.h -@@ -79,7 +79,8 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn, - virNetDevVPortProfileOp vmop, - qemuBuildCommandLineCallbacksPtr callbacks, - bool forXMLToArgv, -- bool enableFips) -+ bool enableFips, -+ virBitmapPtr nodeset) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(11); - - /* Generate '-device' string for chardev device */ -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 0f68abc..d419689 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -6473,7 +6473,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, - VIR_NETDEV_VPORT_PROFILE_OP_NO_OP, - &buildCommandLineCallbacks, - true, -- qemuCheckFips()))) -+ qemuCheckFips(), -+ NULL))) - goto cleanup; - - ret = virCommandToString(cmd); -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 7101311..ed095a2 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -4360,7 +4360,8 @@ int qemuProcessStart(virConnectPtr conn, - priv->monJSON, priv->qemuCaps, - migrateFrom, stdin_fd, snapshot, vmop, - &buildCommandLineCallbacks, false, -- qemuCheckFips()))) -+ qemuCheckFips(), -+ nodemask))) - goto cleanup; - - /* now that we know it is about to start call the hook if present */ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index dafe683..3efe3c9 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -362,7 +362,8 @@ static int testCompareXMLToArgvFiles(const char *xml, - migrateFrom, migrateFd, NULL, - VIR_NETDEV_VPORT_PROFILE_OP_NO_OP, - &testCallbacks, false, -- (flags & FLAG_FIPS)))) { -+ (flags & FLAG_FIPS), -+ NULL))) { - if (!virtTestOOMActive() && - (flags & FLAG_EXPECT_FAILURE)) { - ret = 0; -diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c -index b3a608c..2f37a26 100644 ---- a/tests/qemuxmlnstest.c -+++ b/tests/qemuxmlnstest.c -@@ -119,7 +119,7 @@ static int testCompareXMLToArgvFiles(const char *xml, - vmdef, &monitor_chr, json, extraFlags, - migrateFrom, migrateFd, NULL, - VIR_NETDEV_VPORT_PROFILE_OP_NO_OP, -- &testCallbacks, false, false))) -+ &testCallbacks, false, false, NULL))) - goto fail; - - if (!virtTestOOMActive()) { --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-migration-Relax-enforcement-of-memory-hotplug-support.patch b/SOURCES/libvirt-qemu-migration-Relax-enforcement-of-memory-hotplug-support.patch new file mode 100644 index 0000000..e27f3bb --- /dev/null +++ b/SOURCES/libvirt-qemu-migration-Relax-enforcement-of-memory-hotplug-support.patch @@ -0,0 +1,40 @@ +From a5d2762f9a375c79703e446e9f8e428ffcd4a9d1 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:36 +0200 +Subject: [PATCH] qemu: migration: Relax enforcement of memory hotplug support + +https://bugzilla.redhat.com/show_bug.cgi?id=1252685 + +If the current live definition does not have memory hotplug enabled, but +the persistent one does libvirt would reject migration if the +destination does not support memory hotplug even if the user didn't want +to persist the VM at the destination and thus the XML containing the +memory hotplug definition would not be used. To fix this corner case the +code will check for memory hotplug in the newDef only if +VIR_MIGRATE_PERSIST_DEST was used. + +(cherry picked from commit a98e5a78153644e0f13b34c69d60b7a866c4401a) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_migration.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index cee82fa..58fcb94 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -2989,7 +2989,8 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver, + } + + if (vm->def->mem.max_memory || +- (vm->newDef && ++ ((flags & VIR_MIGRATE_PERSIST_DEST) && ++ vm->newDef && + vm->newDef->mem.max_memory)) + cookieFlags |= QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG; + +-- +2.5.3 + diff --git a/SOURCES/libvirt-qemu-migration-Unlock-vm-on-failed-ACL-check-in-protocol-v2-APIs.patch b/SOURCES/libvirt-qemu-migration-Unlock-vm-on-failed-ACL-check-in-protocol-v2-APIs.patch deleted file mode 100644 index e1ba2c2..0000000 --- a/SOURCES/libvirt-qemu-migration-Unlock-vm-on-failed-ACL-check-in-protocol-v2-APIs.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 64d3b1546dc6c96afd2d06403f0c93308e0b34b6 Mon Sep 17 00:00:00 2001 -Message-Id: <64d3b1546dc6c96afd2d06403f0c93308e0b34b6@dist-git> -From: Peter Krempa -Date: Tue, 23 Dec 2014 15:54:35 -0700 -Subject: [PATCH] qemu: migration: Unlock vm on failed ACL check in protocol v2 - APIs - -CVE-2014-8136 (RHEL 7.0.z, 7.1) - -Avoid leaving the domain locked on a failed ACL check in -qemuDomainMigratePerform() and qemuDomainMigrateFinish2(). - -Introduced in commit abf75aea247e (Add ACL checks into the QEMU driver). - -(cherry picked from commit 2bdcd29c713dfedd813c89f56ae98f6f3898313d) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 619f2d6..1b08cc4 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -11343,8 +11343,10 @@ qemuDomainMigratePerform(virDomainPtr dom, - if (!(vm = qemuDomObjFromDomain(dom))) - goto cleanup; - -- if (virDomainMigratePerformEnsureACL(dom->conn, vm->def) < 0) -+ if (virDomainMigratePerformEnsureACL(dom->conn, vm->def) < 0) { -+ virObjectUnlock(vm); - goto cleanup; -+ } - - if (flags & VIR_MIGRATE_PEER2PEER) { - dconnuri = uri; -@@ -11391,8 +11393,10 @@ qemuDomainMigrateFinish2(virConnectPtr dconn, - goto cleanup; - } - -- if (virDomainMigrateFinish2EnsureACL(dconn, vm->def) < 0) -+ if (virDomainMigrateFinish2EnsureACL(dconn, vm->def) < 0) { -+ virObjectUnlock(vm); - goto cleanup; -+ } - - /* Do not use cookies in v2 protocol, since the cookie - * length was not sufficiently large, causing failures --- -2.2.1 - diff --git a/SOURCES/libvirt-qemu-monitor-Add-helper-function-to-fill-physical-virtual-image-size.patch b/SOURCES/libvirt-qemu-monitor-Add-helper-function-to-fill-physical-virtual-image-size.patch deleted file mode 100644 index 31db9e6..0000000 --- a/SOURCES/libvirt-qemu-monitor-Add-helper-function-to-fill-physical-virtual-image-size.patch +++ /dev/null @@ -1,179 +0,0 @@ -From b2e3b9d00f8e0210132f412ef5cee8367930d440 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Wed, 1 Oct 2014 11:20:23 +0200 -Subject: [PATCH] qemu: monitor: Add helper function to fill physical/virtual - image size - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -While our code gathers block stats via "query-blockstats" some -information need to be gathered via "query-block". Add a helper function -that will update the blockstats structure if requested. - -(cherry picked from commit 8caded6b8ec567eadf5a339ba221d5de3b03a509) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor.c | 17 ++++++++++ - src/qemu/qemu_monitor.h | 6 ++++ - src/qemu/qemu_monitor_json.c | 78 ++++++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_monitor_json.h | 2 ++ - 4 files changed, 103 insertions(+) - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 93e8f22..8e14366 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -1780,6 +1780,23 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, - return qemuMonitorJSONGetAllBlockStatsInfo(mon, ret_stats); - } - -+ -+/* Updates "stats" to fill virtual and physical size of the image */ -+int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, -+ virHashTablePtr stats) -+{ -+ VIR_DEBUG("mon=%p, stats=%p", mon, stats); -+ -+ if (!mon->json) { -+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -+ _("block capacity/size info requires JSON monitor")); -+ return -1; -+ } -+ -+ return qemuMonitorJSONBlockStatsUpdateCapacity(mon, stats); -+} -+ -+ - /* Return 0 and update @nparams with the number of block stats - * QEMU supports if success. Return -1 if failure. - */ -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index 2551272..9c798cf 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -358,12 +358,18 @@ struct _qemuBlockStats { - long long wr_total_times; - long long flush_req; - long long flush_total_times; -+ unsigned long long capacity; -+ unsigned long long physical; - }; - - int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, - virHashTablePtr *ret_stats) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - -+int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, -+ virHashTablePtr stats) -+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -+ - int qemuMonitorGetBlockStatsParamsNumber(qemuMonitorPtr mon, - int *nparams); - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 2b23347..b0a9c99 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -1899,6 +1899,84 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - } - - -+int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, -+ virHashTablePtr stats) -+{ -+ int ret = -1; -+ int rc; -+ size_t i; -+ virJSONValuePtr cmd; -+ virJSONValuePtr reply = NULL; -+ virJSONValuePtr devices; -+ -+ if (!(cmd = qemuMonitorJSONMakeCommand("query-block", NULL))) -+ return -1; -+ -+ if ((rc = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0) -+ goto cleanup; -+ -+ if (qemuMonitorJSONCheckError(cmd, reply) < 0) -+ goto cleanup; -+ -+ devices = virJSONValueObjectGet(reply, "return"); -+ if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("query-block reply was missing device list")); -+ goto cleanup; -+ } -+ -+ for (i = 0; i < virJSONValueArraySize(devices); i++) { -+ virJSONValuePtr dev = virJSONValueArrayGet(devices, i); -+ virJSONValuePtr inserted; -+ virJSONValuePtr image; -+ qemuBlockStatsPtr bstats; -+ const char *devname; -+ -+ if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("query-block device entry was not " -+ "in expected format")); -+ goto cleanup; -+ } -+ -+ if (!(devname = virJSONValueObjectGetString(dev, "device"))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("query-block device entry was not " -+ "in expected format")); -+ goto cleanup; -+ } -+ -+ if (STRPREFIX(devname, QEMU_DRIVE_HOST_PREFIX)) -+ devname += strlen(QEMU_DRIVE_HOST_PREFIX); -+ -+ /* ignore missing info */ -+ if (!(bstats = virHashLookup(stats, devname))) -+ continue; -+ -+ /* drive may be empty */ -+ if (!(inserted = virJSONValueObjectGet(dev, "inserted")) || -+ !(image = virJSONValueObjectGet(inserted, "image"))) -+ continue; -+ -+ if (virJSONValueObjectGetNumberUlong(image, "virtual-size", -+ &bstats->capacity) < 0) -+ continue; -+ -+ /* if actual-size is missing, image is not thin provisioned */ -+ if (virJSONValueObjectGetNumberUlong(image, "actual-size", -+ &bstats->physical) < 0) -+ bstats->physical = bstats->capacity; -+ } -+ -+ ret = 0; -+ -+ cleanup: -+ virJSONValueFree(cmd); -+ virJSONValueFree(reply); -+ return ret; -+} -+ -+ - int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon, - int *nparams) - { -diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index 8e65c4c..289bd11 100644 ---- a/src/qemu/qemu_monitor_json.h -+++ b/src/qemu/qemu_monitor_json.h -@@ -81,6 +81,8 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - long long *errs); - int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - virHashTablePtr *ret_stats); -+int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, -+ virHashTablePtr stats); - int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon, - int *nparams); - int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon, --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-monitor-Avoid-shadowing-variable-devname-on-FreeBSD.-Again.patch b/SOURCES/libvirt-qemu-monitor-Avoid-shadowing-variable-devname-on-FreeBSD.-Again.patch deleted file mode 100644 index 5b2b3b8..0000000 --- a/SOURCES/libvirt-qemu-monitor-Avoid-shadowing-variable-devname-on-FreeBSD.-Again.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 08d883a0282f1a3355b868ed2037eb339d9f5d55 Mon Sep 17 00:00:00 2001 -Message-Id: <08d883a0282f1a3355b868ed2037eb339d9f5d55@dist-git> -From: Peter Krempa -Date: Wed, 1 Oct 2014 15:23:39 +0200 -Subject: [PATCH] qemu: monitor: Avoid shadowing variable "devname" on FreeBSD. - Again. - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -FreeBSD's compiler complains that we shadow the symbol. Sigh. - -s/devname/dev_name/ - -(cherry picked from commit 72945c062916bbfbb509a4b364cfa4bb9b5b2606) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor_json.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 2227744..adf560a 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -1967,7 +1967,7 @@ int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, - virJSONValuePtr inserted; - virJSONValuePtr image; - qemuBlockStatsPtr bstats; -- const char *devname; -+ const char *dev_name; - - if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -1976,18 +1976,18 @@ int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, - goto cleanup; - } - -- if (!(devname = virJSONValueObjectGetString(dev, "device"))) { -+ if (!(dev_name = virJSONValueObjectGetString(dev, "device"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("query-block device entry was not " - "in expected format")); - goto cleanup; - } - -- if (STRPREFIX(devname, QEMU_DRIVE_HOST_PREFIX)) -- devname += strlen(QEMU_DRIVE_HOST_PREFIX); -+ if (STRPREFIX(dev_name, QEMU_DRIVE_HOST_PREFIX)) -+ dev_name += strlen(QEMU_DRIVE_HOST_PREFIX); - - /* ignore missing info */ -- if (!(bstats = virHashLookup(stats, devname))) -+ if (!(bstats = virHashLookup(stats, dev_name))) - continue; - - /* drive may be empty */ --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-monitor-Avoid-shadowing-variable-devname-on-FreeBSD.patch b/SOURCES/libvirt-qemu-monitor-Avoid-shadowing-variable-devname-on-FreeBSD.patch deleted file mode 100644 index f6e5fbc..0000000 --- a/SOURCES/libvirt-qemu-monitor-Avoid-shadowing-variable-devname-on-FreeBSD.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 117ee60d2b88370ddee8c8cd80f6eeb324fbe512 Mon Sep 17 00:00:00 2001 -Message-Id: <117ee60d2b88370ddee8c8cd80f6eeb324fbe512@dist-git> -From: Peter Krempa -Date: Wed, 1 Oct 2014 11:20:22 +0200 -Subject: [PATCH] qemu: monitor: Avoid shadowing variable "devname" on FreeBSD - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -FreeBSD's compiler complains that we shadow the symbol. Sigh. - -s/devname/dev_name/ - -(cherry picked from commit bd2b0968c1bc5950685f61829ed711625e8e9850) - -Backported for consistency of the code. - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor_json.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index db553fb..2b23347 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -1790,7 +1790,7 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - for (i = 0; i < virJSONValueArraySize(devices); i++) { - virJSONValuePtr dev = virJSONValueArrayGet(devices, i); - virJSONValuePtr stats; -- const char *devname; -+ const char *dev_name; - - if (VIR_ALLOC(bstats) < 0) - goto cleanup; -@@ -1802,15 +1802,15 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - goto cleanup; - } - -- if (!(devname = virJSONValueObjectGetString(dev, "device"))) { -+ if (!(dev_name = virJSONValueObjectGetString(dev, "device"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats device entry was not " - "in expected format")); - goto cleanup; - } - -- if (STRPREFIX(devname, QEMU_DRIVE_HOST_PREFIX)) -- devname += strlen(QEMU_DRIVE_HOST_PREFIX); -+ if (STRPREFIX(dev_name, QEMU_DRIVE_HOST_PREFIX)) -+ dev_name += strlen(QEMU_DRIVE_HOST_PREFIX); - - if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL || - stats->type != VIR_JSON_TYPE_OBJECT) { -@@ -1881,7 +1881,7 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - goto cleanup; - } - -- if (virHashAddEntry(hash, devname, bstats) < 0) -+ if (virHashAddEntry(hash, dev_name, bstats) < 0) - goto cleanup; - bstats = NULL; - } --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-monitor-Rename-and-improve-qemuMonitorGetPtyPaths.patch b/SOURCES/libvirt-qemu-monitor-Rename-and-improve-qemuMonitorGetPtyPaths.patch deleted file mode 100644 index accd10a..0000000 --- a/SOURCES/libvirt-qemu-monitor-Rename-and-improve-qemuMonitorGetPtyPaths.patch +++ /dev/null @@ -1,364 +0,0 @@ -From 61f6ae8700cb06aeb73bf8bcb447b50c1af701e4 Mon Sep 17 00:00:00 2001 -Message-Id: <61f6ae8700cb06aeb73bf8bcb447b50c1af701e4@dist-git> -From: Peter Krempa -Date: Mon, 24 Nov 2014 17:51:13 +0100 -Subject: [PATCH] qemu: monitor: Rename and improve qemuMonitorGetPtyPaths - -https://bugzilla.redhat.com/show_bug.cgi?id=1146944 - -To unify future additions that require information from "query-chardev" -rename qemuMonitorGetPtyPaths and friends to qemuMonitorGetChardevInfo -and move the allocation of the returned hash into the top level -function. - -(cherry picked from commit e9a4506963fb70d2b8cbf31a2fe77ec68bacd397) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor.c | 31 +++++++++++++++++++++++-------- - src/qemu/qemu_monitor.h | 4 ++-- - src/qemu/qemu_monitor_json.c | 15 +++++++++------ - src/qemu/qemu_monitor_json.h | 4 ++-- - src/qemu/qemu_monitor_text.c | 6 +++--- - src/qemu/qemu_monitor_text.h | 4 ++-- - src/qemu/qemu_process.c | 28 ++++++++++++---------------- - tests/qemumonitorjsontest.c | 26 +++++++++++++------------- - 8 files changed, 66 insertions(+), 52 deletions(-) - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index d2f0b46..09935f5 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -2972,24 +2972,39 @@ qemuMonitorQueryRxFilter(qemuMonitorPtr mon, const char *alias, - } - - --int qemuMonitorGetPtyPaths(qemuMonitorPtr mon, -- virHashTablePtr paths) -+int -+qemuMonitorGetChardevInfo(qemuMonitorPtr mon, -+ virHashTablePtr *retinfo) - { - int ret; -- VIR_DEBUG("mon=%p", -- mon); -+ virHashTablePtr info = NULL; -+ -+ VIR_DEBUG("mon=%p retinfo=%p", mon, retinfo); - - if (!mon) { - virReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); -- return -1; -+ goto error; - } - -+ if (!(info = virHashCreate(10, virHashValueFree))) -+ goto error; -+ - if (mon->json) -- ret = qemuMonitorJSONGetPtyPaths(mon, paths); -+ ret = qemuMonitorJSONGetChardevInfo(mon, info); - else -- ret = qemuMonitorTextGetPtyPaths(mon, paths); -- return ret; -+ ret = qemuMonitorTextGetChardevInfo(mon, info); -+ -+ if (ret < 0) -+ goto error; -+ -+ *retinfo = info; -+ return 0; -+ -+ error: -+ virHashFree(info); -+ *retinfo = NULL; -+ return -1; - } - - -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index 70bb608..b63799b 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -639,8 +639,8 @@ int qemuMonitorRemoveNetdev(qemuMonitorPtr mon, - int qemuMonitorQueryRxFilter(qemuMonitorPtr mon, const char *alias, - virNetDevRxFilterPtr *filter); - --int qemuMonitorGetPtyPaths(qemuMonitorPtr mon, -- virHashTablePtr paths); -+int qemuMonitorGetChardevInfo(qemuMonitorPtr mon, -+ virHashTablePtr *retinfo); - - int qemuMonitorAttachPCIDiskController(qemuMonitorPtr mon, - const char *bus, -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index f1f65ea..bf28832 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -3539,8 +3539,9 @@ qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias, - * ]} - * - */ --static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply, -- virHashTablePtr paths) -+static int -+qemuMonitorJSONExtractChardevInfo(virJSONValuePtr reply, -+ virHashTablePtr info) - { - virJSONValuePtr data; - int ret = -1; -@@ -3585,7 +3586,7 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply, - if (VIR_STRDUP(path, type + strlen("pty:")) < 0) - goto cleanup; - -- if (virHashAddEntry(paths, id, path) < 0) { -+ if (virHashAddEntry(info, id, path) < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, - _("failed to save chardev path '%s'"), path); - VIR_FREE(path); -@@ -3600,8 +3601,10 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply, - return ret; - } - --int qemuMonitorJSONGetPtyPaths(qemuMonitorPtr mon, -- virHashTablePtr paths) -+ -+int -+qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon, -+ virHashTablePtr info) - - { - int ret; -@@ -3618,7 +3621,7 @@ int qemuMonitorJSONGetPtyPaths(qemuMonitorPtr mon, - ret = qemuMonitorJSONCheckError(cmd, reply); - - if (ret == 0) -- ret = qemuMonitorJSONExtractPtyPaths(reply, paths); -+ ret = qemuMonitorJSONExtractChardevInfo(reply, info); - - virJSONValueFree(cmd); - virJSONValueFree(reply); -diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index 97397fe..17f9718 100644 ---- a/src/qemu/qemu_monitor_json.h -+++ b/src/qemu/qemu_monitor_json.h -@@ -214,8 +214,8 @@ int qemuMonitorJSONRemoveNetdev(qemuMonitorPtr mon, - int qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias, - virNetDevRxFilterPtr *filter); - --int qemuMonitorJSONGetPtyPaths(qemuMonitorPtr mon, -- virHashTablePtr paths); -+int qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon, -+ virHashTablePtr info); - - int qemuMonitorJSONAttachPCIDiskController(qemuMonitorPtr mon, - const char *bus, -diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c -index fc54a11..634f9f3 100644 ---- a/src/qemu/qemu_monitor_text.c -+++ b/src/qemu/qemu_monitor_text.c -@@ -2172,8 +2172,8 @@ int qemuMonitorTextRemoveNetdev(qemuMonitorPtr mon, - * '/dev/pty/7'. The hash will contain only a single value. - */ - --int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon, -- virHashTablePtr paths) -+int qemuMonitorTextGetChardevInfo(qemuMonitorPtr mon, -+ virHashTablePtr info) - { - char *reply = NULL; - int ret = -1; -@@ -2224,7 +2224,7 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon, - if (VIR_STRDUP(path, needle + strlen(NEEDLE)) < 0) - goto cleanup; - -- if (virHashAddEntry(paths, id, path) < 0) { -+ if (virHashAddEntry(info, id, path) < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, - _("failed to save chardev path '%s'"), - path); -diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h -index 49d4b88..f118a30 100644 ---- a/src/qemu/qemu_monitor_text.h -+++ b/src/qemu/qemu_monitor_text.h -@@ -179,8 +179,8 @@ int qemuMonitorTextAddNetdev(qemuMonitorPtr mon, - int qemuMonitorTextRemoveNetdev(qemuMonitorPtr mon, - const char *alias); - --int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon, -- virHashTablePtr paths); -+int qemuMonitorTextGetChardevInfo(qemuMonitorPtr mon, -+ virHashTablePtr info); - - int qemuMonitorTextAttachPCIDiskController(qemuMonitorPtr mon, - const char *bus, -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index fa8b7f8..b7b2d80 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -1865,7 +1865,7 @@ qemuProcessLookupPTYs(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virDomainChrDefPtr *devices, - int count, -- virHashTablePtr paths) -+ virHashTablePtr info) - { - size_t i; - -@@ -1882,7 +1882,7 @@ qemuProcessLookupPTYs(virDomainDefPtr def, - chr->info.alias) >= sizeof(id)) - return -1; - -- path = (const char *) virHashLookup(paths, id); -+ path = (const char *) virHashLookup(info, id); - if (path == NULL) { - if (chr->source.data.file.path == NULL) { - /* neither the log output nor 'info chardev' had a -@@ -1911,23 +1911,23 @@ qemuProcessLookupPTYs(virDomainDefPtr def, - static int - qemuProcessFindCharDevicePTYsMonitor(virDomainObjPtr vm, - virQEMUCapsPtr qemuCaps, -- virHashTablePtr paths) -+ virHashTablePtr info) - { - size_t i = 0; - - if (qemuProcessLookupPTYs(vm->def, qemuCaps, - vm->def->serials, vm->def->nserials, -- paths) < 0) -+ info) < 0) - return -1; - - if (qemuProcessLookupPTYs(vm->def, qemuCaps, - vm->def->parallels, vm->def->nparallels, -- paths) < 0) -+ info) < 0) - return -1; - - if (qemuProcessLookupPTYs(vm->def, qemuCaps, - vm->def->channels, vm->def->nchannels, -- paths) < 0) -+ info) < 0) - return -1; - /* For historical reasons, console[0] can be just an alias - * for serial[0]. That's why we need to update it as well. */ -@@ -1947,7 +1947,7 @@ qemuProcessFindCharDevicePTYsMonitor(virDomainObjPtr vm, - - if (qemuProcessLookupPTYs(vm->def, qemuCaps, - vm->def->consoles + i, vm->def->nconsoles - i, -- paths) < 0) -+ info) < 0) - return -1; - - return 0; -@@ -2031,7 +2031,7 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver, - size_t buf_size = 4096; /* Plenty of space to get startup greeting */ - int logfd = -1; - int ret = -1; -- virHashTablePtr paths = NULL; -+ virHashTablePtr info = NULL; - qemuDomainObjPrivatePtr priv; - - if (pos != -1 && -@@ -2056,22 +2056,18 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver, - * reliable if it's available. - * Note that the monitor itself can be on a pty, so we still need to try the - * log output method. */ -- paths = virHashCreate(0, virHashValueFree); -- if (paths == NULL) -- goto cleanup; -- - priv = vm->privateData; - if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) - goto cleanup; -- ret = qemuMonitorGetPtyPaths(priv->mon, paths); -+ ret = qemuMonitorGetChardevInfo(priv->mon, &info); - qemuDomainObjExitMonitor(driver, vm); - -- VIR_DEBUG("qemuMonitorGetPtyPaths returned %i", ret); -+ VIR_DEBUG("qemuMonitorGetChardevInfo returned %i", ret); - if (ret == 0) -- ret = qemuProcessFindCharDevicePTYsMonitor(vm, qemuCaps, paths); -+ ret = qemuProcessFindCharDevicePTYsMonitor(vm, qemuCaps, info); - - cleanup: -- virHashFree(paths); -+ virHashFree(info); - - if (pos != -1 && kill(vm->pid, 0) == -1 && errno == ESRCH) { - int len; -diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c -index f7b7ea5..afa2561 100644 ---- a/tests/qemumonitorjsontest.c -+++ b/tests/qemumonitorjsontest.c -@@ -1765,24 +1765,24 @@ testHashEqualString(const void *value1, const void *value2) - } - - static int --testQemuMonitorJSONqemuMonitorJSONGetPtyPaths(const void *data) -+testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *data) - { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt); - int ret = -1; -- virHashTablePtr paths = NULL, expectedPaths = NULL; -+ virHashTablePtr info = NULL, expectedInfo = NULL; - - if (!test) - return -1; - -- if (!(paths = virHashCreate(32, (virHashDataFree) free)) || -- !(expectedPaths = virHashCreate(32, NULL))) -+ if (!(info = virHashCreate(32, (virHashDataFree) free)) || -+ !(expectedInfo = virHashCreate(32, NULL))) - goto cleanup; - -- if (virHashAddEntry(expectedPaths, "charserial1", (void *) "/dev/pts/21") < 0 || -- virHashAddEntry(expectedPaths, "charserial0", (void *) "/dev/pts/20") < 0) { -+ if (virHashAddEntry(expectedInfo, "charserial1", (void *) "/dev/pts/21") < 0 || -+ virHashAddEntry(expectedInfo, "charserial0", (void *) "/dev/pts/20") < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- "Unable to create expectedPaths hash table"); -+ "Unable to create expectedInfo hash table"); - goto cleanup; - } - -@@ -1806,11 +1806,11 @@ testQemuMonitorJSONqemuMonitorJSONGetPtyPaths(const void *data) - "}") < 0) - goto cleanup; - -- if (qemuMonitorJSONGetPtyPaths(qemuMonitorTestGetMonitor(test), -- paths) < 0) -+ if (qemuMonitorJSONGetChardevInfo(qemuMonitorTestGetMonitor(test), -+ info) < 0) - goto cleanup; - -- if (!virHashEqual(paths, expectedPaths, testHashEqualString)) { -+ if (!virHashEqual(info, expectedInfo, testHashEqualString)) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - "Hashtable is different to the expected one"); - goto cleanup; -@@ -1818,8 +1818,8 @@ testQemuMonitorJSONqemuMonitorJSONGetPtyPaths(const void *data) - - ret = 0; - cleanup: -- virHashFree(paths); -- virHashFree(expectedPaths); -+ virHashFree(info); -+ virHashFree(expectedInfo); - qemuMonitorTestFree(test); - return ret; - } -@@ -2387,7 +2387,7 @@ mymain(void) - DO_TEST(qemuMonitorJSONGetMigrationCacheSize); - DO_TEST(qemuMonitorJSONGetMigrationStatus); - DO_TEST(qemuMonitorJSONGetSpiceMigrationStatus); -- DO_TEST(qemuMonitorJSONGetPtyPaths); -+ DO_TEST(qemuMonitorJSONGetChardevInfo); - DO_TEST(qemuMonitorJSONSetBlockIoThrottle); - DO_TEST(qemuMonitorJSONGetTargetArch); - DO_TEST(qemuMonitorJSONGetMigrationCapability); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-monitor-return-block-stats-data-as-a-hash-to-avoid-disk-mixup.patch b/SOURCES/libvirt-qemu-monitor-return-block-stats-data-as-a-hash-to-avoid-disk-mixup.patch deleted file mode 100644 index 8a63e4f..0000000 --- a/SOURCES/libvirt-qemu-monitor-return-block-stats-data-as-a-hash-to-avoid-disk-mixup.patch +++ /dev/null @@ -1,361 +0,0 @@ -From 46a13012c80b732c4a1794bc237cdec7a9a65323 Mon Sep 17 00:00:00 2001 -Message-Id: <46a13012c80b732c4a1794bc237cdec7a9a65323@dist-git> -From: Peter Krempa -Date: Wed, 1 Oct 2014 11:20:21 +0200 -Subject: [PATCH] qemu: monitor: return block stats data as a hash to avoid - disk mixup - -https://bugzilla.redhat.com/show_bug.cgi?id=1113116 - -The current block stats code matched up the disk name with the actual -stats by the order in the data returned from qemu. This unfortunately -isn't right as qemu may return the disks in any order. Fix this by -returning a hash of stats and index them by the disk alias. - -(cherry picked from commit 96c0f57a82ef73ca924b7333d1001f05ecf5df86) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 44 ++++++++--------- - src/qemu/qemu_monitor.c | 14 ++---- - src/qemu/qemu_monitor.h | 6 +-- - src/qemu/qemu_monitor_json.c | 111 ++++++++++++++++++++----------------------- - src/qemu/qemu_monitor_json.h | 4 +- - 5 files changed, 81 insertions(+), 98 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 8e90cc6..1a16da7 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17714,24 +17714,18 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - { - size_t i; - int ret = -1; -- int nstats = dom->def->ndisks; -- qemuBlockStatsPtr stats = NULL; -+ int rc; -+ virHashTablePtr stats = NULL; - qemuDomainObjPrivatePtr priv = dom->privateData; - - if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom)) - return 0; /* it's ok, just go ahead silently */ - -- if (VIR_ALLOC_N(stats, nstats) < 0) -- return -1; -- - qemuDomainObjEnterMonitor(driver, dom); -- -- nstats = qemuMonitorGetAllBlockStatsInfo(priv->mon, NULL, -- stats, nstats); -- -+ rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats); - qemuDomainObjExitMonitor(driver, dom); - -- if (nstats < 0) { -+ if (rc < 0) { - virResetLastError(); - ret = 0; /* still ok, again go ahead silently */ - goto cleanup; -@@ -17739,32 +17733,38 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - - QEMU_ADD_COUNT_PARAM(record, maxparams, "block", dom->def->ndisks); - -- for (i = 0; i < nstats; i++) { -- QEMU_ADD_NAME_PARAM(record, maxparams, -- "block", i, dom->def->disks[i]->dst); -+ for (i = 0; i < dom->def->ndisks; i++) { -+ qemuBlockStats *entry; -+ virDomainDiskDefPtr disk = dom->def->disks[i]; -+ -+ QEMU_ADD_NAME_PARAM(record, maxparams, "block", i, disk->dst); -+ -+ if (!disk->info.alias || -+ !(entry = virHashLookup(stats, disk->info.alias))) -+ continue; - - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "rd.reqs", stats[i].rd_req); -+ "rd.reqs", entry->rd_req); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "rd.bytes", stats[i].rd_bytes); -+ "rd.bytes", entry->rd_bytes); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "rd.times", stats[i].rd_total_times); -+ "rd.times", entry->rd_total_times); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "wr.reqs", stats[i].wr_req); -+ "wr.reqs", entry->wr_req); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "wr.bytes", stats[i].wr_bytes); -+ "wr.bytes", entry->wr_bytes); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "wr.times", stats[i].wr_total_times); -+ "wr.times", entry->wr_total_times); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "fl.reqs", stats[i].flush_req); -+ "fl.reqs", entry->flush_req); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, i, -- "fl.times", stats[i].flush_total_times); -+ "fl.times", entry->flush_total_times); - } - - ret = 0; - - cleanup: -- VIR_FREE(stats); -+ virHashFree(stats); - return ret; - } - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index afe7959..93e8f22 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -1767,23 +1767,17 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon, - */ - int - qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, -- const char *dev_name, -- qemuBlockStatsPtr stats, -- int nstats) -+ virHashTablePtr *ret_stats) - { -- int ret; -- VIR_DEBUG("mon=%p dev=%s", mon, dev_name); -+ VIR_DEBUG("mon=%p ret_stats=%p", mon, ret_stats); - -- if (mon->json) { -- ret = qemuMonitorJSONGetAllBlockStatsInfo(mon, dev_name, -- stats, nstats); -- } else { -+ if (!mon->json) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unable to query all block stats with this QEMU")); - return -1; - } - -- return ret; -+ return qemuMonitorJSONGetAllBlockStatsInfo(mon, ret_stats); - } - - /* Return 0 and update @nparams with the number of block stats -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index b7f9fd1..2551272 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -361,10 +361,8 @@ struct _qemuBlockStats { - }; - - int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, -- const char *dev_name, -- qemuBlockStatsPtr stats, -- int nstats) -- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); -+ virHashTablePtr *ret_stats) -+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - - int qemuMonitorGetBlockStatsParamsNumber(qemuMonitorPtr mon, - int *nparams); -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index c013d49..db553fb 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -1708,7 +1708,8 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - long long *flush_total_times, - long long *errs) - { -- qemuBlockStats stats; -+ qemuBlockStats *stats; -+ virHashTablePtr blockstats = NULL; - int ret = -1; - - *rd_req = *rd_bytes = -1; -@@ -1723,56 +1724,61 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - if (flush_total_times) - *flush_total_times = -1; - -- if (qemuMonitorJSONGetAllBlockStatsInfo(mon, dev_name, &stats, 1) != 1) -+ if (qemuMonitorJSONGetAllBlockStatsInfo(mon, &blockstats) < 0) - goto cleanup; - -- *rd_req = stats.rd_req; -- *rd_bytes = stats.rd_bytes; -- *wr_req = stats.wr_req; -- *wr_bytes = stats.wr_bytes; -+ if (!(stats = virHashLookup(blockstats, dev_name))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("cannot find statistics for device '%s'"), dev_name); -+ goto cleanup; -+ } -+ -+ *rd_req = stats->rd_req; -+ *rd_bytes = stats->rd_bytes; -+ *wr_req = stats->wr_req; -+ *wr_bytes = stats->wr_bytes; - *errs = -1; /* QEMU does not have this */ - - if (rd_total_times) -- *rd_total_times = stats.rd_total_times; -+ *rd_total_times = stats->rd_total_times; - if (wr_total_times) -- *wr_total_times = stats.wr_total_times; -+ *wr_total_times = stats->wr_total_times; - if (flush_req) -- *flush_req = stats.flush_req; -+ *flush_req = stats->flush_req; - if (flush_total_times) -- *flush_total_times = stats.flush_total_times; -+ *flush_total_times = stats->flush_total_times; - - ret = 0; - - cleanup: -+ virHashFree(blockstats); - return ret; - } - - - int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, -- const char *dev_name, -- qemuBlockStatsPtr bstats, -- int nstats) -+ virHashTablePtr *ret_stats) - { -- int ret, count; -+ int ret = -1; -+ int rc; - size_t i; -- virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-blockstats", -- NULL); -+ virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr devices; -+ qemuBlockStatsPtr bstats = NULL; -+ virHashTablePtr hash = NULL; - -- if (!cmd) -+ if (!(cmd = qemuMonitorJSONMakeCommand("query-blockstats", NULL))) - return -1; - -- if (!bstats || nstats <= 0) -- return -1; -+ if (!(hash = virHashCreate(10, virHashValueFree))) -+ goto cleanup; - -- ret = qemuMonitorJSONCommand(mon, cmd, &reply); -+ if ((rc = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0) -+ goto cleanup; - -- if (ret == 0) -- ret = qemuMonitorJSONCheckError(cmd, reply); -- if (ret < 0) -+ if (qemuMonitorJSONCheckError(cmd, reply) < 0) - goto cleanup; -- ret = -1; - - devices = virJSONValueObjectGet(reply, "return"); - if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) { -@@ -1781,10 +1787,14 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - goto cleanup; - } - -- count = 0; -- for (i = 0; i < virJSONValueArraySize(devices) && count < nstats; i++) { -+ for (i = 0; i < virJSONValueArraySize(devices); i++) { - virJSONValuePtr dev = virJSONValueArrayGet(devices, i); - virJSONValuePtr stats; -+ const char *devname; -+ -+ if (VIR_ALLOC(bstats) < 0) -+ goto cleanup; -+ - if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats device entry was not " -@@ -1792,29 +1802,16 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - goto cleanup; - } - -- /* If dev_name is specified, we are looking for a specific device, -- * so we must be stricter. -- */ -- if (dev_name) { -- const char *thisdev = virJSONValueObjectGetString(dev, "device"); -- if (!thisdev) { -- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("blockstats device entry was not " -- "in expected format")); -- goto cleanup; -- } -- -- /* New QEMU has separate names for host & guest side of the disk -- * and libvirt gives the host side a 'drive-' prefix. The passed -- * in dev_name is the guest side though -- */ -- if (STRPREFIX(thisdev, QEMU_DRIVE_HOST_PREFIX)) -- thisdev += strlen(QEMU_DRIVE_HOST_PREFIX); -- -- if (STRNEQ(thisdev, dev_name)) -- continue; -+ if (!(devname = virJSONValueObjectGetString(dev, "device"))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("blockstats device entry was not " -+ "in expected format")); -+ goto cleanup; - } - -+ if (STRPREFIX(devname, QEMU_DRIVE_HOST_PREFIX)) -+ devname += strlen(QEMU_DRIVE_HOST_PREFIX); -+ - if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL || - stats->type != VIR_JSON_TYPE_OBJECT) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -1884,22 +1881,18 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - goto cleanup; - } - -- count++; -- bstats++; -- -- if (dev_name && count) -- break; -- } -- -- if (dev_name && !count) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("cannot find statistics for device '%s'"), dev_name); -- goto cleanup; -+ if (virHashAddEntry(hash, devname, bstats) < 0) -+ goto cleanup; -+ bstats = NULL; - } - -- ret = count; -+ *ret_stats = hash; -+ hash = NULL; -+ ret = 0; - - cleanup: -+ VIR_FREE(bstats); -+ virHashFree(hash); - virJSONValueFree(cmd); - virJSONValueFree(reply); - return ret; -diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index 2402b5a..8e65c4c 100644 ---- a/src/qemu/qemu_monitor_json.h -+++ b/src/qemu/qemu_monitor_json.h -@@ -80,9 +80,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, - long long *flush_total_times, - long long *errs); - int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, -- const char *dev_name, -- qemuBlockStatsPtr stats, -- int nstats); -+ virHashTablePtr *ret_stats); - int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon, - int *nparams); - int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon, --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-move-setting-emulatorpin-ahead-of-monitor-showing-up.patch b/SOURCES/libvirt-qemu-move-setting-emulatorpin-ahead-of-monitor-showing-up.patch deleted file mode 100644 index fa3a420..0000000 --- a/SOURCES/libvirt-qemu-move-setting-emulatorpin-ahead-of-monitor-showing-up.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 9cdd161539582fb5262a98d2e8d0ce3645b308f9 Mon Sep 17 00:00:00 2001 -Message-Id: <9cdd161539582fb5262a98d2e8d0ce3645b308f9@dist-git> -From: Zhou yimin -Date: Thu, 4 Dec 2014 14:28:26 +0100 -Subject: [PATCH] qemu: move setting emulatorpin ahead of monitor showing up - -https://bugzilla.redhat.com/show_bug.cgi?id=1170484 - -If VM is configured with many devices(including passthrough devices) -and large memory, libvirtd will take seconds(in the worst case) to -wait for monitor. In this period the qemu process may run on any -PCPU though I intend to pin emulator to the specified PCPU in xml -configuration. - -Actually qemu process takes high cpu usage during vm startup. -So this is not the strict CPU isolation in this case. - -Signed-off-by: Zhou yimin -(cherry picked from commit 411cea638f6ec8503b7142a31e58b1cd85dbeaba) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 904af95..3d275a3 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -4681,6 +4681,14 @@ int qemuProcessStart(virConnectPtr conn, - if (ret == -1) /* The VM failed to start */ - goto cleanup; - -+ VIR_DEBUG("Setting cgroup for emulator (if required)"); -+ if (qemuSetupCgroupForEmulator(driver, vm, nodemask) < 0) -+ goto cleanup; -+ -+ VIR_DEBUG("Setting affinity of emulator threads"); -+ if (qemuProcessSetEmulatorAffinity(vm) < 0) -+ goto cleanup; -+ - VIR_DEBUG("Waiting for monitor to show up"); - if (qemuProcessWaitForMonitor(driver, vm, asyncJob, priv->qemuCaps, pos) < 0) - goto cleanup; -@@ -4716,10 +4724,6 @@ int qemuProcessStart(virConnectPtr conn, - if (qemuSetupCgroupForVcpu(vm) < 0) - goto cleanup; - -- VIR_DEBUG("Setting cgroup for emulator (if required)"); -- if (qemuSetupCgroupForEmulator(driver, vm, nodemask) < 0) -- goto cleanup; -- - VIR_DEBUG("Setting cgroup for each IOThread (if required)"); - if (qemuSetupCgroupForIOThreads(vm) < 0) - goto cleanup; -@@ -4728,10 +4732,6 @@ int qemuProcessStart(virConnectPtr conn, - if (qemuProcessSetVcpuAffinities(vm) < 0) - goto cleanup; - -- VIR_DEBUG("Setting affinity of emulator threads"); -- if (qemuProcessSetEmulatorAffinity(vm) < 0) -- goto cleanup; -- - VIR_DEBUG("Setting affinity of IOThread threads"); - if (qemuProcessSetIOThreadsAffinity(vm) < 0) - goto cleanup; --- -2.2.0 - diff --git a/SOURCES/libvirt-qemu-move-the-guest-status-check-before-agent-config-and-status-check.patch b/SOURCES/libvirt-qemu-move-the-guest-status-check-before-agent-config-and-status-check.patch new file mode 100644 index 0000000..77ca72f --- /dev/null +++ b/SOURCES/libvirt-qemu-move-the-guest-status-check-before-agent-config-and-status-check.patch @@ -0,0 +1,66 @@ +From 80c40537679e42b440f88e97007136aca748d613 Mon Sep 17 00:00:00 2001 +Message-Id: <80c40537679e42b440f88e97007136aca748d613@dist-git> +From: Luyao Huang +Date: Fri, 10 Jul 2015 09:25:23 +0200 +Subject: [PATCH] qemu: move the guest status check before agent config and + status check + +https://bugzilla.redhat.com/show_bug.cgi?id=1240979 + +When use setvcpus command with --guest option to a offline vm, +we will get error: + + # virsh setvcpus test3 1 --guest + error: Guest agent is not responding: QEMU guest agent is not connected + +However guest is not running, agent status could not be connected. +In this case, report domain is not running will be better than agent is +not connected. Move the guest status check more early to output error to +point out guest status is not right. + +Also from the logic, a running vm is a basic requirement to use +agent, we cannot use agent if vm is not running. + +Signed-off-by: Luyao Huang +Signed-off-by: Michal Privoznik +(cherry picked from commit 0b3fcfb1eac845ba24ac2ad6eefb969d5f7b8395) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index e3793bd..c247737 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3076,6 +3076,13 @@ qemuDomainAgentAvailable(virDomainObjPtr vm, + { + qemuDomainObjPrivatePtr priv = vm->privateData; + ++ if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) { ++ if (reportError) { ++ virReportError(VIR_ERR_OPERATION_INVALID, "%s", ++ _("domain is not running")); ++ } ++ return false; ++ } + if (priv->agentError) { + if (reportError) { + virReportError(VIR_ERR_AGENT_UNRESPONSIVE, "%s", +@@ -3099,13 +3106,6 @@ qemuDomainAgentAvailable(virDomainObjPtr vm, + return false; + } + } +- if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) { +- if (reportError) { +- virReportError(VIR_ERR_OPERATION_INVALID, "%s", +- _("domain is not running")); +- } +- return false; +- } + return true; + } + +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu-ppc64-Align-memory-sizes-to-256MiB-blocks.patch b/SOURCES/libvirt-qemu-ppc64-Align-memory-sizes-to-256MiB-blocks.patch new file mode 100644 index 0000000..745017e --- /dev/null +++ b/SOURCES/libvirt-qemu-ppc64-Align-memory-sizes-to-256MiB-blocks.patch @@ -0,0 +1,57 @@ +From 7b6d887931845fb14f04bdfd997d61de940a0cff Mon Sep 17 00:00:00 2001 +Message-Id: <7b6d887931845fb14f04bdfd997d61de940a0cff@dist-git> +From: Peter Krempa +Date: Tue, 22 Sep 2015 16:59:47 +0200 +Subject: [PATCH] qemu: ppc64: Align memory sizes to 256MiB blocks + +For some machine types ppc64 machines now require that memory sizes are +aligned to 256MiB increments (due to the dynamically reconfigurable +memory). As now we treat existing configs reasonably in regards to +migration, we can round all the sizes unconditionally. The only drawback +will be that the memory size of a VM can potentially increase by +(256MiB - 1byte) * number_of_NUMA_nodes. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1249006 +(cherry picked from commit bd874b6c422283ff9c07ee28b042b424e85a2398) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 7 ++++++- + tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args | 2 +- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 77f3d6a..a47535e 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3159,8 +3159,13 @@ qemuDomainAgentAvailable(virDomainObjPtr vm, + + + static unsigned long long +-qemuDomainGetMemorySizeAlignment(virDomainDefPtr def ATTRIBUTE_UNUSED) ++qemuDomainGetMemorySizeAlignment(virDomainDefPtr def) + { ++ /* PPC requires the memory sizes to be rounded to 256MiB increments, so ++ * round them to the size always. */ ++ if (ARCH_IS_PPC64(def->os.arch)) ++ return 256 * 1024; ++ + /* Align memory size. QEMU requires rounding to next 4KiB block. + * We'll take the "traditional" path and round it to 1MiB*/ + +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args +index 64df406..305e924 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args +@@ -1,7 +1,7 @@ + LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \ + QEMU_AUDIO_DRV=none /usr/bin/qemu-system-ppc64 -S -M pseries \ + -cpu host,compat=power7 \ +--m 214 -smp 4 -nographic -nodefconfig -nodefaults \ ++-m 256 -smp 4 -nographic -nodefconfig -nodefaults \ + -chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \ + -mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -usb \ + -chardev pty,id=charserial0 \ +-- +2.5.3 + diff --git a/SOURCES/libvirt-qemu-process-Export-qemuProcessFindDomainDiskByAlias.patch b/SOURCES/libvirt-qemu-process-Export-qemuProcessFindDomainDiskByAlias.patch deleted file mode 100644 index 0d45d4d..0000000 --- a/SOURCES/libvirt-qemu-process-Export-qemuProcessFindDomainDiskByAlias.patch +++ /dev/null @@ -1,48 +0,0 @@ -From b7cd7b195f024f75b5dbc033c49a6da4005aa665 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Tue, 17 Mar 2015 13:13:51 +0100 -Subject: [PATCH] qemu: process: Export qemuProcessFindDomainDiskByAlias - -https://bugzilla.redhat.com/show_bug.cgi?id=1202719 - -(cherry picked from commit 5c634730b99b53afd6e2cea4b7d2fc2dfc2ee630) - -Conflicts: - src/qemu/qemu_process.h - context with new declarations added - upstream - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 2 +- - src/qemu/qemu_process.h | 3 +++ - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index b9e7280..ffba29d 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -389,7 +389,7 @@ qemuProcessFindDomainDiskByPath(virDomainObjPtr vm, - return NULL; - } - --static virDomainDiskDefPtr -+virDomainDiskDefPtr - qemuProcessFindDomainDiskByAlias(virDomainObjPtr vm, - const char *alias) - { -diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h -index 5948ea4..9fbf7ba 100644 ---- a/src/qemu/qemu_process.h -+++ b/src/qemu/qemu_process.h -@@ -104,4 +104,7 @@ virBitmapPtr qemuPrepareCpumap(virQEMUDriverPtr driver, - - int qemuProcessReadLog(int fd, char *buf, int buflen, int off, bool skipchar); - -+virDomainDiskDefPtr qemuProcessFindDomainDiskByAlias(virDomainObjPtr vm, -+ const char *alias); -+ - #endif /* __QEMU_PROCESS_H__ */ --- -2.3.3 - diff --git a/SOURCES/libvirt-qemu-process-Improve-update-of-maximum-balloon-state-at-startup.patch b/SOURCES/libvirt-qemu-process-Improve-update-of-maximum-balloon-state-at-startup.patch new file mode 100644 index 0000000..47508eb --- /dev/null +++ b/SOURCES/libvirt-qemu-process-Improve-update-of-maximum-balloon-state-at-startup.patch @@ -0,0 +1,102 @@ +From e2860c4cd200424d09be581bc5c0b206dcffb629 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Tue, 14 Jul 2015 15:02:58 +0200 +Subject: [PATCH] qemu: process: Improve update of maximum balloon state at + startup + +https://bugzilla.redhat.com/show_bug.cgi?id=1242940 + +In commit 641a145d73fdc3dd9350fd57b3d3247abf101c05 I've added code that +resets the balloon memory value to full size prior to resuming the vCPUs +since the size certainly was not reduced at that point. + +Since qemuProcessStart is used also in code paths with already booted +up guests (migration, save/restore) the assumption is not entirely true +since the guest might already been running before. + +This patch adds a function that queries the monitor rather than using +the full size since a balloon event would not be reissued in case we are +recovering a saved migration state. + +Additionally the new function is used also when reconnecting to a VM +after libvirtd restart since we might have missed a few balloon events +while libvirtd was not running. + +(cherry picked from commit c212e0c77986b0592f63e02d9ecd816aaf7aac18) + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_process.c | 40 ++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 38 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index e05be54..35b6513 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -2116,6 +2116,38 @@ qemuProcessReconnectRefreshChannelVirtioState(virQEMUDriverPtr driver, + + + static int ++qemuProcessRefreshBalloonState(virQEMUDriverPtr driver, ++ virDomainObjPtr vm, ++ int asyncJob) ++{ ++ unsigned long long balloon; ++ int rc; ++ ++ /* if no ballooning is available, the current size equals to the current ++ * full memory size */ ++ if (!vm->def->memballoon || ++ vm->def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_NONE) { ++ vm->def->mem.cur_balloon = virDomainDefGetMemoryActual(vm->def); ++ return 0; ++ } ++ ++ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) ++ return -1; ++ ++ rc = qemuMonitorGetBalloonInfo(qemuDomainGetMonitor(vm), &balloon); ++ if (qemuDomainObjExitMonitor(driver, vm) < 0) ++ rc = -1; ++ ++ if (rc < 0) ++ return -1; ++ ++ vm->def->mem.cur_balloon = balloon; ++ ++ return 0; ++} ++ ++ ++static int + qemuProcessWaitForMonitor(virQEMUDriverPtr driver, + virDomainObjPtr vm, + int asyncJob, +@@ -3830,6 +3862,9 @@ qemuProcessReconnect(void *opaque) + if (qemuProcessReconnectRefreshChannelVirtioState(driver, obj) < 0) + goto error; + ++ if (qemuProcessRefreshBalloonState(driver, obj, QEMU_ASYNC_JOB_NONE) < 0) ++ goto error; ++ + if (qemuProcessRecoverJob(driver, obj, conn, &oldjob) < 0) + goto error; + +@@ -4970,10 +5005,11 @@ int qemuProcessStart(virConnectPtr conn, + goto cleanup; + } + +- /* Since CPUs were not started yet, the ballon could not return the memory ++ /* Since CPUs were not started yet, the balloon could not return the memory + * to the host and thus cur_balloon needs to be updated so that GetXMLdesc + * and friends return the correct size in case they can't grab the job */ +- vm->def->mem.cur_balloon = virDomainDefGetMemoryActual(vm->def); ++ if (qemuProcessRefreshBalloonState(driver, vm, asyncJob) < 0) ++ goto cleanup; + + VIR_DEBUG("Detecting actual memory size for video device"); + if (qemuProcessUpdateVideoRamSize(driver, vm, asyncJob) < 0) +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-process-Refresh-virtio-channel-guest-state-when-connecting-to-mon.patch b/SOURCES/libvirt-qemu-process-Refresh-virtio-channel-guest-state-when-connecting-to-mon.patch deleted file mode 100644 index d2abea2..0000000 --- a/SOURCES/libvirt-qemu-process-Refresh-virtio-channel-guest-state-when-connecting-to-mon.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 6584db581b4044f5ec6bf6d01d0e1b32567cff1d Mon Sep 17 00:00:00 2001 -Message-Id: <6584db581b4044f5ec6bf6d01d0e1b32567cff1d@dist-git> -From: Peter Krempa -Date: Mon, 24 Nov 2014 17:51:17 +0100 -Subject: [PATCH] qemu: process: Refresh virtio channel guest state when - connecting to mon - -https://bugzilla.redhat.com/show_bug.cgi?id=1146944 - -Use data provided by "query-chardev" to refresh the guest frontend state -of virtio channels. - -(cherry picked from commit 21c676c2aa60f55fbb5ade884b4f4bb80281c789) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 66 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index ebcd5e8..e68d9c6 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2065,6 +2065,61 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm, - - - static int -+qemuProcessRefreshChannelVirtioState(virDomainObjPtr vm, -+ virHashTablePtr info) -+{ -+ size_t i; -+ qemuMonitorChardevInfoPtr entry; -+ char id[32]; -+ -+ for (i = 0; i < vm->def->nchannels; i++) { -+ virDomainChrDefPtr chr = vm->def->channels[i]; -+ if (chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) { -+ if (snprintf(id, sizeof(id), "char%s", -+ chr->info.alias) >= sizeof(id)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("failed to format device alias " -+ "for PTY retrieval")); -+ return -1; -+ } -+ -+ /* port state not reported */ -+ if (!(entry = virHashLookup(info, id)) || -+ !entry->state) -+ continue; -+ -+ chr->state = entry->state; -+ } -+ } -+ -+ return 0; -+} -+ -+ -+static int -+qemuProcessReconnectRefreshChannelVirtioState(virQEMUDriverPtr driver, -+ virDomainObjPtr vm) -+{ -+ qemuDomainObjPrivatePtr priv = vm->privateData; -+ virHashTablePtr info = NULL; -+ int ret = -1; -+ -+ qemuDomainObjEnterMonitor(driver, vm); -+ ret = qemuMonitorGetChardevInfo(priv->mon, &info); -+ qemuDomainObjExitMonitor(driver, vm); -+ -+ if (ret < 0) -+ goto cleanup; -+ -+ ret = qemuProcessRefreshChannelVirtioState(vm, info); -+ -+ cleanup: -+ virHashFree(info); -+ return ret; -+} -+ -+ -+static int - qemuProcessWaitForMonitor(virQEMUDriverPtr driver, - virDomainObjPtr vm, - int asyncJob, -@@ -2107,8 +2162,14 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver, - qemuDomainObjExitMonitor(driver, vm); - - VIR_DEBUG("qemuMonitorGetChardevInfo returned %i", ret); -- if (ret == 0) -- ret = qemuProcessFindCharDevicePTYsMonitor(vm, qemuCaps, info); -+ if (ret == 0) { -+ if ((ret = qemuProcessFindCharDevicePTYsMonitor(vm, qemuCaps, -+ info)) < 0) -+ goto cleanup; -+ -+ if ((ret = qemuProcessRefreshChannelVirtioState(vm, info)) < 0) -+ goto cleanup; -+ } - - cleanup: - virHashFree(info); -@@ -3584,6 +3645,9 @@ qemuProcessReconnect(void *opaque) - if (qemuDomainCheckEjectableMedia(driver, obj, QEMU_ASYNC_JOB_NONE) < 0) - goto error; - -+ if (qemuProcessReconnectRefreshChannelVirtioState(driver, obj) < 0) -+ goto error; -+ - if (qemuProcessRecoverJob(driver, obj, conn, &oldjob) < 0) - goto error; - --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-processBlockJob-Don-t-unlock-vm-twice.patch b/SOURCES/libvirt-qemu-processBlockJob-Don-t-unlock-vm-twice.patch deleted file mode 100644 index 5d52d87..0000000 --- a/SOURCES/libvirt-qemu-processBlockJob-Don-t-unlock-vm-twice.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 6d0a3a1730efdc0b0c179e5bee64749ef5eed967 Mon Sep 17 00:00:00 2001 -Message-Id: <6d0a3a1730efdc0b0c179e5bee64749ef5eed967@dist-git> -From: Peter Krempa -Date: Thu, 2 Apr 2015 11:27:57 +0200 -Subject: [PATCH] qemu: processBlockJob: Don't unlock @vm twice - -https://bugzilla.redhat.com/show_bug.cgi?id=1208021 - -Commit 1a92c719 (known as 12fdae1ebb74 downstream) moved code to handle -block job events to a different function that is executed in a separate -thread. The caller of processBlockJob handles locking and unlocking of -@vm, so the we should not do it in the function itself. - -(cherry picked from commit 6b6c4ab8a6d2096bd5f50d2ae9b0a929fbaaf076) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 4293817..0939223 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4523,7 +4523,6 @@ processBlockJobEvent(virQEMUDriverPtr driver, - VIR_WARN("Unable to update persistent definition on vm %s " - "after block job", vm->def->name); - } -- virObjectUnlock(vm); - virObjectUnref(cfg); - - if (event) --- -2.3.5 - diff --git a/SOURCES/libvirt-qemu-qemuMonitorQueryRxFilter-retrieve-guest-netdev-rx-filter.patch b/SOURCES/libvirt-qemu-qemuMonitorQueryRxFilter-retrieve-guest-netdev-rx-filter.patch deleted file mode 100644 index d2bc522..0000000 --- a/SOURCES/libvirt-qemu-qemuMonitorQueryRxFilter-retrieve-guest-netdev-rx-filter.patch +++ /dev/null @@ -1,387 +0,0 @@ -From 81c354a5025995d3e5c88b63a3de64f9c0731f20 Mon Sep 17 00:00:00 2001 -Message-Id: <81c354a5025995d3e5c88b63a3de64f9c0731f20@dist-git> -From: Laine Stump -Date: Mon, 3 Nov 2014 10:00:18 -0500 -Subject: [PATCH] qemu: qemuMonitorQueryRxFilter - retrieve guest netdev - rx-filter - -https://bugzilla.redhat.com/show_bug.cgi?id=848199 - -This function can be called at any time to get the current status of a -guest's network device rx-filter. In particular it is useful to call -after libvirt recieves a NIC_RX_FILTER_CHANGED event - this event only -tells you that something has changed in the rx-filter, the details are -retrieved with the query-rx-filter monitor command (only available in -the json monitor). The command sent to the qemu monitor looks like this: - - {"execute":"query-rx-filter", "arguments": {"name":"net2"} }' - -and the results will look something like this: - -{ - "return": [ - { - "promiscuous": false, - "name": "net2", - "main-mac": "52:54:00:98:2d:e3", - "unicast": "normal", - "vlan": "normal", - "vlan-table": [ - 42, - 0 - ], - "unicast-table": [ - - ], - "multicast": "normal", - "multicast-overflow": false, - "unicast-overflow": false, - "multicast-table": [ - "33:33:ff:98:2d:e3", - "01:80:c2:00:00:21", - "01:00:5e:00:00:fb", - "33:33:ff:98:2d:e2", - "01:00:5e:00:00:01", - "33:33:00:00:00:01" - ], - "broadcast-allowed": false - } - ], - "id": "libvirt-14" -} - -This is all parsed from JSON into a virNetDevRxFilter object for -easier consumption. (unicast-table is usually empty, but is also an -array of mac addresses similar to multicast-table). - -(NB: LIBNL_CFLAGS was added to tests/Makefile.am because virnetdev.h -now includes util/virnetlink.h, which includes netlink/msg.h when -appropriate. Without LIBNL_CFLAGS, gcc can't find that file (if -libnl/netlink isn't available, LIBNL_CFLAGS will be empty and -virnetlink.h won't try to include netlink/msg.h anyway).) - -(cherry picked from commit ab989962d4c2ef9045a9b8344b8e6f4094027c7c) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor.c | 26 ++++++ - src/qemu/qemu_monitor.h | 4 + - src/qemu/qemu_monitor_json.c | 215 +++++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_monitor_json.h | 3 + - tests/Makefile.am | 1 + - 5 files changed, 249 insertions(+) - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 8e14366..be8d60b 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -2933,6 +2933,32 @@ int qemuMonitorRemoveNetdev(qemuMonitorPtr mon, - } - - -+int -+qemuMonitorQueryRxFilter(qemuMonitorPtr mon, const char *alias, -+ virNetDevRxFilterPtr *filter) -+{ -+ int ret = -1; -+ VIR_DEBUG("mon=%p alias=%s filter=%p", -+ mon, alias, filter); -+ -+ if (!mon) { -+ virReportError(VIR_ERR_INVALID_ARG, "%s", -+ _("monitor must not be NULL")); -+ return -1; -+ } -+ -+ -+ VIR_DEBUG("mon=%p, alias=%s", mon, alias); -+ -+ if (mon->json) -+ ret = qemuMonitorJSONQueryRxFilter(mon, alias, filter); -+ else -+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -+ _("query-rx-filter requires JSON monitor")); -+ return ret; -+} -+ -+ - int qemuMonitorGetPtyPaths(qemuMonitorPtr mon, - virHashTablePtr paths) - { -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index 5bffca8..cfcaf30 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -31,6 +31,7 @@ - # include "virbitmap.h" - # include "virhash.h" - # include "virjson.h" -+# include "virnetdev.h" - # include "device_conf.h" - # include "cpu/cpu.h" - -@@ -627,6 +628,9 @@ int qemuMonitorAddNetdev(qemuMonitorPtr mon, - int qemuMonitorRemoveNetdev(qemuMonitorPtr mon, - const char *alias); - -+int qemuMonitorQueryRxFilter(qemuMonitorPtr mon, const char *alias, -+ virNetDevRxFilterPtr *filter); -+ - int qemuMonitorGetPtyPaths(qemuMonitorPtr mon, - virHashTablePtr paths); - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index cad6be8..7a6d1e1 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -3297,6 +3297,221 @@ int qemuMonitorJSONRemoveNetdev(qemuMonitorPtr mon, - } - - -+static int -+qemuMonitorJSONQueryRxFilterParse(virJSONValuePtr msg, -+ virNetDevRxFilterPtr *filter) -+{ -+ int ret = -1; -+ const char *tmp; -+ virJSONValuePtr returnArray, entry, table, element; -+ int nTable; -+ size_t i; -+ virNetDevRxFilterPtr fil = virNetDevRxFilterNew(); -+ -+ if (!fil) -+ goto cleanup; -+ -+ if (!(returnArray = virJSONValueObjectGet(msg, "return"))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("query-rx-filter reply was missing return data")); -+ goto cleanup; -+ } -+ if (returnArray->type != VIR_JSON_TYPE_ARRAY) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("query-rx-filter return data was not an array")); -+ goto cleanup; -+ } -+ if (!(entry = virJSONValueArrayGet(returnArray, 0))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("query -rx-filter return data missing array element")); -+ goto cleanup; -+ } -+ -+ if (!(tmp = virJSONValueObjectGetString(entry, "name"))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid name " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if (VIR_STRDUP(fil->name, tmp) < 0) -+ goto cleanup; -+ if ((!(tmp = virJSONValueObjectGetString(entry, "main-mac"))) || -+ virMacAddrParse(tmp, &fil->mac) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'main-mac' " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if (virJSONValueObjectGetBoolean(entry, "promiscuous", -+ &fil->promiscuous) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'promiscuous' " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if (virJSONValueObjectGetBoolean(entry, "broadcast-allowed", -+ &fil->broadcastAllowed) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'broadcast-allowed' " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ -+ if ((!(tmp = virJSONValueObjectGetString(entry, "unicast"))) || -+ ((fil->unicast.mode -+ = virNetDevRxFilterModeTypeFromString(tmp)) < 0)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'unicast' " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if (virJSONValueObjectGetBoolean(entry, "unicast-overflow", -+ &fil->unicast.overflow) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'unicast-overflow' " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if ((!(table = virJSONValueObjectGet(entry, "unicast-table"))) || -+ ((nTable = virJSONValueArraySize(table)) < 0)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'unicast-table' array " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if (VIR_ALLOC_N(fil->unicast.table, nTable)) -+ goto cleanup; -+ for (i = 0; i < nTable; i++) { -+ if (!(element = virJSONValueArrayGet(table, i)) || -+ !(tmp = virJSONValueGetString(element))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("Missing or invalid element %zu of 'unicast' " -+ "list in query-rx-filter response"), i); -+ goto cleanup; -+ } -+ if (virMacAddrParse(tmp, &fil->unicast.table[i]) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("invalid mac address '%s' in 'unicast-table' " -+ "array in query-rx-filter response"), tmp); -+ goto cleanup; -+ } -+ } -+ fil->unicast.nTable = nTable; -+ -+ if ((!(tmp = virJSONValueObjectGetString(entry, "multicast"))) || -+ ((fil->multicast.mode -+ = virNetDevRxFilterModeTypeFromString(tmp)) < 0)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'multicast' " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if (virJSONValueObjectGetBoolean(entry, "multicast-overflow", -+ &fil->multicast.overflow) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'multicast-overflow' " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if ((!(table = virJSONValueObjectGet(entry, "multicast-table"))) || -+ ((nTable = virJSONValueArraySize(table)) < 0)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'multicast-table' array " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if (VIR_ALLOC_N(fil->multicast.table, nTable)) -+ goto cleanup; -+ for (i = 0; i < nTable; i++) { -+ if (!(element = virJSONValueArrayGet(table, i)) || -+ !(tmp = virJSONValueGetString(element))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("Missing or invalid element %zu of 'multicast' " -+ "list in query-rx-filter response"), i); -+ goto cleanup; -+ } -+ if (virMacAddrParse(tmp, &fil->multicast.table[i]) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("invalid mac address '%s' in 'multicast-table' " -+ "array in query-rx-filter response"), tmp); -+ goto cleanup; -+ } -+ } -+ fil->multicast.nTable = nTable; -+ -+ if ((!(tmp = virJSONValueObjectGetString(entry, "vlan"))) || -+ ((fil->vlan.mode -+ = virNetDevRxFilterModeTypeFromString(tmp)) < 0)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'vlan' " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if ((!(table = virJSONValueObjectGet(entry, "vlan-table"))) || -+ ((nTable = virJSONValueArraySize(table)) < 0)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Missing or invalid 'vlan-table' array " -+ "in query-rx-filter response")); -+ goto cleanup; -+ } -+ if (VIR_ALLOC_N(fil->vlan.table, nTable)) -+ goto cleanup; -+ for (i = 0; i < nTable; i++) { -+ if (!(element = virJSONValueArrayGet(table, i)) || -+ virJSONValueGetNumberUint(element, &fil->vlan.table[i]) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("Missing or invalid element %zu of 'vlan-table' " -+ "array in query-rx-filter response"), i); -+ goto cleanup; -+ } -+ } -+ fil->vlan.nTable = nTable; -+ -+ ret = 0; -+ cleanup: -+ if (ret < 0) { -+ virNetDevRxFilterFree(fil); -+ fil = NULL; -+ } -+ *filter = fil; -+ return ret; -+} -+ -+ -+int -+qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias, -+ virNetDevRxFilterPtr *filter) -+{ -+ int ret = -1; -+ virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-rx-filter", -+ "s:name", alias, -+ NULL); -+ virJSONValuePtr reply = NULL; -+ -+ if (!cmd) -+ goto cleanup; -+ -+ if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) -+ goto cleanup; -+ -+ if (qemuMonitorJSONQueryRxFilterParse(reply, filter) < 0) -+ goto cleanup; -+ -+ ret = 0; -+ cleanup: -+ if (ret == 0) -+ ret = qemuMonitorJSONCheckError(cmd, reply); -+ -+ if (ret < 0) { -+ virNetDevRxFilterFree(*filter); -+ *filter = NULL; -+ } -+ virJSONValueFree(cmd); -+ virJSONValueFree(reply); -+ return ret; -+} -+ -+ - /* - * Example return data - * -diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index 289bd11..8d88c6d 100644 ---- a/src/qemu/qemu_monitor_json.h -+++ b/src/qemu/qemu_monitor_json.h -@@ -210,6 +210,9 @@ int qemuMonitorJSONAddNetdev(qemuMonitorPtr mon, - int qemuMonitorJSONRemoveNetdev(qemuMonitorPtr mon, - const char *alias); - -+int qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias, -+ virNetDevRxFilterPtr *filter); -+ - int qemuMonitorJSONGetPtyPaths(qemuMonitorPtr mon, - virHashTablePtr paths); - -diff --git a/tests/Makefile.am b/tests/Makefile.am -index d6c3cfb..110effd 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -35,6 +35,7 @@ AM_CFLAGS = \ - -Dabs_builddir="\"$(abs_builddir)\"" \ - -Dabs_srcdir="\"$(abs_srcdir)\"" \ - $(LIBXML_CFLAGS) \ -+ $(LIBNL_CFLAGS) \ - $(GNUTLS_CFLAGS) \ - $(SASL_CFLAGS) \ - $(SELINUX_CFLAGS) \ --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-raise-an-error-when-trying-to-use-readonly-sata-disks.patch b/SOURCES/libvirt-qemu-raise-an-error-when-trying-to-use-readonly-sata-disks.patch deleted file mode 100644 index d1aa484..0000000 --- a/SOURCES/libvirt-qemu-raise-an-error-when-trying-to-use-readonly-sata-disks.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 434be9a2661b53b45d592611d45d81fda8dc4510 Mon Sep 17 00:00:00 2001 -Message-Id: <434be9a2661b53b45d592611d45d81fda8dc4510@dist-git> -From: Giuseppe Scrivano -Date: Mon, 22 Sep 2014 17:33:45 +0200 -Subject: [PATCH] qemu: raise an error when trying to use readonly sata disks - -commit 72f919f558902968bd0cf9f99f25ac62cbfe3ac6 introduced an user -friendly error message when trying to use IDE disks as readonly. - -Do the same thing for the SATA bus. - -Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1112939 - -Signed-off-by: Giuseppe Scrivano -(cherry picked from commit 75d6f42f427506a97be086e986d00778f46671d1) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 16 +++++++++++----- - 1 file changed, 11 insertions(+), 5 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 82ee58b..05f328a 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -3507,11 +3507,17 @@ qemuBuildDriveStr(virConnectPtr conn, - virBufferAddLit(&opt, ",boot=on"); - if (disk->src->readonly && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_READONLY)) { -- if (disk->bus == VIR_DOMAIN_DISK_BUS_IDE && -- disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- _("readonly ide disks are not supported")); -- goto error; -+ if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) { -+ if (disk->bus == VIR_DOMAIN_DISK_BUS_IDE) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("readonly ide disks are not supported")); -+ goto error; -+ } -+ if (disk->bus == VIR_DOMAIN_DISK_BUS_SATA) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("readonly sata disks are not supported")); -+ goto error; -+ } - } - virBufferAddLit(&opt, ",readonly=on"); - } --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-read-backing-chain-names-from-qemu.patch b/SOURCES/libvirt-qemu-read-backing-chain-names-from-qemu.patch deleted file mode 100644 index 00ff877..0000000 --- a/SOURCES/libvirt-qemu-read-backing-chain-names-from-qemu.patch +++ /dev/null @@ -1,329 +0,0 @@ -From 1aefc4d0bab87ed9b1a531fad029cb0c24db220f Mon Sep 17 00:00:00 2001 -Message-Id: <1aefc4d0bab87ed9b1a531fad029cb0c24db220f@dist-git> -From: Eric Blake -Date: Tue, 17 Mar 2015 15:12:49 -0600 -Subject: [PATCH] qemu: read backing chain names from qemu - -7.1.z: https://bugzilla.redhat.com/show_bug.cgi?id=1203119 -7.2: https://bugzilla.redhat.com/show_bug.cgi?id=1199182 - -https://bugzilla.redhat.com/show_bug.cgi?id=1199182 documents that -after a series of disk snapshots into existing destination images, -followed by active commits of the top image, it is possible for -qemu 2.2 and earlier to end up tracking a different name for the -image than what it would have had when opening the chain afresh. -That is, when starting with the chain 'a <- b <- c', the name -associated with 'b' is how it was spelled in the metadata of 'c', -but when starting with 'a', taking two snapshots into 'a <- b <- c', -then committing 'c' back into 'b', the name associated with 'b' is -now the name used when taking the first snapshot. - -Sadly, older qemu doesn't know how to treat different spellings of -the same filename as identical files (it uses strcmp() instead of -checking for the same inode), which means libvirt's attempt to -commit an image using solely the names learned from qcow2 metadata -fails with a cryptic: - -error: internal error: unable to execute QEMU command 'block-commit': Top image file /tmp/images/c/../b/b not found - -even though the file exists. Trying to teach libvirt the rules on -which name qemu will expect is not worth the effort (besides, we'd -have to remember it across libvirtd restarts, and track whether a -file was opened via metadata or via snapshot creation for a given -qemu process); it is easier to just always directly ask qemu what -string it expects to see in the first place. - -As a safety valve, we validate that any name returned by qemu -still maps to the same local file as we have tracked it, so that -a compromised qemu cannot accidentally cause us to act on an -incorrect file. - -* src/qemu/qemu_monitor.h (qemuMonitorDiskNameLookup): New -prototype. -* src/qemu/qemu_monitor_json.h (qemuMonitorJSONDiskNameLookup): -Likewise. -* src/qemu/qemu_monitor.c (qemuMonitorDiskNameLookup): New function. -* src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskNameLookup) -(qemuMonitorJSONDiskNameLookupOne): Likewise. -* src/qemu/qemu_driver.c (qemuDomainBlockCommit) -(qemuDomainBlockJobImpl): Use it. - -Signed-off-by: Eric Blake -(cherry picked from commit f9ea3d60119e82c02c00fbf3678c3ed20634dea1) - -Conflicts: - src/qemu/qemu_driver.c - context with older monitor wrap semantics -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 28 ++++++------ - src/qemu/qemu_monitor.c | 18 ++++++++ - src/qemu/qemu_monitor.h | 8 +++- - src/qemu/qemu_monitor_json.c | 102 ++++++++++++++++++++++++++++++++++++++++++- - src/qemu/qemu_monitor_json.h | 9 +++- - 5 files changed, 148 insertions(+), 17 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 9dc243a..4293817 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -15720,9 +15720,6 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm, - goto endjob; - - if (baseSource) { -- if (qemuGetDriveSourceString(baseSource, NULL, &basePath) < 0) -- goto endjob; -- - if (flags & VIR_DOMAIN_BLOCK_REBASE_RELATIVE) { - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CHANGE_BACKING_FILE)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -@@ -15746,8 +15743,12 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm, - } - - qemuDomainObjEnterMonitor(driver, vm); -- ret = qemuMonitorBlockJob(priv->mon, device, basePath, backingPath, -- bandwidth, info, mode, async); -+ if (baseSource) -+ basePath = qemuMonitorDiskNameLookup(priv->mon, device, disk->src, -+ baseSource); -+ if (!baseSource || basePath) -+ ret = qemuMonitorBlockJob(priv->mon, device, basePath, backingPath, -+ bandwidth, info, mode, async); - qemuDomainObjExitMonitor(driver, vm); - if (info && info->type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT && - disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT) -@@ -16313,12 +16314,6 @@ qemuDomainBlockCommit(virDomainPtr dom, - VIR_DISK_CHAIN_READ_WRITE) < 0)) - goto endjob; - -- if (qemuGetDriveSourceString(topSource, NULL, &topPath) < 0) -- goto endjob; -- -- if (qemuGetDriveSourceString(baseSource, NULL, &basePath) < 0) -- goto endjob; -- - if (flags & VIR_DOMAIN_BLOCK_COMMIT_RELATIVE && - topSource != disk->src) { - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CHANGE_BACKING_FILE)) { -@@ -16349,9 +16344,14 @@ qemuDomainBlockCommit(virDomainPtr dom, - disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT; - } - qemuDomainObjEnterMonitor(driver, vm); -- ret = qemuMonitorBlockCommit(priv->mon, device, -- topPath, basePath, backingPath, -- bandwidth); -+ basePath = qemuMonitorDiskNameLookup(priv->mon, device, disk->src, -+ baseSource); -+ topPath = qemuMonitorDiskNameLookup(priv->mon, device, disk->src, -+ topSource); -+ if (basePath && topPath) -+ ret = qemuMonitorBlockCommit(priv->mon, device, -+ topPath, basePath, backingPath, -+ bandwidth); - qemuDomainObjExitMonitor(driver, vm); - - if (ret == 0) -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 0b1b80e..2bb6fdb 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -3464,6 +3464,24 @@ qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon) - } - - -+/* Determine the name that qemu is using for tracking the backing -+ * element TARGET within the chain starting at TOP. */ -+char * -+qemuMonitorDiskNameLookup(qemuMonitorPtr mon, -+ const char *device, -+ virStorageSourcePtr top, -+ virStorageSourcePtr target) -+{ -+ if (!mon->json) { -+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -+ _("JSON monitor is required")); -+ return NULL; -+ } -+ -+ return qemuMonitorJSONDiskNameLookup(mon, device, top, target); -+} -+ -+ - /* Use the block-job-complete monitor command to pivot a block copy - * job. */ - int -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index 8930744..df6a8c0 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -1,7 +1,7 @@ - /* - * qemu_monitor.h: interaction with QEMU monitor console - * -- * Copyright (C) 2006-2014 Red Hat, Inc. -+ * Copyright (C) 2006-2015 Red Hat, Inc. - * Copyright (C) 2006 Daniel P. Berrange - * - * This library is free software; you can redistribute it and/or -@@ -739,6 +739,12 @@ int qemuMonitorBlockCommit(qemuMonitorPtr mon, - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_NONNULL(4); - bool qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon); -+char *qemuMonitorDiskNameLookup(qemuMonitorPtr mon, -+ const char *device, -+ virStorageSourcePtr top, -+ virStorageSourcePtr target) -+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) -+ ATTRIBUTE_NONNULL(4); - - int qemuMonitorArbitraryCommand(qemuMonitorPtr mon, - const char *cmd, -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 9b3d17a..e58c88b 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -1,7 +1,7 @@ - /* - * qemu_monitor_json.c: interaction with QEMU monitor console - * -- * Copyright (C) 2006-2014 Red Hat, Inc. -+ * Copyright (C) 2006-2015 Red Hat, Inc. - * Copyright (C) 2006 Daniel P. Berrange - * - * This library is free software; you can redistribute it and/or -@@ -4221,6 +4221,106 @@ qemuMonitorJSONDrivePivot(qemuMonitorPtr mon, const char *device, - } - - -+static char * -+qemuMonitorJSONDiskNameLookupOne(virJSONValuePtr image, -+ virStorageSourcePtr top, -+ virStorageSourcePtr target) -+{ -+ virJSONValuePtr backing; -+ char *ret; -+ -+ /* The caller will report a generic message if we return NULL -+ * without an error; but in some cases we can improve by reporting -+ * a more specific message. */ -+ if (!top || !image) -+ return NULL; -+ if (top != target) { -+ backing = virJSONValueObjectGet(image, "backing-image"); -+ return qemuMonitorJSONDiskNameLookupOne(backing, top->backingStore, -+ target); -+ } -+ if (VIR_STRDUP(ret, virJSONValueObjectGetString(image, "filename")) < 0) -+ return NULL; -+ /* Sanity check - the name qemu gave us should resolve to the same -+ file tracked by our target description. */ -+ if (virStorageSourceIsLocalStorage(target) && -+ STRNEQ(ret, target->path) && -+ !virFileLinkPointsTo(ret, target->path)) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("qemu block name '%s' doesn't match expected '%s'"), -+ ret, target->path); -+ VIR_FREE(ret); -+ } -+ return ret; -+} -+ -+ -+char * -+qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon, -+ const char *device, -+ virStorageSourcePtr top, -+ virStorageSourcePtr target) -+{ -+ char *ret = NULL; -+ virJSONValuePtr cmd = NULL; -+ virJSONValuePtr reply = NULL; -+ virJSONValuePtr devices; -+ size_t i; -+ -+ cmd = qemuMonitorJSONMakeCommand("query-block", NULL); -+ if (!cmd) -+ return NULL; -+ if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) -+ goto cleanup; -+ -+ devices = virJSONValueObjectGet(reply, "return"); -+ if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("block info reply was missing device list")); -+ goto cleanup; -+ } -+ -+ for (i = 0; i < virJSONValueArraySize(devices); i++) { -+ virJSONValuePtr dev = virJSONValueArrayGet(devices, i); -+ virJSONValuePtr inserted; -+ virJSONValuePtr image; -+ const char *thisdev; -+ -+ if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("block info device entry was not in expected format")); -+ goto cleanup; -+ } -+ -+ if (!(thisdev = virJSONValueObjectGetString(dev, "device"))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("block info device entry was not in expected format")); -+ goto cleanup; -+ } -+ -+ if (STREQ(thisdev, device)) { -+ if ((inserted = virJSONValueObjectGet(dev, "inserted")) && -+ (image = virJSONValueObjectGet(inserted, "image"))) { -+ ret = qemuMonitorJSONDiskNameLookupOne(image, top, target); -+ } -+ break; -+ } -+ } -+ /* Guarantee an error when returning NULL, but don't override a -+ * more specific error if one was already generated. */ -+ if (!ret && !virGetLastError()) -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("unable to find backing name for device %s"), -+ device); -+ -+ cleanup: -+ virJSONValueFree(cmd); -+ virJSONValueFree(reply); -+ -+ return ret; -+} -+ -+ - int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon, - const char *cmd_str, - char **reply_str, -diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index ff20029..1028802 100644 ---- a/src/qemu/qemu_monitor_json.h -+++ b/src/qemu/qemu_monitor_json.h -@@ -1,7 +1,7 @@ - /* - * qemu_monitor_json.h: interaction with QEMU monitor console - * -- * Copyright (C) 2006-2009, 2011-2014 Red Hat, Inc. -+ * Copyright (C) 2006-2009, 2011-2015 Red Hat, Inc. - * Copyright (C) 2006 Daniel P. Berrange - * - * This library is free software; you can redistribute it and/or -@@ -280,6 +280,13 @@ int qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, - unsigned long long bandwidth) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - -+char *qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon, -+ const char *device, -+ virStorageSourcePtr top, -+ virStorageSourcePtr target) -+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) -+ ATTRIBUTE_NONNULL(4); -+ - int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon, - const char *cmd_str, - char **reply_str, --- -2.3.3 - diff --git a/SOURCES/libvirt-qemu-remove-deadcode-in-qemuDomain-HelperGetVcpus-GetIOThreadsLive.patch b/SOURCES/libvirt-qemu-remove-deadcode-in-qemuDomain-HelperGetVcpus-GetIOThreadsLive.patch new file mode 100644 index 0000000..c9e14f0 --- /dev/null +++ b/SOURCES/libvirt-qemu-remove-deadcode-in-qemuDomain-HelperGetVcpus-GetIOThreadsLive.patch @@ -0,0 +1,59 @@ +From 967db74af2bc58af78339a40a079759ec265b8ad Mon Sep 17 00:00:00 2001 +Message-Id: <967db74af2bc58af78339a40a079759ec265b8ad@dist-git> +From: Luyao Huang +Date: Wed, 5 Aug 2015 18:18:06 +0200 +Subject: [PATCH] qemu: remove deadcode in + qemuDomain{HelperGetVcpus|GetIOThreadsLive} + +We set @hostcpus variable but not use it. + +Signed-off-by: Luyao Huang +(cherry picked from commit 3b2b4114da4341feaf477cec7bc20556810e11e7) + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713 + +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index c59186d..8f5e4fb 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -1427,13 +1427,9 @@ static int + qemuDomainHelperGetVcpus(virDomainObjPtr vm, virVcpuInfoPtr info, int maxinfo, + unsigned char *cpumaps, int maplen) + { +- int hostcpus; + size_t i, v; + qemuDomainObjPrivatePtr priv = vm->privateData; + +- if ((hostcpus = nodeGetCPUCount()) < 0) +- return -1; +- + if (priv->vcpupids == NULL) { + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cpu affinity is not supported")); +@@ -5599,7 +5595,6 @@ qemuDomainGetIOThreadsLive(virQEMUDriverPtr driver, + qemuMonitorIOThreadInfoPtr *iothreads = NULL; + virDomainIOThreadInfoPtr *info_ret = NULL; + int niothreads = 0; +- int hostcpus; + size_t i; + int ret = -1; + +@@ -5632,9 +5627,6 @@ qemuDomainGetIOThreadsLive(virQEMUDriverPtr driver, + goto endjob; + } + +- if ((hostcpus = nodeGetCPUCount()) < 0) +- goto endjob; +- + if (VIR_ALLOC_N(info_ret, niothreads) < 0) + goto endjob; + +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu-report-error-for-non-existing-disk-in-blockjobinfo.patch b/SOURCES/libvirt-qemu-report-error-for-non-existing-disk-in-blockjobinfo.patch new file mode 100644 index 0000000..81374ec --- /dev/null +++ b/SOURCES/libvirt-qemu-report-error-for-non-existing-disk-in-blockjobinfo.patch @@ -0,0 +1,45 @@ +From aa35a16bdc42e64f646b5fa09cdf5809b98e507f Mon Sep 17 00:00:00 2001 +Message-Id: +From: Luyao Huang +Date: Fri, 10 Jul 2015 09:27:56 +0200 +Subject: [PATCH] qemu: report error for non-existing disk in blockjobinfo + +Before: + + # virsh blockjob r7 vdc + error: An error occurred, but the cause is unknown + +After: + + # virsh blockjob r7 vdc + error: Disk 'vdc' not found in the domain + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1241355 + +Signed-off-by: Luyao Huang +(cherry picked from commit b5c2245b0cddbb605fece8d8f3c7075d269e3302) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index b3e9e63..063bedb 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -16515,8 +16515,11 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, + if (qemuDomainSupportsBlockJobs(vm, NULL) < 0) + goto endjob; + +- if (!(disk = virDomainDiskByName(vm->def, path, true))) ++ if (!(disk = virDomainDiskByName(vm->def, path, true))) { ++ virReportError(VIR_ERR_INVALID_ARG, ++ _("disk %s not found in the domain"), path); + goto endjob; ++ } + + qemuDomainObjEnterMonitor(driver, vm); + ret = qemuMonitorGetBlockJobInfo(qemuDomainGetMonitor(vm), +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu-restore-Fix-restoring-of-VM-when-the-restore-hook-returns-empty-XML.patch b/SOURCES/libvirt-qemu-restore-Fix-restoring-of-VM-when-the-restore-hook-returns-empty-XML.patch deleted file mode 100644 index 8513e29..0000000 --- a/SOURCES/libvirt-qemu-restore-Fix-restoring-of-VM-when-the-restore-hook-returns-empty-XML.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 12f71d1ec11e0acaf369b16a9bd6965f69f94e74 Mon Sep 17 00:00:00 2001 -Message-Id: <12f71d1ec11e0acaf369b16a9bd6965f69f94e74@dist-git> -From: Peter Krempa -Date: Wed, 22 Oct 2014 18:29:46 +0200 -Subject: [PATCH] qemu: restore: Fix restoring of VM when the restore hook - returns empty XML - -https://bugzilla.redhat.com/show_bug.cgi?id=1142693 - -The documentation for the restore hook states that returning an empty -XML is equivalent with copying the input. There was a bug in the code -checking the returned string by checking the string instead of the -contents. Use the new helper to check if the string is empty. - -(cherry picked from commit e38677993734e9af3dbd0589e1cecd0b75f7e757) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 4c57fcd..039b987 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -5727,7 +5727,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, - &xmlout)) < 0) - goto cleanup; - -- if (hookret == 0 && xmlout) { -+ if (hookret == 0 && !virStringIsEmpty(xmlout)) { - VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout); - hook_taint = true; - newxml = xmlout; -@@ -5943,7 +5943,7 @@ qemuDomainObjRestore(virConnectPtr conn, - NULL, xml, &xmlout)) < 0) - goto cleanup; - -- if (hookret == 0 && xmlout) { -+ if (hookret == 0 && !virStringIsEmpty(xmlout)) { - virDomainDefPtr tmp; - - VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-save-domain-status-after-set-domain-s-numa-parameters.patch b/SOURCES/libvirt-qemu-save-domain-status-after-set-domain-s-numa-parameters.patch deleted file mode 100644 index 690c661..0000000 --- a/SOURCES/libvirt-qemu-save-domain-status-after-set-domain-s-numa-parameters.patch +++ /dev/null @@ -1,118 +0,0 @@ -From bfa70528ef83f6bf596494ebe4bdc34f15648378 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Shanzhi Yu -Date: Wed, 22 Oct 2014 09:54:38 +0200 -Subject: [PATCH] qemu: save domain status after set domain's numa parameters - -After set domain's numa parameters for running domain, save the change, -save the change into live xml is needed to survive restarting the libvirtd, -same story with bug 1146511; meanwihle add call -qemuDomainObjBeginJob/qemuDomainObjEndJob in qemuDomainSetNumaParameters - -Signed-off-by: Shanzhi Yu -(cherry picked from commit 566d5de7bf9b7218ba0c7025046d4d28f3414e60) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146511 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 30 ++++++++++++++++++++---------- - 1 file changed, 20 insertions(+), 10 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 90f81a0..3c1d2f5 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -8987,15 +8987,18 @@ qemuDomainSetNumaParameters(virDomainPtr dom, - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; - -+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -+ goto cleanup; -+ - if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags, - &persistentDef) < 0) -- goto cleanup; -+ goto endjob; - - if (flags & VIR_DOMAIN_AFFECT_LIVE) { - if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("cgroup cpuset controller is not mounted")); -- goto cleanup; -+ goto endjob; - } - } - -@@ -9008,18 +9011,18 @@ qemuDomainSetNumaParameters(virDomainPtr dom, - if (mode < 0 || mode >= VIR_DOMAIN_NUMATUNE_MEM_LAST) { - virReportError(VIR_ERR_INVALID_ARG, - _("unsupported numatune mode: '%d'"), mode); -- goto cleanup; -+ goto endjob; - } - - } else if (STREQ(param->field, VIR_DOMAIN_NUMA_NODESET)) { - if (virBitmapParse(param->value.s, 0, &nodeset, - VIR_DOMAIN_CPUMASK_LEN) < 0) -- goto cleanup; -+ goto endjob; - - if (virBitmapIsAllClear(nodeset)) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("Invalid nodeset for numatune")); -- goto cleanup; -+ goto endjob; - } - } - } -@@ -9029,18 +9032,21 @@ qemuDomainSetNumaParameters(virDomainPtr dom, - virDomainNumatuneGetMode(vm->def->numatune, -1) != mode) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("can't change numatune mode for running domain")); -- goto cleanup; -+ goto endjob; - } - - if (nodeset && - qemuDomainSetNumaParamsLive(vm, caps, nodeset) < 0) -- goto cleanup; -+ goto endjob; - - if (virDomainNumatuneSet(&vm->def->numatune, - vm->def->placement_mode == - VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC, - -1, mode, nodeset) < 0) -- goto cleanup; -+ goto endjob; -+ -+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) -+ goto endjob; - } - - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { -@@ -9048,14 +9054,18 @@ qemuDomainSetNumaParameters(virDomainPtr dom, - persistentDef->placement_mode == - VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC, - -1, mode, nodeset) < 0) -- goto cleanup; -+ goto endjob; - - if (virDomainSaveConfig(cfg->configDir, persistentDef) < 0) -- goto cleanup; -+ goto endjob; - } - - ret = 0; - -+ endjob: -+ if (!qemuDomainObjEndJob(driver, vm)) -+ vm = NULL; -+ - cleanup: - virBitmapFree(nodeset); - if (vm) --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-save-domain-status-after-set-the-blkio-parameters.patch b/SOURCES/libvirt-qemu-save-domain-status-after-set-the-blkio-parameters.patch deleted file mode 100644 index 85d0b4e..0000000 --- a/SOURCES/libvirt-qemu-save-domain-status-after-set-the-blkio-parameters.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 34202c841fb328d20be3ea0618996940e187f3f9 Mon Sep 17 00:00:00 2001 -Message-Id: <34202c841fb328d20be3ea0618996940e187f3f9@dist-git> -From: Shanzhi Yu -Date: Wed, 22 Oct 2014 09:54:36 +0200 -Subject: [PATCH] qemu: save domain status after set the blkio parameters - -After set the blkio parameters for running domain, save the change into -live xml is needed to survive restarting the libvirtd, same story with -bug 1146511, meanwhile add call qemuDomainObjBeginJob/qemuDomainObjEndJob -in qemuDomainSetBlkioParameters - -Signed-off-by: Shanzhi Yu -(cherry picked from commit bde879c1847f8181ca144c0807ae83906de8440d) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146511 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 36b394e..12a32ec 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -7993,15 +7993,18 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; - -+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -+ goto cleanup; -+ - if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags, - &persistentDef) < 0) -- goto cleanup; -+ goto endjob; - - if (flags & VIR_DOMAIN_AFFECT_LIVE) { - if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_BLKIO)) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("blkio cgroup isn't mounted")); -- goto cleanup; -+ goto endjob; - } - } - -@@ -8094,9 +8097,12 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, - VIR_FREE(devices); - } - } -+ -+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) -+ goto endjob; - } - if (ret < 0) -- goto cleanup; -+ goto endjob; - if (flags & VIR_DOMAIN_AFFECT_CONFIG) { - /* Clang can't see that if we get here, persistentDef was set. */ - sa_assert(persistentDef); -@@ -8134,6 +8140,10 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, - ret = -1; - } - -+ endjob: -+ if (!qemuDomainObjEndJob(driver, vm)) -+ vm = NULL; -+ - cleanup: - if (vm) - virObjectUnlock(vm); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-save-image-Add-possibility-to-return-XML-stored-in-the-image.patch b/SOURCES/libvirt-qemu-save-image-Add-possibility-to-return-XML-stored-in-the-image.patch deleted file mode 100644 index 7b7e2d9..0000000 --- a/SOURCES/libvirt-qemu-save-image-Add-possibility-to-return-XML-stored-in-the-image.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 92e5050e1616027fe779250891e380deb0191a6d Mon Sep 17 00:00:00 2001 -Message-Id: <92e5050e1616027fe779250891e380deb0191a6d@dist-git> -From: Peter Krempa -Date: Mon, 22 Sep 2014 17:52:37 +0200 -Subject: [PATCH] qemu: save image: Add possibility to return XML stored in the - image - -https://bugzilla.redhat.com/show_bug.cgi?id=1142693 - -Add a new parameter that will allow to return the XML stored in the save -image for further manipulation and adjust the callers. This option will -be used in later patches. - -(cherry picked from commit eb9595b7250880a7a49a4944ad01a8beb7c52be3) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 18 +++++++++++------- - 1 file changed, 11 insertions(+), 7 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 73aad99..530caef 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -5389,6 +5389,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - const char *path, - virDomainDefPtr *ret_def, - virQEMUSaveHeaderPtr ret_header, -+ char **xmlout, - bool bypass_cache, - virFileWrapperFdPtr *wrapperFd, - const char *xmlin, int state, bool edit, -@@ -5511,7 +5512,10 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - def = tmp; - } - -- VIR_FREE(xml); -+ if (xmlout) -+ *xmlout = xml; -+ else -+ VIR_FREE(xml); - - *ret_def = def; - *ret_header = header; -@@ -5667,7 +5671,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, - else if (flags & VIR_DOMAIN_SAVE_PAUSED) - state = 0; - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, - (flags & VIR_DOMAIN_SAVE_BYPASS_CACHE) != 0, - &wrapperFd, dxml, state, false, false); - if (fd < 0) -@@ -5728,8 +5732,8 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path, - /* We only take subset of virDomainDefFormat flags. */ - virCheckFlags(VIR_DOMAIN_XML_SECURE, NULL); - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, false, NULL, -- NULL, -1, false, false); -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, -+ false, NULL, NULL, -1, false, false); - - if (fd < 0) - goto cleanup; -@@ -5766,8 +5770,8 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - else if (flags & VIR_DOMAIN_SAVE_PAUSED) - state = 0; - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, false, NULL, -- dxml, state, true, false); -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, -+ false, NULL, dxml, state, true, false); - - if (fd < 0) { - /* Check for special case of no change needed. */ -@@ -5831,7 +5835,7 @@ qemuDomainObjRestore(virConnectPtr conn, - virQEMUSaveHeader header; - virFileWrapperFdPtr wrapperFd = NULL; - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, - bypass_cache, &wrapperFd, NULL, -1, false, - true); - if (fd < 0) { --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-save-image-Split-out-checks-done-only-when-editing-the-save-img.patch b/SOURCES/libvirt-qemu-save-image-Split-out-checks-done-only-when-editing-the-save-img.patch deleted file mode 100644 index c8762e3..0000000 --- a/SOURCES/libvirt-qemu-save-image-Split-out-checks-done-only-when-editing-the-save-img.patch +++ /dev/null @@ -1,181 +0,0 @@ -From 5c6c436d14fa9f504f5889f3e60fdecc65208b26 Mon Sep 17 00:00:00 2001 -Message-Id: <5c6c436d14fa9f504f5889f3e60fdecc65208b26@dist-git> -From: Peter Krempa -Date: Mon, 22 Sep 2014 17:52:39 +0200 -Subject: [PATCH] qemu: save image: Split out checks done only when editing the - save img - -https://bugzilla.redhat.com/show_bug.cgi?id=1142693 - -Move them to the single corresponding function rather than having them -in the common chunk of code. - -(cherry picked from commit 3035123d65714975dcc8527289fe68c7b5d3526f) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 76 +++++++++++++++++++++++++++----------------------- - 1 file changed, 41 insertions(+), 35 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 96c7dd2..580ac17 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -5380,10 +5380,22 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, - } - - --/* Return -1 on most failures after raising error, -2 if edit was specified -- * but xmlin and state (-1 for no change, 0 for paused, 1 for running) do -- * not represent any changes (no error raised), -3 if corrupt image was -- * unlinked (no error raised), and opened fd on success. */ -+/** -+ * qemuDomainSaveImageOpen: -+ * @driver: qemu driver data -+ * @path: path of the save image -+ * @ret_def: returns domain definition created from the XML stored in the image -+ * @ret_header: returns structure filled with data from the image header -+ * @xmlout: returns the XML from the image file (may be NULL) -+ * @bypass_cache: bypass cache when opening the file -+ * @wrapperFd: returns the file wrapper structure -+ * @open_write: open the file for writing (for updates) -+ * @unlink_corrupt: remove the image file if it is corrupted -+ * -+ * Returns the opened fd of the save image file and fills the apropriate fields -+ * on success. On error returns -1 on most failures, -3 if corrupt image was -+ * unlinked (no error raised). -+ */ - static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) - qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - const char *path, -@@ -5392,14 +5404,14 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - char **xmlout, - bool bypass_cache, - virFileWrapperFdPtr *wrapperFd, -- const char *xmlin, int state, bool edit, -+ bool open_write, - bool unlink_corrupt) - { - int fd = -1; - virQEMUSaveHeader header; - char *xml = NULL; - virDomainDefPtr def = NULL; -- int oflags = edit ? O_RDWR : O_RDONLY; -+ int oflags = open_write ? O_RDWR : O_RDONLY; - virCapsPtr caps = NULL; - - if (bypass_cache) { -@@ -5484,18 +5496,6 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - goto error; - } - -- if (edit && STREQ(xml, xmlin) && -- (state < 0 || state == header.was_running)) { -- VIR_FREE(xml); -- if (VIR_CLOSE(fd) < 0) { -- virReportSystemError(errno, _("cannot close file: %s"), path); -- goto error; -- } -- return -2; -- } -- if (state >= 0) -- header.was_running = state; -- - /* Create a domain from this XML */ - if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt, - QEMU_EXPECTED_VIRT_TYPES, -@@ -5650,21 +5650,15 @@ qemuDomainRestoreFlags(virConnectPtr conn, - int ret = -1; - virQEMUSaveHeader header; - virFileWrapperFdPtr wrapperFd = NULL; -- int state = -1; - - virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE | - VIR_DOMAIN_SAVE_RUNNING | - VIR_DOMAIN_SAVE_PAUSED, -1); - - -- if (flags & VIR_DOMAIN_SAVE_RUNNING) -- state = 1; -- else if (flags & VIR_DOMAIN_SAVE_PAUSED) -- state = 0; -- - fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, - (flags & VIR_DOMAIN_SAVE_BYPASS_CACHE) != 0, -- &wrapperFd, dxml, state, false, false); -+ &wrapperFd, false, false); - if (fd < 0) - goto cleanup; - -@@ -5687,6 +5681,11 @@ qemuDomainRestoreFlags(virConnectPtr conn, - goto cleanup; - def = NULL; - -+ if (flags & VIR_DOMAIN_SAVE_RUNNING) -+ header.was_running = 1; -+ else if (flags & VIR_DOMAIN_SAVE_PAUSED) -+ header.was_running = 0; -+ - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) - goto cleanup; - -@@ -5732,7 +5731,7 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path, - virCheckFlags(VIR_DOMAIN_XML_SECURE, NULL); - - fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, -- false, NULL, NULL, -1, false, false); -+ false, NULL, false, false); - - if (fd < 0) - goto cleanup; -@@ -5770,22 +5769,30 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - else if (flags & VIR_DOMAIN_SAVE_PAUSED) - state = 0; - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, -- false, NULL, dxml, state, true, false); -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &header, &xml, -+ false, NULL, true, false); - -- if (fd < 0) { -- /* Check for special case of no change needed. */ -- if (fd == -2) -- ret = 0; -+ if (fd < 0) - goto cleanup; -- } - - if (virDomainSaveImageDefineXMLEnsureACL(conn, def) < 0) - goto cleanup; - -+ if (STREQ(xml, dxml) && -+ (state < 0 || state == header.was_running)) { -+ /* no change to the XML */ -+ ret = 0; -+ goto cleanup; -+ } -+ -+ if (state >= 0) -+ header.was_running = state; -+ - if (!(newdef = qemuDomainSaveImageUpdateDef(driver, def, dxml))) - goto cleanup; - -+ VIR_FREE(xml); -+ - xml = qemuDomainDefFormatXML(driver, newdef, - VIR_DOMAIN_XML_INACTIVE | - VIR_DOMAIN_XML_SECURE | -@@ -5840,8 +5847,7 @@ qemuDomainObjRestore(virConnectPtr conn, - virFileWrapperFdPtr wrapperFd = NULL; - - fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, -- bypass_cache, &wrapperFd, NULL, -1, false, -- true); -+ bypass_cache, &wrapperFd, false, true); - if (fd < 0) { - if (fd == -3) - ret = 1; --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-save-image-Split-out-new-definition-check-update.patch b/SOURCES/libvirt-qemu-save-image-Split-out-new-definition-check-update.patch deleted file mode 100644 index a17ea76..0000000 --- a/SOURCES/libvirt-qemu-save-image-Split-out-new-definition-check-update.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 1b1bbd468451d73c72aaf27d4ab8f85866b78299 Mon Sep 17 00:00:00 2001 -Message-Id: <1b1bbd468451d73c72aaf27d4ab8f85866b78299@dist-git> -From: Peter Krempa -Date: Mon, 22 Sep 2014 17:52:38 +0200 -Subject: [PATCH] qemu: save image: Split out new definition check/update - -https://bugzilla.redhat.com/show_bug.cgi?id=1142693 - -Split out the call to the update method only to places where it is -actually used rather than having a mega-method that does all the stuff. - -(cherry picked from commit 4e215bcb2f522f898872dc551d3df3cd68c653ba) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 26 +++++++++++++++----------- - 1 file changed, 15 insertions(+), 11 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 530caef..96c7dd2 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -5502,16 +5502,6 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - VIR_DOMAIN_XML_INACTIVE))) - goto error; - -- if (xmlin) { -- virDomainDefPtr tmp; -- -- if (!(tmp = qemuDomainSaveImageUpdateDef(driver, def, xmlin))) -- goto error; -- -- virDomainDefFree(def); -- def = tmp; -- } -- - if (xmlout) - *xmlout = xml; - else -@@ -5654,6 +5644,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, - { - virQEMUDriverPtr driver = conn->privateData; - virDomainDefPtr def = NULL; -+ virDomainDefPtr newdef = NULL; - virDomainObjPtr vm = NULL; - int fd = -1; - int ret = -1; -@@ -5680,6 +5671,14 @@ qemuDomainRestoreFlags(virConnectPtr conn, - if (virDomainRestoreFlagsEnsureACL(conn, def) < 0) - goto cleanup; - -+ if (dxml) { -+ if (!(newdef = qemuDomainSaveImageUpdateDef(driver, def, dxml))) -+ goto cleanup; -+ -+ virDomainDefFree(def); -+ def = newdef; -+ } -+ - if (!(vm = virDomainObjListAdd(driver->domains, def, - driver->xmlopt, - VIR_DOMAIN_OBJ_LIST_ADD_LIVE | -@@ -5756,6 +5755,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - virQEMUDriverPtr driver = conn->privateData; - int ret = -1; - virDomainDefPtr def = NULL; -+ virDomainDefPtr newdef = NULL; - int fd = -1; - virQEMUSaveHeader header; - char *xml = NULL; -@@ -5783,7 +5783,10 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - if (virDomainSaveImageDefineXMLEnsureACL(conn, def) < 0) - goto cleanup; - -- xml = qemuDomainDefFormatXML(driver, def, -+ if (!(newdef = qemuDomainSaveImageUpdateDef(driver, def, dxml))) -+ goto cleanup; -+ -+ xml = qemuDomainDefFormatXML(driver, newdef, - VIR_DOMAIN_XML_INACTIVE | - VIR_DOMAIN_XML_SECURE | - VIR_DOMAIN_XML_MIGRATABLE); -@@ -5814,6 +5817,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - - cleanup: - virDomainDefFree(def); -+ virDomainDefFree(newdef); - VIR_FORCE_CLOSE(fd); - VIR_FREE(xml); - return ret; --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-save-image-Split-out-user-provided-XML-checker.patch b/SOURCES/libvirt-qemu-save-image-Split-out-user-provided-XML-checker.patch deleted file mode 100644 index 9ba865c..0000000 --- a/SOURCES/libvirt-qemu-save-image-Split-out-user-provided-XML-checker.patch +++ /dev/null @@ -1,144 +0,0 @@ -From 0c43436d94324c3d4e0ff26c78b549be29f05ddb Mon Sep 17 00:00:00 2001 -Message-Id: <0c43436d94324c3d4e0ff26c78b549be29f05ddb@dist-git> -From: Peter Krempa -Date: Mon, 22 Sep 2014 17:52:36 +0200 -Subject: [PATCH] qemu: save image: Split out user provided XML checker - -https://bugzilla.redhat.com/show_bug.cgi?id=1142693 - -Extract code used to check save image XMLs provided by users to separate -use. - -(cherry picked from commit 92e1df2529f2c18b18c4025795e19e729f60e62e) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 100 ++++++++++++++++++++++++++++++++----------------- - 1 file changed, 66 insertions(+), 34 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 98b214a..73aad99 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -5318,6 +5318,68 @@ static int qemuNodeGetSecurityModel(virConnectPtr conn, - return ret; - } - -+ -+/** -+ * qemuDomainSaveImageUpdateDef: -+ * @driver: qemu driver data -+ * @def: def of the domain from the save image -+ * @newxml: user provided replacement XML -+ * -+ * Returns the new domain definition in case @newxml is ABI compatible with the -+ * guest. -+ */ -+static virDomainDefPtr -+qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, -+ virDomainDefPtr def, -+ const char *newxml) -+{ -+ virDomainDefPtr ret = NULL; -+ virDomainDefPtr newdef_migr = NULL; -+ virDomainDefPtr newdef = NULL; -+ virCapsPtr caps = NULL; -+ -+ if (!(caps = virQEMUDriverGetCapabilities(driver, false))) -+ goto cleanup; -+ -+ if (!(newdef = virDomainDefParseString(newxml, caps, driver->xmlopt, -+ QEMU_EXPECTED_VIRT_TYPES, -+ VIR_DOMAIN_XML_INACTIVE))) -+ goto cleanup; -+ -+ if (!(newdef_migr = qemuDomainDefCopy(driver, -+ newdef, -+ VIR_DOMAIN_XML_MIGRATABLE))) -+ goto cleanup; -+ -+ if (!virDomainDefCheckABIStability(def, newdef_migr)) { -+ virResetLastError(); -+ -+ /* Due to a bug in older version of external snapshot creation -+ * code, the XML saved in the save image was not a migratable -+ * XML. To ensure backwards compatibility with the change of the -+ * saved XML type, we need to check the ABI compatibility against -+ * the user provided XML if the check against the migratable XML -+ * fails. Snapshots created prior to v1.1.3 have this issue. */ -+ if (!virDomainDefCheckABIStability(def, newdef)) -+ goto cleanup; -+ -+ /* use the user provided XML */ -+ ret = newdef; -+ newdef = NULL; -+ } else { -+ ret = newdef_migr; -+ newdef_migr = NULL; -+ } -+ -+ cleanup: -+ virObjectUnref(caps); -+ virDomainDefFree(newdef); -+ virDomainDefFree(newdef_migr); -+ -+ return ret; -+} -+ -+ - /* Return -1 on most failures after raising error, -2 if edit was specified - * but xmlin and state (-1 for no change, 0 for paused, 1 for running) do - * not represent any changes (no error raised), -3 if corrupt image was -@@ -5438,45 +5500,15 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - QEMU_EXPECTED_VIRT_TYPES, - VIR_DOMAIN_XML_INACTIVE))) - goto error; -+ - if (xmlin) { -- virDomainDefPtr def2 = NULL; -- virDomainDefPtr newdef = NULL; -+ virDomainDefPtr tmp; - -- if (!(def2 = virDomainDefParseString(xmlin, caps, driver->xmlopt, -- QEMU_EXPECTED_VIRT_TYPES, -- VIR_DOMAIN_XML_INACTIVE))) -+ if (!(tmp = qemuDomainSaveImageUpdateDef(driver, def, xmlin))) - goto error; - -- newdef = qemuDomainDefCopy(driver, def2, VIR_DOMAIN_XML_MIGRATABLE); -- if (!newdef) { -- virDomainDefFree(def2); -- goto error; -- } -- -- if (!virDomainDefCheckABIStability(def, newdef)) { -- virDomainDefFree(newdef); -- virResetLastError(); -- -- /* Due to a bug in older version of external snapshot creation -- * code, the XML saved in the save image was not a migratable -- * XML. To ensure backwards compatibility with the change of the -- * saved XML type, we need to check the ABI compatibility against -- * the user provided XML if the check against the migratable XML -- * fails. Snapshots created prior to v1.1.3 have this issue. */ -- if (!virDomainDefCheckABIStability(def, def2)) { -- virDomainDefFree(def2); -- goto error; -- } -- -- /* use the user provided XML */ -- newdef = def2; -- def2 = NULL; -- } else { -- virDomainDefFree(def2); -- } -- - virDomainDefFree(def); -- def = newdef; -+ def = tmp; - } - - VIR_FREE(xml); --- -2.1.1 - diff --git a/SOURCES/libvirt-qemu-setup-infrastructure-to-handle-NIC_RX_FILTER_CHANGED-event.patch b/SOURCES/libvirt-qemu-setup-infrastructure-to-handle-NIC_RX_FILTER_CHANGED-event.patch deleted file mode 100644 index c20220e..0000000 --- a/SOURCES/libvirt-qemu-setup-infrastructure-to-handle-NIC_RX_FILTER_CHANGED-event.patch +++ /dev/null @@ -1,280 +0,0 @@ -From 5fe7a27d876a94c77d23b5e846f8af58756125c3 Mon Sep 17 00:00:00 2001 -Message-Id: <5fe7a27d876a94c77d23b5e846f8af58756125c3@dist-git> -From: Laine Stump -Date: Mon, 3 Nov 2014 10:00:20 -0500 -Subject: [PATCH] qemu: setup infrastructure to handle NIC_RX_FILTER_CHANGED - event - -https://bugzilla.redhat.com/show_bug.cgi?id=848199 - -NIC_RX_FILTER_CHANGED is sent by qemu any time a NIC driver in the -guest modified the NIC's RX Filter (for example, if the MAC address of -the NIC is changed by the guest). - -This patch doesn't do anything useful with that event; it just sets up -all the plumbing to get news of the event into a worker thread with -all proper locking/reference counting, and provide an easy place to -add in desired functionality. - -See src/qemu/EVENTHANDLERS.txt for information/instructions on adding -a libvirt-internal handler for a qemu event (using -NIC_RX_FILTER_CHANGED as an example). - -(cherry picked from commit b6bdda458ab08353dc2b664d026de6322c7db680) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.h | 1 + - src/qemu/qemu_driver.c | 55 ++++++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_monitor.c | 13 +++++++++++ - src/qemu/qemu_monitor.h | 7 ++++++ - src/qemu/qemu_monitor_json.c | 17 ++++++++++++++ - src/qemu/qemu_process.c | 42 +++++++++++++++++++++++++++++++++ - 6 files changed, 135 insertions(+) - -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 845d3c7..ad45a66 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -195,6 +195,7 @@ typedef enum { - QEMU_PROCESS_EVENT_WATCHDOG = 0, - QEMU_PROCESS_EVENT_GUESTPANIC, - QEMU_PROCESS_EVENT_DEVICE_DELETED, -+ QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED, - - QEMU_PROCESS_EVENT_LAST - } qemuProcessEventType; -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index c158f64..29deb76 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4147,6 +4147,58 @@ processDeviceDeletedEvent(virQEMUDriverPtr driver, - } - - -+static void -+processNicRxFilterChangedEvent(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ char *devAlias) -+{ -+ virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); -+ virDomainDeviceDef dev; -+ virDomainNetDefPtr def; -+ -+ VIR_DEBUG("Received NIC_RX_FILTER_CHANGED event for device %s " -+ "from domain %p %s", -+ devAlias, vm, vm->def->name); -+ -+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -+ goto cleanup; -+ -+ if (!virDomainObjIsActive(vm)) { -+ VIR_DEBUG("Domain is not running"); -+ goto endjob; -+ } -+ -+ if (virDomainDefFindDevice(vm->def, devAlias, &dev, true) < 0) { -+ VIR_WARN("NIC_RX_FILTER_CHANGED event received for " -+ "non-existent device %s in domain %s", -+ devAlias, vm->def->name); -+ goto endjob; -+ } -+ if (dev.type != VIR_DOMAIN_DEVICE_NET) { -+ VIR_WARN("NIC_RX_FILTER_CHANGED event received for " -+ "non-network device %s in domain %s", -+ devAlias, vm->def->name); -+ goto endjob; -+ } -+ def = dev.data.net; -+ -+ /* handle the event - send query-rx-filter and respond to it. */ -+ -+ VIR_DEBUG("process NIC_RX_FILTER_CHANGED event for network " -+ "device %s in domain %s", def->info.alias, vm->def->name); -+ -+ endjob: -+ /* We had an extra reference to vm before starting a new job so ending the -+ * job is guaranteed not to remove the last reference. -+ */ -+ ignore_value(qemuDomainObjEndJob(driver, vm)); -+ -+ cleanup: -+ VIR_FREE(devAlias); -+ virObjectUnref(cfg); -+} -+ -+ - static void qemuProcessEventHandler(void *data, void *opaque) - { - struct qemuProcessEvent *processEvent = data; -@@ -4167,6 +4219,9 @@ static void qemuProcessEventHandler(void *data, void *opaque) - case QEMU_PROCESS_EVENT_DEVICE_DELETED: - processDeviceDeletedEvent(driver, vm, processEvent->data); - break; -+ case QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED: -+ processNicRxFilterChangedEvent(driver, vm, processEvent->data); -+ break; - case QEMU_PROCESS_EVENT_LAST: - break; - } -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index be8d60b..b516880 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -1391,6 +1391,19 @@ qemuMonitorEmitDeviceDeleted(qemuMonitorPtr mon, - } - - -+int -+qemuMonitorEmitNicRxFilterChanged(qemuMonitorPtr mon, -+ const char *devAlias) -+{ -+ int ret = -1; -+ VIR_DEBUG("mon=%p", mon); -+ -+ QEMU_MONITOR_CALLBACK(mon, ret, domainNicRxFilterChanged, mon->vm, devAlias); -+ -+ return ret; -+} -+ -+ - int qemuMonitorSetCapabilities(qemuMonitorPtr mon) - { - int ret; -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index cfcaf30..69f41bf 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -171,6 +171,10 @@ typedef int (*qemuMonitorDomainDeviceDeletedCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, - const char *devAlias, - void *opaque); -+typedef int (*qemuMonitorDomainNicRxFilterChangedCallback)(qemuMonitorPtr mon, -+ virDomainObjPtr vm, -+ const char *devAlias, -+ void *opaque); - - typedef struct _qemuMonitorCallbacks qemuMonitorCallbacks; - typedef qemuMonitorCallbacks *qemuMonitorCallbacksPtr; -@@ -197,6 +201,7 @@ struct _qemuMonitorCallbacks { - qemuMonitorDomainPMSuspendDiskCallback domainPMSuspendDisk; - qemuMonitorDomainGuestPanicCallback domainGuestPanic; - qemuMonitorDomainDeviceDeletedCallback domainDeviceDeleted; -+ qemuMonitorDomainNicRxFilterChangedCallback domainNicRxFilterChanged; - }; - - char *qemuMonitorEscapeArg(const char *in); -@@ -285,6 +290,8 @@ int qemuMonitorEmitPMSuspendDisk(qemuMonitorPtr mon); - int qemuMonitorEmitGuestPanic(qemuMonitorPtr mon); - int qemuMonitorEmitDeviceDeleted(qemuMonitorPtr mon, - const char *devAlias); -+int qemuMonitorEmitNicRxFilterChanged(qemuMonitorPtr mon, -+ const char *devAlias); - - int qemuMonitorStartCPUs(qemuMonitorPtr mon, - virConnectPtr conn); -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 7a6d1e1..4fb1d81 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -81,6 +81,7 @@ static void qemuMonitorJSONHandleBalloonChange(qemuMonitorPtr mon, virJSONValueP - static void qemuMonitorJSONHandlePMSuspendDisk(qemuMonitorPtr mon, virJSONValuePtr data); - static void qemuMonitorJSONHandleGuestPanic(qemuMonitorPtr mon, virJSONValuePtr data); - static void qemuMonitorJSONHandleDeviceDeleted(qemuMonitorPtr mon, virJSONValuePtr data); -+static void qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitorPtr mon, virJSONValuePtr data); - - typedef struct { - const char *type; -@@ -96,6 +97,7 @@ static qemuEventHandler eventHandlers[] = { - { "DEVICE_DELETED", qemuMonitorJSONHandleDeviceDeleted, }, - { "DEVICE_TRAY_MOVED", qemuMonitorJSONHandleTrayChange, }, - { "GUEST_PANICKED", qemuMonitorJSONHandleGuestPanic, }, -+ { "NIC_RX_FILTER_CHANGED", qemuMonitorJSONHandleNicRxFilterChanged, }, - { "POWERDOWN", qemuMonitorJSONHandlePowerdown, }, - { "RESET", qemuMonitorJSONHandleReset, }, - { "RESUME", qemuMonitorJSONHandleResume, }, -@@ -1021,6 +1023,21 @@ qemuMonitorJSONHandleDeviceDeleted(qemuMonitorPtr mon, virJSONValuePtr data) - qemuMonitorEmitDeviceDeleted(mon, device); - } - -+ -+static void -+qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitorPtr mon, virJSONValuePtr data) -+{ -+ const char *name; -+ -+ if (!(name = virJSONValueObjectGetString(data, "name"))) { -+ VIR_WARN("missing device in NIC_RX_FILTER_CHANGED event"); -+ return; -+ } -+ -+ qemuMonitorEmitNicRxFilterChanged(mon, name); -+} -+ -+ - int - qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon, - const char *cmd_str, -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index e711b5f..7101311 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -1488,6 +1488,47 @@ qemuProcessHandleDeviceDeleted(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - } - - -+static int -+qemuProcessHandleNicRxFilterChanged(qemuMonitorPtr mon ATTRIBUTE_UNUSED, -+ virDomainObjPtr vm, -+ const char *devAlias, -+ void *opaque) -+{ -+ virQEMUDriverPtr driver = opaque; -+ struct qemuProcessEvent *processEvent = NULL; -+ char *data; -+ -+ virObjectLock(vm); -+ -+ VIR_DEBUG("Device %s RX Filter changed in domain %p %s", -+ devAlias, vm, vm->def->name); -+ -+ if (VIR_ALLOC(processEvent) < 0) -+ goto error; -+ -+ processEvent->eventType = QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED; -+ if (VIR_STRDUP(data, devAlias) < 0) -+ goto error; -+ processEvent->data = data; -+ processEvent->vm = vm; -+ -+ virObjectRef(vm); -+ if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) { -+ ignore_value(virObjectUnref(vm)); -+ goto error; -+ } -+ -+ cleanup: -+ virObjectUnlock(vm); -+ return 0; -+ error: -+ if (processEvent) -+ VIR_FREE(processEvent->data); -+ VIR_FREE(processEvent); -+ goto cleanup; -+} -+ -+ - static qemuMonitorCallbacks monitorCallbacks = { - .eofNotify = qemuProcessHandleMonitorEOF, - .errorNotify = qemuProcessHandleMonitorError, -@@ -1509,6 +1550,7 @@ static qemuMonitorCallbacks monitorCallbacks = { - .domainPMSuspendDisk = qemuProcessHandlePMSuspendDisk, - .domainGuestPanic = qemuProcessHandleGuestPanic, - .domainDeviceDeleted = qemuProcessHandleDeviceDeleted, -+ .domainNicRxFilterChanged = qemuProcessHandleNicRxFilterChanged, - }; - - static int --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-setup-tap-devices-for-macTableManager-libvirt.patch b/SOURCES/libvirt-qemu-setup-tap-devices-for-macTableManager-libvirt.patch deleted file mode 100644 index fb91201..0000000 --- a/SOURCES/libvirt-qemu-setup-tap-devices-for-macTableManager-libvirt.patch +++ /dev/null @@ -1,89 +0,0 @@ -From f5ee5251bed8e5ff62d58dd6e8ee56b29b6ce3b4 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Laine Stump -Date: Mon, 15 Dec 2014 10:51:31 -0500 -Subject: [PATCH] qemu: setup tap devices for macTableManager='libvirt' - -This is part of the fix for: - - https://bugzilla.redhat.com/show_bug.cgi?id=1099210 - -When libvirt is managing the MAC table of a Linux host bridge, it must -turn off learning and unicast_flood for each tap device attached to -that bridge, then add a Forwarding Database (fdb) entry for the tap -device using the MAC address from the domain interface config. - -Once we have disabled learning and flooding, any packet that has a -destination MAC address not present in the fdb will be dropped by the -bridge. This, along with the opportunistic disabling of promiscuous -mode[*], can result in enhanced network performance. and a potential -slight security improvement. - -[*] If there is only one device on the bridge with learning/unicast_flood -enabled, then that device will automatically have promiscuous mode -disabled. If there are *no* devices with learning/unicast_flood -enabled (e.g. for a libvirt "route", "nat", or isolated network that -has no physical device attached), then all non-tap devices will have -promiscuous mode disabled (tap devices always have promiscuous mode -enabled, which may be a bug in the kernel, but in practice has 0 -effect). - -None of this has any effect for kernels prior to 3.15 (upstream kernel -commit 2796d0c648c940b4796f84384fbcfb0a2399db84 "bridge: Automatically -manage port promiscuous mode"). Even after that, until kernel 3.17 -(upstream commit 5be5a2df40f005ea7fb7e280e87bbbcfcf1c2fc0 "bridge: Add -filtering support for default_pvid") traffic will not be properly -forwarded without manually adding vlan table entries. Unfortunately, -although the presence of the first patch is signalled by existence of -the "learning" and "unicast_flood" options in sysfs, there is no -reliable way to query whether or not the system's kernel has the -second of those patches installed, the only thing that can be done is -to try the setting and see if traffic continues to pass. - -(cherry picked from commit 7cb822c2a5f697823764aee94524243e8ed5e165) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index cd87812..a9c4271 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -35,6 +35,7 @@ - #include "virerror.h" - #include "virfile.h" - #include "virnetdev.h" -+#include "virnetdevbridge.h" - #include "virstring.h" - #include "virtime.h" - #include "viruuid.h" -@@ -349,6 +350,24 @@ qemuNetworkIfaceConnect(virDomainDefPtr def, - virDomainAuditNetDevice(def, net, tunpath, false); - goto cleanup; - } -+ if (virDomainNetGetActualBridgeMACTableManager(net) -+ == VIR_NETWORK_BRIDGE_MAC_TABLE_MANAGER_LIBVIRT) { -+ /* libvirt is managing the FDB of the bridge this device -+ * is attaching to, so we need to turn off learning and -+ * unicast_flood on the device to prevent the kernel from -+ * adding any FDB entries for it, then add an fdb entry -+ * outselves, using the MAC address from the interface -+ * config. -+ */ -+ if (virNetDevBridgePortSetLearning(brname, net->ifname, false) < 0) -+ goto cleanup; -+ if (virNetDevBridgePortSetUnicastFlood(brname, net->ifname, false) < 0) -+ goto cleanup; -+ if (virNetDevBridgeFDBAdd(&net->mac, net->ifname, -+ VIR_NETDEVBRIDGE_FDB_FLAG_MASTER | -+ VIR_NETDEVBRIDGE_FDB_FLAG_TEMP) < 0) -+ goto cleanup; -+ } - } else { - if (qemuCreateInBridgePortWithHelper(cfg, brname, - &net->ifname, --- -2.2.0 - diff --git a/SOURCES/libvirt-qemu-snapshot-Acquire-job-earlier-on-snapshot-revert-delete.patch b/SOURCES/libvirt-qemu-snapshot-Acquire-job-earlier-on-snapshot-revert-delete.patch deleted file mode 100644 index f5a88fe..0000000 --- a/SOURCES/libvirt-qemu-snapshot-Acquire-job-earlier-on-snapshot-revert-delete.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 4c96d5344961e60ef8b0150192fa2a5c2c8ca960 Mon Sep 17 00:00:00 2001 -Message-Id: <4c96d5344961e60ef8b0150192fa2a5c2c8ca960@dist-git> -From: Jincheng Miao -Date: Mon, 8 Sep 2014 13:24:18 +0200 -Subject: [PATCH] qemu: snapshot: Acquire job earlier on snapshot revert/delete - -https://bugzilla.redhat.com/show_bug.cgi?id=1134154 - -The code would lookup the snapshot object before acquiring the job. This -could lead to a crash as one thread could delete the snapshot object, -while a second thread already had the reference. - -Signed-off-by: Jincheng Miao -Signed-off-by: Peter Krempa -(cherry picked from commit a4065dc3e7b17a5fa6916fca2fb28a0d723fe13d) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 30 +++++++++++++++--------------- - 1 file changed, 15 insertions(+), 15 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 6a79f28..fb4b508 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -14018,9 +14018,12 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - goto cleanup; - } - -- if (!(snap = qemuSnapObjFromSnapshot(vm, snapshot))) -+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) - goto cleanup; - -+ if (!(snap = qemuSnapObjFromSnapshot(vm, snapshot))) -+ goto endjob; -+ - if (!vm->persistent && - snap->def->state != VIR_DOMAIN_RUNNING && - snap->def->state != VIR_DOMAIN_PAUSED && -@@ -14029,13 +14032,13 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("transient domain needs to request run or pause " - "to revert to inactive snapshot")); -- goto cleanup; -+ goto endjob; - } - - if (virDomainSnapshotIsExternal(snap)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("revert to external snapshot not supported yet")); -- goto cleanup; -+ goto endjob; - } - - if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) { -@@ -14043,7 +14046,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, - _("snapshot '%s' lacks domain '%s' rollback info"), - snap->def->name, vm->def->name); -- goto cleanup; -+ goto endjob; - } - if (virDomainObjIsActive(vm) && - !(snap->def->state == VIR_DOMAIN_RUNNING -@@ -14052,7 +14055,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED))) { - virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, "%s", - _("must respawn qemu to start inactive snapshot")); -- goto cleanup; -+ goto endjob; - } - } - -@@ -14061,7 +14064,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - vm->current_snapshot->def->current = false; - if (qemuDomainSnapshotWriteMetadata(vm, vm->current_snapshot, - cfg->snapshotDir) < 0) -- goto cleanup; -+ goto endjob; - vm->current_snapshot = NULL; - /* XXX Should we restore vm->current_snapshot after this point - * in the failure cases where we know there was no change? */ -@@ -14076,12 +14079,9 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - if (snap->def->dom) { - config = virDomainDefCopy(snap->def->dom, caps, driver->xmlopt, true); - if (!config) -- goto cleanup; -+ goto endjob; - } - -- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -- goto cleanup; -- - switch ((virDomainState) snap->def->state) { - case VIR_DOMAIN_RUNNING: - case VIR_DOMAIN_PAUSED: -@@ -14391,9 +14391,12 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, - if (virDomainSnapshotDeleteEnsureACL(snapshot->domain->conn, vm->def) < 0) - goto cleanup; - -- if (!(snap = qemuSnapObjFromSnapshot(vm, snapshot))) -+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) - goto cleanup; - -+ if (!(snap = qemuSnapObjFromSnapshot(vm, snapshot))) -+ goto endjob; -+ - if (!metadata_only) { - if (!(flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) && - virDomainSnapshotIsExternal(snap)) -@@ -14406,13 +14409,10 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("deletion of %d external disk snapshots not " - "supported yet"), external); -- goto cleanup; -+ goto endjob; - } - } - -- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -- goto cleanup; -- - if (flags & (VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN | - VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY)) { - rem.driver = driver; --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-snapshot-Fix-job-handling-when-creating-snapshots.patch b/SOURCES/libvirt-qemu-snapshot-Fix-job-handling-when-creating-snapshots.patch deleted file mode 100644 index 2ad6145..0000000 --- a/SOURCES/libvirt-qemu-snapshot-Fix-job-handling-when-creating-snapshots.patch +++ /dev/null @@ -1,434 +0,0 @@ -From ed2165ed57e2e207d08e3202e0f93201a1f1183b Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Mon, 8 Sep 2014 13:24:17 +0200 -Subject: [PATCH] qemu: snapshot: Fix job handling when creating snapshots - -https://bugzilla.redhat.com/show_bug.cgi?id=1134154 - -Creating snapshots modifies the domain state. Currently we wouldn't -enter the job for certain operations although they would modify the -state. Refactor job handling so that everything is covered by an async -job. - -(cherry picked from commit b3d2a42e80aaee1f322fc9beb98b6ed541574ab3) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 173 +++++++++++++++++++++---------------------------- - 1 file changed, 75 insertions(+), 98 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 74d0477..6a79f28 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -12363,32 +12363,22 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver, - static int - qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn, - virQEMUDriverPtr driver, -- virDomainObjPtr *vmptr, -+ virDomainObjPtr vm, - virDomainSnapshotObjPtr snap, - unsigned int flags) - { -- virDomainObjPtr vm = *vmptr; - qemuDomainObjPrivatePtr priv = vm->privateData; - virObjectEventPtr event = NULL; - bool resume = false; - int ret = -1; - -- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) -- return -1; -- -- if (!virDomainObjIsActive(vm)) { -- virReportError(VIR_ERR_OPERATION_INVALID, -- "%s", _("domain is not running")); -- goto endjob; -- } -- - if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) { - /* savevm monitor command pauses the domain emitting an event which - * confuses libvirt since it's not notified when qemu resumes the - * domain. Thus we stop and start CPUs ourselves. - */ - if (qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_SAVE, -- QEMU_ASYNC_JOB_NONE) < 0) -+ QEMU_ASYNC_JOB_SNAPSHOT) < 0) - goto cleanup; - - resume = true; -@@ -12399,7 +12389,12 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn, - } - } - -- qemuDomainObjEnterMonitor(driver, vm); -+ if (qemuDomainObjEnterMonitorAsync(driver, vm, -+ QEMU_ASYNC_JOB_SNAPSHOT) < 0) { -+ resume = false; -+ goto cleanup; -+ } -+ - ret = qemuMonitorCreateSnapshot(priv->mon, snap->def->name); - qemuDomainObjExitMonitor(driver, vm); - if (ret < 0) -@@ -12410,18 +12405,14 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn, - VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT); - qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, 0); - virDomainAuditStop(vm, "from-snapshot"); -- /* We already filtered the _HALT flag for persistent domains -- * only, so this end job never drops the last reference. */ -- ignore_value(qemuDomainObjEndJob(driver, vm)); - resume = false; -- vm = NULL; - } - - cleanup: - if (resume && virDomainObjIsActive(vm) && - qemuProcessStartCPUs(driver, vm, conn, - VIR_DOMAIN_RUNNING_UNPAUSED, -- QEMU_ASYNC_JOB_NONE) < 0) { -+ QEMU_ASYNC_JOB_SNAPSHOT) < 0) { - event = virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_SUSPENDED, - VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR); -@@ -12431,14 +12422,6 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn, - } - } - -- endjob: -- if (vm && !qemuDomainObjEndJob(driver, vm)) { -- /* Only possible if a transient vm quit while our locks were down, -- * in which case we don't want to save snapshot metadata. */ -- *vmptr = NULL; -- ret = -1; -- } -- - if (event) - qemuDomainEventQueue(driver, event); - -@@ -13140,13 +13123,13 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, - static int - qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - virQEMUDriverPtr driver, -- virDomainObjPtr *vmptr, -+ virDomainObjPtr vm, - virDomainSnapshotObjPtr snap, - unsigned int flags) - { -+ virObjectEventPtr event; - bool resume = false; - int ret = -1; -- virDomainObjPtr vm = *vmptr; - qemuDomainObjPrivatePtr priv = vm->privateData; - char *xml = NULL; - bool memory = snap->def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL; -@@ -13158,9 +13141,6 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - virQEMUDriverConfigPtr cfg = NULL; - int compressed = QEMU_SAVE_FORMAT_RAW; - -- if (qemuDomainObjBeginAsyncJob(driver, vm, QEMU_ASYNC_JOB_SNAPSHOT) < 0) -- goto cleanup; -- - /* If quiesce was requested, then issue a freeze command, and a - * counterpart thaw command when it is actually sent to agent. - * The command will fail if the guest is paused or the guest agent -@@ -13171,7 +13151,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - /* the helper reported the error */ - if (freeze == -2) - thaw = -1; /* the command is sent but agent failed */ -- goto endjob; -+ goto cleanup; - } - thaw = 1; - } -@@ -13198,12 +13178,12 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - (!memory && atomic && !transaction)) { - if (qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_SNAPSHOT, - QEMU_ASYNC_JOB_SNAPSHOT) < 0) -- goto endjob; -+ goto cleanup; - - if (!virDomainObjIsActive(vm)) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); -- goto endjob; -+ goto cleanup; - } - } - } -@@ -13212,7 +13192,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - if (memory) { - /* check if migration is possible */ - if (!qemuMigrationIsAllowed(driver, vm, vm->def, false, false)) -- goto endjob; -+ goto cleanup; - - /* allow the migration job to be cancelled or the domain to be paused */ - qemuDomainObjSetAsyncJobMask(vm, (QEMU_JOB_DEFAULT_MASK | -@@ -13226,24 +13206,24 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - virReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("Invalid snapshot image format specified " - "in configuration file")); -- goto endjob; -+ goto cleanup; - } - - if (!qemuCompressProgramAvailable(compressed)) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("Compression program for image format " - "in configuration file isn't available")); -- goto endjob; -+ goto cleanup; - } - } - - if (!(xml = qemuDomainDefFormatLive(driver, vm->def, true, true))) -- goto endjob; -+ goto cleanup; - - if ((ret = qemuDomainSaveMemory(driver, vm, snap->def->file, - xml, compressed, resume, 0, - QEMU_ASYNC_JOB_SNAPSHOT)) < 0) -- goto endjob; -+ goto cleanup; - - /* the memory image was created, remove it on errors */ - memory_unlink = true; -@@ -13261,30 +13241,22 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - */ - if ((ret = qemuDomainSnapshotCreateDiskActive(driver, vm, snap, flags, - QEMU_ASYNC_JOB_SNAPSHOT)) < 0) -- goto endjob; -+ goto cleanup; - - /* the snapshot is complete now */ - if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT) { -- virObjectEventPtr event; -- - event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED, - VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT); - qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, 0); - virDomainAuditStop(vm, "from-snapshot"); -- /* We already filtered the _HALT flag for persistent domains -- * only, so this end job never drops the last reference. */ -- ignore_value(qemuDomainObjEndAsyncJob(driver, vm)); - resume = false; - thaw = 0; -- vm = NULL; - if (event) - qemuDomainEventQueue(driver, event); - } else if (memory && pmsuspended) { - /* qemu 1.3 is unable to save a domain in pm-suspended (S3) - * state; so we must emit an event stating that it was - * converted to paused. */ -- virObjectEventPtr event; -- - virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, - VIR_DOMAIN_PAUSED_FROM_SNAPSHOT); - event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED, -@@ -13295,12 +13267,11 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - - ret = 0; - -- endjob: -- if (resume && vm && virDomainObjIsActive(vm) && -+ cleanup: -+ if (resume && virDomainObjIsActive(vm) && - qemuProcessStartCPUs(driver, vm, conn, - VIR_DOMAIN_RUNNING_UNPAUSED, - QEMU_ASYNC_JOB_SNAPSHOT) < 0) { -- virObjectEventPtr event = NULL; - event = virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_SUSPENDED, - VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR); -@@ -13314,21 +13285,14 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - ret = -1; - goto cleanup; - } -- if (vm && thaw != 0 && -+ -+ if (thaw != 0 && - qemuDomainSnapshotFSThaw(driver, vm, thaw > 0) < 0) { - /* helper reported the error, if it was needed */ - if (thaw > 0) - ret = -1; - } -- if (vm && !qemuDomainObjEndAsyncJob(driver, vm)) { -- /* Only possible if a transient vm quit while our locks were down, -- * in which case we don't want to save snapshot metadata. -- */ -- *vmptr = NULL; -- ret = -1; -- } - -- cleanup: - VIR_FREE(xml); - virObjectUnref(cfg); - if (memory_unlink && ret < 0) -@@ -13474,10 +13438,19 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - goto cleanup; - } - -+ /* We are going to modify the domain below. Internal snapshots would use -+ * a regular job, so we need to set the job mask to disallow query as -+ * 'savevm' blocks the monitor. External snapshot will then modify the -+ * job mask appropriately. */ -+ if (qemuDomainObjBeginAsyncJob(driver, vm, QEMU_ASYNC_JOB_SNAPSHOT) < 0) -+ goto cleanup; -+ -+ qemuDomainObjSetAsyncJobMask(vm, QEMU_JOB_NONE); -+ - if (redefine) { - if (virDomainSnapshotRedefinePrep(domain, vm, &def, &snap, - &update_current, flags) < 0) -- goto cleanup; -+ goto endjob; - } else { - /* Easiest way to clone inactive portion of vm->def is via - * conversion in and back out of xml. */ -@@ -13485,7 +13458,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - !(def->dom = virDomainDefParseString(xml, caps, driver->xmlopt, - QEMU_EXPECTED_VIRT_TYPES, - VIR_DOMAIN_XML_INACTIVE))) -- goto cleanup; -+ goto endjob; - - if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) { - align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL; -@@ -13507,7 +13480,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("internal snapshot of a running VM " - "must include the memory state")); -- goto cleanup; -+ goto endjob; - } - - def->memory = (def->state == VIR_DOMAIN_SHUTOFF ? -@@ -13517,12 +13490,12 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - if (virDomainSnapshotAlignDisks(def, align_location, - align_match) < 0 || - qemuDomainSnapshotPrepare(conn, vm, def, &flags) < 0) -- goto cleanup; -+ goto endjob; - } - - if (!snap) { - if (!(snap = virDomainSnapshotAssignDef(vm->snapshots, def))) -- goto cleanup; -+ goto endjob; - - def = NULL; - } -@@ -13532,12 +13505,12 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - if (vm->current_snapshot) { - if (!redefine && - VIR_STRDUP(snap->def->parent, vm->current_snapshot->def->name) < 0) -- goto cleanup; -+ goto endjob; - if (update_current) { - vm->current_snapshot->def->current = false; - if (qemuDomainSnapshotWriteMetadata(vm, vm->current_snapshot, - cfg->snapshotDir) < 0) -- goto cleanup; -+ goto endjob; - vm->current_snapshot = NULL; - } - } -@@ -13552,13 +13525,13 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - snap->def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) { - /* external checkpoint or disk snapshot */ - if (qemuDomainSnapshotCreateActiveExternal(domain->conn, driver, -- &vm, snap, flags) < 0) -- goto cleanup; -+ vm, snap, flags) < 0) -+ goto endjob; - } else { - /* internal checkpoint */ - if (qemuDomainSnapshotCreateActiveInternal(domain->conn, driver, -- &vm, snap, flags) < 0) -- goto cleanup; -+ vm, snap, flags) < 0) -+ goto endjob; - } - } else { - /* inactive; qemuDomainSnapshotPrepare guaranteed that we -@@ -13569,10 +13542,10 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - - if (qemuDomainSnapshotCreateInactiveExternal(driver, vm, snap, - reuse) < 0) -- goto cleanup; -+ goto endjob; - } else { - if (qemuDomainSnapshotCreateInactiveInternal(driver, vm, snap) < 0) -- goto cleanup; -+ goto endjob; - } - } - -@@ -13582,34 +13555,38 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - */ - snapshot = virGetDomainSnapshot(domain, snap->def->name); - -- cleanup: -- if (vm) { -- if (snapshot && !(flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)) { -- if (qemuDomainSnapshotWriteMetadata(vm, snap, -- cfg->snapshotDir) < 0) { -- /* if writing of metadata fails, error out rather than trying -- * to silently carry on without completing the snapshot */ -- virDomainSnapshotFree(snapshot); -- snapshot = NULL; -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("unable to save metadata for snapshot %s"), -- snap->def->name); -- virDomainSnapshotObjListRemove(vm->snapshots, snap); -- } else { -- if (update_current) -- vm->current_snapshot = snap; -- other = virDomainSnapshotFindByName(vm->snapshots, -- snap->def->parent); -- snap->parent = other; -- other->nchildren++; -- snap->sibling = other->first_child; -- other->first_child = snap; -- } -- } else if (snap) { -+ endjob: -+ if (snapshot && !(flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)) { -+ if (qemuDomainSnapshotWriteMetadata(vm, snap, -+ cfg->snapshotDir) < 0) { -+ /* if writing of metadata fails, error out rather than trying -+ * to silently carry on without completing the snapshot */ -+ virDomainSnapshotFree(snapshot); -+ snapshot = NULL; -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("unable to save metadata for snapshot %s"), -+ snap->def->name); - virDomainSnapshotObjListRemove(vm->snapshots, snap); -+ } else { -+ if (update_current) -+ vm->current_snapshot = snap; -+ other = virDomainSnapshotFindByName(vm->snapshots, -+ snap->def->parent); -+ snap->parent = other; -+ other->nchildren++; -+ snap->sibling = other->first_child; -+ other->first_child = snap; - } -- virObjectUnlock(vm); -+ } else if (snap) { -+ virDomainSnapshotObjListRemove(vm->snapshots, snap); - } -+ -+ if (!qemuDomainObjEndAsyncJob(driver, vm)) -+ vm = NULL; -+ -+ cleanup: -+ if (vm) -+ virObjectUnlock(vm); - virDomainSnapshotDefFree(def); - VIR_FREE(xml); - virObjectUnref(caps); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-snapshot-Fix-snapshot-function-header-formatting-and-spacing.patch b/SOURCES/libvirt-qemu-snapshot-Fix-snapshot-function-header-formatting-and-spacing.patch deleted file mode 100644 index 8d89772..0000000 --- a/SOURCES/libvirt-qemu-snapshot-Fix-snapshot-function-header-formatting-and-spacing.patch +++ /dev/null @@ -1,255 +0,0 @@ -From 70735dbc64bdc1331ef4bc1cb89a86232e114ee6 Mon Sep 17 00:00:00 2001 -Message-Id: <70735dbc64bdc1331ef4bc1cb89a86232e114ee6@dist-git> -From: Peter Krempa -Date: Mon, 8 Sep 2014 13:24:19 +0200 -Subject: [PATCH] qemu: snapshot: Fix snapshot function header formatting and - spacing - -https://bugzilla.redhat.com/show_bug.cgi?id=1134154 - -(cherry picked from commit d03044717dd8f41991bb0eb959e7aa5fba3de79a) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 70 ++++++++++++++++++++++++++++++++++++-------------- - 1 file changed, 51 insertions(+), 19 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index fb4b508..d02c76d 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -12193,6 +12193,7 @@ qemuDomainSnapshotFSFreeze(virQEMUDriverPtr driver, - return frozen < 0 ? -2 : frozen; - } - -+ - /* Return -1 on error, otherwise number of thawed filesystems. */ - static int - qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver, -@@ -12238,6 +12239,7 @@ qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver, - return thawed; - } - -+ - /* The domain is expected to be locked and inactive. */ - static int - qemuDomainSnapshotCreateInactiveInternal(virQEMUDriverPtr driver, -@@ -12247,6 +12249,7 @@ qemuDomainSnapshotCreateInactiveInternal(virQEMUDriverPtr driver, - return qemuDomainSnapshotForEachQcow2(driver, vm, snap, "-c", false); - } - -+ - /* The domain is expected to be locked and inactive. */ - static int - qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver, -@@ -12428,6 +12431,7 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn, - return ret; - } - -+ - static int - qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk) - { -@@ -12833,6 +12837,7 @@ qemuDomainSnapshotPrepare(virConnectPtr conn, - return ret; - } - -+ - /* The domain is expected to hold monitor lock. */ - static int - qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver, -@@ -12951,6 +12956,7 @@ qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver, - return ret; - } - -+ - /* The domain is expected to hold monitor lock. This is the - * counterpart to qemuDomainSnapshotCreateSingleDiskActive, called - * only on a failed transaction. */ -@@ -12989,6 +12995,7 @@ qemuDomainSnapshotUndoSingleDiskActive(virQEMUDriverPtr driver, - } - } - -+ - /* The domain is expected to be locked and active. */ - static int - qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, -@@ -13594,9 +13601,12 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - return snapshot; - } - --static int qemuDomainSnapshotListNames(virDomainPtr domain, char **names, -- int nameslen, -- unsigned int flags) -+ -+static int -+qemuDomainSnapshotListNames(virDomainPtr domain, -+ char **names, -+ int nameslen, -+ unsigned int flags) - { - virDomainObjPtr vm = NULL; - int n = -1; -@@ -13619,8 +13629,10 @@ static int qemuDomainSnapshotListNames(virDomainPtr domain, char **names, - return n; - } - --static int qemuDomainSnapshotNum(virDomainPtr domain, -- unsigned int flags) -+ -+static int -+qemuDomainSnapshotNum(virDomainPtr domain, -+ unsigned int flags) - { - virDomainObjPtr vm = NULL; - int n = -1; -@@ -13642,8 +13654,10 @@ static int qemuDomainSnapshotNum(virDomainPtr domain, - return n; - } - -+ - static int --qemuDomainListAllSnapshots(virDomainPtr domain, virDomainSnapshotPtr **snaps, -+qemuDomainListAllSnapshots(virDomainPtr domain, -+ virDomainSnapshotPtr **snaps, - unsigned int flags) - { - virDomainObjPtr vm = NULL; -@@ -13666,6 +13680,7 @@ qemuDomainListAllSnapshots(virDomainPtr domain, virDomainSnapshotPtr **snaps, - return n; - } - -+ - static int - qemuDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot, - char **names, -@@ -13697,6 +13712,7 @@ qemuDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot, - return n; - } - -+ - static int - qemuDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, - unsigned int flags) -@@ -13725,6 +13741,7 @@ qemuDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, - return n; - } - -+ - static int - qemuDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot, - virDomainSnapshotPtr **snaps, -@@ -13755,9 +13772,11 @@ qemuDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot, - return n; - } - --static virDomainSnapshotPtr qemuDomainSnapshotLookupByName(virDomainPtr domain, -- const char *name, -- unsigned int flags) -+ -+static virDomainSnapshotPtr -+qemuDomainSnapshotLookupByName(virDomainPtr domain, -+ const char *name, -+ unsigned int flags) - { - virDomainObjPtr vm; - virDomainSnapshotObjPtr snap = NULL; -@@ -13782,8 +13801,10 @@ static virDomainSnapshotPtr qemuDomainSnapshotLookupByName(virDomainPtr domain, - return snapshot; - } - --static int qemuDomainHasCurrentSnapshot(virDomainPtr domain, -- unsigned int flags) -+ -+static int -+qemuDomainHasCurrentSnapshot(virDomainPtr domain, -+ unsigned int flags) - { - virDomainObjPtr vm; - int ret = -1; -@@ -13804,6 +13825,7 @@ static int qemuDomainHasCurrentSnapshot(virDomainPtr domain, - return ret; - } - -+ - static virDomainSnapshotPtr - qemuDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, - unsigned int flags) -@@ -13838,8 +13860,10 @@ qemuDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, - return parent; - } - --static virDomainSnapshotPtr qemuDomainSnapshotCurrent(virDomainPtr domain, -- unsigned int flags) -+ -+static virDomainSnapshotPtr -+qemuDomainSnapshotCurrent(virDomainPtr domain, -+ unsigned int flags) - { - virDomainObjPtr vm; - virDomainSnapshotPtr snapshot = NULL; -@@ -13866,8 +13890,10 @@ static virDomainSnapshotPtr qemuDomainSnapshotCurrent(virDomainPtr domain, - return snapshot; - } - --static char *qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, -- unsigned int flags) -+ -+static char * -+qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, -+ unsigned int flags) - { - virDomainObjPtr vm = NULL; - char *xml = NULL; -@@ -13895,6 +13921,7 @@ static char *qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, - return xml; - } - -+ - static int - qemuDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, - unsigned int flags) -@@ -13954,6 +13981,7 @@ qemuDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot, - return ret; - } - -+ - /* The domain is expected to be locked and inactive. */ - static int - qemuDomainSnapshotRevertInactive(virQEMUDriverPtr driver, -@@ -13965,8 +13993,10 @@ qemuDomainSnapshotRevertInactive(virQEMUDriverPtr driver, - return ret > 0 ? -1 : ret; - } - --static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, -- unsigned int flags) -+ -+static int -+qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, -+ unsigned int flags) - { - virQEMUDriverPtr driver = snapshot->domain->conn->privateData; - virDomainObjPtr vm = NULL; -@@ -14337,6 +14367,7 @@ struct _virQEMUSnapReparent { - virDomainSnapshotObjPtr last; - }; - -+ - static void - qemuDomainSnapshotReparentChildren(void *payload, - const void *name ATTRIBUTE_UNUSED, -@@ -14366,8 +14397,9 @@ qemuDomainSnapshotReparentChildren(void *payload, - } - - --static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, -- unsigned int flags) -+static int -+qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, -+ unsigned int flags) - { - virQEMUDriverPtr driver = snapshot->domain->conn->privateData; - virDomainObjPtr vm = NULL; --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-snapshot-Simplify-error-paths.patch b/SOURCES/libvirt-qemu-snapshot-Simplify-error-paths.patch deleted file mode 100644 index e6791a4..0000000 --- a/SOURCES/libvirt-qemu-snapshot-Simplify-error-paths.patch +++ /dev/null @@ -1,273 +0,0 @@ -From 921e000d67265b2931772a89ee56b8309ac7b9e2 Mon Sep 17 00:00:00 2001 -Message-Id: <921e000d67265b2931772a89ee56b8309ac7b9e2@dist-git> -From: Peter Krempa -Date: Mon, 8 Sep 2014 13:24:20 +0200 -Subject: [PATCH] qemu: snapshot: Simplify error paths - -https://bugzilla.redhat.com/show_bug.cgi?id=1134154 - -Return failure right away when the domain object can't be looked up -instead of jumping to cleanup. This allows to remove the condition -before unlocking the domain object. - -(cherry picked from commit 2990db96b61d60a487152f9382881a2f56f4fca8) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 65 ++++++++++++++++++++------------------------------ - 1 file changed, 26 insertions(+), 39 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index d02c76d..53baced 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -13615,7 +13615,7 @@ qemuDomainSnapshotListNames(virDomainPtr domain, - VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, -1); - - if (!(vm = qemuDomObjFromDomain(domain))) -- goto cleanup; -+ return -1; - - if (virDomainSnapshotListNamesEnsureACL(domain->conn, vm->def) < 0) - goto cleanup; -@@ -13624,8 +13624,7 @@ qemuDomainSnapshotListNames(virDomainPtr domain, - flags); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return n; - } - -@@ -13641,7 +13640,7 @@ qemuDomainSnapshotNum(virDomainPtr domain, - VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, -1); - - if (!(vm = qemuDomObjFromDomain(domain))) -- goto cleanup; -+ return -1; - - if (virDomainSnapshotNumEnsureACL(domain->conn, vm->def) < 0) - goto cleanup; -@@ -13649,8 +13648,7 @@ qemuDomainSnapshotNum(virDomainPtr domain, - n = virDomainSnapshotObjListNum(vm->snapshots, NULL, flags); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return n; - } - -@@ -13667,7 +13665,7 @@ qemuDomainListAllSnapshots(virDomainPtr domain, - VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, -1); - - if (!(vm = qemuDomObjFromDomain(domain))) -- goto cleanup; -+ return -1; - - if (virDomainListAllSnapshotsEnsureACL(domain->conn, vm->def) < 0) - goto cleanup; -@@ -13675,8 +13673,7 @@ qemuDomainListAllSnapshots(virDomainPtr domain, - n = virDomainListSnapshots(vm->snapshots, NULL, domain, snaps, flags); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return n; - } - -@@ -13695,7 +13692,7 @@ qemuDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot, - VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, -1); - - if (!(vm = qemuDomObjFromSnapshot(snapshot))) -- goto cleanup; -+ return -1; - - if (virDomainSnapshotListChildrenNamesEnsureACL(snapshot->domain->conn, vm->def) < 0) - goto cleanup; -@@ -13707,8 +13704,7 @@ qemuDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot, - flags); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return n; - } - -@@ -13725,7 +13721,7 @@ qemuDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, - VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, -1); - - if (!(vm = qemuDomObjFromSnapshot(snapshot))) -- goto cleanup; -+ return -1; - - if (virDomainSnapshotNumChildrenEnsureACL(snapshot->domain->conn, vm->def) < 0) - goto cleanup; -@@ -13736,8 +13732,7 @@ qemuDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, - n = virDomainSnapshotObjListNum(vm->snapshots, snap, flags); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return n; - } - -@@ -13755,7 +13750,7 @@ qemuDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot, - VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, -1); - - if (!(vm = qemuDomObjFromSnapshot(snapshot))) -- goto cleanup; -+ return -1; - - if (virDomainSnapshotListAllChildrenEnsureACL(snapshot->domain->conn, vm->def) < 0) - goto cleanup; -@@ -13767,8 +13762,7 @@ qemuDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot, - flags); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return n; - } - -@@ -13785,7 +13779,7 @@ qemuDomainSnapshotLookupByName(virDomainPtr domain, - virCheckFlags(0, NULL); - - if (!(vm = qemuDomObjFromDomain(domain))) -- goto cleanup; -+ return NULL; - - if (virDomainSnapshotLookupByNameEnsureACL(domain->conn, vm->def) < 0) - goto cleanup; -@@ -13796,8 +13790,7 @@ qemuDomainSnapshotLookupByName(virDomainPtr domain, - snapshot = virGetDomainSnapshot(domain, snap->def->name); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return snapshot; - } - -@@ -13812,7 +13805,7 @@ qemuDomainHasCurrentSnapshot(virDomainPtr domain, - virCheckFlags(0, -1); - - if (!(vm = qemuDomObjFromDomain(domain))) -- goto cleanup; -+ return -1; - - if (virDomainHasCurrentSnapshotEnsureACL(domain->conn, vm->def) < 0) - goto cleanup; -@@ -13820,8 +13813,7 @@ qemuDomainHasCurrentSnapshot(virDomainPtr domain, - ret = (vm->current_snapshot != NULL); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return ret; - } - -@@ -13837,7 +13829,7 @@ qemuDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, - virCheckFlags(0, NULL); - - if (!(vm = qemuDomObjFromSnapshot(snapshot))) -- goto cleanup; -+ return NULL; - - if (virDomainSnapshotGetParentEnsureACL(snapshot->domain->conn, vm->def) < 0) - goto cleanup; -@@ -13855,8 +13847,7 @@ qemuDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, - parent = virGetDomainSnapshot(snapshot->domain, snap->def->parent); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return parent; - } - -@@ -13871,7 +13862,7 @@ qemuDomainSnapshotCurrent(virDomainPtr domain, - virCheckFlags(0, NULL); - - if (!(vm = qemuDomObjFromDomain(domain))) -- goto cleanup; -+ return NULL; - - if (virDomainSnapshotCurrentEnsureACL(domain->conn, vm->def) < 0) - goto cleanup; -@@ -13885,8 +13876,7 @@ qemuDomainSnapshotCurrent(virDomainPtr domain, - snapshot = virGetDomainSnapshot(domain, vm->current_snapshot->def->name); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return snapshot; - } - -@@ -13903,7 +13893,7 @@ qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, - virCheckFlags(VIR_DOMAIN_XML_SECURE, NULL); - - if (!(vm = qemuDomObjFromSnapshot(snapshot))) -- goto cleanup; -+ return NULL; - - if (virDomainSnapshotGetXMLDescEnsureACL(snapshot->domain->conn, vm->def) < 0) - goto cleanup; -@@ -13916,8 +13906,7 @@ qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, - xml = virDomainSnapshotDefFormat(uuidstr, snap->def, flags, 0); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return xml; - } - -@@ -13933,7 +13922,7 @@ qemuDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, - virCheckFlags(0, -1); - - if (!(vm = qemuDomObjFromSnapshot(snapshot))) -- goto cleanup; -+ return -1; - - if (virDomainSnapshotIsCurrentEnsureACL(snapshot->domain->conn, vm->def) < 0) - goto cleanup; -@@ -13945,8 +13934,7 @@ qemuDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, - STREQ(snapshot->name, vm->current_snapshot->def->name)); - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return ret; - } - -@@ -13962,7 +13950,7 @@ qemuDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot, - virCheckFlags(0, -1); - - if (!(vm = qemuDomObjFromSnapshot(snapshot))) -- goto cleanup; -+ return -1; - - if (virDomainSnapshotHasMetadataEnsureACL(snapshot->domain->conn, vm->def) < 0) - goto cleanup; -@@ -13976,8 +13964,7 @@ qemuDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot, - ret = 1; - - cleanup: -- if (vm) -- virObjectUnlock(vm); -+ virObjectUnlock(vm); - return ret; - } - --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-stop-NBD-server-after-successful-migration.patch b/SOURCES/libvirt-qemu-stop-NBD-server-after-successful-migration.patch deleted file mode 100644 index 0ea4795..0000000 --- a/SOURCES/libvirt-qemu-stop-NBD-server-after-successful-migration.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 8af0eae29dac349052a5d2cfd78198074a50af89 Mon Sep 17 00:00:00 2001 -Message-Id: <8af0eae29dac349052a5d2cfd78198074a50af89@dist-git> -From: Weiwei Li -Date: Tue, 4 Nov 2014 12:08:37 +0100 -Subject: [PATCH] qemu: stop NBD server after successful migration -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1160212 - -In qemuMigrationFinish mig->nbd can not be initialized by -qemuMigrationEatCookie without the QEMU_MIGRATION_COOKIE_NBD flag. -That causes qemuMigrationStopNBDServer to return early without -stopping the NBD server properly. - -Signed-off-by: Weiwei Li -Signed-off-by: Ján Tomko -(cherry picked from commit c3012a023f2ae5763027cafc1cf2881a3c7c4b45) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 1998bc9..cc245f6 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -4823,7 +4823,8 @@ qemuMigrationFinish(virQEMUDriverPtr driver, - VIR_FREE(priv->job.completed); - - cookie_flags = QEMU_MIGRATION_COOKIE_NETWORK | -- QEMU_MIGRATION_COOKIE_STATS; -+ QEMU_MIGRATION_COOKIE_STATS | -+ QEMU_MIGRATION_COOKIE_NBD; - if (flags & VIR_MIGRATE_PERSIST_DEST) - cookie_flags |= QEMU_MIGRATION_COOKIE_PERSISTENT; - --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-support-nospace-reason-in-io-error-event.patch b/SOURCES/libvirt-qemu-support-nospace-reason-in-io-error-event.patch deleted file mode 100644 index 890780a..0000000 --- a/SOURCES/libvirt-qemu-support-nospace-reason-in-io-error-event.patch +++ /dev/null @@ -1,105 +0,0 @@ -From f7959239dcc411b050db4b5560d7349df7f8f848 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Eric Blake -Date: Fri, 3 Oct 2014 08:46:25 -0600 -Subject: [PATCH] qemu: support nospace reason in io error event - -Aeons ago (commit 34dcbbb4, v0.8.2), we added a new libvirt event -(VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON) in order to tell the user WHY -the guest halted. This is because at least VDSM wants to react -differently to ENOSPC events (resize the lvm partition to be larger, -and resume the guest as if nothing had happened) from all other events -(I/O is hosed, throw up our hands and flag things as broken). At the -time this was done, downstream RHEL qemu added a vendor extension -'__com.redhat_reason', which would be exactly one of these strings: -"enospc", "eperm", "eio", and "eother". In our stupidity, we exposed -those exact strings to clients, rather than an enum, and we also -return "" if we did not have access to a reason (which was the case -for upstream qemu). - -Fast forward to now: upstream qemu commit c7c2ff0c (will be qemu 2.2) -FINALLY adds a 'nospace' boolean, after discussion with multiple -projects determined that VDSM really doesn't care about distinction -between any other error types. So this patch converts 'nospace' into -the string "enospc" for compatibility with RHEL clients that were -already used to the downstream extension, while leaving the reason -blank for all other cases (no change from the status quo). - -See also https://bugzilla.redhat.com/show_bug.cgi?id=1119784 - -* src/qemu/qemu_monitor_json.c (qewmuMonitorJSONHandleIOError): -Parse reason field from modern qemu. -* include/libvirt/libvirt.h.in -(virConnectDomainEventIOErrorReasonCallback): Document it. - -Signed-off-by: Eric Blake -(cherry picked from commit e9392e48d4e3b29809da7883b697d5caf3a09680) -Signed-off-by: Jiri Denemark - -Conflicts: - src/qemu/qemu_monitor_json.c -- RHEL-only addition of - __com.redhat_reason - -This backport removes the RHEL-only __com.redhat_reason to make the code -match upstream. The next patch will add the RHEL-only reason back. This -is to make future rebases easier. We won't have to rework this once -again, we can just drop the old RHEL-only patch and this backport and -only keep the new RHEL-only patch. ---- - include/libvirt/libvirt.h.in | 6 ++++++ - src/qemu/qemu_monitor_json.c | 12 ++++++------ - 2 files changed, 12 insertions(+), 6 deletions(-) - -diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in -index 60b3e0b..3ca935e 100644 ---- a/include/libvirt/libvirt.h.in -+++ b/include/libvirt/libvirt.h.in -@@ -4853,6 +4853,12 @@ typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn, - * The callback signature to use when registering for an event of type - * VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON with virConnectDomainEventRegisterAny() - * -+ * If the I/O error is known to be caused by an ENOSPC condition in -+ * the host (where resizing the disk to be larger will allow the guest -+ * to be resumed as if nothing happened), @reason will be "enospc". -+ * Otherwise, @reason will be "", although future strings may be added -+ * if determination of other error types becomes possible. -+ * - */ - typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn, - virDomainPtr dom, -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index adf560a..7dcea2e 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -717,11 +717,13 @@ VIR_ENUM_IMPL(qemuMonitorIOErrorAction, VIR_DOMAIN_EVENT_IO_ERROR_LAST, - "ignore", "stop", "report"); - - --static void qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) -+static void -+qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) - { - const char *device; - const char *action; -- const char *reason; -+ const char *reason = ""; -+ bool nospc = false; - int actionID; - - /* Throughout here we try our best to carry on upon errors, -@@ -737,10 +739,8 @@ static void qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr dat - VIR_WARN("missing device in disk io error event"); - } - -- if ((reason = virJSONValueObjectGetString(data, "__com.redhat_reason")) == NULL) { -- VIR_WARN("missing __com.redhat_reason in disk io error event"); -- reason = ""; -- } -+ if (virJSONValueObjectGetBoolean(data, "nospace", &nospc) == 0 && nospc) -+ reason = "enospc"; - - if ((actionID = qemuMonitorIOErrorActionTypeFromString(action)) < 0) { - VIR_WARN("unknown disk io error action '%s'", action); --- -2.1.3 - diff --git a/SOURCES/libvirt-qemu-support-relative-backing-for-RHEL-7.0.z-qemu.patch b/SOURCES/libvirt-qemu-support-relative-backing-for-RHEL-7.0.z-qemu.patch deleted file mode 100644 index 9fbadb3..0000000 --- a/SOURCES/libvirt-qemu-support-relative-backing-for-RHEL-7.0.z-qemu.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 820ceb697d18e7d6f613b9496d7a6aceb50c80ed Mon Sep 17 00:00:00 2001 -Message-Id: <820ceb697d18e7d6f613b9496d7a6aceb50c80ed@dist-git> -From: Eric Blake -Date: Tue, 7 Oct 2014 17:06:17 -0600 -Subject: [PATCH] qemu: support relative backing for RHEL 7.0.z qemu - -RHEL-only: https://bugzilla.redhat.com/show_bug.cgi?id=1150322 - -qemu-kvm-rhev for RHEL 7.0.z backported enough code to allow -relative backing file manipulations, but could not backport -everything from upstream. So, instead of providing the upstream -'change-backing-file' QMP command, it added a downstream-only -'__com.redhat_change-backing-file' as a witness that relative -backing is supported, but not as full-featured. Since libvirt -from RHEL 7.1 may be driving an older qemu, we need to be able -to recognize the alternate spelling. - -* src/qemu/qemu_capabilities.c (virQEMUCapsCommands): Also -recognize downstream spelling. - -Signed-off-by: Eric Blake -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index ea1250d..bb804d3 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -1434,6 +1434,7 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { - { "add-fd", QEMU_CAPS_ADD_FD }, - { "nbd-server-start", QEMU_CAPS_NBD_SERVER }, - { "change-backing-file", QEMU_CAPS_CHANGE_BACKING_FILE }, -+ { "__com.redhat_change-backing-file", QEMU_CAPS_CHANGE_BACKING_FILE }, - { "rtc-reset-reinjection", QEMU_CAPS_RTC_RESET_REINJECTION }, - }; - --- -2.1.2 - diff --git a/SOURCES/libvirt-qemu-time-Report-errors-if-agent-command-fails.patch b/SOURCES/libvirt-qemu-time-Report-errors-if-agent-command-fails.patch deleted file mode 100644 index ebb87f8..0000000 --- a/SOURCES/libvirt-qemu-time-Report-errors-if-agent-command-fails.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 30540f7d14552466cf514704cfc91420b0cf81ca Mon Sep 17 00:00:00 2001 -Message-Id: <30540f7d14552466cf514704cfc91420b0cf81ca@dist-git> -From: Peter Krempa -Date: Tue, 16 Sep 2014 17:59:38 +0200 -Subject: [PATCH] qemu: time: Report errors if agent command fails - -Commit b606bbb4 broke reporting of errors when setting of guest time -fails via the guest agent as the return value is not checked and later -overwritten by the return value qemuMonitorRTCResetReinjection(); - -Fix this by checking the return value before resetting the RTC -reinjection. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1142294 -(cherry picked from commit 98fd3b7f0b1af179336e55ddee6163580a927d93) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index a2b9901..48bf612 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -16895,6 +16895,9 @@ qemuDomainSetTime(virDomainPtr dom, - rv = qemuAgentSetTime(priv->agent, seconds, nseconds, rtcSync); - qemuDomainObjExitAgent(vm); - -+ if (rv < 0) -+ goto endjob; -+ - if (!virDomainObjIsActive(vm)) { - virReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu-wire-up-virtio-net-segment-offloading-options.patch b/SOURCES/libvirt-qemu-wire-up-virtio-net-segment-offloading-options.patch deleted file mode 100644 index ac77a56..0000000 --- a/SOURCES/libvirt-qemu-wire-up-virtio-net-segment-offloading-options.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 8e70457b217ea22feea3ae674e4bf080f6518177 Mon Sep 17 00:00:00 2001 -Message-Id: <8e70457b217ea22feea3ae674e4bf080f6518177@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Wed, 24 Sep 2014 16:55:45 +0200 -Subject: [PATCH] qemu: wire up virtio-net segment offloading options - -https://bugzilla.redhat.com/show_bug.cgi?id=1139364 - -Format the segment offloading options specified by - - - - -on virtio-net command line. - -(cherry picked from commit 2d79e1752a0609eb17eef06223e4645f79fbb2cd) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 44 ++++++++++++++++++++++ - .../qemuxml2argv-net-virtio-disable-offloads.args | 10 +++++ - tests/qemuxml2argvtest.c | 2 + - 3 files changed, 56 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 7d4f3cc..6c4e2ff 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -4472,6 +4472,50 @@ qemuBuildNicDevStr(virDomainDefPtr def, - virBufferAsprintf(&buf, ",event_idx=%s", - virTristateSwitchTypeToString(net->driver.virtio.event_idx)); - } -+ if (net->driver.virtio.host.csum) { -+ virBufferAsprintf(&buf, ",csum=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.host.csum)); -+ } -+ if (net->driver.virtio.host.gso) { -+ virBufferAsprintf(&buf, ",gso=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.host.gso)); -+ } -+ if (net->driver.virtio.host.tso4) { -+ virBufferAsprintf(&buf, ",host_tso4=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.host.tso4)); -+ } -+ if (net->driver.virtio.host.tso6) { -+ virBufferAsprintf(&buf, ",host_tso6=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.host.tso6)); -+ } -+ if (net->driver.virtio.host.ecn) { -+ virBufferAsprintf(&buf, ",host_ecn=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.host.ecn)); -+ } -+ if (net->driver.virtio.host.ufo) { -+ virBufferAsprintf(&buf, ",host_ufo=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.host.ufo)); -+ } -+ if (net->driver.virtio.guest.csum) { -+ virBufferAsprintf(&buf, ",guest_csum=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.guest.csum)); -+ } -+ if (net->driver.virtio.guest.tso4) { -+ virBufferAsprintf(&buf, ",guest_tso4=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.guest.tso4)); -+ } -+ if (net->driver.virtio.guest.tso6) { -+ virBufferAsprintf(&buf, ",guest_tso6=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.guest.tso6)); -+ } -+ if (net->driver.virtio.guest.ecn) { -+ virBufferAsprintf(&buf, ",guest_ecn=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.guest.ecn)); -+ } -+ if (net->driver.virtio.guest.ufo) { -+ virBufferAsprintf(&buf, ",guest_ufo=%s", -+ virTristateSwitchTypeToString(net->driver.virtio.guest.ufo)); -+ } - } - if (usingVirtio && vhostfdSize > 1) { - /* As advised at http://www.linux-kvm.org/page/Multiqueue -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args -new file mode 100644 -index 0000000..b7ce282 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args -@@ -0,0 +1,10 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \ -+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -+-hda /dev/HostVG/QEMUGuest7 \ -+-device virtio-net-pci,csum=off,gso=off,\ -+host_tso4=off,host_tso6=off,host_ecn=off,host_ufo=off,\ -+guest_csum=off,guest_tso4=off,guest_tso6=off,guest_ecn=off,guest_ufo=off,\ -+vlan=0,id=net0,mac=00:22:44:66:88:aa,bus=pci.0,addr=0x3 \ -+-net user,vlan=0,name=hostnet0 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index a9129dc..410540f 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -969,6 +969,8 @@ mymain(void) - DO_TEST("net-virtio", NONE); - DO_TEST("net-virtio-device", - QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_VIRTIO_TX_ALG); -+ DO_TEST("net-virtio-disable-offloads", -+ QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); - DO_TEST("net-virtio-netdev", - QEMU_CAPS_DEVICE, QEMU_CAPS_NETDEV, QEMU_CAPS_NODEFCONFIG); - DO_TEST("net-virtio-s390", --- -2.1.1 - diff --git a/SOURCES/libvirt-qemuBuildNumaArgStr-Use-memory-backend-ram-more-wisely.patch b/SOURCES/libvirt-qemuBuildNumaArgStr-Use-memory-backend-ram-more-wisely.patch deleted file mode 100644 index bf83133..0000000 --- a/SOURCES/libvirt-qemuBuildNumaArgStr-Use-memory-backend-ram-more-wisely.patch +++ /dev/null @@ -1,248 +0,0 @@ -From c0af84c532e72d42a66059998ef7f03dcb0d6bd1 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Mon, 23 Feb 2015 08:20:03 +0100 -Subject: [PATCH] qemuBuildNumaArgStr: Use memory-backend-ram more wisely - -RHEL-7.2: https://bugzilla.redhat.com/show_bug.cgi?id=1191567 -RHEL-7.1.z: https://bugzilla.redhat.com/show_bug.cgi?id=1194982 - -So, when building the '-numa' command line, the qemuBuildNumaArgStr() -function does quite a lot of checks to chose the best backend, or to -check if one is in fact needed. However, it returned that backend is -needed even for this little fella: - - - - - -This can be guaranteed via CGroups entirely, there's no need to use -memory-backend-ram to let qemu know where to get memory from. Well, as -long as there's no element, which explicitly requires the -backend. Long story short, we wouldn't have to care, as qemu works -either way. However, the problem is migration (as always). Previously, -libvirt would have started qemu with: - - -numa node,memory=X - -in this case and restricted memory placement in CGroups. Today, libvirt -creates more complicated command line: - - -object memory-backend-ram,id=ram-node0,size=X - -numa node,memdev=ram-node0 - -Again, one wouldn't find anything wrong with these two approaches. -Both work just fine. Unless you try to migrated from the older libvirt -into the newer one. These two approaches are, unfortunately, not -compatible. My suggestion is, in order to allow users to migrate, lets -use the older approach for as long as the newer one is not needed. - -Moreover, this partly cherry-picks -b92a0037103efc15639dee9562866dbaffe302fb too. Especially the tests, -which need to be fixed too. We can't mix the bare -numa and -memory-backend-ram on the command line. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 7832fac84741d65e851dbdbfaf474785cbfdcf3c) -Signed-off-by: Michal Privoznik - -Conflicts: - src/qemu/qemu_command.c: The code is totally rewritten - upstream (esp. after memory hotplug). - tests/qemuxml2argvtest.c: Context, some tests were not - introduced yet. -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 35 +++++++++++--------- - .../qemuxml2argv-cputune-numatune.args | 5 +++ - .../qemuxml2argv-cputune-numatune.xml | 37 ++++++++++++++++++++++ - .../qemuxml2argv-hugepages-pages3.args | 3 +- - .../qemuxml2argv-numatune-auto-prefer.args | 5 +++ - .../qemuxml2argv-numatune-memnode-no-memory.args | 3 +- - tests/qemuxml2argvtest.c | 6 ++++ - 7 files changed, 77 insertions(+), 17 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-prefer.args - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index db0c324..a9cb7a3 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -6540,22 +6540,27 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - char *nodemask = NULL; - char *mem_path = NULL; - int ret = -1; -+ bool useNodemask = false; - -- if (virDomainNumatuneHasPerNodeBinding(def->numatune) && -- !(virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) || -- virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE))) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- _("Per-node memory binding is not supported " -- "with this QEMU")); -- goto cleanup; -+ if (virDomainNumatuneHasPerNodeBinding(def->numatune)) { -+ if (!(virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) || -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE))) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("Per-node memory binding is not supported " -+ "with this QEMU")); -+ goto cleanup; -+ } -+ useNodemask = true; - } - -- if (def->mem.nhugepages && def->mem.hugepages[0].size && -- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE)) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- _("huge pages per NUMA node are not " -- "supported with this QEMU")); -- goto cleanup; -+ if (def->mem.nhugepages && def->mem.hugepages[0].size) { -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("huge pages per NUMA node are not " -+ "supported with this QEMU")); -+ goto cleanup; -+ } -+ useNodemask = true; - } - - for (i = 0; i < def->mem.nhugepages; i++) { -@@ -6714,7 +6719,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - virBufferAsprintf(&buf, ",policy=%s", policy); - } - -- if (hugepage || nodemask) { -+ if (useNodemask) { - virCommandAddArg(cmd, "-object"); - virCommandAddArgBuffer(cmd, &buf); - } else { -@@ -6739,7 +6744,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, - virBufferAdd(&buf, tmpmask, -1); - } - -- if (hugepage || nodemask) -+ if (useNodemask) - virBufferAsprintf(&buf, ",memdev=ram-node%zu", i); - else - virBufferAsprintf(&buf, ",mem=%d", cellmem); -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args -new file mode 100644 -index 0000000..481f72f ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args -@@ -0,0 +1,5 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-x86_64 -S -M pc-q35-2.3 -m 128 \ -+-smp 2,maxcpus=6,sockets=6,cores=1,threads=1 \ -+-nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi \ -+-boot c -net none -serial none -parallel none -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml -new file mode 100644 -index 0000000..01bbb3d ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml -@@ -0,0 +1,37 @@ -+ -+ dummy2 -+ 4d92ec27-9ebf-400b-ae91-20c71c647c19 -+ 131072 -+ 65536 -+ 6 -+ 2 -+ -+ -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-x86_64 -+ -+
    -+ -+ -+ -+
    -+ -+ -+
    -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args -index f81947e..27b3f8e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args -@@ -1,6 +1,7 @@ - LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ - /usr/bin/qemu -S -M pc -m 1024 -smp 2 \ ---numa node,nodeid=0,cpus=0,mem=256 \ -+-object memory-backend-ram,size=256M,id=ram-node0 \ -+-numa node,nodeid=0,cpus=0,memdev=ram-node0 \ - -object memory-backend-file,prealloc=yes,\ - mem-path=/dev/hugepages1G/libvirt/qemu,size=768M,id=ram-node1 \ - -numa node,nodeid=1,cpus=1,memdev=ram-node1 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-prefer.args b/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-prefer.args -new file mode 100644 -index 0000000..0b1b0f5 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-prefer.args -@@ -0,0 +1,5 @@ -+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -+/usr/bin/kvm -S -M pc -m 64 -smp 1 \ -+-numa node,nodeid=0,cpus=0,mem=64 \ -+-nographic -monitor unix:/tmp/test-monitor,server,nowait \ -+-no-acpi -boot c -usb -net none -serial none -parallel none -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args -index 2addf97..b0e274c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args -@@ -2,6 +2,7 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ - /usr/bin/kvm -S -M pc -m 64 -smp 2 \ - -object memory-backend-ram,size=32M,id=ram-node0,host-nodes=3,policy=preferred \ - -numa node,nodeid=0,cpus=0,memdev=ram-node0 \ ---numa node,nodeid=1,cpus=1,mem=32 \ -+-object memory-backend-ram,size=32M,id=ram-node1 \ -+-numa node,nodeid=1,cpus=1,memdev=ram-node1 \ - -nographic -monitor unix:/tmp/test-monitor,server,nowait \ - -no-acpi -boot c -usb -net none -serial none -parallel none -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 98bb9ad..ee7397a 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1246,6 +1246,10 @@ mymain(void) - DO_TEST("blkiotune-device", QEMU_CAPS_NAME); - DO_TEST("cputune", QEMU_CAPS_NAME); - DO_TEST("cputune-zero-shares", QEMU_CAPS_NAME); -+ DO_TEST("cputune-numatune", QEMU_CAPS_SMP_TOPOLOGY, -+ QEMU_CAPS_KVM, -+ QEMU_CAPS_OBJECT_MEMORY_RAM, -+ QEMU_CAPS_OBJECT_MEMORY_FILE); - - DO_TEST("numatune-memory", NONE); - DO_TEST_PARSE_ERROR("numatune-memory-invalid-nodeset", NONE); -@@ -1256,6 +1260,8 @@ mymain(void) - DO_TEST_FAILURE("numatune-memnode-no-memory", NONE); - - DO_TEST("numatune-auto-nodeset-invalid", NONE); -+ DO_TEST("numatune-auto-prefer", QEMU_CAPS_OBJECT_MEMORY_RAM, -+ QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST_PARSE_ERROR("numatune-memnode-nocpu", NONE); - DO_TEST_PARSE_ERROR("numatune-memnodes-problematic", NONE); - DO_TEST("numad", NONE); --- -2.3.0 - diff --git a/SOURCES/libvirt-qemuDomainGetJobStatsInternal-Support-migration-events.patch b/SOURCES/libvirt-qemuDomainGetJobStatsInternal-Support-migration-events.patch new file mode 100644 index 0000000..1c9cd26 --- /dev/null +++ b/SOURCES/libvirt-qemuDomainGetJobStatsInternal-Support-migration-events.patch @@ -0,0 +1,80 @@ +From 891e04fccd80d2773e177858da80210800ebbad5 Mon Sep 17 00:00:00 2001 +Message-Id: <891e04fccd80d2773e177858da80210800ebbad5@dist-git> +From: Jiri Denemark +Date: Tue, 26 May 2015 13:42:06 +0200 +Subject: [PATCH] qemuDomainGetJobStatsInternal: Support migration events + +When QEMU supports migration events the qemuDomainJobInfo structure will +no longer be updated with migration statistics. We have to enter a job +and explicitly ask QEMU every time virDomainGetJob{Info,Stats} is +called. + +Signed-off-by: Jiri Denemark +(cherry picked from commit 66c95964a5706c223f4857e55396318c857abb6f) + +https://bugzilla.redhat.com/show_bug.cgi?id=1212077 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 27 +++++++++++++++++++++++---- + 1 file changed, 23 insertions(+), 4 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 6dafbec..b3e9e63 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -13021,15 +13021,27 @@ qemuConnectBaselineCPU(virConnectPtr conn ATTRIBUTE_UNUSED, + + + static int +-qemuDomainGetJobStatsInternal(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, ++qemuDomainGetJobStatsInternal(virQEMUDriverPtr driver, + virDomainObjPtr vm, + bool completed, + qemuDomainJobInfoPtr jobInfo) + { + qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainJobInfoPtr info; ++ bool fetch = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT); + int ret = -1; + ++ if (completed) ++ fetch = false; ++ ++ /* Do not ask QEMU if migration is not even running yet */ ++ if (!priv->job.current || !priv->job.current->status.status) ++ fetch = false; ++ ++ if (fetch && ++ qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0) ++ return -1; ++ + if (!completed && + !virDomainObjIsActive(vm)) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", +@@ -13050,12 +13062,19 @@ qemuDomainGetJobStatsInternal(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, + *jobInfo = *info; + + if (jobInfo->type == VIR_DOMAIN_JOB_BOUNDED || +- jobInfo->type == VIR_DOMAIN_JOB_UNBOUNDED) +- ret = qemuDomainJobInfoUpdateTime(jobInfo); +- else ++ jobInfo->type == VIR_DOMAIN_JOB_UNBOUNDED) { ++ if (fetch) ++ ret = qemuMigrationFetchJobStatus(driver, vm, QEMU_ASYNC_JOB_NONE, ++ jobInfo); ++ else ++ ret = qemuDomainJobInfoUpdateTime(jobInfo); ++ } else { + ret = 0; ++ } + + cleanup: ++ if (fetch) ++ qemuDomainObjEndJob(driver, vm); + return ret; + } + +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemuDomainSetInterfaceParameters-Use-new-functions-to-update-bandwidth.patch b/SOURCES/libvirt-qemuDomainSetInterfaceParameters-Use-new-functions-to-update-bandwidth.patch new file mode 100644 index 0000000..88f09f0 --- /dev/null +++ b/SOURCES/libvirt-qemuDomainSetInterfaceParameters-Use-new-functions-to-update-bandwidth.patch @@ -0,0 +1,83 @@ +From 97db8e9056749a76419e87339d2d368b29a9098a Mon Sep 17 00:00:00 2001 +Message-Id: <97db8e9056749a76419e87339d2d368b29a9098a@dist-git> +From: Michal Privoznik +Date: Fri, 14 Aug 2015 16:06:33 +0200 +Subject: [PATCH] qemuDomainSetInterfaceParameters: Use new functions to update + bandwidth + +https://bugzilla.redhat.com/show_bug.cgi?id=1252473 + +As sketched in previous commits, imagine the following scenario: + + virsh # domiftune gentoo vnet0 + inbound.average: 100 + inbound.peak : 0 + inbound.burst : 0 + outbound.average: 100 + outbound.peak : 0 + outbound.burst : 0 + + virsh # domiftune gentoo vnet0 --inbound 0 + + virsh # shutdown gentoo + Domain gentoo is being shutdown + + virsh # list --all + error: Failed to list domains + error: Cannot recv data: Connection reset by peer + + Program received signal SIGSEGV, Segmentation fault. + 0x00007fffe80ea221 in networkUnplugBandwidth (net=0x7fff9400c1a0, iface=0x7fff940ea3e0) at network/bridge_driver.c:4881 + 4881 net->floor_sum -= ifaceBand->in->floor; + +This is rather unfortunate. We should not SIGSEGV here. The +problem is, that while in the second step the inbound QoS was +cleared out, the network part of it was not updated (moreover, we +don't report that vnet0 had inbound.floor set). Internal +structure therefore still had some fragments left (e.g. +class_id). So when qemuProcessStop() started to clean up the +environment it got to networkUnplugBandwidth(). Here, class_id is +set therefore function assumes that there is an inbound QoS. This +actually is a fair assumption to make, there's no need for a +special QoS box in network's QoS when there's no QoS to set. +Anyway, the problem is not the networkUnplugBandwidth() rather +than qemuDomainSetInterfaceParameters() which completely forgot +about QoS being disperse (some parts are set directly on +interface itself, some on bridge the interface is plugged into). + +Signed-off-by: Michal Privoznik +(cherry picked from commit 5ee6d243fc5f2ba840ba43e4c9bd85cb5cb745a0) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index ec61bb5..e1ceb98 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -100,6 +100,7 @@ + #include "vircgroup.h" + #include "virnuma.h" + #include "dirname.h" ++#include "network/bridge_driver.h" + + #define VIR_FROM_THIS VIR_FROM_QEMU + +@@ -11323,7 +11324,11 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, + sizeof(*newBandwidth->out)); + } + +- if (virNetDevBandwidthSet(net->ifname, newBandwidth, false) < 0) { ++ if (!networkBandwidthChangeAllowed(net, newBandwidth)) ++ goto endjob; ++ ++ if (virNetDevBandwidthSet(net->ifname, newBandwidth, false) < 0 || ++ networkBandwidthUpdate(net, newBandwidth) < 0) { + ignore_value(virNetDevBandwidthSet(net->ifname, + net->bandwidth, + false)); +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemuDomainSetNumaParamsLive-Check-for-NUMA-mode-more-wisely.patch b/SOURCES/libvirt-qemuDomainSetNumaParamsLive-Check-for-NUMA-mode-more-wisely.patch new file mode 100644 index 0000000..2b00b9b --- /dev/null +++ b/SOURCES/libvirt-qemuDomainSetNumaParamsLive-Check-for-NUMA-mode-more-wisely.patch @@ -0,0 +1,41 @@ +From 5804052866cb35179f3520d1b21238b49ee19018 Mon Sep 17 00:00:00 2001 +Message-Id: <5804052866cb35179f3520d1b21238b49ee19018@dist-git> +From: Michal Privoznik +Date: Tue, 14 Jul 2015 11:20:26 +0200 +Subject: [PATCH] qemuDomainSetNumaParamsLive: Check for NUMA mode more wisely + +https://bugzilla.redhat.com/show_bug.cgi?id=1232663 + +In one of my previous ptaches (bcd9a564) I've tried to fix the problem +that we blindly assumed strict NUMA mode for guests. This led to +several problems like us pinning a domain onto a nodeset via libnuma +among with CGroups. Once the nodeset was changed by user, well, it did +not result in desired effect. See the original commit for more info. +But, the commit I wrote had a bug: when NUMA parameters are changed on +a running domain we require domain to be strictly pinned onto a +nodeset. Due to a typo a condition was mis-evaluated. + +Signed-off-by: Michal Privoznik +(cherry picked from commit 1cf25f633414dd844601965174b81bc9eb207d6b) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index fb42dae..47889d9 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -10036,7 +10036,7 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm, + size_t i = 0; + int ret = -1; + +- if (virDomainNumatuneGetMode(vm->def->numa, -1, &mode) < 0 || ++ if (virDomainNumatuneGetMode(vm->def->numa, -1, &mode) == 0 && + mode != VIR_DOMAIN_NUMATUNE_MEM_STRICT) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("change of nodeset for running domain " +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemuMonitorJSONBlockStatsUpdateCapacity-Don-t-skip-disks.patch b/SOURCES/libvirt-qemuMonitorJSONBlockStatsUpdateCapacity-Don-t-skip-disks.patch deleted file mode 100644 index 44f3b64..0000000 --- a/SOURCES/libvirt-qemuMonitorJSONBlockStatsUpdateCapacity-Don-t-skip-disks.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 4dc81b3be7488e24a61358e97c7a19faa27c9ed2 Mon Sep 17 00:00:00 2001 -Message-Id: <4dc81b3be7488e24a61358e97c7a19faa27c9ed2@dist-git> -From: Michal Privoznik -Date: Wed, 17 Dec 2014 03:09:03 -0700 -Subject: [PATCH] qemuMonitorJSONBlockStatsUpdateCapacity: Don't skip disks - -https://bugzilla.redhat.com/show_bug.cgi?id=1041569 - -The function queries the block devices visible to qemu -('query-block') and parses the qemu's output. The info is -returned in a hash table which is expected to be pre-filled by -qemuMonitorJSONGetAllBlockStatsInfo(). However, in the next patch -we are not going to call the latter function at all, so we should -make the former function add devices into the hash table if not -found there. - -Signed-off-by: Michal Privoznik -(cherry picked from commit a714533b2bd2de81b9319bb753e74cc9210ca647) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor_json.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 34fb91f..3cf67aa 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -2032,15 +2032,21 @@ int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, - if (STRPREFIX(dev_name, QEMU_DRIVE_HOST_PREFIX)) - dev_name += strlen(QEMU_DRIVE_HOST_PREFIX); - -- /* ignore missing info */ -- if (!(bstats = virHashLookup(stats, dev_name))) -- continue; -- - /* drive may be empty */ - if (!(inserted = virJSONValueObjectGet(dev, "inserted")) || - !(image = virJSONValueObjectGet(inserted, "image"))) - continue; - -+ if (!(bstats = virHashLookup(stats, dev_name))) { -+ if (VIR_ALLOC(bstats) < 0) -+ goto cleanup; -+ -+ if (virHashAddEntry(stats, dev_name, bstats) < 0) { -+ VIR_FREE(bstats); -+ goto cleanup; -+ } -+ } -+ - if (virJSONValueObjectGetNumberUlong(image, "virtual-size", - &bstats->capacity) < 0) - continue; --- -2.2.0 - diff --git a/SOURCES/libvirt-qemuPrepareNVRAM-Save-domain-after-NVRAM-path-generation.patch b/SOURCES/libvirt-qemuPrepareNVRAM-Save-domain-after-NVRAM-path-generation.patch deleted file mode 100644 index a643d83..0000000 --- a/SOURCES/libvirt-qemuPrepareNVRAM-Save-domain-after-NVRAM-path-generation.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 66b00a2567f5e00e0d94ee5af4a1b1c65dd90341 Mon Sep 17 00:00:00 2001 -Message-Id: <66b00a2567f5e00e0d94ee5af4a1b1c65dd90341@dist-git> -From: Michal Privoznik -Date: Mon, 29 Sep 2014 12:57:10 +0200 -Subject: [PATCH] qemuPrepareNVRAM: Save domain after NVRAM path generation - -https://bugzilla.redhat.com/show_bug.cgi?id=1026772 - -On a domain startup, the variable store path is generated if needed. -The path is intended to be generated only once. However, the updated -domain definition is not saved into config dir rather than state XML -only. So later, whenever the domain is destroyed and the daemon is -restarted, the generated path is forgotten and the file may be left -behind on virDomainUndefine() call. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 3a3c3780b478ccf137b434754c7c6b1ddbdf1ac2) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 9294619..d675add 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3874,6 +3874,9 @@ qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg, - goto cleanup; - - generated = true; -+ -+ if (virDomainSaveConfig(cfg->configDir, def) < 0) -+ goto cleanup; - } - - if (!virFileExists(loader->nvram)) { --- -2.1.2 - diff --git a/SOURCES/libvirt-qemuPrepareNVRAM-Save-domain-conf-only-if-domain-s-persistent.patch b/SOURCES/libvirt-qemuPrepareNVRAM-Save-domain-conf-only-if-domain-s-persistent.patch deleted file mode 100644 index 220a24b..0000000 --- a/SOURCES/libvirt-qemuPrepareNVRAM-Save-domain-conf-only-if-domain-s-persistent.patch +++ /dev/null @@ -1,71 +0,0 @@ -From de4f1874ef3fc1e2f63559441d7c63a5e0ae9048 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Wed, 19 Nov 2014 09:37:01 +0100 -Subject: [PATCH] qemuPrepareNVRAM: Save domain conf only if domain's - persistent - -https://bugzilla.redhat.com/show_bug.cgi?id=1026772 - -In one of my previous patches (3a3c3780b) I've tried to fix the -problem of nvram path disappearing on a domain that's been -started and shut down again. I fixed this by explicitly saving -domain's config file. However, I did a bit of clumsy without -realizing we have a transient domains for which we don't save the -config file. Hence, any domain using UEFI became persistent. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 54ddc08ddb3d86e90b48b655a51577761e20ac34) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 3eb1036..d6e10e3 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3898,13 +3898,13 @@ qemuProcessVerifyGuestCPU(virQEMUDriverPtr driver, - - static int - qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg, -- virDomainDefPtr def, -+ virDomainObjPtr vm, - bool migrated) - { - int ret = -1; - int srcFD = -1; - int dstFD = -1; -- virDomainLoaderDefPtr loader = def->os.loader; -+ virDomainLoaderDefPtr loader = vm->def->os.loader; - bool generated = false; - bool created = false; - -@@ -3931,12 +3931,13 @@ qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg, - if (!loader->nvram) { - if (virAsprintf(&loader->nvram, - "%s/lib/libvirt/qemu/nvram/%s_VARS.fd", -- LOCALSTATEDIR, def->name) < 0) -+ LOCALSTATEDIR, vm->def->name) < 0) - goto cleanup; - - generated = true; - -- if (virDomainSaveConfig(cfg->configDir, def) < 0) -+ if (vm->persistent && -+ virDomainSaveConfig(cfg->configDir, vm->def) < 0) - goto cleanup; - } - -@@ -4101,7 +4102,7 @@ int qemuProcessStart(virConnectPtr conn, - * Fill them in prior to setting the domain def as transient. */ - VIR_DEBUG("Generating paths"); - -- if (qemuPrepareNVRAM(cfg, vm->def, migrateFrom) < 0) -+ if (qemuPrepareNVRAM(cfg, vm, migrateFrom) < 0) - goto cleanup; - - /* Do this upfront, so any part of the startup process can add --- -2.1.3 - diff --git a/SOURCES/libvirt-qemuProcessHandleBlockJob-Set-disk-mirrorState-more-often.patch b/SOURCES/libvirt-qemuProcessHandleBlockJob-Set-disk-mirrorState-more-often.patch deleted file mode 100644 index 5ca957b..0000000 --- a/SOURCES/libvirt-qemuProcessHandleBlockJob-Set-disk-mirrorState-more-often.patch +++ /dev/null @@ -1,86 +0,0 @@ -From cafefa3ed050be8e81f29e4b6fa4ea30597ab8a3 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Tue, 17 Mar 2015 13:13:48 +0100 -Subject: [PATCH] qemuProcessHandleBlockJob: Set disk->mirrorState more often - -https://bugzilla.redhat.com/show_bug.cgi?id=1202719 - -Currently, upon BLOCK_JOB_* event, disk->mirrorState is not updated -each time. The callback code handling the events checks if a blockjob -was started via our public APIs prior to setting the mirrorState. -However, some block jobs may be started internally (e.g. during -storage migration), in which case we don't bother with setting -disk->mirror (there's nothing we can set it to anyway), or other -fields. But it will come handy if we update the mirrorState in these -cases too. The event wasn't delivered just for fun - we've started the -job after all. - -So, in this commit, the mirrorState is set to whatever job status -we've obtained. Of course, there are some actions on some statuses -that we want to perform. But instead of if {} else if {} else {} ... -enumeration, let's move to switch(). - -Signed-off-by: Michal Privoznik -(cherry picked from commit c37943a0687a8fdb08e6eda8ae4b9f4f43f4f2ed) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 35 ++++++++++++++++++++--------------- - 1 file changed, 20 insertions(+), 15 deletions(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 45bcf76..63cb198 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -1048,7 +1048,8 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - - /* If we completed a block pull or commit, then update the XML - * to match. */ -- if (status == VIR_DOMAIN_BLOCK_JOB_COMPLETED) { -+ switch ((virConnectDomainEventBlockJobStatus) status) { -+ case VIR_DOMAIN_BLOCK_JOB_COMPLETED: - if (disk->mirrorState == VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT) { - if (vm->newDef) { - int indx = virDomainDiskIndexByName(vm->newDef, disk->dst, -@@ -1098,20 +1099,24 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; - ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, - true, true)); -- } else if (disk->mirror && -- (type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY || -- type == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT)) { -- if (status == VIR_DOMAIN_BLOCK_JOB_READY) { -- disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY; -- save = true; -- } else if (status == VIR_DOMAIN_BLOCK_JOB_FAILED || -- status == VIR_DOMAIN_BLOCK_JOB_CANCELED) { -- virStorageSourceFree(disk->mirror); -- disk->mirror = NULL; -- disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -- disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -- save = true; -- } -+ break; -+ -+ case VIR_DOMAIN_BLOCK_JOB_READY: -+ disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY; -+ save = true; -+ break; -+ -+ case VIR_DOMAIN_BLOCK_JOB_FAILED: -+ case VIR_DOMAIN_BLOCK_JOB_CANCELED: -+ virStorageSourceFree(disk->mirror); -+ disk->mirror = NULL; -+ disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -+ disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; -+ save = true; -+ break; -+ -+ case VIR_DOMAIN_BLOCK_JOB_LAST: -+ break; - } - } - --- -2.3.3 - diff --git a/SOURCES/libvirt-qemuProcessHandleBlockJob-Take-status-into-account.patch b/SOURCES/libvirt-qemuProcessHandleBlockJob-Take-status-into-account.patch deleted file mode 100644 index e619d2a..0000000 --- a/SOURCES/libvirt-qemuProcessHandleBlockJob-Take-status-into-account.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 137ba6bfafefe50b85f7c099dd1472f2fe69c127 Mon Sep 17 00:00:00 2001 -Message-Id: <137ba6bfafefe50b85f7c099dd1472f2fe69c127@dist-git> -From: Michal Privoznik -Date: Tue, 17 Mar 2015 13:13:50 +0100 -Subject: [PATCH] qemuProcessHandleBlockJob: Take status into account - -https://bugzilla.redhat.com/show_bug.cgi?id=1202719 - -Upon BLOCK_JOB_COMPLETED event delivery, we check if the job has -completed (in qemuMonitorJSONHandleBlockJobImpl()). For better image, -the event looks something like this: - -"timestamp": {"seconds": 1423582694, "microseconds": 372666}, "event": -"BLOCK_JOB_COMPLETED", "data": {"device": "drive-virtio-disk0", "len": -8412790784, "offset": 409993216, "speed": 8796093022207, "type": -"mirror", "error": "No space left on device"}} - -If "len" does not equal "offset" it's considered an error, and we can -clearly see "error" field filled in. However, later in the event -processing this case was handled no differently to case of job being -aborted via separate API. It's time that we start differentiate these -two because of the future work. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 76c61cdca20c106960af033e5d0f5da70177af0f) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 63cb198..b9e7280 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -1110,7 +1110,8 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - case VIR_DOMAIN_BLOCK_JOB_CANCELED: - virStorageSourceFree(disk->mirror); - disk->mirror = NULL; -- disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; -+ disk->mirrorState = status == VIR_DOMAIN_BLOCK_JOB_FAILED ? -+ VIR_DOMAIN_DISK_MIRROR_STATE_ABORT : VIR_DOMAIN_DISK_MIRROR_STATE_NONE; - disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; - save = true; - break; --- -2.3.3 - diff --git a/SOURCES/libvirt-qemuProcessHandleMigrationStatus-Update-migration-status-more-frequently.patch b/SOURCES/libvirt-qemuProcessHandleMigrationStatus-Update-migration-status-more-frequently.patch new file mode 100644 index 0000000..8090b4f --- /dev/null +++ b/SOURCES/libvirt-qemuProcessHandleMigrationStatus-Update-migration-status-more-frequently.patch @@ -0,0 +1,47 @@ +From 8aa9a7056bc7d9510819b67a7a082ad661d9dc99 Mon Sep 17 00:00:00 2001 +Message-Id: <8aa9a7056bc7d9510819b67a7a082ad661d9dc99@dist-git> +From: Michal Privoznik +Date: Mon, 13 Jul 2015 15:26:04 +0200 +Subject: [PATCH] qemuProcessHandleMigrationStatus: Update migration status + more frequently + +https://bugzilla.redhat.com/show_bug.cgi?id=1212077 + +After Jirka's migration patches libvirt is listening on migration +events from qemu instead of actively polling on the monitor. There is, +however, a little regression (introduced in 6d2edb6a42d0d41). The +problem is, the current status of migration job is updated in +qemuProcessHandleMigrationStatus if and only if migration job was +started. But eventually every asynchronous job may result in +migration. Therefore, since this job is not strictly a +migration job, internal state was not updated and later checks failed: + + virsh # save fedora22 /tmp/fedora22_ble.save + error: Failed to save domain fedora22 to /tmp/fedora22_ble.save + error: operation failed: domain save job: is not active + +Signed-off-by: Michal Privoznik +(cherry picked from commit 45cc2fca5c97d7e6d6e00389c6f459b5660d0f1f) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_process.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 91ff5f8..e05be54 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -1532,8 +1532,7 @@ qemuProcessHandleMigrationStatus(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + qemuMonitorMigrationStatusTypeToString(status)); + + priv = vm->privateData; +- if (priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT && +- priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_IN) { ++ if (priv->job.asyncJob == QEMU_ASYNC_JOB_NONE) { + VIR_DEBUG("got MIGRATION event without a migration job"); + goto cleanup; + } +-- +2.5.0 + diff --git a/SOURCES/libvirt-qemu_capabilities-Change-virQEMUCapsFillDomainCaps-signature.patch b/SOURCES/libvirt-qemu_capabilities-Change-virQEMUCapsFillDomainCaps-signature.patch deleted file mode 100644 index 48c4062..0000000 --- a/SOURCES/libvirt-qemu_capabilities-Change-virQEMUCapsFillDomainCaps-signature.patch +++ /dev/null @@ -1,199 +0,0 @@ -From 55cf13fbf9802a2b52b77210e9b6360c1b0650e6 Mon Sep 17 00:00:00 2001 -Message-Id: <55cf13fbf9802a2b52b77210e9b6360c1b0650e6@dist-git> -From: Michal Privoznik -Date: Thu, 18 Sep 2014 11:45:38 +0200 -Subject: [PATCH] qemu_capabilities: Change virQEMUCapsFillDomainCaps signature - -https://bugzilla.redhat.com/show_bug.cgi?id=1026772 - -Up till now the virQEMUCapsFillDomainCaps() was type of void as -there was no way for it to fail. This is, however, going to -change in the next commit. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 2b2e4a7acff5574dd82bfbd61a638270f6be54ef) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 25 ++++++++++++++++--------- - src/qemu/qemu_capabilities.h | 4 ++-- - src/qemu/qemu_driver.c | 3 ++- - tests/domaincapstest.c | 19 ++++++++++++------- - 4 files changed, 32 insertions(+), 19 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 65efe3e..f398e3a 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -3608,7 +3608,7 @@ virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps) - } - - --static void -+static int - virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsLoaderPtr loader, - virArch arch) -@@ -3629,10 +3629,11 @@ virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps, - VIR_DOMAIN_CAPS_ENUM_SET(loader->readonly, - VIR_TRISTATE_BOOL_YES, - VIR_TRISTATE_BOOL_NO); -+ return 0; - } - - --static void -+static int - virQEMUCapsFillDomainOSCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsOSPtr os, - virArch arch) -@@ -3640,11 +3641,13 @@ virQEMUCapsFillDomainOSCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsLoaderPtr loader = &os->loader; - - os->device.supported = true; -- virQEMUCapsFillDomainLoaderCaps(qemuCaps, loader, arch); -+ if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, loader, arch) < 0) -+ return -1; -+ return 0; - } - - --static void -+static int - virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsDeviceDiskPtr disk) - { -@@ -3667,10 +3670,11 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps, - - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE)) - VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_USB); -+ return 0; - } - - --static void -+static int - virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsDeviceHostdevPtr hostdev) - { -@@ -3715,10 +3719,11 @@ virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps, - VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT, - VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM); - } -+ return 0; - } - - --void -+int - virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, - virQEMUCapsPtr qemuCaps) - { -@@ -3729,7 +3734,9 @@ virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, - - domCaps->maxvcpus = maxvcpus; - -- virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch); -- virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, disk); -- virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev); -+ if (virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch) < 0 || -+ virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, disk) < 0 || -+ virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0) -+ return -1; -+ return 0; - } -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 0980c00..828bba3 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -324,7 +324,7 @@ int virQEMUCapsInitGuestFromBinary(virCapsPtr caps, - virQEMUCapsPtr kvmbinCaps, - virArch guestarch); - --void virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, -- virQEMUCapsPtr qemuCaps); -+int virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps, -+ virQEMUCapsPtr qemuCaps); - - #endif /* __QEMU_CAPABILITIES_H__*/ -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index c0927d7..446dd63 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17140,7 +17140,8 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, - if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, virttype))) - goto cleanup; - -- virQEMUCapsFillDomainCaps(domCaps, qemuCaps); -+ if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps) < 0) -+ goto cleanup; - - ret = virDomainCapsFormat(domCaps); - cleanup: -diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c -index f240643..0c4b09f 100644 ---- a/tests/domaincapstest.c -+++ b/tests/domaincapstest.c -@@ -28,13 +28,13 @@ - - #define VIR_FROM_THIS VIR_FROM_NONE - --typedef void (*virDomainCapsFill)(virDomainCapsPtr domCaps, -- void *opaque); -+typedef int (*virDomainCapsFill)(virDomainCapsPtr domCaps, -+ void *opaque); - - #define SET_ALL_BITS(x) \ - memset(&(x.values), 0xff, sizeof(x.values)) - --static void -+static int - fillAll(virDomainCapsPtr domCaps, - void *opaque ATTRIBUTE_UNUSED) - { -@@ -60,18 +60,20 @@ fillAll(virDomainCapsPtr domCaps, - SET_ALL_BITS(hostdev->subsysType); - SET_ALL_BITS(hostdev->capsType); - SET_ALL_BITS(hostdev->pciBackend); -+ return 0; - } - - - #ifdef WITH_QEMU - # include "testutilsqemu.h" --static void -+static int - fillQemuCaps(virDomainCapsPtr domCaps, - void *opaque) - { - virQEMUCapsPtr qemuCaps = (virQEMUCapsPtr) opaque; - -- virQEMUCapsFillDomainCaps(domCaps, qemuCaps); -+ if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps) < 0) -+ return -1; - - /* The function above tries to query host's KVM & VFIO capabilities by - * calling qemuHostdevHostSupportsPassthroughLegacy() and -@@ -82,6 +84,7 @@ fillQemuCaps(virDomainCapsPtr domCaps, - VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT, - VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM, - VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO); -+ return 0; - } - #endif /* WITH_QEMU */ - -@@ -99,8 +102,10 @@ buildVirDomainCaps(const char *emulatorbin, - if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, type))) - goto cleanup; - -- if (fillFunc) -- fillFunc(domCaps, opaque); -+ if (fillFunc && fillFunc(domCaps, opaque) < 0) { -+ virObjectUnref(domCaps); -+ domCaps = NULL; -+ } - - cleanup: - return domCaps; --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu_cgroup-Adjust-spacing-around-incrementor.patch b/SOURCES/libvirt-qemu_cgroup-Adjust-spacing-around-incrementor.patch deleted file mode 100644 index 98fe183..0000000 --- a/SOURCES/libvirt-qemu_cgroup-Adjust-spacing-around-incrementor.patch +++ /dev/null @@ -1,64 +0,0 @@ -From d9be878c70729eec8350e3fcc0c79ef034e1a3a5 Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Thu, 18 Sep 2014 09:29:59 -0400 -Subject: [PATCH] qemu_cgroup: Adjust spacing around incrementor - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -Change "i+1" to "i + 1" - -(cherry picked from commit 500c91c57dafc7c4405e993bbb5261bb4ad43530) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_cgroup.c | 7 ++++--- - src/qemu/qemu_process.c | 2 +- - 2 files changed, 5 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index c1d89bb..9d39370 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -1140,7 +1140,8 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm) - /* IOThreads are numbered 1..n, although the array is 0..n-1, - * so we will account for that here - */ -- if (virCgroupNewIOThread(priv->cgroup, i+1, true, &cgroup_iothread) < 0) -+ if (virCgroupNewIOThread(priv->cgroup, i + 1, true, -+ &cgroup_iothread) < 0) - goto cleanup; - - /* move the thread for iothread to sub dir */ -@@ -1159,13 +1160,13 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm) - * qemuSetupCgroupIOThreadsPin will fail. */ - for (j = 0; j < def->cputune.niothreadspin; j++) { - /* IOThreads are numbered/named 1..n */ -- if (def->cputune.iothreadspin[j]->vcpuid != i+1) -+ if (def->cputune.iothreadspin[j]->vcpuid != i + 1) - continue; - - if (qemuSetupCgroupIOThreadsPin(cgroup_iothread, - def->cputune.iothreadspin, - def->cputune.niothreadspin, -- i+1) < 0) -+ i + 1) < 0) - goto cleanup; - - break; -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 274fc1b..a2304dc 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2357,7 +2357,7 @@ qemuProcessSetIOThreadsAffinity(virDomainObjPtr vm) - /* set affinity only for existing vcpus */ - if (!(pininfo = virDomainVcpuPinFindByVcpu(def->cputune.iothreadspin, - def->cputune.niothreadspin, -- i+1))) -+ i + 1))) - continue; - - if (virProcessSetAffinity(priv->iothreadpids[i], pininfo->cpumask) < 0) --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu_cgroup-Introduce-cgroup-functions-for-IOThreads.patch b/SOURCES/libvirt-qemu_cgroup-Introduce-cgroup-functions-for-IOThreads.patch deleted file mode 100644 index 3040d95..0000000 --- a/SOURCES/libvirt-qemu_cgroup-Introduce-cgroup-functions-for-IOThreads.patch +++ /dev/null @@ -1,170 +0,0 @@ -From c6bfaa39bd6a2d1bfd0e608b38afa39a698c809b Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Thu, 18 Sep 2014 09:29:53 -0400 -Subject: [PATCH] qemu_cgroup: Introduce cgroup functions for IOThreads - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -In order to support cpuset setting, introduce qemuSetupCgroupIOThreadsPin -and qemuSetupCgroupForIOThreads to mimic the existing Vcpu API's. - -These will support having an 'iotrhreadpin' element in the 'cpuset' in -order to pin named IOThreads to specific CPU's. The IOThread pin names -will follow the IOThread naming scheme starting at 1 (eg "iothread1") -up through an including the def->iothreads value. - -(cherry picked from commit 5f6ad32c733a3bd158938aecabb0508a434ece95) - -NOTE: Requires commit 938fb12fad6d15c9fdb73f998c4e0ec1e278721f in order - to build - should be two patches later - -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_cgroup.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_cgroup.h | 5 +++ - 2 files changed, 109 insertions(+) - -diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c -index 43d14d4..c1d89bb 100644 ---- a/src/qemu/qemu_cgroup.c -+++ b/src/qemu/qemu_cgroup.c -@@ -903,6 +903,23 @@ qemuSetupCgroupVcpuPin(virCgroupPtr cgroup, - } - - int -+qemuSetupCgroupIOThreadsPin(virCgroupPtr cgroup, -+ virDomainVcpuPinDefPtr *iothreadspin, -+ int niothreadspin, -+ int iothreadid) -+{ -+ size_t i; -+ -+ for (i = 0; i < niothreadspin; i++) { -+ if (iothreadid == iothreadspin[i]->vcpuid) { -+ return qemuSetupCgroupEmulatorPin(cgroup, iothreadspin[i]->cpumask); -+ } -+ } -+ -+ return -1; -+} -+ -+int - qemuSetupCgroupEmulatorPin(virCgroupPtr cgroup, - virBitmapPtr cpumask) - { -@@ -1083,6 +1100,93 @@ qemuSetupCgroupForEmulator(virQEMUDriverPtr driver, - } - - int -+qemuSetupCgroupForIOThreads(virDomainObjPtr vm) -+{ -+ virCgroupPtr cgroup_iothread = NULL; -+ qemuDomainObjPrivatePtr priv = vm->privateData; -+ virDomainDefPtr def = vm->def; -+ size_t i, j; -+ unsigned long long period = vm->def->cputune.period; -+ long long quota = vm->def->cputune.quota; -+ -+ if ((period || quota) && -+ !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("cgroup cpu is required for scheduler tuning")); -+ return -1; -+ } -+ -+ /* -+ * If CPU cgroup controller is not initialized here, then we need -+ * neither period nor quota settings. And if CPUSET controller is -+ * not initialized either, then there's nothing to do anyway. -+ */ -+ if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU) && -+ !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) -+ return 0; -+ -+ /* We are trying to setup cgroups for CPU pinning, which can also be done -+ * with virProcessSetAffinity, thus the lack of cgroups is not fatal here. -+ */ -+ if (priv->cgroup == NULL) -+ return 0; -+ -+ if (priv->niothreadpids == 0) { -+ VIR_WARN("Unable to get iothreads' pids."); -+ return 0; -+ } -+ -+ for (i = 0; i < priv->niothreadpids; i++) { -+ /* IOThreads are numbered 1..n, although the array is 0..n-1, -+ * so we will account for that here -+ */ -+ if (virCgroupNewIOThread(priv->cgroup, i+1, true, &cgroup_iothread) < 0) -+ goto cleanup; -+ -+ /* move the thread for iothread to sub dir */ -+ if (virCgroupAddTask(cgroup_iothread, priv->iothreadpids[i]) < 0) -+ goto cleanup; -+ -+ if (period || quota) { -+ if (qemuSetupCgroupVcpuBW(cgroup_iothread, period, quota) < 0) -+ goto cleanup; -+ } -+ -+ /* Set iothreadpin in cgroup if iothreadpin xml is provided */ -+ if (virCgroupHasController(priv->cgroup, -+ VIR_CGROUP_CONTROLLER_CPUSET)) { -+ /* find the right CPU to pin, otherwise -+ * qemuSetupCgroupIOThreadsPin will fail. */ -+ for (j = 0; j < def->cputune.niothreadspin; j++) { -+ /* IOThreads are numbered/named 1..n */ -+ if (def->cputune.iothreadspin[j]->vcpuid != i+1) -+ continue; -+ -+ if (qemuSetupCgroupIOThreadsPin(cgroup_iothread, -+ def->cputune.iothreadspin, -+ def->cputune.niothreadspin, -+ i+1) < 0) -+ goto cleanup; -+ -+ break; -+ } -+ } -+ -+ virCgroupFree(&cgroup_iothread); -+ } -+ -+ return 0; -+ -+ cleanup: -+ if (cgroup_iothread) { -+ virCgroupRemove(cgroup_iothread); -+ virCgroupFree(&cgroup_iothread); -+ } -+ -+ return -1; -+} -+ -+int - qemuRemoveCgroup(virDomainObjPtr vm) - { - qemuDomainObjPrivatePtr priv = vm->privateData; -diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h -index 7394969..8a2c723 100644 ---- a/src/qemu/qemu_cgroup.h -+++ b/src/qemu/qemu_cgroup.h -@@ -57,7 +57,12 @@ int qemuSetupCgroupVcpuPin(virCgroupPtr cgroup, - int nvcpupin, - int vcpuid); - int qemuSetupCgroupEmulatorPin(virCgroupPtr cgroup, virBitmapPtr cpumask); -+int qemuSetupCgroupIOThreadsPin(virCgroupPtr cgroup, -+ virDomainVcpuPinDefPtr *iothreadspin, -+ int niothreadspin, -+ int iothreadid); - int qemuSetupCgroupForVcpu(virDomainObjPtr vm); -+int qemuSetupCgroupForIOThreads(virDomainObjPtr vm); - int qemuSetupCgroupForEmulator(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virBitmapPtr nodemask); --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu_domain-Add-niothreadpids-and-iothreadpids.patch b/SOURCES/libvirt-qemu_domain-Add-niothreadpids-and-iothreadpids.patch deleted file mode 100644 index f2eae4b..0000000 --- a/SOURCES/libvirt-qemu_domain-Add-niothreadpids-and-iothreadpids.patch +++ /dev/null @@ -1,97 +0,0 @@ -From e2bc63134ab6c302d7a7e605e0da4fd46b4c687a Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Thu, 18 Sep 2014 09:29:52 -0400 -Subject: [PATCH] qemu_domain: Add niothreadpids and iothreadpids - -https://bugzilla.redhat.com/show_bug.cgi?id=1101574 - -Add new 'niothreadpids' and 'iothreadpids' to mimic the 'ncpupids' and -'vcpupids' that already exist. - -(cherry picked from commit 586905512ac2a43698e6d1fa9e719fa564571613) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 36 ++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_domain.h | 3 +++ - 2 files changed, 39 insertions(+) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index c0306d7..863ab09 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -425,6 +425,7 @@ qemuDomainObjPrivateFree(void *data) - virDomainChrSourceDefFree(priv->monConfig); - qemuDomainObjFreeJob(priv); - VIR_FREE(priv->vcpupids); -+ VIR_FREE(priv->iothreadpids); - VIR_FREE(priv->lockState); - VIR_FREE(priv->origname); - -@@ -483,6 +484,18 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, void *data) - virBufferAddLit(buf, "\n"); - } - -+ if (priv->niothreadpids) { -+ size_t i; -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ for (i = 0; i < priv->niothreadpids; i++) { -+ virBufferAsprintf(buf, "\n", -+ priv->iothreadpids[i]); -+ } -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ } -+ - if (priv->qemuCaps) { - size_t i; - virBufferAddLit(buf, "\n"); -@@ -606,6 +619,29 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data) - VIR_FREE(nodes); - } - -+ n = virXPathNodeSet("./iothreads/iothread", ctxt, &nodes); -+ if (n < 0) -+ goto error; -+ if (n) { -+ priv->niothreadpids = n; -+ if (VIR_REALLOC_N(priv->iothreadpids, priv->niothreadpids) < 0) -+ goto error; -+ -+ for (i = 0; i < n; i++) { -+ char *pidstr = virXMLPropString(nodes[i], "pid"); -+ if (!pidstr) -+ goto error; -+ -+ if (virStrToLong_i(pidstr, NULL, 10, -+ &(priv->iothreadpids[i])) < 0) { -+ VIR_FREE(pidstr); -+ goto error; -+ } -+ VIR_FREE(pidstr); -+ } -+ VIR_FREE(nodes); -+ } -+ - if ((n = virXPathNodeSet("./qemuCaps/flag", ctxt, &nodes)) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("failed to parse qemu capabilities flags")); -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 479b51f..4ae2c57 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -154,6 +154,9 @@ struct _qemuDomainObjPrivate { - int nvcpupids; - int *vcpupids; - -+ int niothreadpids; -+ int *iothreadpids; -+ - virDomainPCIAddressSetPtr pciaddrs; - virDomainCCWAddressSetPtr ccwaddrs; - int persistentAddrs; --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu_driver-Resolve-Coverity-COPY_PASTE_ERROR.patch b/SOURCES/libvirt-qemu_driver-Resolve-Coverity-COPY_PASTE_ERROR.patch deleted file mode 100644 index c4ec23f..0000000 --- a/SOURCES/libvirt-qemu_driver-Resolve-Coverity-COPY_PASTE_ERROR.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 25e86fba1910cccd107b66a23a0d5a71ae3e2621 Mon Sep 17 00:00:00 2001 -Message-Id: <25e86fba1910cccd107b66a23a0d5a71ae3e2621@dist-git> -From: John Ferlan -Date: Mon, 15 Sep 2014 15:13:47 -0400 -Subject: [PATCH] qemu_driver: Resolve Coverity COPY_PASTE_ERROR - -https://bugzilla.redhat.com/show_bug.cgi?id=1141209 - -In qemuDomainSetBlkioParameters(), Coverity points out that the calls -to qemuDomainParseBlkioDeviceStr() are slightly different and points -out there may be a cut-n-paste error. - -In the first call (AFFECT_LIVE), the second parameter is "param->field"; -however, for the second call (AFFECT_CONFIG), the second parameter is -"params->field". It seems the "param->field" is correct especially since -each path as a setting of "param" to "¶ms[i]". Furthermore, there -were a few more instances of using "params[i]" instead of "param->" -which I cleaned up. - -Signed-off-by: John Ferlan -(cherry picked from commit f72f064269ea599bc0e67787e2c69f98e524fa56) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 496fab5..04384fb 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -7831,7 +7831,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, - virTypedParameterPtr param = ¶ms[i]; - - if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) { -- if (virCgroupSetBlkioWeight(priv->cgroup, params[i].value.ui) < 0) -+ if (virCgroupSetBlkioWeight(priv->cgroup, param->value.ui) < 0) - ret = -1; - } else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) || - STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS) || -@@ -7842,7 +7842,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, - virBlkioDevicePtr devices = NULL; - size_t j; - -- if (qemuDomainParseBlkioDeviceStr(params[i].value.s, -+ if (qemuDomainParseBlkioDeviceStr(param->value.s, - param->field, - &devices, - &ndevices) < 0) { -@@ -7925,7 +7925,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, - virTypedParameterPtr param = ¶ms[i]; - - if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) { -- persistentDef->blkio.weight = params[i].value.ui; -+ persistentDef->blkio.weight = param->value.ui; - } else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) || - STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS) || - STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS) || -@@ -7934,8 +7934,8 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, - virBlkioDevicePtr devices = NULL; - size_t ndevices; - -- if (qemuDomainParseBlkioDeviceStr(params[i].value.s, -- params->field, -+ if (qemuDomainParseBlkioDeviceStr(param->value.s, -+ param->field, - &devices, - &ndevices) < 0) { - ret = -1; --- -2.1.0 - diff --git a/SOURCES/libvirt-qemu_driver-fix-setting-vcpus-for-offline-domain.patch b/SOURCES/libvirt-qemu_driver-fix-setting-vcpus-for-offline-domain.patch deleted file mode 100644 index 06df892..0000000 --- a/SOURCES/libvirt-qemu_driver-fix-setting-vcpus-for-offline-domain.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 6f34957b6242c1537e91684af2864eeed434d5b1 Mon Sep 17 00:00:00 2001 -Message-Id: <6f34957b6242c1537e91684af2864eeed434d5b1@dist-git> -From: Pavel Hrdina -Date: Thu, 15 Jan 2015 15:03:51 +0100 -Subject: [PATCH] qemu_driver: fix setting vcpus for offline domain - -https://bugzilla.redhat.com/show_bug.cgi?id=1161540 - -Commit e3435caf fixed hot-plugging of vcpus with strict memory pinning -on NUMA hosts, but unfortunately it also broke updating number of vcpus -for offline guests using our API. - -The issue is that we try to create a cpu cgroup for non-running guest -which fails as there are no cgroups for that domain. We should create -cgroups and update cpuset.mems only if we are hot-plugging. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit e105dc981438bc33fa771bd67cece6234dbf6c8d) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 26 ++++++++++++++------------ - 1 file changed, 14 insertions(+), 12 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index afcf326..619f2d6 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -4672,21 +4672,23 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, - - priv = vm->privateData; - -- if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0) -- goto cleanup; -- -- if (!(all_nodes = virNumaGetHostNodeset())) -- goto cleanup; -- -- if (!(all_nodes_str = virBitmapFormat(all_nodes))) -- goto cleanup; -- - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) - goto cleanup; - -- if (virCgroupGetCpusetMems(cgroup_temp, &mem_mask) < 0 || -- virCgroupSetCpusetMems(cgroup_temp, all_nodes_str) < 0) -- goto endjob; -+ if (flags & VIR_DOMAIN_AFFECT_LIVE && !(flags & VIR_DOMAIN_VCPU_GUEST)) { -+ if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0) -+ goto cleanup; -+ -+ if (!(all_nodes = virNumaGetHostNodeset())) -+ goto cleanup; -+ -+ if (!(all_nodes_str = virBitmapFormat(all_nodes))) -+ goto cleanup; -+ -+ if (virCgroupGetCpusetMems(cgroup_temp, &mem_mask) < 0 || -+ virCgroupSetCpusetMems(cgroup_temp, all_nodes_str) < 0) -+ goto endjob; -+ } - - maximum = (flags & VIR_DOMAIN_VCPU_MAXIMUM) != 0; - flags &= ~VIR_DOMAIN_VCPU_MAXIMUM; --- -2.2.1 - diff --git a/SOURCES/libvirt-qemu_hotplug-try-harder-to-eject-media.patch b/SOURCES/libvirt-qemu_hotplug-try-harder-to-eject-media.patch new file mode 100644 index 0000000..bfea4fe --- /dev/null +++ b/SOURCES/libvirt-qemu_hotplug-try-harder-to-eject-media.patch @@ -0,0 +1,169 @@ +From cc6d958b1ba9efb26ca5b28c575369e335b1e7a0 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Pavel Hrdina +Date: Fri, 10 Jul 2015 12:39:32 +0200 +Subject: [PATCH] qemu_hotplug: try harder to eject media + +Some guests lock the tray and QEMU eject command will simply fail to +eject the media. But the guest OS can handle this attempt to eject the +media and can unlock the tray and open it. In this case, we should try +again to actually eject the media. + +If the first attempt fails to detect a tray_open we will fail with +error, from monitor. If we receive that event, we know, that the guest +properly reacted to the eject request, unlocked the tray and opened it. +In this case, we need to run the command again to actually eject the +media from the device. The reason to call it again is, that QEMU +doesn't wait for the guest to react and report an error, that the tray +is locked. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1147471 + +Signed-off-by: Pavel Hrdina +(cherry picked from commit 28554080ecbcd1e57266b29734feb76799c2ee48) +Signed-off-by: Pavel Hrdina +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_hotplug.c | 73 +++++++++++++++++++++++-------------------------- + src/qemu/qemu_process.c | 2 ++ + 2 files changed, 36 insertions(+), 39 deletions(-) + +diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c +index 79338cf..1ea397f 100644 +--- a/src/qemu/qemu_hotplug.c ++++ b/src/qemu/qemu_hotplug.c +@@ -59,7 +59,7 @@ + + VIR_LOG_INIT("qemu.qemu_hotplug"); + +-#define CHANGE_MEDIA_RETRIES 10 ++#define CHANGE_MEDIA_TIMEOUT 5000 + + /* Wait up to 5 seconds for device removal to finish. */ + unsigned long long qemuDomainRemoveDeviceWaitTime = 1000ull * 5; +@@ -166,12 +166,13 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, + virStorageSourcePtr newsrc, + bool force) + { +- int ret = -1; ++ int ret = -1, rc; + char *driveAlias = NULL; + qemuDomainObjPrivatePtr priv = vm->privateData; +- int retries = CHANGE_MEDIA_RETRIES; + const char *format = NULL; + char *sourcestr = NULL; ++ bool ejectRetry = false; ++ unsigned long long now; + + if (!disk->info.alias) { + virReportError(VIR_ERR_INTERNAL_ERROR, +@@ -193,36 +194,31 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, + if (!(driveAlias = qemuDeviceDriveHostAlias(disk, priv->qemuCaps))) + goto error; + +- qemuDomainObjEnterMonitor(driver, vm); +- ret = qemuMonitorEjectMedia(priv->mon, driveAlias, force); +- if (qemuDomainObjExitMonitor(driver, vm) < 0) { +- ret = -1; +- goto cleanup; +- } ++ do { ++ qemuDomainObjEnterMonitor(driver, vm); ++ rc = qemuMonitorEjectMedia(priv->mon, driveAlias, force); ++ if (qemuDomainObjExitMonitor(driver, vm) < 0) ++ goto cleanup; + +- if (ret < 0) +- goto error; ++ if (rc == -2) { ++ /* we've already tried, error out */ ++ if (ejectRetry) ++ goto error; ++ VIR_DEBUG("tray is locked, wait for the guest to unlock " ++ "the tray and try to eject it again"); ++ ejectRetry = true; ++ } else if (rc < 0) { ++ goto error; ++ } + +- virObjectRef(vm); +- /* we don't want to report errors from media tray_open polling */ +- while (retries) { +- if (disk->tray_status == VIR_DOMAIN_DISK_TRAY_OPEN) +- break; ++ if (virTimeMillisNow(&now) < 0) ++ goto error; + +- retries--; +- virObjectUnlock(vm); +- VIR_DEBUG("Waiting 500ms for tray to open. Retries left %d", retries); +- usleep(500 * 1000); /* sleep 500ms */ +- virObjectLock(vm); +- } +- virObjectUnref(vm); +- +- if (retries <= 0) { +- virReportError(VIR_ERR_OPERATION_FAILED, "%s", +- _("Unable to eject media")); +- ret = -1; +- goto error; +- } ++ while (disk->tray_status != VIR_DOMAIN_DISK_TRAY_OPEN) { ++ if (virDomainObjWaitUntil(vm, now + CHANGE_MEDIA_TIMEOUT) != 0) ++ goto error; ++ } ++ } while (ejectRetry && rc != 0); + + if (!virStorageSourceIsEmpty(newsrc)) { + if (qemuGetDriveSourceString(newsrc, conn, &sourcestr) < 0) +@@ -237,19 +233,17 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, + } + } + qemuDomainObjEnterMonitor(driver, vm); +- ret = qemuMonitorChangeMedia(priv->mon, +- driveAlias, +- sourcestr, +- format); +- if (qemuDomainObjExitMonitor(driver, vm) < 0) { +- ret = -1; ++ rc = qemuMonitorChangeMedia(priv->mon, ++ driveAlias, ++ sourcestr, ++ format); ++ if (qemuDomainObjExitMonitor(driver, vm) < 0) + goto cleanup; +- } + } + +- virDomainAuditDisk(vm, disk->src, newsrc, "update", ret >= 0); ++ virDomainAuditDisk(vm, disk->src, newsrc, "update", rc >= 0); + +- if (ret < 0) ++ if (rc < 0) + goto error; + + /* remove the old source from shared device list */ +@@ -259,6 +253,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, + virStorageSourceFree(disk->src); + disk->src = newsrc; + newsrc = NULL; ++ ret = 0; + + cleanup: + VIR_FREE(driveAlias); +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 9f1ae5a..c5f467b 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -1155,6 +1155,8 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + VIR_WARN("Unable to save status on vm %s after tray moved event", + vm->def->name); + } ++ ++ virDomainObjBroadcast(vm); + } + + virObjectUnlock(vm); +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu_monitor-Wire-up-MIGRATION-event.patch b/SOURCES/libvirt-qemu_monitor-Wire-up-MIGRATION-event.patch new file mode 100644 index 0000000..c687212 --- /dev/null +++ b/SOURCES/libvirt-qemu_monitor-Wire-up-MIGRATION-event.patch @@ -0,0 +1,164 @@ +From a72b20b3cb4837a87cdeb50fd625ccfe7a6c76a7 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Thu, 28 May 2015 13:35:52 +0200 +Subject: [PATCH] qemu_monitor: Wire up MIGRATION event + +Thanks to Juan's work QEMU finally emits an event whenever migration +state changes. + +Signed-off-by: Jiri Denemark +(cherry picked from commit a60ee613c499c255faf7c36e7cd8582b5a79ca57) + +https://bugzilla.redhat.com/show_bug.cgi?id=1212077 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 2 ++ + src/qemu/qemu_capabilities.h | 1 + + src/qemu/qemu_monitor.c | 14 ++++++++++++++ + src/qemu/qemu_monitor.h | 8 ++++++++ + src/qemu/qemu_monitor_json.c | 23 +++++++++++++++++++++++ + 5 files changed, 48 insertions(+) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 89d63e5..b4a6961 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -287,6 +287,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + "aarch64-off", + + "vhost-user-multiqueue", /* 190 */ ++ "migration-event", + ); + + +@@ -1506,6 +1507,7 @@ struct virQEMUCapsStringFlags virQEMUCapsEvents[] = { + { "BALLOON_CHANGE", QEMU_CAPS_BALLOON_EVENT }, + { "SPICE_MIGRATE_COMPLETED", QEMU_CAPS_SEAMLESS_MIGRATION }, + { "DEVICE_DELETED", QEMU_CAPS_DEVICE_DEL_EVENT }, ++ { "MIGRATION", QEMU_CAPS_MIGRATION_EVENT }, + }; + + struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index 30aa504..f77bd06 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -230,6 +230,7 @@ typedef enum { + QEMU_CAPS_DEVICE_PCI_SERIAL = 188, /* -device pci-serial */ + QEMU_CAPS_CPU_AARCH64_OFF = 189, /* -cpu ...,aarch64=off */ + QEMU_CAPS_VHOSTUSER_MULTIQUEUE = 190, /* vhost-user with -netdev queues= */ ++ QEMU_CAPS_MIGRATION_EVENT = 191, /* MIGRATION event */ + + QEMU_CAPS_LAST, /* this must always be the last item */ + } virQEMUCapsFlags; +diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c +index 9c70211..dd742cf 100644 +--- a/src/qemu/qemu_monitor.c ++++ b/src/qemu/qemu_monitor.c +@@ -1498,6 +1498,20 @@ qemuMonitorEmitSpiceMigrated(qemuMonitorPtr mon) + + + int ++qemuMonitorEmitMigrationStatus(qemuMonitorPtr mon, ++ int status) ++{ ++ int ret = -1; ++ VIR_DEBUG("mon=%p, status=%s", ++ mon, NULLSTR(qemuMonitorMigrationStatusTypeToString(status))); ++ ++ QEMU_MONITOR_CALLBACK(mon, ret, domainMigrationStatus, mon->vm, status); ++ ++ return ret; ++} ++ ++ ++int + qemuMonitorSetCapabilities(qemuMonitorPtr mon) + { + QEMU_CHECK_MONITOR(mon); +diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h +index 87167e3..d2b2f94 100644 +--- a/src/qemu/qemu_monitor.h ++++ b/src/qemu/qemu_monitor.h +@@ -186,6 +186,11 @@ typedef int (*qemuMonitorDomainSpiceMigratedCallback)(qemuMonitorPtr mon, + virDomainObjPtr vm, + void *opaque); + ++typedef int (*qemuMonitorDomainMigrationStatusCallback)(qemuMonitorPtr mon, ++ virDomainObjPtr vm, ++ int status, ++ void *opaque); ++ + typedef struct _qemuMonitorCallbacks qemuMonitorCallbacks; + typedef qemuMonitorCallbacks *qemuMonitorCallbacksPtr; + struct _qemuMonitorCallbacks { +@@ -214,6 +219,7 @@ struct _qemuMonitorCallbacks { + qemuMonitorDomainNicRxFilterChangedCallback domainNicRxFilterChanged; + qemuMonitorDomainSerialChangeCallback domainSerialChange; + qemuMonitorDomainSpiceMigratedCallback domainSpiceMigrated; ++ qemuMonitorDomainMigrationStatusCallback domainMigrationStatus; + }; + + char *qemuMonitorEscapeArg(const char *in); +@@ -313,6 +319,8 @@ int qemuMonitorEmitSerialChange(qemuMonitorPtr mon, + const char *devAlias, + bool connected); + int qemuMonitorEmitSpiceMigrated(qemuMonitorPtr mon); ++int qemuMonitorEmitMigrationStatus(qemuMonitorPtr mon, ++ int status); + + int qemuMonitorStartCPUs(qemuMonitorPtr mon, + virConnectPtr conn); +diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c +index 065c7fe..4323c2a 100644 +--- a/src/qemu/qemu_monitor_json.c ++++ b/src/qemu/qemu_monitor_json.c +@@ -84,6 +84,7 @@ static void qemuMonitorJSONHandleDeviceDeleted(qemuMonitorPtr mon, virJSONValueP + static void qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitorPtr mon, virJSONValuePtr data); + static void qemuMonitorJSONHandleSerialChange(qemuMonitorPtr mon, virJSONValuePtr data); + static void qemuMonitorJSONHandleSpiceMigrated(qemuMonitorPtr mon, virJSONValuePtr data); ++static void qemuMonitorJSONHandleMigrationStatus(qemuMonitorPtr mon, virJSONValuePtr data); + + typedef struct { + const char *type; +@@ -99,6 +100,7 @@ static qemuEventHandler eventHandlers[] = { + { "DEVICE_DELETED", qemuMonitorJSONHandleDeviceDeleted, }, + { "DEVICE_TRAY_MOVED", qemuMonitorJSONHandleTrayChange, }, + { "GUEST_PANICKED", qemuMonitorJSONHandleGuestPanic, }, ++ { "MIGRATION", qemuMonitorJSONHandleMigrationStatus, }, + { "NIC_RX_FILTER_CHANGED", qemuMonitorJSONHandleNicRxFilterChanged, }, + { "POWERDOWN", qemuMonitorJSONHandlePowerdown, }, + { "RESET", qemuMonitorJSONHandleReset, }, +@@ -990,6 +992,27 @@ qemuMonitorJSONHandleSpiceMigrated(qemuMonitorPtr mon, + } + + ++static void ++qemuMonitorJSONHandleMigrationStatus(qemuMonitorPtr mon, ++ virJSONValuePtr data) ++{ ++ const char *str; ++ int status; ++ ++ if (!(str = virJSONValueObjectGetString(data, "status"))) { ++ VIR_WARN("missing status in migration event"); ++ return; ++ } ++ ++ if ((status = qemuMonitorMigrationStatusTypeFromString(str)) == -1) { ++ VIR_WARN("unknown status '%s' in migration event", str); ++ return; ++ } ++ ++ qemuMonitorEmitMigrationStatus(mon, status); ++} ++ ++ + int + qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon, + const char *cmd_str, +-- +2.4.5 + diff --git a/SOURCES/libvirt-qemu_monitor-introduce-new-function-to-get-QOM-path.patch b/SOURCES/libvirt-qemu_monitor-introduce-new-function-to-get-QOM-path.patch deleted file mode 100644 index 3916aad..0000000 --- a/SOURCES/libvirt-qemu_monitor-introduce-new-function-to-get-QOM-path.patch +++ /dev/null @@ -1,262 +0,0 @@ -From d3a5d3a03e6dd4230c44656f130acbf1f9821be5 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pavel Hrdina -Date: Wed, 14 Jan 2015 13:38:26 +0100 -Subject: [PATCH] qemu_monitor: introduce new function to get QOM path - -The search is done recursively only through QOM object that has a type -prefixed with "child<" as this indicate that the QOM is a parent for -other QOM objects. - -The usage is that you give known device name with starting path where to -search. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit cc41c64878590d7016e0dfa488d345e8634c3bf2) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1180574 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor.c | 178 ++++++++++++++++++++++++++++-------------------- - 1 file changed, 105 insertions(+), 73 deletions(-) - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index f797f4f..df7bb45 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -1012,38 +1012,106 @@ qemuMonitorSetOptions(qemuMonitorPtr mon, virJSONValuePtr options) - mon->options = options; - } - --/* Search the qom objects for the balloon driver object by it's known name -- * of "virtio-balloon-pci". The entry for the driver will be found in the -- * returned 'type' field using the syntax "child". -- * -- * Once found, check the entry to ensure it has the correct property listed. -- * If it does not, then obtaining statistics from qemu will not be possible. -- * This feature was added to qemu 1.5. -+ -+/** -+ * Search the qom objects by it's known name. The name is compared against -+ * filed 'type' formatted as 'link<%name>'. - * - * This procedure will be call recursively until found or the qom-list is - * exhausted. - * - * Returns: - * -- * 1 - Found -- * 0 - Not found still looking -+ * 0 - Found - * -1 - Error bail out -+ * -2 - Not found - * - * NOTE: This assumes we have already called qemuDomainObjEnterMonitor() - */ - static int --qemuMonitorFindBalloonObjectPath(qemuMonitorPtr mon, -- virDomainObjPtr vm, -- const char *curpath) -+qemuMonitorFindObjectPath(qemuMonitorPtr mon, -+ const char *curpath, -+ const char *name, -+ char **path) - { -- ssize_t i, j, npaths = 0, nprops = 0; -- int ret = 0; -+ ssize_t i, npaths = 0; -+ int ret = -2; - char *nextpath = NULL; -+ char *type = NULL; - qemuMonitorJSONListPathPtr *paths = NULL; -+ -+ if (virAsprintf(&type, "link<%s>", name) < 0) -+ return -1; -+ -+ VIR_DEBUG("Searching for '%s' Object Path starting at '%s'", type, curpath); -+ -+ npaths = qemuMonitorJSONGetObjectListPaths(mon, curpath, &paths); -+ if (npaths < 0) -+ goto cleanup; -+ -+ for (i = 0; i < npaths && ret == -2; i++) { -+ -+ if (STREQ_NULLABLE(paths[i]->type, type)) { -+ VIR_DEBUG("Path to '%s' is '%s/%s'", type, curpath, paths[i]->name); -+ ret = 0; -+ if (virAsprintf(path, "%s/%s", curpath, paths[i]->name) < 0) { -+ *path = NULL; -+ ret = -1; -+ } -+ goto cleanup; -+ } -+ -+ /* Type entries that begin with "child<" are a branch that can be -+ * traversed looking for more entries -+ */ -+ if (paths[i]->type && STRPREFIX(paths[i]->type, "child<")) { -+ if (virAsprintf(&nextpath, "%s/%s", curpath, paths[i]->name) < 0) { -+ ret = -1; -+ goto cleanup; -+ } -+ -+ ret = qemuMonitorFindObjectPath(mon, nextpath, name, path); -+ } -+ } -+ -+ cleanup: -+ for (i = 0; i < npaths; i++) -+ qemuMonitorJSONListPathFree(paths[i]); -+ VIR_FREE(paths); -+ VIR_FREE(nextpath); -+ VIR_FREE(type); -+ return ret; -+} -+ -+ -+/** -+ * Search the qom objects for the balloon driver object by it's known name -+ * of "virtio-balloon-pci". The entry for the driver will be found by using -+ * function "qemuMonitorFindObjectPath". -+ * -+ * Once found, check the entry to ensure it has the correct property listed. -+ * If it does not, then obtaining statistics from QEMU will not be possible. -+ * This feature was added to QEMU 1.5. -+ * -+ * Returns: -+ * -+ * 0 - Found -+ * -1 - Not found or error -+ * -+ * NOTE: This assumes we have already called qemuDomainObjEnterMonitor() -+ */ -+static int -+qemuMonitorFindBalloonObjectPath(qemuMonitorPtr mon, -+ const char *curpath) -+{ -+ ssize_t i, nprops = 0; -+ int ret = -1; -+ char *path = NULL; - qemuMonitorJSONListPathPtr *bprops = NULL; -+ virDomainObjPtr vm = mon->vm; - - if (mon->balloonpath) { -- return 1; -+ return 0; - } else if (mon->ballooninit) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Cannot determine balloon device path")); -@@ -1059,70 +1127,34 @@ qemuMonitorFindBalloonObjectPath(qemuMonitorPtr mon, - return -1; - } - -- VIR_DEBUG("Searching for Balloon Object Path starting at %s", curpath); -- -- npaths = qemuMonitorJSONGetObjectListPaths(mon, curpath, &paths); -- if (npaths < 0) -+ if (qemuMonitorFindObjectPath(mon, curpath, "virtio-balloon-pci", &path) < 0) - return -1; - -- for (i = 0; i < npaths && ret == 0; i++) { -- -- if (STREQ_NULLABLE(paths[i]->type, "link")) { -- VIR_DEBUG("Path to is '%s/%s'", -- curpath, paths[i]->name); -- if (virAsprintf(&nextpath, "%s/%s", curpath, paths[i]->name) < 0) { -- ret = -1; -- goto cleanup; -- } -- -- /* Now look at the each of the property entries to determine -- * whether "guest-stats-polling-interval" exists. If not, -- * then this version of qemu/kvm does not support the feature. -- */ -- nprops = qemuMonitorJSONGetObjectListPaths(mon, nextpath, &bprops); -- if (nprops < 0) { -- ret = -1; -- goto cleanup; -- } -- -- for (j = 0; j < nprops; j++) { -- if (STREQ(bprops[j]->name, "guest-stats-polling-interval")) { -- VIR_DEBUG("Found Balloon Object Path %s", nextpath); -- mon->balloonpath = nextpath; -- nextpath = NULL; -- ret = 1; -- goto cleanup; -- } -- } -- -- /* If we get here, we found the path, but not the property */ -- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -- _("Property 'guest-stats-polling-interval' " -- "not found on memory balloon driver.")); -- ret = -1; -+ nprops = qemuMonitorJSONGetObjectListPaths(mon, path, &bprops); -+ if (nprops < 0) -+ goto cleanup; -+ -+ for (i = 0; i < nprops; i++) { -+ if (STREQ(bprops[i]->name, "guest-stats-polling-interval")) { -+ VIR_DEBUG("Found Balloon Object Path %s", path); -+ mon->balloonpath = path; -+ path = NULL; -+ ret = 0; - goto cleanup; - } -- -- /* Type entries that begin with "child<" are a branch that can be -- * traversed looking for more entries -- */ -- if (paths[i]->type && STRPREFIX(paths[i]->type, "child<")) { -- if (virAsprintf(&nextpath, "%s/%s", curpath, paths[i]->name) < 0) { -- ret = -1; -- goto cleanup; -- } -- ret = qemuMonitorFindBalloonObjectPath(mon, vm, nextpath); -- } - } - -+ -+ /* If we get here, we found the path, but not the property */ -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("Property 'guest-stats-polling-interval' " -+ "not found on memory balloon driver.")); -+ - cleanup: -- for (i = 0; i < npaths; i++) -- qemuMonitorJSONListPathFree(paths[i]); -- VIR_FREE(paths); -- for (j = 0; j < nprops; j++) -- qemuMonitorJSONListPathFree(bprops[j]); -+ for (i = 0; i < nprops; i++) -+ qemuMonitorJSONListPathFree(bprops[i]); - VIR_FREE(bprops); -- VIR_FREE(nextpath); -+ VIR_FREE(path); - return ret; - } - -@@ -1636,7 +1668,7 @@ int qemuMonitorGetMemoryStats(qemuMonitorPtr mon, - } - - if (mon->json) { -- ignore_value(qemuMonitorFindBalloonObjectPath(mon, mon->vm, "/")); -+ ignore_value(qemuMonitorFindBalloonObjectPath(mon, "/")); - mon->ballooninit = true; - ret = qemuMonitorJSONGetMemoryStats(mon, mon->balloonpath, - stats, nr_stats); -@@ -1664,7 +1696,7 @@ int qemuMonitorSetMemoryStatsPeriod(qemuMonitorPtr mon, - return -1; - } - -- if (qemuMonitorFindBalloonObjectPath(mon, mon->vm, "/") == 1) { -+ if (qemuMonitorFindBalloonObjectPath(mon, "/") == 0) { - ret = qemuMonitorJSONSetMemoryStatsPeriod(mon, mon->balloonpath, - period); - } --- -2.2.1 - diff --git a/SOURCES/libvirt-qemu_process-detect-updated-video-ram-size-values-from-QEMU.patch b/SOURCES/libvirt-qemu_process-detect-updated-video-ram-size-values-from-QEMU.patch deleted file mode 100644 index 3cfc133..0000000 --- a/SOURCES/libvirt-qemu_process-detect-updated-video-ram-size-values-from-QEMU.patch +++ /dev/null @@ -1,289 +0,0 @@ -From abecf1fdcf58796b048eeaa6ccecc39f19ffdbcd Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pavel Hrdina -Date: Wed, 14 Jan 2015 13:38:27 +0100 -Subject: [PATCH] qemu_process: detect updated video ram size values from QEMU - -QEMU internally updates the size of video memory if the domain XML had -provided too low memory size or there are some dependencies for a QXL -devices 'vgamem' and 'ram' size. We need to know about the changes and -store them into the status XML to not break migration or managedsave -through different libvirt versions. - -The values would be loaded only if the "vgamem_mb" property exists for -the device. The presence of the "vgamem_mb" also tells that the -"ram_size" and "vram_size" exists for QXL devices. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit ce745914b33e3f9a136d91655600b931e7a4178f) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1180574 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor.c | 34 ++++++++++++++++++ - src/qemu/qemu_monitor.h | 4 +++ - src/qemu/qemu_monitor_json.c | 69 ++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_monitor_json.h | 3 ++ - src/qemu/qemu_process.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ - 5 files changed, 193 insertions(+) - -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index df7bb45..0b1b80e 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -1158,6 +1158,40 @@ qemuMonitorFindBalloonObjectPath(qemuMonitorPtr mon, - return ret; - } - -+ -+/** -+ * To update video memory size in status XML we need to load correct values from -+ * QEMU. This is supported only with JSON monitor. -+ * -+ * Returns 0 on success, -1 on failure and sets proper error message. -+ */ -+int -+qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, -+ virDomainVideoDefPtr video, -+ const char *videoName) -+{ -+ int ret = -1; -+ char *path = NULL; -+ -+ if (mon->json) { -+ ret = qemuMonitorFindObjectPath(mon, "/", videoName, &path); -+ if (ret < 0) { -+ if (ret == -2) -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("Failed to find QOM Object path for " -+ "device '%s'"), videoName); -+ return -1; -+ } -+ -+ ret = qemuMonitorJSONUpdateVideoMemorySize(mon, video, path); -+ VIR_FREE(path); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+ - int qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon, - const char *cmd, - int scm_fd, -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index b08d74d..8930744 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -243,6 +243,10 @@ virJSONValuePtr qemuMonitorGetOptions(qemuMonitorPtr mon) - ATTRIBUTE_NONNULL(1); - void qemuMonitorSetOptions(qemuMonitorPtr mon, virJSONValuePtr options) - ATTRIBUTE_NONNULL(1); -+int qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, -+ virDomainVideoDefPtr video, -+ const char *videName) -+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); - int qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon, - const char *cmd, - int scm_fd, -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 97151dc..9b3d17a 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -1443,6 +1443,75 @@ int qemuMonitorJSONGetVirtType(qemuMonitorPtr mon, - } - - -+/** -+ * Loads correct video memory size values from QEMU and update the video -+ * definition. -+ * -+ * Return 0 on success, -1 on failure and set proper error message. -+ */ -+int -+qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon, -+ virDomainVideoDefPtr video, -+ char *path) -+{ -+ qemuMonitorJSONObjectProperty prop = { -+ QEMU_MONITOR_OBJECT_PROPERTY_ULONG, -+ {0} -+ }; -+ -+ switch (video->type) { -+ case VIR_DOMAIN_VIDEO_TYPE_VGA: -+ if (qemuMonitorJSONGetObjectProperty(mon, path, "vgamem_mb", &prop) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("QOM Objext '%s' has no property 'vgamem_mb'"), -+ path); -+ return -1; -+ } -+ video->vram = prop.val.ul * 1024; -+ break; -+ case VIR_DOMAIN_VIDEO_TYPE_QXL: -+ if (qemuMonitorJSONGetObjectProperty(mon, path, "vram_size", &prop) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("QOM Objext '%s' has no property 'vram_size'"), -+ path); -+ return -1; -+ } -+ video->vram = prop.val.ul / 1024; -+ if (qemuMonitorJSONGetObjectProperty(mon, path, "ram_size", &prop) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("QOM Objext '%s' has no property 'ram_size'"), -+ path); -+ return -1; -+ } -+ video->ram = prop.val.ul / 1024; -+ if (qemuMonitorJSONGetObjectProperty(mon, path, "vgamem_mb", &prop) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("QOM Objext '%s' has no property 'vgamem_mb'"), -+ path); -+ return -1; -+ } -+ video->vgamem = prop.val.ul * 1024; -+ break; -+ case VIR_DOMAIN_VIDEO_TYPE_VMVGA: -+ if (qemuMonitorJSONGetObjectProperty(mon, path, "vgamem_mb", &prop) < 0) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("QOM Objext '%s' has no property 'vgamem_mb'"), -+ path); -+ return -1; -+ } -+ video->vram = prop.val.ul * 1024; -+ break; -+ case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: -+ case VIR_DOMAIN_VIDEO_TYPE_XEN: -+ case VIR_DOMAIN_VIDEO_TYPE_VBOX: -+ case VIR_DOMAIN_VIDEO_TYPE_LAST: -+ break; -+ } -+ -+ return 0; -+} -+ -+ - /* - * Returns: 0 if balloon not supported, +1 if balloon query worked - * or -1 on failure -diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index d039991..ff20029 100644 ---- a/src/qemu/qemu_monitor_json.h -+++ b/src/qemu/qemu_monitor_json.h -@@ -57,6 +57,9 @@ int qemuMonitorJSONGetCPUInfo(qemuMonitorPtr mon, - int **pids); - int qemuMonitorJSONGetVirtType(qemuMonitorPtr mon, - int *virtType); -+int qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon, -+ virDomainVideoDefPtr video, -+ char *path); - int qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon, - unsigned long long *currmem); - int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index d7b2688..d965938 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3032,6 +3032,85 @@ qemuProcessCleanupChardevDevice(virDomainDefPtr def ATTRIBUTE_UNUSED, - } - - -+/** -+ * Loads and update video memory size for video devices according to QEMU -+ * process as the QEMU will silently update the values that we pass to QEMU -+ * through command line. We need to load these updated values and store them -+ * into the status XML. -+ * -+ * We will fail if for some reason the values cannot be loaded from QEMU because -+ * its mandatory to get the correct video memory size to status XML to not break -+ * migration. -+ */ -+static int -+qemuProcessUpdateVideoRamSize(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ int asyncJob) -+{ -+ int ret = -1; -+ ssize_t i; -+ qemuDomainObjPrivatePtr priv = vm->privateData; -+ virDomainVideoDefPtr video = NULL; -+ virQEMUDriverConfigPtr cfg = NULL; -+ -+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) -+ return -1; -+ -+ for (i = 0; i < vm->def->nvideos; i++) { -+ video = vm->def->videos[i]; -+ -+ switch (video->type) { -+ case VIR_DOMAIN_VIDEO_TYPE_VGA: -+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VGA_VGAMEM)) { -+ if (qemuMonitorUpdateVideoMemorySize(priv->mon, video, "VGA") < 0) -+ goto error; -+ } -+ break; -+ case VIR_DOMAIN_VIDEO_TYPE_QXL: -+ if (i == 0) { -+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) { -+ if (qemuMonitorUpdateVideoMemorySize(priv->mon, video, -+ "qxl-vga") < 0) -+ goto error; -+ } -+ } else { -+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QXL_VGAMEM)) { -+ if (qemuMonitorUpdateVideoMemorySize(priv->mon, video, -+ "qxl") < 0) -+ goto error; -+ } -+ } -+ break; -+ case VIR_DOMAIN_VIDEO_TYPE_VMVGA: -+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)) { -+ if (qemuMonitorUpdateVideoMemorySize(priv->mon, video, -+ "vmware-svga") < 0) -+ goto error; -+ } -+ break; -+ case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: -+ case VIR_DOMAIN_VIDEO_TYPE_XEN: -+ case VIR_DOMAIN_VIDEO_TYPE_VBOX: -+ case VIR_DOMAIN_VIDEO_TYPE_LAST: -+ break; -+ } -+ -+ } -+ -+ qemuDomainObjExitMonitor(driver, vm); -+ -+ cfg = virQEMUDriverGetConfig(driver); -+ ret = virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm); -+ virObjectUnref(cfg); -+ -+ return ret; -+ -+ error: -+ qemuDomainObjExitMonitor(driver, vm); -+ return -1; -+} -+ -+ - struct qemuProcessHookData { - virConnectPtr conn; - virDomainObjPtr vm; -@@ -4795,6 +4874,10 @@ int qemuProcessStart(virConnectPtr conn, - } - qemuDomainObjExitMonitor(driver, vm); - -+ VIR_DEBUG("Detecting actual memory size for video device"); -+ if (qemuProcessUpdateVideoRamSize(driver, vm, asyncJob) < 0) -+ goto cleanup; -+ - if (!(flags & VIR_QEMU_PROCESS_START_PAUSED)) { - VIR_DEBUG("Starting domain CPUs"); - /* Allow the CPUS to start executing */ --- -2.2.1 - diff --git a/SOURCES/libvirt-qemuxml2argvtest-Fake-response-from-numad.patch b/SOURCES/libvirt-qemuxml2argvtest-Fake-response-from-numad.patch deleted file mode 100644 index 400a421..0000000 --- a/SOURCES/libvirt-qemuxml2argvtest-Fake-response-from-numad.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 4841f815fcefb0a2e8715808bb4038c89e3b3889 Mon Sep 17 00:00:00 2001 -Message-Id: <4841f815fcefb0a2e8715808bb4038c89e3b3889@dist-git> -From: Michal Privoznik -Date: Mon, 23 Feb 2015 08:20:02 +0100 -Subject: [PATCH] qemuxml2argvtest: Fake response from numad - -RHEL-7.2: https://bugzilla.redhat.com/show_bug.cgi?id=1191567 -RHEL-7.1.z: https://bugzilla.redhat.com/show_bug.cgi?id=1194982 - -Well, we can pretend that we've asked numad for its suggestion and let -qemu command line be built with that respect. Again, this alone has no -big value, but see later commits which build on the top of this. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 38064806966c04d7cf7525cd78aa6f82bd09e6d0) -Signed-off-by: Michal Privoznik - -Conflicts: - tests/qemuxml2argvtest.c: Context, as f7afeddc is not - backported yet. -Signed-off-by: Jiri Denemark ---- - tests/qemuxml2argvtest.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 595b658..98bb9ad 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -279,12 +279,16 @@ static int testCompareXMLToArgvFiles(const char *xml, - char *log = NULL; - virCommandPtr cmd = NULL; - size_t i; -+ virBitmapPtr nodeset = NULL; - - if (!(conn = virGetConnect())) - goto out; - conn->secretDriver = &fakeSecretDriver; - conn->storageDriver = &fakeStorageDriver; - -+ if (virBitmapParse("0-3", '\0', &nodeset, 4) < 0) -+ goto out; -+ - if (!(vmdef = virDomainDefParseFile(xml, driver.caps, driver.xmlopt, - QEMU_EXPECTED_VIRT_TYPES, - VIR_DOMAIN_XML_INACTIVE))) { -@@ -363,7 +367,7 @@ static int testCompareXMLToArgvFiles(const char *xml, - VIR_NETDEV_VPORT_PROFILE_OP_NO_OP, - &testCallbacks, false, - (flags & FLAG_FIPS), -- NULL))) { -+ nodeset))) { - if (!virtTestOOMActive() && - (flags & FLAG_EXPECT_FAILURE)) { - ret = 0; -@@ -416,6 +420,7 @@ static int testCompareXMLToArgvFiles(const char *xml, - virCommandFree(cmd); - virDomainDefFree(vmdef); - virObjectUnref(conn); -+ virBitmapFree(nodeset); - return ret; - } - --- -2.3.0 - diff --git a/SOURCES/libvirt-qemuxml2argvtest-Fix-test-after-change-of-qxl-vgamem_mb-default.patch b/SOURCES/libvirt-qemuxml2argvtest-Fix-test-after-change-of-qxl-vgamem_mb-default.patch deleted file mode 100644 index 9a109ad..0000000 --- a/SOURCES/libvirt-qemuxml2argvtest-Fix-test-after-change-of-qxl-vgamem_mb-default.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 6890c1de31047886de4817e989fbfa7883818c5b Mon Sep 17 00:00:00 2001 -Message-Id: <6890c1de31047886de4817e989fbfa7883818c5b@dist-git> -From: Michal Privoznik -Date: Mon, 12 Jan 2015 16:08:41 +0100 -Subject: [PATCH] qemuxml2argvtest: Fix test after change of qxl vgamem_mb - default - -Well, apparently it's possible for a patch to sneak in through -review process and break 'make check'. It happened just lately -with 0e502466acb84a which changed the default of vgamem_mb for -qxl device. However, there were left some domain XMLs within our -test suite relying on the old default. These should be updated to -match the change. - -Signed-off-by: Michal Privoznik -(cherry picked from commit d776e995e38ebf7be11778f29e23acd3c8f16506) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1181052 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args | 2 +- - tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -index 5398ffe..92e343f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -@@ -2,5 +2,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ - /usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ - -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ - -hda /var/lib/libvirt/images/QEMUGuest1 \ ---device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\ -+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16\ - ,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -index 82aa0a9..51fc524 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -@@ -2,7 +2,7 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ - /usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ - -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ - -hda /var/lib/libvirt/images/QEMUGuest1 \ ---device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\ -+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16\ - ,bus=pci.0,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864\ --,vgamem_mb=8,bus=pci.0,addr=0x4 \ -+,vgamem_mb=16,bus=pci.0,addr=0x4 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 --- -2.2.1 - diff --git a/SOURCES/libvirt-qxl-change-the-default-value-for-vgamem_mb-to-16-MiB.patch b/SOURCES/libvirt-qxl-change-the-default-value-for-vgamem_mb-to-16-MiB.patch deleted file mode 100644 index 034f097..0000000 --- a/SOURCES/libvirt-qxl-change-the-default-value-for-vgamem_mb-to-16-MiB.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 0e5c56e4aa3a08035f835b26dddfbb2be01880e2 Mon Sep 17 00:00:00 2001 -Message-Id: <0e5c56e4aa3a08035f835b26dddfbb2be01880e2@dist-git> -From: Pavel Hrdina -Date: Mon, 12 Jan 2015 15:00:41 +0100 -Subject: [PATCH] qxl: change the default value for vgamem_mb to 16 MiB - -The default value should be 16 MiB instead of 8 MiB. Only really old -version of upstream QEMU used the 8 MiB as default for vga framebuffer. - -Without this change if you update your libvirt where we introduced the -"vgamem" attribute for QXL video device the value will be set to 8 MiB, -but previously your guest had 16 MiB because we didn't pass any value to -QEMU command line which means QEMU used its own 16 MiB as default. - -This will affect all users with guest's display resolution higher than -1920x1080. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 0e502466acb84aa05dead1cbe23e6debf58f4ff1) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1181052 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 2 +- - src/qemu/qemu_command.h | 2 ++ - src/qemu/qemu_domain.c | 2 +- - 3 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index d3eb43b..db0c324 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -12203,7 +12203,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps, - vid->vram = virDomainVideoDefaultRAM(def, vid->type); - if (vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { - vid->ram = virDomainVideoDefaultRAM(def, vid->type); -- vid->vgamem = 8 * 1024; -+ vid->vgamem = QEMU_QXL_VGAMEM_DEFAULT; - } else { - vid->ram = 0; - vid->vgamem = 0; -diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h -index f7d3c2d..6246a85 100644 ---- a/src/qemu/qemu_command.h -+++ b/src/qemu/qemu_command.h -@@ -55,6 +55,8 @@ - # define QEMU_MIGRATION_PORT_MIN 49152 - # define QEMU_MIGRATION_PORT_MAX 49215 - -+# define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024 -+ - typedef struct _qemuBuildCommandLineCallbacks qemuBuildCommandLineCallbacks; - typedef qemuBuildCommandLineCallbacks *qemuBuildCommandLineCallbacksPtr; - struct _qemuBuildCommandLineCallbacks { -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 58fcd75..0cfc603 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -1187,7 +1187,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, - goto cleanup; - } - } else { -- dev->data.video->vgamem = 8 * 1024; -+ dev->data.video->vgamem = QEMU_QXL_VGAMEM_DEFAULT; - } - } - --- -2.2.1 - diff --git a/SOURCES/libvirt-remote-Fix-memory-leak-in-remoteConnectGetAllDomainStats.patch b/SOURCES/libvirt-remote-Fix-memory-leak-in-remoteConnectGetAllDomainStats.patch deleted file mode 100644 index 55f64ae..0000000 --- a/SOURCES/libvirt-remote-Fix-memory-leak-in-remoteConnectGetAllDomainStats.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ef895aea24b07fc419496a3e2780629380d061b5 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Wed, 5 Nov 2014 16:32:38 +0100 -Subject: [PATCH] remote: Fix memory leak in remoteConnectGetAllDomainStats - -https://bugzilla.redhat.com/show_bug.cgi?id=1158715 - -The remote call actually doesn't free the arguments array so we leak -memory in case a domain list is specified. As the remote domain list -array consists only of stolen pointers from the actual domain objects -it's sufficient just to free the array. - -Valgrind message: -==1081452== 64 bytes in 1 blocks are definitely lost in loss record 632 of 726 -==1081452== at 0x4C296D0: calloc (vg_replace_malloc.c:618) -==1081452== by 0x4EA5CB4: virAllocN (viralloc.c:191) -==1081452== by 0x505D21E: remoteConnectGetAllDomainStats (remote_driver.c:7785) -==1081452== by 0x50081AA: virDomainListGetStats (libvirt-domain.c:11080) -==1081452== by 0x155249: cmdDomstats (virsh-domain-monitor.c:2147) -==1081452== by 0x12FB73: vshCommandRun (virsh.c:1935) -==1081452== by 0x133FEB: main (virsh.c:3719) - -(cherry picked from commit bf1f8e280c330f51833189d40a99dc894205a129) - -Signed-off-by: Jiri Denemark ---- - src/remote/remote_driver.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c -index de021d4..6f7c894 100644 ---- a/src/remote/remote_driver.c -+++ b/src/remote/remote_driver.c -@@ -7842,6 +7842,7 @@ remoteConnectGetAllDomainStats(virConnectPtr conn, - VIR_FREE(elem); - } - virDomainStatsRecordListFree(tmpret); -+ VIR_FREE(args.doms.doms_val); - xdr_free((xdrproc_t)xdr_remote_connect_get_all_domain_stats_ret, - (char *) &ret); - --- -2.1.3 - diff --git a/SOURCES/libvirt-remote-Fix-memory-leak-on-error-path-when-deserializing-bulk-stats.patch b/SOURCES/libvirt-remote-Fix-memory-leak-on-error-path-when-deserializing-bulk-stats.patch deleted file mode 100644 index 9194d19..0000000 --- a/SOURCES/libvirt-remote-Fix-memory-leak-on-error-path-when-deserializing-bulk-stats.patch +++ /dev/null @@ -1,64 +0,0 @@ -From c2f30fd3e2111d1645b83cbfecda655ec0b2d7dc Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Tue, 2 Sep 2014 15:38:31 +0200 -Subject: [PATCH] remote: Fix memory leak on error path when deserializing bulk - stats - -https://bugzilla.redhat.com/show_bug.cgi?id=1136350 - -The 'elem' variable along with the domain object would be leaked when -taking the error path. - -Found by coverity. - -(cherry picked from commit 137d0165cd8c5daccc00786f8de272b57e68ff84) - -Signed-off-by: Jiri Denemark ---- - src/remote/remote_driver.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c -index fda27f7..8bc4baa 100644 ---- a/src/remote/remote_driver.c -+++ b/src/remote/remote_driver.c -@@ -7730,7 +7730,7 @@ remoteConnectGetAllDomainStats(virConnectPtr conn, - size_t i; - remote_connect_get_all_domain_stats_args args; - remote_connect_get_all_domain_stats_ret ret; -- -+ virDomainStatsRecordPtr elem = NULL; - virDomainStatsRecordPtr *tmpret = NULL; - - if (ndoms) { -@@ -7769,7 +7769,6 @@ remoteConnectGetAllDomainStats(virConnectPtr conn, - goto cleanup; - - for (i = 0; i < ret.retStats.retStats_len; i++) { -- virDomainStatsRecordPtr elem; - remote_domain_stats_record *rec = ret.retStats.retStats_val + i; - - if (VIR_ALLOC(elem) < 0) -@@ -7786,6 +7785,7 @@ remoteConnectGetAllDomainStats(virConnectPtr conn, - goto cleanup; - - tmpret[i] = elem; -+ elem = NULL; - } - - *retStats = tmpret; -@@ -7793,6 +7793,10 @@ remoteConnectGetAllDomainStats(virConnectPtr conn, - rv = ret.retStats.retStats_len; - - cleanup: -+ if (elem) { -+ virObjectUnref(elem->dom); -+ VIR_FREE(elem); -+ } - virDomainStatsRecordListFree(tmpret); - xdr_free((xdrproc_t)xdr_remote_connect_get_all_domain_stats_ret, - (char *) &ret); --- -2.1.0 - diff --git a/SOURCES/libvirt-remote-fix-jump-depends-on-uninitialised-value.patch b/SOURCES/libvirt-remote-fix-jump-depends-on-uninitialised-value.patch deleted file mode 100644 index 6327865..0000000 --- a/SOURCES/libvirt-remote-fix-jump-depends-on-uninitialised-value.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 0e09eeb1a38ce91c021b82df59a8e34cc586c35f Mon Sep 17 00:00:00 2001 -Message-Id: <0e09eeb1a38ce91c021b82df59a8e34cc586c35f@dist-git> -From: Jincheng Miao -Date: Thu, 30 Oct 2014 07:10:46 +0100 -Subject: [PATCH] remote: fix jump depends on uninitialised value - -https://bugzilla.redhat.com/show_bug.cgi?id=1158715 - -Currently remote driver only initializes partial fields of -remote_connect_get_all_domain_stats_args. But xdr_array() -will check the uninitialised field 'doms_val'. -For safty reason, memset all fields of args is better. - -Fix the following error from valgrind, like: -==30515== 1 errors in context 1 of 3: -==30515== Conditional jump or move depends on uninitialised value(s) -==30515== at 0x85E9402: xdr_array (xdr_array.c:88) -==30515== by 0x4FD8FC9: xdr_remote_connect_get_all_domain_stats_args (remote_protocol.c:6473) -==30515== by 0x4FE72F2: virNetMessageEncodePayload (virnetmessage.c:350) -==30515== by 0x4FDD21C: virNetClientProgramCall (virnetclientprogram.c:326) -==30515== by 0x4FB4D01: callFull.isra.2 (remote_driver.c:6667) -==30515== by 0x4FCBD45: call (remote_driver.c:6689) -==30515== by 0x4FCBD45: remoteConnectGetAllDomainStats (remote_driver.c:7793) -==30515== by 0x4FA0E75: virConnectGetAllDomainStats (libvirt.c:21678) -==30515== by 0x147FD1: cmdDomstats (virsh-domain-monitor.c:2148) -==30515== by 0x13006B: vshCommandRun (virsh.c:1915) -==30515== by 0x12A9E1: main (virsh.c:3699) - -Signed-off-by: Jincheng Miao -(cherry picked from commit 28b7601dc7acf99d06277267afb63fff4167b755) -Signed-off-by: Jiri Denemark ---- - src/remote/remote_driver.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c -index 6cf1aae..de021d4 100644 ---- a/src/remote/remote_driver.c -+++ b/src/remote/remote_driver.c -@@ -7775,6 +7775,8 @@ remoteConnectGetAllDomainStats(virConnectPtr conn, - virDomainStatsRecordPtr elem = NULL; - virDomainStatsRecordPtr *tmpret = NULL; - -+ memset(&args, 0, sizeof(args)); -+ - if (ndoms) { - if (VIR_ALLOC_N(args.doms.doms_val, ndoms) < 0) - goto cleanup; --- -2.1.3 - diff --git a/SOURCES/libvirt-remove-redundant-pidfile-path-constructions.patch b/SOURCES/libvirt-remove-redundant-pidfile-path-constructions.patch deleted file mode 100644 index f21560a..0000000 --- a/SOURCES/libvirt-remove-redundant-pidfile-path-constructions.patch +++ /dev/null @@ -1,240 +0,0 @@ -From 9a8acfe35e869f387c09a7495ef9bebcc00657cc Mon Sep 17 00:00:00 2001 -Message-Id: <9a8acfe35e869f387c09a7495ef9bebcc00657cc@dist-git> -From: Martin Kletzander -Date: Wed, 17 Sep 2014 17:11:01 +0200 -Subject: [PATCH] remove redundant pidfile path constructions - -https://bugzilla.redhat.com/show_bug.cgi?id=927369 - -Signed-off-by: Martin Kletzander -(cherry picked from commit 8035f2e6f2db7fc0b74b639deb7eff64957692bc) -Signed-off-by: Jiri Denemark ---- - daemon/libvirtd.c | 41 ++++----------------------------------- - src/libvirt_private.syms | 1 + - src/locking/lock_daemon.c | 42 ++++------------------------------------ - src/util/virpidfile.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++- - src/util/virpidfile.h | 7 ++++++- - 5 files changed, 63 insertions(+), 77 deletions(-) - -diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c -index 05ee50e..9ad8ff5 100644 ---- a/daemon/libvirtd.c -+++ b/daemon/libvirtd.c -@@ -251,41 +251,6 @@ static int daemonForkIntoBackground(const char *argv0) - - - static int --daemonPidFilePath(bool privileged, -- char **pidfile) --{ -- if (privileged) { -- if (VIR_STRDUP(*pidfile, LOCALSTATEDIR "/run/libvirtd.pid") < 0) -- goto error; -- } else { -- char *rundir = NULL; -- mode_t old_umask; -- -- if (!(rundir = virGetUserRuntimeDirectory())) -- goto error; -- -- old_umask = umask(077); -- if (virFileMakePath(rundir) < 0) { -- umask(old_umask); -- goto error; -- } -- umask(old_umask); -- -- if (virAsprintf(pidfile, "%s/libvirtd.pid", rundir) < 0) { -- VIR_FREE(rundir); -- goto error; -- } -- -- VIR_FREE(rundir); -- } -- -- return 0; -- -- error: -- return -1; --} -- --static int - daemonUnixSocketPaths(struct daemonConfig *config, - bool privileged, - char **sockfile, -@@ -1313,8 +1278,10 @@ int main(int argc, char **argv) { - } - - if (!pid_file && -- daemonPidFilePath(privileged, -- &pid_file) < 0) { -+ virPidFileConstructPath(privileged, -+ LOCALSTATEDIR, -+ "libvirtd", -+ &pid_file) < 0) { - VIR_ERROR(_("Can't determine pid file path.")); - exit(EXIT_FAILURE); - } -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index b4b13f9..18cf0c2 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -1776,6 +1776,7 @@ virPCIIsVirtualFunction; - virPidFileAcquire; - virPidFileAcquirePath; - virPidFileBuildPath; -+virPidFileConstructPath; - virPidFileDelete; - virPidFileDeletePath; - virPidFileRead; -diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c -index 02d77e3..fe7cfb8 100644 ---- a/src/locking/lock_daemon.c -+++ b/src/locking/lock_daemon.c -@@ -366,42 +366,6 @@ virLockDaemonForkIntoBackground(const char *argv0) - - - static int --virLockDaemonPidFilePath(bool privileged, -- char **pidfile) --{ -- if (privileged) { -- if (VIR_STRDUP(*pidfile, LOCALSTATEDIR "/run/virtlockd.pid") < 0) -- goto error; -- } else { -- char *rundir = NULL; -- mode_t old_umask; -- -- if (!(rundir = virGetUserRuntimeDirectory())) -- goto error; -- -- old_umask = umask(077); -- if (virFileMakePath(rundir) < 0) { -- umask(old_umask); -- goto error; -- } -- umask(old_umask); -- -- if (virAsprintf(pidfile, "%s/virtlockd.pid", rundir) < 0) { -- VIR_FREE(rundir); -- goto error; -- } -- -- VIR_FREE(rundir); -- } -- -- return 0; -- -- error: -- return -1; --} -- -- --static int - virLockDaemonUnixSocketPaths(bool privileged, - char **sockfile) - { -@@ -1283,8 +1247,10 @@ int main(int argc, char **argv) { - } - - if (!pid_file && -- virLockDaemonPidFilePath(privileged, -- &pid_file) < 0) { -+ virPidFileConstructPath(privileged, -+ LOCALSTATEDIR, -+ "virtlockd", -+ &pid_file) < 0) { - VIR_ERROR(_("Can't determine pid file path.")); - exit(EXIT_FAILURE); - } -diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c -index 1d9a1c5..19ec103 100644 ---- a/src/util/virpidfile.c -+++ b/src/util/virpidfile.c -@@ -1,7 +1,7 @@ - /* - * virpidfile.c: manipulation of pidfiles - * -- * Copyright (C) 2010-2012 Red Hat, Inc. -+ * Copyright (C) 2010-2012, 2014 Red Hat, Inc. - * Copyright (C) 2006, 2007 Binary Karma - * Copyright (C) 2006 Shuveb Hussain - * -@@ -521,3 +521,50 @@ int virPidFileRelease(const char *dir, - VIR_FREE(pidfile); - return rc; - } -+ -+ -+int -+virPidFileConstructPath(bool privileged, -+ const char *statedir, -+ const char *progname, -+ char **pidfile) -+{ -+ if (privileged) { -+ /* -+ * This is here just to allow calling this function with -+ * statedir == NULL; of course only when !privileged. -+ */ -+ if (!statedir) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ "%s", _("No statedir specified")); -+ goto cleanup; -+ } -+ if (virAsprintf(pidfile, "%s/run/%s.pid", statedir, progname) < 0) -+ goto cleanup; -+ } else { -+ char *rundir = NULL; -+ mode_t old_umask; -+ -+ if (!(rundir = virGetUserRuntimeDirectory())) -+ goto error; -+ -+ old_umask = umask(077); -+ if (virFileMakePath(rundir) < 0) { -+ umask(old_umask); -+ goto error; -+ } -+ umask(old_umask); -+ -+ if (virAsprintf(pidfile, "%s/%s.pid", rundir, progname) < 0) { -+ VIR_FREE(rundir); -+ goto error; -+ } -+ -+ VIR_FREE(rundir); -+ } -+ -+ return 0; -+ -+ error: -+ return -1; -+} -diff --git a/src/util/virpidfile.h b/src/util/virpidfile.h -index 2720206..ca1dbff 100644 ---- a/src/util/virpidfile.h -+++ b/src/util/virpidfile.h -@@ -1,7 +1,7 @@ - /* - * virpidfile.h: manipulation of pidfiles - * -- * Copyright (C) 2010-2011 Red Hat, Inc. -+ * Copyright (C) 2010-2011, 2014 Red Hat, Inc. - * Copyright (C) 2006, 2007 Binary Karma - * Copyright (C) 2006 Shuveb Hussain - * -@@ -69,4 +69,9 @@ int virPidFileRelease(const char *dir, - const char *name, - int fd); - -+int virPidFileConstructPath(bool privileged, -+ const char *statedir, -+ const char *progname, -+ char **pidfile); -+ - #endif /* __VIR_PIDFILE_H__ */ --- -2.1.0 - diff --git a/SOURCES/libvirt-rpc-Add-virNetDaemonHasClients.patch b/SOURCES/libvirt-rpc-Add-virNetDaemonHasClients.patch new file mode 100644 index 0000000..2f1e913 --- /dev/null +++ b/SOURCES/libvirt-rpc-Add-virNetDaemonHasClients.patch @@ -0,0 +1,69 @@ +From ce2001d94e099b4d8e6279f70af6d355283279fb Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Wed, 15 Jul 2015 17:11:55 +0200 +Subject: [PATCH] rpc: Add virNetDaemonHasClients + +https://bugzilla.redhat.com/show_bug.cgi?id=1240283 + +So callers don't have to iterate over each server. + +Signed-off-by: Martin Kletzander +(cherry picked from commit 699faeacb10459fed748d425eb044ef69697e804) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/libvirt_remote.syms | 1 + + src/rpc/virnetdaemon.c | 13 +++++++++++++ + src/rpc/virnetdaemon.h | 2 ++ + 3 files changed, 16 insertions(+) + +diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms +index e6ca041..6bfdcfa 100644 +--- a/src/libvirt_remote.syms ++++ b/src/libvirt_remote.syms +@@ -65,6 +65,7 @@ virNetDaemonAddSignalHandler; + virNetDaemonAutoShutdown; + virNetDaemonClose; + virNetDaemonGetServer; ++virNetDaemonHasClients; + virNetDaemonIsPrivileged; + virNetDaemonNew; + virNetDaemonNewPostExecRestart; +diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c +index 67dff14..6b13282 100644 +--- a/src/rpc/virnetdaemon.c ++++ b/src/rpc/virnetdaemon.c +@@ -747,3 +747,16 @@ virNetDaemonClose(virNetDaemonPtr dmn) + + virObjectUnlock(dmn); + } ++ ++bool ++virNetDaemonHasClients(virNetDaemonPtr dmn) ++{ ++ size_t i = 0; ++ ++ for (i = 0; i < dmn->nservers; i++) { ++ if (virNetServerHasClients(dmn->servers[i])) ++ return true; ++ } ++ ++ return false; ++} +diff --git a/src/rpc/virnetdaemon.h b/src/rpc/virnetdaemon.h +index 9e176d6..bb32053 100644 +--- a/src/rpc/virnetdaemon.h ++++ b/src/rpc/virnetdaemon.h +@@ -76,6 +76,8 @@ void virNetDaemonQuit(virNetDaemonPtr dmn); + + void virNetDaemonClose(virNetDaemonPtr dmn); + ++bool virNetDaemonHasClients(virNetDaemonPtr dmn); ++ + virNetServerPtr virNetDaemonGetServer(virNetDaemonPtr dmn, + int subServerID); + +-- +2.5.0 + diff --git a/SOURCES/libvirt-rpc-Remove-keepalive_required-option.patch b/SOURCES/libvirt-rpc-Remove-keepalive_required-option.patch new file mode 100644 index 0000000..845384b --- /dev/null +++ b/SOURCES/libvirt-rpc-Remove-keepalive_required-option.patch @@ -0,0 +1,695 @@ +From 62c256e02e63007860ca1fb4ef0d6d1121091e55 Mon Sep 17 00:00:00 2001 +Message-Id: <62c256e02e63007860ca1fb4ef0d6d1121091e55@dist-git> +From: Martin Kletzander +Date: Mon, 10 Aug 2015 13:55:19 +0200 +Subject: [PATCH] rpc: Remove keepalive_required option + +https://bugzilla.redhat.com/show_bug.cgi?id=1247087 + +Since its introduction in 2011 (particularly in commit f4324e329275), +the option doesn't work. It just effectively disables all incoming +connections. That's because the client private data that contain the +'keepalive_supported' boolean, are initialized to zeroes so the bool is +false and the only other place where the bool is used is when checking +whether the client supports keepalive. Thus, according to the server, +no client supports keepalive. + +Removing this instead of fixing it is better because a) apparently +nobody ever tried it since 2011 (4 years without one month) and b) we +cannot know whether the client supports keepalive until we get a ping or +pong keepalive packet. And that won't happen until after we dispatched +the ConnectOpen call. + +Another two reasons would be c) the keepalive_required was tracked on +the server level, but keepalive_supported was in private data of the +client as well as the check that was made in the remote layer, thus +making all other instances of virNetServer miss this feature unless they +all implemented it for themselves and d) we can always add it back in +case there is a request and a use-case for it. + +Signed-off-by: Martin Kletzander +(cherry picked from commit a8743c39389b76897811f60dcd8485cd51d76f02) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + daemon/libvirtd-config.c | 4 - + daemon/libvirtd-config.h | 2 - + daemon/libvirtd.c | 2 - + daemon/libvirtd.conf | 9 +- + daemon/libvirtd.h | 1 - + daemon/remote.c | 8 +- + daemon/test_libvirtd.aug.in | 2 +- + src/libvirt_remote.syms | 1 - + src/locking/lock_daemon.c | 2 +- + src/lxc/lxc_controller.c | 2 +- + src/rpc/virnetserver.c | 25 +---- + src/rpc/virnetserver.h | 3 - + tests/libvirtdconftest.c | 4 +- + .../input-data-no-keepalive-required.json | 124 +++++++++++++++++++++ + .../virnetdaemondata/output-data-admin-nomdns.json | 2 - + .../virnetdaemondata/output-data-anon-clients.json | 1 - + .../output-data-initial-nomdns.json | 1 - + tests/virnetdaemondata/output-data-initial.json | 1 - + .../output-data-no-keepalive-required.json | 124 +++++++++++++++++++++ + tests/virnetdaemontest.c | 2 +- + 20 files changed, 262 insertions(+), 58 deletions(-) + create mode 100644 tests/virnetdaemondata/input-data-no-keepalive-required.json + create mode 100644 tests/virnetdaemondata/output-data-no-keepalive-required.json + +diff --git a/daemon/libvirtd-config.c b/daemon/libvirtd-config.c +index 10dcc42..c31c8b2 100644 +--- a/daemon/libvirtd-config.c ++++ b/daemon/libvirtd-config.c +@@ -292,7 +292,6 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED) + + data->keepalive_interval = 5; + data->keepalive_count = 5; +- data->keepalive_required = 0; + + data->admin_min_workers = 5; + data->admin_max_workers = 20; +@@ -302,7 +301,6 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED) + + data->admin_keepalive_interval = 5; + data->admin_keepalive_count = 5; +- data->admin_keepalive_required = 0; + + localhost = virGetHostname(); + if (localhost == NULL) { +@@ -471,11 +469,9 @@ daemonConfigLoadOptions(struct daemonConfig *data, + + GET_CONF_INT(conf, filename, keepalive_interval); + GET_CONF_UINT(conf, filename, keepalive_count); +- GET_CONF_UINT(conf, filename, keepalive_required); + + GET_CONF_INT(conf, filename, admin_keepalive_interval); + GET_CONF_UINT(conf, filename, admin_keepalive_count); +- GET_CONF_UINT(conf, filename, admin_keepalive_required); + + return 0; + +diff --git a/daemon/libvirtd-config.h b/daemon/libvirtd-config.h +index 9cdae1a..3e1971d 100644 +--- a/daemon/libvirtd-config.h ++++ b/daemon/libvirtd-config.h +@@ -81,7 +81,6 @@ struct daemonConfig { + + int keepalive_interval; + unsigned int keepalive_count; +- int keepalive_required; + + int admin_min_workers; + int admin_max_workers; +@@ -91,7 +90,6 @@ struct daemonConfig { + + int admin_keepalive_interval; + unsigned int admin_keepalive_count; +- int admin_keepalive_required; + }; + + +diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c +index 654e7f4..2c27970 100644 +--- a/daemon/libvirtd.c ++++ b/daemon/libvirtd.c +@@ -1389,7 +1389,6 @@ int main(int argc, char **argv) { + config->max_anonymous_clients, + config->keepalive_interval, + config->keepalive_count, +- !!config->keepalive_required, + config->mdns_adv ? config->mdns_name : NULL, + remoteClientInitHook, + NULL, +@@ -1464,7 +1463,6 @@ int main(int argc, char **argv) { + 0, + config->admin_keepalive_interval, + config->admin_keepalive_count, +- !!config->admin_keepalive_required, + NULL, + remoteAdmClientInitHook, + NULL, +diff --git a/daemon/libvirtd.conf b/daemon/libvirtd.conf +index ac06cdd..514e6e4 100644 +--- a/daemon/libvirtd.conf ++++ b/daemon/libvirtd.conf +@@ -440,14 +440,15 @@ + # + #keepalive_interval = 5 + #keepalive_count = 5 ++ + # +-# If set to 1, libvirtd will refuse to talk to clients that do not +-# support keepalive protocol. Defaults to 0. ++# These configuration options are no longer used. There is no way to ++# restrict such clients from connecting since they first need to ++# connect in order to ask for keepalive. + # + #keepalive_required = 1 ++#admin_keepalive_required = 1 + + # Keepalive settings for the admin interface + #admin_keepalive_interval = 5 + #admin_keepalive_count = 5 +-# +-#admin_keepalive_required = 1 +diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h +index 8c1a904..efd4823 100644 +--- a/daemon/libvirtd.h ++++ b/daemon/libvirtd.h +@@ -72,7 +72,6 @@ struct daemonClientPrivate { + virConnectPtr conn; + + daemonClientStreamPtr streams; +- bool keepalive_supported; + }; + + /* Separate private data for admin connection */ +diff --git a/daemon/remote.c b/daemon/remote.c +index e9e2dca..3a3eb09 100644 +--- a/daemon/remote.c ++++ b/daemon/remote.c +@@ -1290,7 +1290,7 @@ void *remoteClientInitHook(virNetServerClientPtr client, + /*----- Functions. -----*/ + + static int +-remoteDispatchConnectOpen(virNetServerPtr server, ++remoteDispatchConnectOpen(virNetServerPtr server ATTRIBUTE_UNUSED, + virNetServerClientPtr client, + virNetMessagePtr msg ATTRIBUTE_UNUSED, + virNetMessageErrorPtr rerr, +@@ -1309,12 +1309,6 @@ remoteDispatchConnectOpen(virNetServerPtr server, + goto cleanup; + } + +- if (virNetServerKeepAliveRequired(server) && !priv->keepalive_supported) { +- virReportError(VIR_ERR_OPERATION_FAILED, "%s", +- _("keepalive support is required to connect")); +- goto cleanup; +- } +- + name = args->name ? *args->name : NULL; + + /* If this connection arrived on a readonly socket, force +diff --git a/daemon/test_libvirtd.aug.in b/daemon/test_libvirtd.aug.in +index 4921cbf..b0cb7eb 100644 +--- a/daemon/test_libvirtd.aug.in ++++ b/daemon/test_libvirtd.aug.in +@@ -58,6 +58,6 @@ module Test_libvirtd = + { "keepalive_interval" = "5" } + { "keepalive_count" = "5" } + { "keepalive_required" = "1" } ++ { "admin_keepalive_required" = "1" } + { "admin_keepalive_interval" = "5" } + { "admin_keepalive_count" = "5" } +- { "admin_keepalive_required" = "1" } +diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms +index 6bfdcfa..90a453c 100644 +--- a/src/libvirt_remote.syms ++++ b/src/libvirt_remote.syms +@@ -101,7 +101,6 @@ virNetServerAddProgram; + virNetServerAddService; + virNetServerClose; + virNetServerHasClients; +-virNetServerKeepAliveRequired; + virNetServerNew; + virNetServerNewPostExecRestart; + virNetServerPreExecRestart; +diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c +index ecbe03a..c035024 100644 +--- a/src/locking/lock_daemon.c ++++ b/src/locking/lock_daemon.c +@@ -151,7 +151,7 @@ virLockDaemonNew(virLockDaemonConfigPtr config, bool privileged) + + if (!(lockd->srv = virNetServerNew(1, 1, 0, config->max_clients, + config->max_clients, -1, 0, +- false, NULL, ++ NULL, + virLockDaemonClientNew, + virLockDaemonClientPreExecRestart, + virLockDaemonClientFree, +diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c +index 27e2e3a..06ffee4 100644 +--- a/src/lxc/lxc_controller.c ++++ b/src/lxc/lxc_controller.c +@@ -910,7 +910,7 @@ static int virLXCControllerSetupServer(virLXCControllerPtr ctrl) + return -1; + + if (!(srv = virNetServerNew(0, 0, 0, 1, +- 0, -1, 0, false, ++ 0, -1, 0, + NULL, + virLXCControllerClientPrivateNew, + NULL, +diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c +index 60a9714..80b5588 100644 +--- a/src/rpc/virnetserver.c ++++ b/src/rpc/virnetserver.c +@@ -69,7 +69,6 @@ struct _virNetServer { + + int keepaliveInterval; + unsigned int keepaliveCount; +- bool keepaliveRequired; + + #ifdef WITH_GNUTLS + virNetTLSContextPtr tls; +@@ -312,7 +311,6 @@ virNetServerPtr virNetServerNew(size_t min_workers, + size_t max_anonymous_clients, + int keepaliveInterval, + unsigned int keepaliveCount, +- bool keepaliveRequired, + const char *mdnsGroupName, + virNetServerClientPrivNew clientPrivNew, + virNetServerClientPrivPreExecRestart clientPrivPreExecRestart, +@@ -338,7 +336,6 @@ virNetServerPtr virNetServerNew(size_t min_workers, + srv->nclients_unauth_max = max_anonymous_clients; + srv->keepaliveInterval = keepaliveInterval; + srv->keepaliveCount = keepaliveCount; +- srv->keepaliveRequired = keepaliveRequired; + srv->clientPrivNew = clientPrivNew; + srv->clientPrivPreExecRestart = clientPrivPreExecRestart; + srv->clientPrivFree = clientPrivFree; +@@ -380,7 +377,6 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, + unsigned int max_anonymous_clients; + unsigned int keepaliveInterval; + unsigned int keepaliveCount; +- bool keepaliveRequired; + const char *mdnsGroupName = NULL; + + if (virJSONValueObjectGetNumberUint(object, "min_workers", &min_workers) < 0) { +@@ -423,11 +419,6 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, + _("Missing keepaliveCount data in JSON document")); + goto error; + } +- if (virJSONValueObjectGetBoolean(object, "keepaliveRequired", &keepaliveRequired) < 0) { +- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", +- _("Missing keepaliveRequired data in JSON document")); +- goto error; +- } + + if (virJSONValueObjectHasKey(object, "mdnsGroupName") && + (!(mdnsGroupName = virJSONValueObjectGetString(object, "mdnsGroupName")))) { +@@ -440,7 +431,7 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, + priority_workers, max_clients, + max_anonymous_clients, + keepaliveInterval, keepaliveCount, +- keepaliveRequired, mdnsGroupName, ++ mdnsGroupName, + clientPrivNew, clientPrivPreExecRestart, + clientPrivFree, clientPrivOpaque))) + goto error; +@@ -573,11 +564,6 @@ virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv) + _("Cannot set keepaliveCount data in JSON document")); + goto error; + } +- if (virJSONValueObjectAppendBoolean(object, "keepaliveRequired", srv->keepaliveRequired) < 0) { +- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", +- _("Cannot set keepaliveRequired data in JSON document")); +- goto error; +- } + + if (srv->mdnsGroupName && + virJSONValueObjectAppendString(object, "mdnsGroupName", srv->mdnsGroupName) < 0) { +@@ -786,15 +772,6 @@ void virNetServerClose(virNetServerPtr srv) + virObjectUnlock(srv); + } + +-bool virNetServerKeepAliveRequired(virNetServerPtr srv) +-{ +- bool required; +- virObjectLock(srv); +- required = srv->keepaliveRequired; +- virObjectUnlock(srv); +- return required; +-} +- + static inline size_t + virNetServerTrackPendingAuthLocked(virNetServerPtr srv) + { +diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h +index 0e16e8f..89d8db9 100644 +--- a/src/rpc/virnetserver.h ++++ b/src/rpc/virnetserver.h +@@ -41,7 +41,6 @@ virNetServerPtr virNetServerNew(size_t min_workers, + size_t max_anonymous_clients, + int keepaliveInterval, + unsigned int keepaliveCount, +- bool keepaliveRequired, + const char *mdnsGroupName, + virNetServerClientPrivNew clientPrivNew, + virNetServerClientPrivPreExecRestart clientPrivPreExecRestart, +@@ -74,8 +73,6 @@ int virNetServerSetTLSContext(virNetServerPtr srv, + virNetTLSContextPtr tls); + # endif + +-bool virNetServerKeepAliveRequired(virNetServerPtr srv); +- + size_t virNetServerTrackPendingAuth(virNetServerPtr srv); + size_t virNetServerTrackCompletedAuth(virNetServerPtr srv); + +diff --git a/tests/libvirtdconftest.c b/tests/libvirtdconftest.c +index d589d51..61d861d 100644 +--- a/tests/libvirtdconftest.c ++++ b/tests/libvirtdconftest.c +@@ -227,7 +227,9 @@ mymain(void) + for (i = 0; params[i] != 0; i++) { + const struct testCorruptData data = { params, filedata, filename, i }; + /* Skip now ignored config param */ +- if (STRPREFIX(filedata + params[i], "log_buffer_size")) ++ if (STRPREFIX(filedata + params[i], "log_buffer_size") || ++ STRPREFIX(filedata + params[i], "keepalive_required") || ++ STRPREFIX(filedata + params[i], "admin_keepalive_required")) + continue; + if (virtTestRun("Test corruption", testCorrupt, &data) < 0) + ret = -1; +diff --git a/tests/virnetdaemondata/input-data-no-keepalive-required.json b/tests/virnetdaemondata/input-data-no-keepalive-required.json +new file mode 100644 +index 0000000..b5e4dc8 +--- /dev/null ++++ b/tests/virnetdaemondata/input-data-no-keepalive-required.json +@@ -0,0 +1,124 @@ ++{ ++ "servers": [ ++ { ++ "min_workers": 10, ++ "max_workers": 50, ++ "priority_workers": 5, ++ "max_clients": 100, ++ "keepaliveInterval": 120, ++ "keepaliveCount": 5, ++ "services": [ ++ { ++ "auth": 0, ++ "readonly": true, ++ "nrequests_client_max": 2, ++ "socks": [ ++ { ++ "fd": 100, ++ "errfd": -1, ++ "pid": 0, ++ "isClient": false ++ } ++ ] ++ }, ++ { ++ "auth": 2, ++ "readonly": false, ++ "nrequests_client_max": 5, ++ "socks": [ ++ { ++ "fd": 101, ++ "errfd": -1, ++ "pid": 0, ++ "isClient": false ++ } ++ ] ++ } ++ ], ++ "clients": [ ++ { ++ "auth": 1, ++ "readonly": true, ++ "nrequests_max": 15, ++ "sock": { ++ "fd": 102, ++ "errfd": -1, ++ "pid": -1, ++ "isClient": true ++ } ++ }, ++ { ++ "auth": 2, ++ "readonly": true, ++ "nrequests_max": 66, ++ "sock": { ++ "fd": 103, ++ "errfd": -1, ++ "pid": -1, ++ "isClient": true ++ } ++ } ++ ] ++ }, ++ { ++ "min_workers": 2, ++ "max_workers": 50, ++ "priority_workers": 5, ++ "max_clients": 100, ++ "keepaliveInterval": 120, ++ "keepaliveCount": 5, ++ "services": [ ++ { ++ "auth": 0, ++ "readonly": true, ++ "nrequests_client_max": 2, ++ "socks": [ ++ { ++ "fd": 100, ++ "errfd": -1, ++ "pid": 0, ++ "isClient": false ++ } ++ ] ++ }, ++ { ++ "auth": 2, ++ "readonly": false, ++ "nrequests_client_max": 5, ++ "socks": [ ++ { ++ "fd": 101, ++ "errfd": -1, ++ "pid": 0, ++ "isClient": false ++ } ++ ] ++ } ++ ], ++ "clients": [ ++ { ++ "auth": 1, ++ "readonly": true, ++ "nrequests_max": 15, ++ "sock": { ++ "fd": 102, ++ "errfd": -1, ++ "pid": -1, ++ "isClient": true ++ } ++ }, ++ { ++ "auth": 2, ++ "readonly": true, ++ "nrequests_max": 66, ++ "sock": { ++ "fd": 103, ++ "errfd": -1, ++ "pid": -1, ++ "isClient": true ++ } ++ } ++ ] ++ } ++ ] ++} +diff --git a/tests/virnetdaemondata/output-data-admin-nomdns.json b/tests/virnetdaemondata/output-data-admin-nomdns.json +index 5df71a0..a814aeb 100644 +--- a/tests/virnetdaemondata/output-data-admin-nomdns.json ++++ b/tests/virnetdaemondata/output-data-admin-nomdns.json +@@ -8,7 +8,6 @@ + "max_anonymous_clients": 100, + "keepaliveInterval": 120, + "keepaliveCount": 5, +- "keepaliveRequired": true, + "services": [ + { + "auth": 0, +@@ -70,7 +69,6 @@ + "max_anonymous_clients": 100, + "keepaliveInterval": 120, + "keepaliveCount": 5, +- "keepaliveRequired": true, + "services": [ + { + "auth": 0, +diff --git a/tests/virnetdaemondata/output-data-anon-clients.json b/tests/virnetdaemondata/output-data-anon-clients.json +index 4e43326..05fc0ae 100644 +--- a/tests/virnetdaemondata/output-data-anon-clients.json ++++ b/tests/virnetdaemondata/output-data-anon-clients.json +@@ -8,7 +8,6 @@ + "max_anonymous_clients": 10, + "keepaliveInterval": 120, + "keepaliveCount": 5, +- "keepaliveRequired": true, + "services": [ + { + "auth": 0, +diff --git a/tests/virnetdaemondata/output-data-initial-nomdns.json b/tests/virnetdaemondata/output-data-initial-nomdns.json +index bef54bf..400e47b 100644 +--- a/tests/virnetdaemondata/output-data-initial-nomdns.json ++++ b/tests/virnetdaemondata/output-data-initial-nomdns.json +@@ -8,7 +8,6 @@ + "max_anonymous_clients": 100, + "keepaliveInterval": 120, + "keepaliveCount": 5, +- "keepaliveRequired": true, + "services": [ + { + "auth": 0, +diff --git a/tests/virnetdaemondata/output-data-initial.json b/tests/virnetdaemondata/output-data-initial.json +index 9afa791..e875cff 100644 +--- a/tests/virnetdaemondata/output-data-initial.json ++++ b/tests/virnetdaemondata/output-data-initial.json +@@ -8,7 +8,6 @@ + "max_anonymous_clients": 100, + "keepaliveInterval": 120, + "keepaliveCount": 5, +- "keepaliveRequired": true, + "mdnsGroupName": "libvirtTest", + "services": [ + { +diff --git a/tests/virnetdaemondata/output-data-no-keepalive-required.json b/tests/virnetdaemondata/output-data-no-keepalive-required.json +new file mode 100644 +index 0000000..b5e4dc8 +--- /dev/null ++++ b/tests/virnetdaemondata/output-data-no-keepalive-required.json +@@ -0,0 +1,124 @@ ++{ ++ "servers": [ ++ { ++ "min_workers": 10, ++ "max_workers": 50, ++ "priority_workers": 5, ++ "max_clients": 100, ++ "keepaliveInterval": 120, ++ "keepaliveCount": 5, ++ "services": [ ++ { ++ "auth": 0, ++ "readonly": true, ++ "nrequests_client_max": 2, ++ "socks": [ ++ { ++ "fd": 100, ++ "errfd": -1, ++ "pid": 0, ++ "isClient": false ++ } ++ ] ++ }, ++ { ++ "auth": 2, ++ "readonly": false, ++ "nrequests_client_max": 5, ++ "socks": [ ++ { ++ "fd": 101, ++ "errfd": -1, ++ "pid": 0, ++ "isClient": false ++ } ++ ] ++ } ++ ], ++ "clients": [ ++ { ++ "auth": 1, ++ "readonly": true, ++ "nrequests_max": 15, ++ "sock": { ++ "fd": 102, ++ "errfd": -1, ++ "pid": -1, ++ "isClient": true ++ } ++ }, ++ { ++ "auth": 2, ++ "readonly": true, ++ "nrequests_max": 66, ++ "sock": { ++ "fd": 103, ++ "errfd": -1, ++ "pid": -1, ++ "isClient": true ++ } ++ } ++ ] ++ }, ++ { ++ "min_workers": 2, ++ "max_workers": 50, ++ "priority_workers": 5, ++ "max_clients": 100, ++ "keepaliveInterval": 120, ++ "keepaliveCount": 5, ++ "services": [ ++ { ++ "auth": 0, ++ "readonly": true, ++ "nrequests_client_max": 2, ++ "socks": [ ++ { ++ "fd": 100, ++ "errfd": -1, ++ "pid": 0, ++ "isClient": false ++ } ++ ] ++ }, ++ { ++ "auth": 2, ++ "readonly": false, ++ "nrequests_client_max": 5, ++ "socks": [ ++ { ++ "fd": 101, ++ "errfd": -1, ++ "pid": 0, ++ "isClient": false ++ } ++ ] ++ } ++ ], ++ "clients": [ ++ { ++ "auth": 1, ++ "readonly": true, ++ "nrequests_max": 15, ++ "sock": { ++ "fd": 102, ++ "errfd": -1, ++ "pid": -1, ++ "isClient": true ++ } ++ }, ++ { ++ "auth": 2, ++ "readonly": true, ++ "nrequests_max": 66, ++ "sock": { ++ "fd": 103, ++ "errfd": -1, ++ "pid": -1, ++ "isClient": true ++ } ++ } ++ ] ++ } ++ ] ++} +diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c +index ef45018..fb8a6c0 100644 +--- a/tests/virnetdaemontest.c ++++ b/tests/virnetdaemontest.c +@@ -50,7 +50,7 @@ testCreateServer(const char *host, int family) + } + + if (!(srv = virNetServerNew(10, 50, 5, 100, 10, +- 120, 5, true, ++ 120, 5, + mdns_group, + NULL, + NULL, +-- +2.5.0 + diff --git a/SOURCES/libvirt-rpc-Rework-timerActive-logic-in-daemon.patch b/SOURCES/libvirt-rpc-Rework-timerActive-logic-in-daemon.patch new file mode 100644 index 0000000..21f29d4 --- /dev/null +++ b/SOURCES/libvirt-rpc-Rework-timerActive-logic-in-daemon.patch @@ -0,0 +1,63 @@ +From c6ea8b7cb4d2b56f29b791a5f2ee492b4e2bc055 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Wed, 15 Jul 2015 17:11:56 +0200 +Subject: [PATCH] rpc: Rework timerActive logic in daemon + +Daemon used false logic for determining whether there were any clients. +When the timer was inactive, it was activated if at least one of the +servers did not have clients. So the bool was being flipped there and +back all the time in case there was one client, for example. + +Initially introduced by fa1420736882. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1240283 + +Signed-off-by: Martin Kletzander +(cherry picked from commit b7ea58c262194037042284a14fb1608c9cf31884) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + src/rpc/virnetdaemon.c | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c +index 6b13282..910f266 100644 +--- a/src/rpc/virnetdaemon.c ++++ b/src/rpc/virnetdaemon.c +@@ -682,23 +682,17 @@ virNetDaemonRun(virNetDaemonPtr dmn) + */ + if (dmn->autoShutdownTimeout) { + if (timerActive) { +- for (i = 0; i < dmn->nservers; i++) { +- if (virNetServerHasClients(dmn->servers[i])) { +- VIR_DEBUG("Deactivating shutdown timer %d", timerid); +- virEventUpdateTimeout(timerid, -1); +- timerActive = false; +- break; +- } ++ if (virNetDaemonHasClients(dmn)) { ++ VIR_DEBUG("Deactivating shutdown timer %d", timerid); ++ virEventUpdateTimeout(timerid, -1); ++ timerActive = false; + } + } else { +- for (i = 0; i < dmn->nservers; i++) { +- if (!virNetServerHasClients(dmn->servers[i])) { +- VIR_DEBUG("Activating shutdown timer %d", timerid); +- virEventUpdateTimeout(timerid, +- dmn->autoShutdownTimeout * 1000); +- timerActive = true; +- break; +- } ++ if (!virNetDaemonHasClients(dmn)) { ++ VIR_DEBUG("Activating shutdown timer %d", timerid); ++ virEventUpdateTimeout(timerid, ++ dmn->autoShutdownTimeout * 1000); ++ timerActive = true; + } + } + } +-- +2.5.0 + diff --git a/SOURCES/libvirt-rpc-make-daemon-spawning-a-bit-more-intelligent.patch b/SOURCES/libvirt-rpc-make-daemon-spawning-a-bit-more-intelligent.patch deleted file mode 100644 index c4e0135..0000000 --- a/SOURCES/libvirt-rpc-make-daemon-spawning-a-bit-more-intelligent.patch +++ /dev/null @@ -1,152 +0,0 @@ -From 31f55c6f1cbe6ed6ac9891ea47c3823ed18f1921 Mon Sep 17 00:00:00 2001 -Message-Id: <31f55c6f1cbe6ed6ac9891ea47c3823ed18f1921@dist-git> -From: Martin Kletzander -Date: Wed, 17 Sep 2014 17:11:04 +0200 -Subject: [PATCH] rpc: make daemon spawning a bit more intelligent - -This way it behaves more like the daemon itself does (acquiring a -pidfile, deleting the socket before binding, etc.). - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=927369 -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1138604 - -Signed-off-by: Martin Kletzander -(cherry picked from commit bd9ad91a4036649645fffb1598213339263478de) -Signed-off-by: Jiri Denemark ---- - src/rpc/virnetsocket.c | 67 ++++++++++++++++++++++++++++++++++++++++++++------ - 1 file changed, 59 insertions(+), 8 deletions(-) - -diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c -index 306c9ea..5feccf6 100644 ---- a/src/rpc/virnetsocket.c -+++ b/src/rpc/virnetsocket.c -@@ -51,9 +51,11 @@ - #include "virlog.h" - #include "virfile.h" - #include "virthread.h" -+#include "virpidfile.h" - #include "virprobe.h" - #include "virprocess.h" - #include "virstring.h" -+#include "dirname.h" - #include "passfd.h" - - #if WITH_SSH2 -@@ -544,7 +546,10 @@ int virNetSocketNewConnectUNIX(const char *path, - const char *binary, - virNetSocketPtr *retsock) - { -+ char *binname = NULL; -+ char *pidpath = NULL; - int fd, passfd = -1; -+ int pidfd = -1; - virSocketAddr localAddr; - virSocketAddr remoteAddr; - -@@ -583,16 +588,46 @@ int virNetSocketNewConnectUNIX(const char *path, - goto error; - } - -+ if (!(binname = last_component(binary)) || binname[0] == '\0') { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("Cannot determine basename for binary '%s'"), -+ binary); -+ goto error; -+ } -+ -+ if (virPidFileConstructPath(false, NULL, binname, &pidpath) < 0) -+ goto error; -+ -+ pidfd = virPidFileAcquirePath(pidpath, false, getpid()); -+ if (pidfd < 0) { -+ /* -+ * This can happen in a very rare case of two clients spawning two -+ * daemons at the same time, and the error in the logs that gets -+ * reset here can be a clue to some future debugging. -+ */ -+ virResetLastError(); -+ spawnDaemon = false; -+ goto retry; -+ } -+ - if ((passfd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) { - virReportSystemError(errno, "%s", _("Failed to create socket")); - goto error; - } - - /* -- * We have to fork() here, because umask() is set -- * per-process, chmod() is racy and fchmod() has undefined -- * behaviour on sockets according to POSIX, so it doesn't -- * work outside Linux. -+ * We already even acquired the pidfile, so no one else should be using -+ * @path right now. So we're OK to unlink it and paying attention to -+ * the return value makes no real sense here. Only if it's not an -+ * abstract socket, of course. -+ */ -+ if (path[0] != '@') -+ unlink(path); -+ -+ /* -+ * We have to fork() here, because umask() is set per-process, chmod() -+ * is racy and fchmod() has undefined behaviour on sockets according to -+ * POSIX, so it doesn't work outside Linux. - */ - if ((pid = virFork()) < 0) - goto error; -@@ -610,12 +645,16 @@ int virNetSocketNewConnectUNIX(const char *path, - - if (status != EXIT_SUCCESS) { - /* -- * OK, so the subprocces failed to bind() the socket. This may mean -- * that another daemon was starting at the same time and succeeded -- * with its bind(). So we'll try connecting again, but this time -- * without spawning the daemon. -+ * OK, so the child failed to bind() the socket. This may mean that -+ * another daemon was starting at the same time and succeeded with -+ * its bind() (even though it should not happen because we using a -+ * pidfile for the race). So we'll try connecting again, but this -+ * time without spawning the daemon. - */ - spawnDaemon = false; -+ virPidFileDeletePath(pidpath); -+ VIR_FORCE_CLOSE(pidfd); -+ VIR_FORCE_CLOSE(passfd); - goto retry; - } - -@@ -632,6 +671,12 @@ int virNetSocketNewConnectUNIX(const char *path, - goto error; - } - -+ /* -+ * Do we need to eliminate the super-rare race here any more? It would -+ * need incorporating the following VIR_FORCE_CLOSE() into a -+ * virCommandHook inside a virNetSocketForkDaemon(). -+ */ -+ VIR_FORCE_CLOSE(pidfd); - if (virNetSocketForkDaemon(binary, passfd) < 0) - goto error; - } -@@ -645,11 +690,17 @@ int virNetSocketNewConnectUNIX(const char *path, - if (!(*retsock = virNetSocketNew(&localAddr, &remoteAddr, true, fd, -1, 0))) - goto error; - -+ VIR_FREE(pidpath); -+ - return 0; - - error: -+ if (pidfd >= 0) -+ virPidFileDeletePath(pidpath); -+ VIR_FREE(pidpath); - VIR_FORCE_CLOSE(fd); - VIR_FORCE_CLOSE(passfd); -+ VIR_FORCE_CLOSE(pidfd); - if (spawnDaemon) - unlink(path); - return -1; --- -2.1.0 - diff --git a/SOURCES/libvirt-rpc-reformat-the-flow-to-make-a-bit-more-sense.patch b/SOURCES/libvirt-rpc-reformat-the-flow-to-make-a-bit-more-sense.patch deleted file mode 100644 index d1b68fe..0000000 --- a/SOURCES/libvirt-rpc-reformat-the-flow-to-make-a-bit-more-sense.patch +++ /dev/null @@ -1,140 +0,0 @@ -From 2898f0d6a6535ed6f07d2860a044a8eb4414e48f Mon Sep 17 00:00:00 2001 -Message-Id: <2898f0d6a6535ed6f07d2860a044a8eb4414e48f@dist-git> -From: Martin Kletzander -Date: Wed, 17 Sep 2014 17:11:00 +0200 -Subject: [PATCH] rpc: reformat the flow to make a bit more sense - -https://bugzilla.redhat.com/show_bug.cgi?id=927369 - -Just remove useless "else". Best viewed with '-w'. - -Signed-off-by: Martin Kletzander -(cherry picked from commit 3951d4a6d3d5867eadc82814e8dd9a61d19b68cf) -Signed-off-by: Jiri Denemark ---- - src/rpc/virnetsocket.c | 98 +++++++++++++++++++++++++------------------------- - 1 file changed, 49 insertions(+), 49 deletions(-) - -diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c -index 9780e17..306c9ea 100644 ---- a/src/rpc/virnetsocket.c -+++ b/src/rpc/virnetsocket.c -@@ -574,66 +574,66 @@ int virNetSocketNewConnectUNIX(const char *path, - - retry: - if (connect(fd, &remoteAddr.data.sa, remoteAddr.len) < 0) { -+ int status = 0; -+ pid_t pid = 0; -+ - if (!spawnDaemon) { - virReportSystemError(errno, _("Failed to connect socket to '%s'"), - path); - goto error; -- } else { -- int status = 0; -- pid_t pid = 0; -+ } - -- if ((passfd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) { -- virReportSystemError(errno, "%s", _("Failed to create socket")); -- goto error; -- } -+ if ((passfd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) { -+ virReportSystemError(errno, "%s", _("Failed to create socket")); -+ goto error; -+ } - -+ /* -+ * We have to fork() here, because umask() is set -+ * per-process, chmod() is racy and fchmod() has undefined -+ * behaviour on sockets according to POSIX, so it doesn't -+ * work outside Linux. -+ */ -+ if ((pid = virFork()) < 0) -+ goto error; -+ -+ if (pid == 0) { -+ umask(0077); -+ if (bind(passfd, &remoteAddr.data.sa, remoteAddr.len) < 0) -+ _exit(EXIT_FAILURE); -+ -+ _exit(EXIT_SUCCESS); -+ } -+ -+ if (virProcessWait(pid, &status, false) < 0) -+ goto error; -+ -+ if (status != EXIT_SUCCESS) { - /* -- * We have to fork() here, because umask() is set -- * per-process, chmod() is racy and fchmod() has undefined -- * behaviour on sockets according to POSIX, so it doesn't -- * work outside Linux. -+ * OK, so the subprocces failed to bind() the socket. This may mean -+ * that another daemon was starting at the same time and succeeded -+ * with its bind(). So we'll try connecting again, but this time -+ * without spawning the daemon. - */ -- if ((pid = virFork()) < 0) -- goto error; -- -- if (pid == 0) { -- umask(0077); -- if (bind(passfd, &remoteAddr.data.sa, remoteAddr.len) < 0) -- _exit(EXIT_FAILURE); -- -- _exit(EXIT_SUCCESS); -- } -- -- if (virProcessWait(pid, &status, false) < 0) -- goto error; -- -- if (status != EXIT_SUCCESS) { -- /* -- * OK, so the subprocces failed to bind() the socket. This may mean -- * that another daemon was starting at the same time and succeeded -- * with its bind(). So we'll try connecting again, but this time -- * without spawning the daemon. -- */ -- spawnDaemon = false; -- goto retry; -- } -- -- if (listen(passfd, 0) < 0) { -- virReportSystemError(errno, "%s", -- _("Failed to listen on socket that's about " -- "to be passed to the daemon")); -- goto error; -- } -+ spawnDaemon = false; -+ goto retry; -+ } - -- if (connect(fd, &remoteAddr.data.sa, remoteAddr.len) < 0) { -- virReportSystemError(errno, _("Failed to connect socket to '%s'"), -- path); -- goto error; -- } -+ if (listen(passfd, 0) < 0) { -+ virReportSystemError(errno, "%s", -+ _("Failed to listen on socket that's about " -+ "to be passed to the daemon")); -+ goto error; -+ } - -- if (virNetSocketForkDaemon(binary, passfd) < 0) -- goto error; -+ if (connect(fd, &remoteAddr.data.sa, remoteAddr.len) < 0) { -+ virReportSystemError(errno, _("Failed to connect socket to '%s'"), -+ path); -+ goto error; - } -+ -+ if (virNetSocketForkDaemon(binary, passfd) < 0) -+ goto error; - } - - localAddr.len = sizeof(localAddr.data); --- -2.1.0 - diff --git a/SOURCES/libvirt-schemas-finish-virTristate-Bool-Switch-transition.patch b/SOURCES/libvirt-schemas-finish-virTristate-Bool-Switch-transition.patch deleted file mode 100644 index 92d6811..0000000 --- a/SOURCES/libvirt-schemas-finish-virTristate-Bool-Switch-transition.patch +++ /dev/null @@ -1,611 +0,0 @@ -From 375c93d2f57b7620299c856e60207507ef28f552 Mon Sep 17 00:00:00 2001 -Message-Id: <375c93d2f57b7620299c856e60207507ef28f552@dist-git> -From: Martin Kletzander -Date: Wed, 24 Sep 2014 16:55:41 +0200 -Subject: [PATCH] schemas: finish virTristate{Bool, Switch} transition - -https://bugzilla.redhat.com/show_bug.cgi?id=1139364 - -Signed-off-by: Martin Kletzander -(cherry picked from commit f864aac90bcc029584c9cc847ce36fdc108baad9) -Signed-off-by: Jiri Denemark ---- - docs/schemas/basictypes.rng | 19 ++++-- - docs/schemas/capability.rng | 10 +-- - docs/schemas/domaincaps.rng | 5 +- - docs/schemas/domaincommon.rng | 155 +++++++++--------------------------------- - docs/schemas/interface.rng | 19 +----- - docs/schemas/network.rng | 29 ++------ - docs/schemas/nwfilter.rng | 5 +- - docs/schemas/secret.rng | 10 +-- - 8 files changed, 61 insertions(+), 191 deletions(-) - -diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng -index 75d5238..14245c9 100644 ---- a/docs/schemas/basictypes.rng -+++ b/docs/schemas/basictypes.rng -@@ -77,10 +77,7 @@ - - - -- -- on -- off -- -+ - - - -@@ -446,4 +443,18 @@ - - - -+ -+ -+ yes -+ no -+ -+ -+ -+ -+ -+ on -+ off -+ -+ -+ - -diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng -index f954599..5f3ec70 100644 ---- a/docs/schemas/capability.rng -+++ b/docs/schemas/capability.rng -@@ -405,16 +405,10 @@ - - - -- -- yes -- no -- -+ - - -- -- on -- off -- -+ - - - -diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng -index f4a555f..35d3745 100644 ---- a/docs/schemas/domaincaps.rng -+++ b/docs/schemas/domaincaps.rng -@@ -98,10 +98,7 @@ - - - -- -- yes -- no -- -+ - - - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index badc17b..19dc82f 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -118,10 +118,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -282,10 +279,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -584,10 +578,7 @@ - - - -- -- on -- off -- -+ - - - -@@ -1012,10 +1003,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -1265,10 +1253,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -1536,10 +1521,7 @@ - - - -- -- on -- off -- -+ - - - -@@ -1672,26 +1654,17 @@ - - - -- -- on -- off -- -+ - - - - -- -- on -- off -- -+ - - - - -- -- on -- off -- -+ - - - -@@ -2222,20 +2195,14 @@ - - - -- -- yes -- no -- -+ - - - - - - -- -- yes -- no -- -+ - - - -@@ -2468,10 +2435,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -2488,10 +2452,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -2562,10 +2523,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -2674,10 +2632,7 @@ - - - -- -- on -- off -- -+ - - - -@@ -2697,10 +2652,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -2719,10 +2671,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -2740,26 +2689,17 @@ - - - -- -- yes -- no -- -+ - - - - -- -- yes -- no -- -+ - - - - -- -- yes -- no -- -+ - - - -@@ -2780,10 +2720,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -2862,28 +2799,19 @@ - - - -- -- yes -- no -- -+ - - - - - - -- -- yes -- no -- -+ - - - - -- -- yes -- no -- -+ - - - -@@ -3009,10 +2937,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -3104,10 +3029,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -3567,10 +3489,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -3910,10 +3829,7 @@ - - - -- -- on -- off -- -+ - - - -@@ -4215,10 +4131,7 @@ - - - -- -- yes -- no -- -+ - - - -@@ -4288,10 +4201,7 @@ - - - -- -- on -- off -- -+ - - - -@@ -4761,10 +4671,7 @@ - - - -- -- on -- off -- -+ - - - -diff --git a/docs/schemas/interface.rng b/docs/schemas/interface.rng -index 0f577d6..d78f877 100644 ---- a/docs/schemas/interface.rng -+++ b/docs/schemas/interface.rng -@@ -127,7 +127,7 @@ - - - -- -+ - - - -@@ -376,7 +376,7 @@ - - - -- -+ - - - -@@ -415,21 +415,6 @@ - instead of destination and nexthop instead of gateway. - --> - -- -- -- -- on -- off -- -- -- -- -- -- yes -- no -- -- -- - - - -diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng -index 0e7da89..d84ccc0 100644 ---- a/docs/schemas/network.rng -+++ b/docs/schemas/network.rng -@@ -21,12 +21,9 @@ - with no gateways addresses specified --> - - -- -- yes -- no -- -- -- -+ -+ -+ - - -