]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: snapshot: Report better error message if migration isn't allowed
authorPeter Krempa <pkrempa@redhat.com>
Fri, 7 Dec 2012 11:06:30 +0000 (12:06 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 11 Dec 2012 18:48:37 +0000 (19:48 +0100)
Qemu doesn't support migration on guests with host devices. This patch
adds a check to ensure migration is safe before actually doing so.

src/qemu/qemu_driver.c

index 93d9b69b498024023322c6971cc9360255806825..9a449bfbeba61dbc25b9d82b6b11e1b38e45bad8 100644 (file)
@@ -11430,6 +11430,10 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
 
     /* do the memory snapshot if necessary */
     if (memory) {
+        /* check if migration is possible */
+        if (!qemuMigrationIsAllowed(driver, vm, vm->def, false))
+            goto endjob;
+
         /* allow the migration job to be cancelled or the domain to be paused */
         qemuDomainObjSetAsyncJobMask(vm, DEFAULT_JOB_MASK |
                                      JOB_MASK(QEMU_JOB_SUSPEND) |