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

qemu: introduce CHECK_STREQ_NULLABLE in qemuDomainDiskChangeSupported

A macro for comparing string fields of the disk.

https://bugzilla.redhat.com/show_bug.cgi?id=1601677Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NLaine Stump <laine@laine.org>
上级 21a9cb98
......@@ -9321,6 +9321,18 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
} \
} while (0)
#define CHECK_STREQ_NULLABLE(field, field_name) \
do { \
if (!disk->field) \
break; \
if (STRNEQ_NULLABLE(disk->field, orig_disk->field)) { \
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, \
_("cannot modify field '%s' of the disk"), \
field_name); \
return false; \
} \
} while (0)
CHECK_EQ(device, "device", false);
CHECK_EQ(bus, "bus", false);
if (STRNEQ(disk->dst, orig_disk->dst)) {
......@@ -9468,6 +9480,7 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
}
#undef CHECK_EQ
#undef CHECK_STREQ_NULLABLE
return true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册