diff --git a/2d07f1f0-fix-storage-crash.patch b/2d07f1f0-fix-storage-crash.patch new file mode 100644 index 0000000..ecbda6e --- /dev/null +++ b/2d07f1f0-fix-storage-crash.patch @@ -0,0 +1,62 @@ +commit 2d07f1f0ebd44b0348daa61afa0de34f3f838c22 +Author: Peter Krempa +Date: Wed Dec 6 16:20:07 2017 +0100 + + storage: Don't dereference driver object if virStorageSource is not initialized + + virStorageFileReportBrokenChain uses data from the driver private data + pointer to print the user and group. This would lead to a crash in call + paths where we did not initialize the storage backend as recently added + in commit 24e47ee2b93 to qemuDomainDetermineDiskChain. + + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1522682 + +Index: libvirt-3.10.0/src/storage/storage_source.c +=================================================================== +--- libvirt-3.10.0.orig/src/storage/storage_source.c ++++ libvirt-3.10.0/src/storage/storage_source.c +@@ -419,19 +419,33 @@ virStorageFileReportBrokenChain(int errc + virStorageSourcePtr src, + virStorageSourcePtr parent) + { +- unsigned int access_user = src->drv->uid; +- unsigned int access_group = src->drv->gid; + +- if (src == parent) { +- virReportSystemError(errcode, +- _("Cannot access storage file '%s' " +- "(as uid:%u, gid:%u)"), +- src->path, access_user, access_group); ++ if (src->drv) { ++ unsigned int access_user = src->drv->uid; ++ unsigned int access_group = src->drv->gid; ++ ++ if (src == parent) { ++ virReportSystemError(errcode, ++ _("Cannot access storage file '%s' " ++ "(as uid:%u, gid:%u)"), ++ src->path, access_user, access_group); ++ } else { ++ virReportSystemError(errcode, ++ _("Cannot access backing file '%s' " ++ "of storage file '%s' (as uid:%u, gid:%u)"), ++ src->path, parent->path, access_user, access_group); ++ } + } else { +- virReportSystemError(errcode, +- _("Cannot access backing file '%s' " +- "of storage file '%s' (as uid:%u, gid:%u)"), +- src->path, parent->path, access_user, access_group); ++ if (src == parent) { ++ virReportSystemError(errcode, ++ _("Cannot access storage file '%s'"), ++ src->path); ++ } else { ++ virReportSystemError(errcode, ++ _("Cannot access backing file '%s' " ++ "of storage file '%s'"), ++ src->path, parent->path); ++ } + } + } + diff --git a/69ed99c7-dom0-persistent.patch b/69ed99c7-dom0-persistent.patch new file mode 100644 index 0000000..af75a07 --- /dev/null +++ b/69ed99c7-dom0-persistent.patch @@ -0,0 +1,21 @@ +commit 69ed99c78696d7ac405ce9e193a4a312fd9945d7 +Author: Jim Fehlig +Date: Wed Dec 13 14:20:37 2017 -0700 + + libxl: mark domain0 as persistent + + A Xen domain0 is better described as a persistent domain. Mark it + as such during intialization. + +Index: libvirt-3.10.0/src/libxl/libxl_driver.c +=================================================================== +--- libvirt-3.10.0.orig/src/libxl/libxl_driver.c ++++ libvirt-3.10.0/src/libxl/libxl_driver.c +@@ -609,6 +609,7 @@ libxlAddDom0(libxlDriverPrivatePtr drive + + def = NULL; + ++ vm->persistent = 1; + virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED); + if (virDomainDefSetVcpusMax(vm->def, d_info.vcpu_max_id + 1, driver->xmlopt)) + goto cleanup; diff --git a/8599aedd-libvirt-guests-dom0-filter.patch b/8599aedd-libvirt-guests-dom0-filter.patch new file mode 100644 index 0000000..67273a2 --- /dev/null +++ b/8599aedd-libvirt-guests-dom0-filter.patch @@ -0,0 +1,25 @@ +commit 8599aedd434a2843dca7fae37bd397f07a584c1a +Author: Jim Fehlig +Date: Fri Dec 15 15:28:49 2017 -0700 + + Improve filtering of Xen domain0 in libvirt-guests + + The list_guests function in libvirt-guests uses 'grep -v' to filter + Xen domain0 from a list of guests. If domain0 is the only item in + the list, 'grep -v' returns 1, causing the 'stop' operation to fail + when action is 'suspend'. Improve the filtering by using sed to remove + domain0 from the list of guests. + +Index: libvirt-3.10.0/tools/libvirt-guests.sh.in +=================================================================== +--- libvirt-3.10.0.orig/tools/libvirt-guests.sh.in ++++ libvirt-3.10.0/tools/libvirt-guests.sh.in +@@ -121,7 +121,7 @@ list_guests() { + return 1 + fi + +- echo "$list" | grep -v 00000000-0000-0000-0000-000000000000 ++ echo "$list" | sed "/00000000-0000-0000-0000-000000000000/d" + } + + # guest_name URI UUID diff --git a/libvirt.changes b/libvirt.changes index f2e76a7..4150f9c 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Mon Dec 18 17:08:28 UTC 2017 - jfehlig@suse.com + +- libvirt-guests: fix 'stop' operation when action is 'suspend' + 69ed99c7-dom0-persistent.patch, + 8599aedd-libvirt-guests-dom0-filter.patch + bsc#1070130 + +------------------------------------------------------------------- +Thu Dec 14 23:04:20 UTC 2017 - jfehlig@suse.com + +- storage: Don't dereference driver object if virStorageSource is + not initialized + 2d07f1f0-fix-storage-crash.patch + bsc#1072974 + ------------------------------------------------------------------- Mon Dec 4 18:30:11 UTC 2017 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index b6deea5..586a7a4 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -308,6 +308,9 @@ Source4: libvirt-supportconfig Source99: baselibs.conf Source100: %{name}-rpmlintrc # Upstream patches +Patch0: 2d07f1f0-fix-storage-crash.patch +Patch1: 69ed99c7-dom0-persistent.patch +Patch2: 8599aedd-libvirt-guests-dom0-filter.patch # Patches pending upstream review Patch100: libxl-dom-reset.patch Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch @@ -883,6 +886,9 @@ libvirt plugin for NSS for translating domain names into IP addresses. %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 %patch100 -p1 %patch101 -p1 %patch150 -p1 diff --git a/libxl-dom-reset.patch b/libxl-dom-reset.patch index c13b0f8..b83e6e8 100644 --- a/libxl-dom-reset.patch +++ b/libxl-dom-reset.patch @@ -12,7 +12,7 @@ Index: libvirt-3.10.0/src/libxl/libxl_driver.c =================================================================== --- libvirt-3.10.0.orig/src/libxl/libxl_driver.c +++ libvirt-3.10.0/src/libxl/libxl_driver.c -@@ -1381,6 +1381,61 @@ libxlDomainReboot(virDomainPtr dom, unsi +@@ -1382,6 +1382,61 @@ libxlDomainReboot(virDomainPtr dom, unsi } static int @@ -74,7 +74,7 @@ Index: libvirt-3.10.0/src/libxl/libxl_driver.c libxlDomainDestroyFlags(virDomainPtr dom, unsigned int flags) { -@@ -6497,6 +6552,7 @@ static virHypervisorDriver libxlHypervis +@@ -6498,6 +6553,7 @@ static virHypervisorDriver libxlHypervis .domainShutdown = libxlDomainShutdown, /* 0.9.0 */ .domainShutdownFlags = libxlDomainShutdownFlags, /* 0.9.10 */ .domainReboot = libxlDomainReboot, /* 0.9.0 */ diff --git a/libxl-set-migration-constraints.patch b/libxl-set-migration-constraints.patch index 3a915d0..36a2456 100644 --- a/libxl-set-migration-constraints.patch +++ b/libxl-set-migration-constraints.patch @@ -56,7 +56,7 @@ Index: libvirt-3.10.0/src/libxl/libxl_driver.c =================================================================== --- libvirt-3.10.0.orig/src/libxl/libxl_driver.c +++ libvirt-3.10.0/src/libxl/libxl_driver.c -@@ -6099,6 +6099,9 @@ libxlDomainMigratePerform3Params(virDoma +@@ -6100,6 +6100,9 @@ libxlDomainMigratePerform3Params(virDoma const char *dname = NULL; const char *uri = NULL; int ret = -1; @@ -66,7 +66,7 @@ Index: libvirt-3.10.0/src/libxl/libxl_driver.c #ifdef LIBXL_HAVE_NO_SUSPEND_RESUME virReportUnsupportedError(); -@@ -6115,6 +6118,18 @@ libxlDomainMigratePerform3Params(virDoma +@@ -6116,6 +6119,18 @@ libxlDomainMigratePerform3Params(virDoma virTypedParamsGetString(params, nparams, VIR_MIGRATE_PARAM_DEST_NAME, &dname) < 0 || @@ -85,7 +85,7 @@ Index: libvirt-3.10.0/src/libxl/libxl_driver.c virTypedParamsGetString(params, nparams, VIR_MIGRATE_PARAM_URI, &uri) < 0) -@@ -6129,11 +6144,11 @@ libxlDomainMigratePerform3Params(virDoma +@@ -6130,11 +6145,11 @@ libxlDomainMigratePerform3Params(virDoma if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) { if (libxlDomainMigrationPerformP2P(driver, vm, dom->conn, dom_xml,