mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
conf: Use virTristateXXX in virDomainDiskDef
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
5cbc83774a
commit
a9ef3272c5
@ -9210,27 +9210,36 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def,
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
|
||||
if ((tmp = virXMLPropString(cur, "ioeventfd")) &&
|
||||
(def->ioeventfd = virTristateSwitchTypeFromString(tmp)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown disk ioeventfd mode '%s'"), tmp);
|
||||
return -1;
|
||||
if ((tmp = virXMLPropString(cur, "ioeventfd"))) {
|
||||
int value;
|
||||
if ((value = virTristateSwitchTypeFromString(tmp)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown disk ioeventfd mode '%s'"), tmp);
|
||||
return -1;
|
||||
}
|
||||
def->ioeventfd = value;
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
|
||||
if ((tmp = virXMLPropString(cur, "event_idx")) &&
|
||||
(def->event_idx = virTristateSwitchTypeFromString(tmp)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown disk event_idx mode '%s'"), tmp);
|
||||
return -1;
|
||||
if ((tmp = virXMLPropString(cur, "event_idx"))) {
|
||||
int value;
|
||||
if ((value = virTristateSwitchTypeFromString(tmp)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown disk event_idx mode '%s'"), tmp);
|
||||
return -1;
|
||||
}
|
||||
def->event_idx = value;
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
|
||||
if ((tmp = virXMLPropString(cur, "copy_on_read")) &&
|
||||
(def->copy_on_read = virTristateSwitchTypeFromString(tmp)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown disk copy_on_read mode '%s'"), tmp);
|
||||
return -1;
|
||||
if ((tmp = virXMLPropString(cur, "copy_on_read"))) {
|
||||
int value;
|
||||
if ((value = virTristateSwitchTypeFromString(tmp)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown disk copy_on_read mode '%s'"), tmp);
|
||||
return -1;
|
||||
}
|
||||
def->copy_on_read = value;
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
|
||||
|
@ -569,9 +569,9 @@ struct _virDomainDiskDef {
|
||||
int error_policy; /* enum virDomainDiskErrorPolicy */
|
||||
int rerror_policy; /* enum virDomainDiskErrorPolicy */
|
||||
int iomode; /* enum virDomainDiskIo */
|
||||
int ioeventfd; /* enum virTristateSwitch */
|
||||
int event_idx; /* enum virTristateSwitch */
|
||||
int copy_on_read; /* enum virTristateSwitch */
|
||||
virTristateSwitch ioeventfd;
|
||||
virTristateSwitch event_idx;
|
||||
virTristateSwitch copy_on_read;
|
||||
int snapshot; /* virDomainSnapshotLocation, snapshot_conf.h */
|
||||
int startupPolicy; /* enum virDomainStartupPolicy */
|
||||
bool transient;
|
||||
|
Loading…
Reference in New Issue
Block a user