]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Add the new disk src into shared disk table when updating disk
authorOsier Yang <jyang@redhat.com>
Mon, 18 Mar 2013 13:52:04 +0000 (21:52 +0800)
committerOsier Yang <jyang@redhat.com>
Thu, 21 Mar 2013 04:20:36 +0000 (12:20 +0800)
We should record the new disk src in the shared disk table for
updating disk (CD-ROM or Floppy) API. Fortunately, we only allow
to update the disk source now, otherwise we might also want to
set the unpriv_sgio setting.

src/qemu/qemu_driver.c

index f057d385ecd81251c0ce8228f5d728ebad9fed48..3b1beb40def024fed0473deb55a98d0c91557343 100644 (file)
@@ -6067,6 +6067,10 @@ qemuDomainChangeDiskMediaLive(virDomainObjPtr vm,
         }
         dev->data.disk = tmp;
 
+        /* Add the new disk src into shared disk hash table */
+        if (qemuAddSharedDisk(driver, dev->data.disk, vm->def->name) < 0)
+            goto end;
+
         ret = qemuDomainChangeEjectableMedia(driver, vm, disk, orig_disk, force);
         if (ret == 0) {
             dev->data.disk = NULL;