提交 662862ec 编写于 作者: P Peter Krempa

qemu: hotplug: Allow update of disk default snapshot location

Since the field is internal to libvirt we can allow the users to modify
it.
上级 3b3debfb
......@@ -3923,7 +3923,7 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
CHECK_EQ(ioeventfd, "ioeventfd", true);
CHECK_EQ(event_idx, "event_idx", true);
CHECK_EQ(copy_on_read, "copy_on_read", true);
CHECK_EQ(snapshot, "snapshot", true);
/* "snapshot" is a libvirt internal field and thus can be changed */
/* startupPolicy is allowed to be updated. Therefore not checked here. */
CHECK_EQ(transient, "transient", true);
CHECK_EQ(info.bootIndex, "boot order", true);
......
......@@ -7682,6 +7682,7 @@ qemuDomainChangeDiskLive(virConnectPtr conn,
virDomainDiskDefPtr disk = dev->data.disk;
virDomainDiskDefPtr orig_disk = NULL;
int startupPolicy;
int snapshot;
int ret = -1;
if (virStorageTranslateDiskSourcePool(conn, disk) < 0)
......@@ -7700,6 +7701,7 @@ qemuDomainChangeDiskLive(virConnectPtr conn,
}
startupPolicy = orig_disk->startupPolicy;
snapshot = orig_disk->snapshot;
switch ((virDomainDiskDevice) disk->device) {
case VIR_DOMAIN_DISK_DEVICE_CDROM:
......@@ -7708,6 +7710,7 @@ qemuDomainChangeDiskLive(virConnectPtr conn,
goto cleanup;
orig_disk->startupPolicy = dev->data.disk->startupPolicy;
orig_disk->snapshot = dev->data.disk->snapshot;
if (qemuDomainDiskSourceDiffers(conn, disk, orig_disk)) {
/* Add the new disk src into shared disk hash table */
......@@ -7742,6 +7745,7 @@ qemuDomainChangeDiskLive(virConnectPtr conn,
return ret;
rollback:
orig_disk->snapshot = snapshot;
orig_disk->startupPolicy = startupPolicy;
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册