提交 e5794c54 编写于 作者: J Ján Tomko

qemuDomainDiskChangeSupported: use CHECK_STREQ_NULLABLE more

Convert the other string comparisons to use the macro.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NLaine Stump <laine@laine.org>
上级 35d76db2
...@@ -9400,33 +9400,14 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk, ...@@ -9400,33 +9400,14 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
CHECK_STREQ_NULLABLE(blkdeviotune.group_name, CHECK_STREQ_NULLABLE(blkdeviotune.group_name,
"blkdeviotune group name"); "blkdeviotune group name");
if (disk->serial && STRNEQ_NULLABLE(disk->serial, orig_disk->serial)) { CHECK_STREQ_NULLABLE(serial,
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot modify field '%s' of the disk"),
"serial"); "serial");
return false; CHECK_STREQ_NULLABLE(wwn,
}
if (disk->wwn && STRNEQ_NULLABLE(disk->wwn, orig_disk->wwn)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot modify field '%s' of the disk"),
"wwn"); "wwn");
return false; CHECK_STREQ_NULLABLE(vendor,
}
if (disk->vendor && STRNEQ_NULLABLE(disk->vendor, orig_disk->vendor)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot modify field '%s' of the disk"),
"vendor"); "vendor");
return false; CHECK_STREQ_NULLABLE(product,
}
if (disk->product && STRNEQ_NULLABLE(disk->product, orig_disk->product)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot modify field '%s' of the disk"),
"product"); "product");
return false;
}
CHECK_EQ(cachemode, "cache", true); CHECK_EQ(cachemode, "cache", true);
CHECK_EQ(error_policy, "error_policy", true); CHECK_EQ(error_policy, "error_policy", true);
...@@ -9459,13 +9440,8 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk, ...@@ -9459,13 +9440,8 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
CHECK_EQ(discard, "discard", true); CHECK_EQ(discard, "discard", true);
CHECK_EQ(iothread, "iothread", true); CHECK_EQ(iothread, "iothread", true);
if (disk->domain_name && CHECK_STREQ_NULLABLE(domain_name,
STRNEQ_NULLABLE(disk->domain_name, orig_disk->domain_name)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot modify field '%s' of the disk"),
"backenddomain"); "backenddomain");
return false;
}
/* checks for fields stored in disk->src */ /* checks for fields stored in disk->src */
/* unfortunately 'readonly' and 'shared' can't be converted to tristate /* unfortunately 'readonly' and 'shared' can't be converted to tristate
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册