]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: snapshot: Forbid internal snapshot with passthrough devices
authorShanzhi Yu <shyu@redhat.com>
Wed, 3 Dec 2014 11:12:35 +0000 (19:12 +0800)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 5 Dec 2014 10:08:45 +0000 (11:08 +0100)
When attempting to create internal system checkpoint with a passthrough
device qemu will report the following error:

error: operation failed: Error -22 while writing VM

This patch calls the function to check if migration is possible with
given VM and thus improves the error to:

error: Requested operation is not valid: domain has assigned non-USB host devices

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=874418#c19
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_driver.c

index b9935e4a7adb1bafa591c47ca0bfe7ac495f530b..9152cf5e954526ccc4773886feaf3be62dde440e 100644 (file)
@@ -12885,6 +12885,9 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
     bool resume = false;
     int ret = -1;
 
+    if (!qemuMigrationIsAllowed(driver, vm, vm->def, false, false))
+        goto cleanup;
+
     if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
         /* savevm monitor command pauses the domain emitting an event which
          * confuses libvirt since it's not notified when qemu resumes the