From c01d33d0ce38e4f393b9419c34f106b1bd7eb61dece473d268e406769b3efcd5 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Mon, 18 Dec 2017 18:48:46 +0000 Subject: [PATCH] Accepting request 558230 from home:jfehlig:branches:Virtualization - libvirt-guests: fix 'stop' operation when action is 'suspend' 69ed99c7-dom0-persistent.patch, 8599aedd-libvirt-guests-dom0-filter.patch bsc#1070130 OBS-URL: https://build.opensuse.org/request/show/558230 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=650 --- 69ed99c7-dom0-persistent.patch | 21 +++++++++++++++++++ 8599aedd-libvirt-guests-dom0-filter.patch | 25 +++++++++++++++++++++++ libvirt.changes | 8 ++++++++ libvirt.spec | 4 ++++ libxl-dom-reset.patch | 4 ++-- libxl-set-migration-constraints.patch | 6 +++--- 6 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 69ed99c7-dom0-persistent.patch create mode 100644 8599aedd-libvirt-guests-dom0-filter.patch 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 6751285..4150f9c 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +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 diff --git a/libvirt.spec b/libvirt.spec index 289df31..586a7a4 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -309,6 +309,8 @@ 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 @@ -885,6 +887,8 @@ 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,