]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: domain: Clear startup policy for dropped removable media
authorPeter Krempa <pkrempa@redhat.com>
Mon, 5 Sep 2016 13:50:18 +0000 (15:50 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 12 Sep 2016 07:54:36 +0000 (09:54 +0200)
When a source image is dropped when missing due to startup policy the
policy needs to be cleared since it was relevant only for the given
storage source. New sources need to update it if needed.

src/qemu/qemu_domain.c

index 6c57ed2c6235396b444460ee7b0d7818bdb9a6ad..fd79390a7ae9be34ba52c28b583a25b9b2fe9e56 100644 (file)
@@ -4341,6 +4341,8 @@ qemuDomainCheckRemoveOptionalDisk(virQEMUDriverPtr driver,
                                                    disk->info.alias,
                                                    VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START);
         ignore_value(virDomainDiskSetSource(disk, NULL));
+        /* keeping the old startup policy would be invalid for new images */
+        disk->startupPolicy = VIR_DOMAIN_STARTUP_POLICY_DEFAULT;
     } else {
         event = virDomainEventDiskChangeNewFromObj(vm, src, NULL,
                                                    disk->info.alias,