Bug ID 1048783
Summary libvirt-guests does not suspend all guests
Classification openSUSE
Product openSUSE Distribution
Version Leap 42.2
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Virtualization:Tools
Assignee virt-bugs@suse.de
Reporter richard@nod.at
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

The helper script /usr/lib64/libvirt/libvirt-guests.sh suspends all guests upon
stop and resumes them later.
I found that it does not suspend all guests in my case when PARALLEL_SHUTDOWN=0
in /etc/sysconfig/libvirt-guests.

The script constructs a file of the format "URI GUEST_O-UUID GUEST_1-UUID ...
GUEST_N-UUID".
In the bad case my file contained a new line right after the first guest
causing the script to think that the next UUID is an URI.
e.g.
default 5db0ac02-75d1-4854-84a7-54cbd373e594
2f64bbab-e15c-4811-9485-6099806a92c7

Output from the script:
Running guests on default URI: win7-support, sap-ts

Suspending guests on default URI...
Suspending win7-support: ...
Suspending win7-support: ...
Suspending win7-support: done
Suspending guests on 2f64bbab-e15c-4811-9485-6099806a92c7 URI...

The problem seems to be that the list_guests() function returns a newline
separated list.

The following changes makes the script work correctly for me:
--- /usr/lib64/libvirt/libvirt-guests.sh        2017-07-14 18:56:36.378235880
+0200
+++ /usr/lib64/libvirt/libvirt-guests.sh.rw     2017-07-14 18:56:31.430426761
+0200
@@ -142,7 +142,7 @@
         return 1
     fi

-    echo "$list" | grep -v 00000000-0000-0000-0000-000000000000
+    echo "$list" | grep -v 00000000-0000-0000-0000-000000000000 | tr "\n" " "
 }

 # guest_name URI UUID

Again, the output:
Running guests on default URI: win7-support, sap-ts

Suspending guests on default URI...
Suspending win7-support: ...
Suspending win7-support: ...
Suspending win7-support: ...
Suspending win7-support: done
Suspending sap-ts: ...
Suspending sap-ts: ...
Suspending sap-ts: done


You are receiving this mail because: