g_autofree char *target = NULL;
g_autofree char *bus = NULL;
g_autofree char *serial = NULL;
- g_autofree char *removable = NULL;
g_autofree char *logical_block_size = NULL;
g_autofree char *physical_block_size = NULL;
g_autofree char *wwn = NULL;
if (virXMLPropEnum(cur, "tray", virDomainDiskTrayTypeFromString,
VIR_XML_PROP_OPTIONAL, &def->tray_status) < 0)
return NULL;
- removable = virXMLPropString(cur, "removable");
+
+ if (virXMLPropTristateSwitch(cur, "removable", VIR_XML_PROP_OPTIONAL,
+ &def->removable) < 0)
+ return NULL;
+
rotation_rate = virXMLPropString(cur, "rotation_rate");
} else if (!domain_name &&
virXMLNodeNameEqual(cur, "backenddomain")) {
}
}
- if (removable) {
- if ((def->removable = virTristateSwitchTypeFromString(removable)) < 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown disk removable status '%s'"), removable);
- return NULL;
- }
- }
-
if (rotation_rate &&
virStrToLong_ui(rotation_rate, NULL, 10, &def->rotation_rate) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
int bus; /* enum virDomainDiskBus */
char *dst;
virDomainDiskTray tray_status;
- int removable; /* enum virTristateSwitch */
+ virTristateSwitch removable;
unsigned int rotation_rate;
virStorageSource *mirror;