提交 3fa8125f 编写于 作者: P Peter Krempa

conf: disk: Extract checking of removable status

上级 2d3557b2
......@@ -6941,6 +6941,13 @@ virDomainDiskDefValidate(const virDomainDiskDef *def)
return -1;
}
if (def->removable != VIR_TRISTATE_SWITCH_ABSENT &&
def->bus != VIR_DOMAIN_DISK_BUS_USB) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("removable is only valid for usb disks"));
return -1;
}
return 0;
}
......@@ -7423,12 +7430,6 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
_("unknown disk removable status '%s'"), removable);
goto error;
}
if (def->bus != VIR_DOMAIN_DISK_BUS_USB) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("removable is only valid for usb disks"));
goto error;
}
}
if (devaddr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册