mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
virDomainHostdevSubsys: Convert 'type' field to proper enum type
Convert the field, and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
c1afc835b0
commit
44f0371c8c
@ -353,7 +353,7 @@ virDomainAuditHostdev(virDomainObj *vm, virDomainHostdevDef *hostdev,
|
||||
|
||||
switch (hostdev->mode) {
|
||||
case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS:
|
||||
switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) {
|
||||
switch (hostdev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
address = virPCIDeviceAddressAsString(&pcisrc->addr);
|
||||
break;
|
||||
|
@ -2632,7 +2632,7 @@ virDomainHostdevDefClear(virDomainHostdevDef *def)
|
||||
}
|
||||
break;
|
||||
case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS:
|
||||
switch ((virDomainHostdevSubsysType) def->source.subsys.type) {
|
||||
switch (def->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
virDomainHostdevSubsysSCSIClear(&def->source.subsys.u.scsi);
|
||||
break;
|
||||
@ -6168,7 +6168,7 @@ virDomainHostdevSubsysMediatedDevDefParseXML(virDomainHostdevDef *def,
|
||||
static int
|
||||
virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
|
||||
xmlXPathContextPtr ctxt,
|
||||
const char *type,
|
||||
virDomainHostdevSubsysType type,
|
||||
virDomainHostdevDef *def,
|
||||
unsigned int flags,
|
||||
virDomainXMLOption *xmlopt)
|
||||
@ -6202,18 +6202,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
|
||||
* <hostdev>. (the functions we're going to call expect address
|
||||
* type to already be known).
|
||||
*/
|
||||
if (!type) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
"%s", _("missing source address type"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((def->source.subsys.type = virDomainHostdevSubsysTypeFromString(type)) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown host device source address type '%1$s'"),
|
||||
type);
|
||||
return -1;
|
||||
}
|
||||
def->source.subsys.type = type;
|
||||
|
||||
if (!(sourcenode = virXPathNode("./source", ctxt))) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
@ -6322,6 +6311,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
|
||||
return -1;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("address type='%1$s' not supported in hostdev interfaces"),
|
||||
@ -8868,6 +8858,7 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
|
||||
}
|
||||
} else if (actual->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
|
||||
virDomainHostdevDef *hostdev = &actual->data.hostdev.def;
|
||||
int type;
|
||||
|
||||
hostdev->parentnet = parent;
|
||||
hostdev->info = &parent->info;
|
||||
@ -8879,8 +8870,16 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
|
||||
/* if not explicitly stated, source/vendor implies usb device */
|
||||
if (!addrtype && virXPathNode("./source/vendor", ctxt))
|
||||
addrtype = g_strdup("usb");
|
||||
|
||||
if ((type = virDomainHostdevSubsysTypeFromString(addrtype)) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown host device source address type '%1$s'"),
|
||||
addrtype);
|
||||
goto error;
|
||||
}
|
||||
|
||||
hostdev->mode = VIR_DOMAIN_HOSTDEV_MODE_SUBSYS;
|
||||
if (virDomainHostdevDefParseXMLSubsys(node, ctxt, addrtype,
|
||||
if (virDomainHostdevDefParseXMLSubsys(node, ctxt, type,
|
||||
hostdev, flags, xmlopt) < 0) {
|
||||
goto error;
|
||||
}
|
||||
@ -9544,6 +9543,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
|
||||
|
||||
case VIR_DOMAIN_NET_TYPE_HOSTDEV: {
|
||||
g_autofree char *addrtype = virXPathString("string(./source/address/@type)", ctxt);
|
||||
int type;
|
||||
|
||||
def->data.hostdev.def.parentnet = def;
|
||||
def->data.hostdev.def.info = &def->info;
|
||||
@ -9556,7 +9556,15 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
|
||||
/* The helper function expects type to already be found and
|
||||
* passed in as a string, since it is in a different place in
|
||||
* NetDef vs HostdevDef. */
|
||||
if (virDomainHostdevDefParseXMLSubsys(node, ctxt, addrtype,
|
||||
|
||||
if ((type = virDomainHostdevSubsysTypeFromString(addrtype)) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown host device source address type '%1$s'"),
|
||||
addrtype);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (virDomainHostdevDefParseXMLSubsys(node, ctxt, type,
|
||||
&def->data.hostdev.def,
|
||||
flags, xmlopt) < 0)
|
||||
return NULL;
|
||||
@ -12909,8 +12917,7 @@ virDomainHostdevDefParseXML(virDomainXMLOption *xmlopt,
|
||||
{
|
||||
virDomainHostdevDef *def;
|
||||
VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
||||
g_autofree char *type = virXMLPropString(node, "type");
|
||||
unsigned int typeU;
|
||||
unsigned int type;
|
||||
|
||||
ctxt->node = node;
|
||||
|
||||
@ -12926,6 +12933,10 @@ virDomainHostdevDefParseXML(virDomainXMLOption *xmlopt,
|
||||
switch (def->mode) {
|
||||
case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS:
|
||||
/* parse managed/mode/type, and the <source> element */
|
||||
if (virXMLPropEnum(node, "type",
|
||||
virDomainHostdevSubsysTypeFromString,
|
||||
VIR_XML_PROP_REQUIRED, &type) < 0)
|
||||
goto error;
|
||||
if (virDomainHostdevDefParseXMLSubsys(node, ctxt, type, def, flags, xmlopt) < 0)
|
||||
goto error;
|
||||
break;
|
||||
@ -12933,10 +12944,10 @@ virDomainHostdevDefParseXML(virDomainXMLOption *xmlopt,
|
||||
/* parse managed/mode/type, and the <source> element */
|
||||
if (virXMLPropEnum(node, "type",
|
||||
virDomainHostdevCapsTypeFromString,
|
||||
VIR_XML_PROP_REQUIRED, &typeU) < 0)
|
||||
VIR_XML_PROP_REQUIRED, &type) < 0)
|
||||
goto error;
|
||||
|
||||
if (virDomainHostdevDefParseXMLCaps(node, ctxt, typeU, def) < 0)
|
||||
if (virDomainHostdevDefParseXMLCaps(node, ctxt, type, def) < 0)
|
||||
goto error;
|
||||
break;
|
||||
default:
|
||||
@ -12953,7 +12964,7 @@ virDomainHostdevDefParseXML(virDomainXMLOption *xmlopt,
|
||||
goto error;
|
||||
}
|
||||
if (def->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
||||
switch ((virDomainHostdevSubsysType) def->source.subsys.type) {
|
||||
switch (def->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
if (virXPathBoolean("boolean(./readonly)", ctxt))
|
||||
def->readonly = true;
|
||||
@ -14087,7 +14098,7 @@ virDomainHostdevMatchSubsys(virDomainHostdevDef *a,
|
||||
if (a->source.subsys.type != b->source.subsys.type)
|
||||
return 0;
|
||||
|
||||
switch ((virDomainHostdevSubsysType) a->source.subsys.type) {
|
||||
switch (a->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
return virDomainHostdevMatchSubsysPCI(a, b);
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
@ -23436,7 +23447,7 @@ virDomainHostdevDefFormatSubsys(virBuffer *buf,
|
||||
bool includeTypeInAddr,
|
||||
virDomainXMLOption *xmlopt)
|
||||
{
|
||||
switch ((virDomainHostdevSubsysType) def->source.subsys.type) {
|
||||
switch (def->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
virDomainHostdevDefFormatSubsysUSB(buf, def, flags, includeTypeInAddr);
|
||||
return 0;
|
||||
|
@ -316,7 +316,7 @@ struct _virDomainHostdevSubsysSCSIVHost {
|
||||
};
|
||||
|
||||
struct _virDomainHostdevSubsys {
|
||||
int type; /* enum virDomainHostdevSubsysType */
|
||||
virDomainHostdevSubsysType type;
|
||||
union {
|
||||
virDomainHostdevSubsysUSB usb;
|
||||
virDomainHostdevSubsysPCI pci;
|
||||
|
@ -2149,7 +2149,7 @@ static int
|
||||
virDomainHostdevDefValidate(const virDomainHostdevDef *hostdev)
|
||||
{
|
||||
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
||||
switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) {
|
||||
switch (hostdev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
if (hostdev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
|
||||
hostdev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_UNASSIGNED &&
|
||||
|
@ -3271,6 +3271,10 @@ libxlDomainAttachHostDevice(libxlDriverPrivate *driver,
|
||||
return -1;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("hostdev subsys type '%1$s' not supported"),
|
||||
@ -3561,6 +3565,10 @@ libxlDomainAttachDeviceConfig(virDomainDef *vmdef, virDomainDeviceDef *dev)
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
return -1;
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
||||
break;
|
||||
}
|
||||
|
||||
if (virDomainHostdevFind(vmdef, hostdev, &found) >= 0) {
|
||||
@ -3835,6 +3843,10 @@ libxlDomainDetachHostDevice(libxlDriverPrivate *driver,
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
return libxlDomainDetachHostUSBDevice(driver, vm, hostdev);
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
default:
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected hostdev type %1$d"), subsys->type);
|
||||
|
@ -1776,6 +1776,11 @@ virLXCControllerSetupHostdevSubsys(virDomainDef *vmDef,
|
||||
def,
|
||||
securityDriver);
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported host device mode %1$s"),
|
||||
|
@ -3848,6 +3848,11 @@ lxcDomainAttachDeviceHostdevSubsysLive(virLXCDriver *driver,
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
return lxcDomainAttachDeviceHostdevSubsysUSBLive(driver, vm, dev);
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported host device type %1$s"),
|
||||
@ -4281,6 +4286,11 @@ lxcDomainDetachDeviceHostdevSubsysLive(virLXCDriver *driver,
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
return lxcDomainDetachDeviceHostdevUSBLive(driver, vm, dev);
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported host device type %1$s"),
|
||||
|
@ -76,6 +76,11 @@ int virLXCPrepareHostDevices(virLXCDriver *driver,
|
||||
switch (dev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
break;
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported hostdev type %1$s"),
|
||||
|
@ -5141,7 +5141,7 @@ qemuBuildHostdevCommandLine(virCommand *cmd,
|
||||
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
|
||||
continue;
|
||||
|
||||
switch ((virDomainHostdevSubsysType) subsys->type) {
|
||||
switch (subsys->type) {
|
||||
/* USB */
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
if (!(devprops = qemuBuildUSBHostdevDevProps(def, hostdev, qemuCaps)))
|
||||
|
@ -10680,7 +10680,7 @@ qemuDomainGetHostdevPath(virDomainHostdevDef *dev,
|
||||
|
||||
switch (dev->mode) {
|
||||
case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS:
|
||||
switch ((virDomainHostdevSubsysType)dev->source.subsys.type) {
|
||||
switch (dev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
if (pcisrc->backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
|
||||
if (!(tmpPath = virPCIDeviceAddressGetIOMMUGroupDev(&pcisrc->addr)))
|
||||
@ -11488,7 +11488,7 @@ qemuDomainPrepareHostdev(virDomainHostdevDef *hostdev,
|
||||
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
|
||||
return 0;
|
||||
|
||||
switch ((virDomainHostdevSubsysType)hostdev->source.subsys.type) {
|
||||
switch (hostdev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
return qemuDomainPrepareHostdevSCSI(hostdev, priv);
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
|
@ -2791,6 +2791,7 @@ qemuDomainAttachHostDevice(virQEMUDriver *driver,
|
||||
return -1;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("hotplug is not supported for hostdev subsys type '%1$s'"),
|
||||
@ -4680,7 +4681,7 @@ qemuDomainRemoveHostDevice(virQEMUDriver *driver,
|
||||
if (qemuDomainNamespaceTeardownHostdev(vm, hostdev) < 0)
|
||||
VIR_WARN("Unable to remove host device from /dev");
|
||||
|
||||
switch ((virDomainHostdevSubsysType)hostdev->source.subsys.type) {
|
||||
switch (hostdev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
qemuDomainRemovePCIHostDevice(driver, vm, hostdev);
|
||||
/* QEMU might no longer need to lock as much memory, eg. we just
|
||||
@ -5726,6 +5727,7 @@ qemuDomainDetachPrepHostdev(virDomainObj *vm,
|
||||
break;
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
||||
break;
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
default:
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected hostdev type %1$d"), subsys->type);
|
||||
|
@ -1287,7 +1287,7 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def)
|
||||
return false;
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS:
|
||||
switch ((virDomainHostdevSubsysType)hostdev->source.subsys.type) {
|
||||
switch (hostdev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
/* USB devices can be "migrated" */
|
||||
continue;
|
||||
|
@ -2448,7 +2448,7 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHostdevDef *hostdev,
|
||||
}
|
||||
|
||||
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
||||
switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) {
|
||||
switch (hostdev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
if (hostdev->source.subsys.u.usb.guestReset &&
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_HOST_GUESTS_RESETS_ALL)) {
|
||||
|
@ -846,7 +846,7 @@ AppArmorSetSecurityHostdevLabel(virSecurityManager *mgr,
|
||||
ptr->mgr = mgr;
|
||||
ptr->def = def;
|
||||
|
||||
switch ((virDomainHostdevSubsysType)dev->source.subsys.type) {
|
||||
switch (dev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
|
||||
virUSBDevice *usb =
|
||||
virUSBDeviceNew(usbsrc->bus, usbsrc->device, vroot);
|
||||
|
@ -1230,7 +1230,7 @@ virSecurityDACSetHostdevLabel(virSecurityManager *mgr,
|
||||
if (cbdata.secdef && !cbdata.secdef->relabel)
|
||||
return 0;
|
||||
|
||||
switch ((virDomainHostdevSubsysType)dev->source.subsys.type) {
|
||||
switch (dev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
|
||||
g_autoptr(virUSBDevice) usb = NULL;
|
||||
|
||||
@ -1393,7 +1393,7 @@ virSecurityDACRestoreHostdevLabel(virSecurityManager *mgr,
|
||||
scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
|
||||
return 0;
|
||||
|
||||
switch ((virDomainHostdevSubsysType)dev->source.subsys.type) {
|
||||
switch (dev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
|
||||
g_autoptr(virUSBDevice) usb = NULL;
|
||||
|
||||
|
@ -2184,7 +2184,7 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityManager *mgr,
|
||||
scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
|
||||
return 0;
|
||||
|
||||
switch ((virDomainHostdevSubsysType)dev->source.subsys.type) {
|
||||
switch (dev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
|
||||
g_autoptr(virUSBDevice) usb = NULL;
|
||||
|
||||
@ -2420,7 +2420,7 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecurityManager *mgr,
|
||||
scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
|
||||
return 0;
|
||||
|
||||
switch ((virDomainHostdevSubsysType)dev->source.subsys.type) {
|
||||
switch (dev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
|
||||
g_autoptr(virUSBDevice) usb = NULL;
|
||||
|
||||
|
@ -1106,6 +1106,9 @@ get_files(vahControl * ctl)
|
||||
break;
|
||||
}
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
default:
|
||||
rc = 0;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user