]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: support PARAVIRT reboot flag
authorJim Fehlig <jfehlig@suse.com>
Thu, 1 May 2014 21:00:47 +0000 (15:00 -0600)
committerJim Fehlig <jfehlig@suse.com>
Mon, 5 May 2014 16:52:21 +0000 (10:52 -0600)
Add support for the VIR_DOMAIN_REBOOT_PARAVIRT flag in
libxlDomainReboot().

src/libxl/libxl_driver.c

index 56284e87029cff4da2f74d55000ddda8a5a77351..df7d51066d484d8d1ab6485f8fb9f1c6ced69ead 100644 (file)
@@ -939,7 +939,9 @@ libxlDomainReboot(virDomainPtr dom, unsigned int flags)
     int ret = -1;
     libxlDomainObjPrivatePtr priv;
 
-    virCheckFlags(0, -1);
+    virCheckFlags(VIR_DOMAIN_REBOOT_PARAVIRT, -1);
+    if (flags == 0)
+        flags = VIR_DOMAIN_REBOOT_PARAVIRT;
 
     if (!(vm = libxlDomObjFromDomain(dom)))
         goto cleanup;
@@ -954,13 +956,16 @@ libxlDomainReboot(virDomainPtr dom, unsigned int flags)
     }
 
     priv = vm->privateData;
-    if (libxl_domain_reboot(priv->ctx, vm->def->id) != 0) {
+    if (flags & VIR_DOMAIN_REBOOT_PARAVIRT) {
+        ret = libxl_domain_reboot(priv->ctx, vm->def->id);
+        if (ret == 0)
+            goto cleanup;
+
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to reboot domain '%d' with libxenlight"),
                        vm->def->id);
-        goto cleanup;
+        ret = -1;
     }
-    ret = 0;
 
  cleanup:
     if (vm)