[libvirt] [PATCH] libxl: mark domain0 as persistent

Jim Fehlig jfehlig at suse.com
Wed Dec 13 21:41:53 UTC 2017

A Xen domain0 is better described as a persistent domain. Mark it
as such during intialization.

Signed-off-by: Jim Fehlig <jfehlig at suse.com>

I noticed this while debugging a libvirt-guests issue. The list_guests()
function filters domain0 with

echo "$list" | grep -v 00000000-0000-0000-0000-000000000000

If domain0 is the only item in $list, the grep returns 1, causing
a failure of the stop operation when action is suspend. This
patch fixes the libvirt-guests issue, but I can also send a patch
to improve the filter if desired. E.g.

echo "$list" | sed "s/00000000-0000-0000-0000-000000000000//g"

 src/libxl/libxl_driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 40328a6cb..79e29ce07 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -609,6 +609,7 @@ libxlAddDom0(libxlDriverPrivatePtr driver)
     def = NULL;
+    vm->persistent = 1;
     if (virDomainDefSetVcpusMax(vm->def, d_info.vcpu_max_id + 1, driver->xmlopt))
         goto cleanup;

More information about the libvir-list mailing list