]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: add a flag to mark guests as tainted by a hook
authorCédric Bosdonnat <cbosdonnat@suse.com>
Mon, 11 Jul 2016 13:54:31 +0000 (15:54 +0200)
committerCédric Bosdonnat <cbosdonnat@suse.com>
Tue, 2 Aug 2016 12:20:31 +0000 (14:20 +0200)
The migrate hook will affect the migrated guest definition. Allow
these domains be marked as tainted in the libxl driver.

src/libxl/libxl_domain.c
src/libxl/libxl_domain.h

index 0e26b9188071efb1510a42a33220a2a523f38c83..886b40fbb22462756c71eba3395270a522ff3648 100644 (file)
@@ -1135,6 +1135,16 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
                                        vm->def, hostdev_flags) < 0)
         goto cleanup_dom;
 
+    if (priv->hookRun) {
+        char uuidstr[VIR_UUID_STRING_BUFLEN];
+        virUUIDFormat(vm->def->uuid, uuidstr);
+
+        VIR_WARN("Domain id='%d' name='%s' uuid='%s' is tainted: hook",
+                 vm->def->id,
+                 vm->def->name,
+                 uuidstr);
+    }
+
     /* Unlock virDomainObj while creating the domain */
     virObjectUnlock(vm);
 
index af11a2c83d464b2f2ec1ce7688aed0526074af4f..3a3890b732e38586220d55d762c1a77681736294 100644 (file)
@@ -69,6 +69,8 @@ struct _libxlDomainObjPrivate {
     char *lockState;
 
     struct libxlDomainJobObj job;
+
+    bool hookRun;  /* true if there was a hook run over this domain */
 };