qemuDomainDiskChangeSupported: Fill in missing checks

So far this function was not kept in sync with changing
virDomainDiskDef. Fill in all the missing checks and reorganize
their order so it's easier to track which items are not being
checked for.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2015-09-15 15:41:18 +02:00
parent 127328a07e
commit 08573b632d

View File

@ -3057,15 +3057,15 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
} while (0) } while (0)
CHECK_EQ(device, "device", false); CHECK_EQ(device, "device", false);
CHECK_EQ(cachemode, "cache", true); CHECK_EQ(bus, "bus", false);
CHECK_EQ(error_policy, "error_policy", true); if (STRNEQ(disk->dst, orig_disk->dst)) {
CHECK_EQ(rerror_policy, "rerror_policy", true); virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
CHECK_EQ(iomode, "io", true); _("cannot modify field '%s' of the disk"),
CHECK_EQ(ioeventfd, "ioeventfd", true); "bus");
CHECK_EQ(event_idx, "event_idx", true); return false;
CHECK_EQ(copy_on_read, "copy_on_read", true); }
CHECK_EQ(discard, "discard", true); CHECK_EQ(tray_status, "tray", true);
CHECK_EQ(iothread, "iothread", true); CHECK_EQ(removable, "removable", true);
if (disk->geometry.cylinders && if (disk->geometry.cylinders &&
disk->geometry.heads && disk->geometry.heads &&
@ -3081,9 +3081,6 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
CHECK_EQ(blockio.physical_block_size, CHECK_EQ(blockio.physical_block_size,
"blockio physical_block_size", false); "blockio physical_block_size", false);
if (disk->bus == VIR_DOMAIN_DISK_BUS_USB)
CHECK_EQ(removable, "removable", true);
CHECK_EQ(blkdeviotune.total_bytes_sec, CHECK_EQ(blkdeviotune.total_bytes_sec,
"blkdeviotune total_bytes_sec", "blkdeviotune total_bytes_sec",
true); true);
@ -3124,8 +3121,6 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
"blkdeviotune size_iops_sec", "blkdeviotune size_iops_sec",
true); true);
CHECK_EQ(transient, "transient", true);
if (disk->serial && STRNEQ_NULLABLE(disk->serial, orig_disk->serial)) { if (disk->serial && STRNEQ_NULLABLE(disk->serial, orig_disk->serial)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot modify field '%s' of the disk"), _("cannot modify field '%s' of the disk"),
@ -3154,7 +3149,29 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
return false; return false;
} }
CHECK_EQ(cachemode, "cache", true);
CHECK_EQ(error_policy, "error_policy", true);
CHECK_EQ(rerror_policy, "rerror_policy", true);
CHECK_EQ(iomode, "io", true);
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);
CHECK_EQ(startupPolicy, "startupPolicy", true);
CHECK_EQ(transient, "transient", true);
CHECK_EQ(info.bootIndex, "boot order", true); CHECK_EQ(info.bootIndex, "boot order", true);
CHECK_EQ(rawio, "rawio", true);
CHECK_EQ(sgio, "sgio", true);
CHECK_EQ(discard, "discard", true);
CHECK_EQ(iothread, "iothread", true);
if (disk->domain_name &&
STRNEQ_NULLABLE(disk->domain_name, orig_disk->domain_name)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot modify field '%s' of the disk"),
"backenddomain");
return false;
}
#undef CHECK_EQ #undef CHECK_EQ