mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 12:35:20 +00:00
lxc: Fix access to hostdev capabilities
In a few places, where a capabilities <hostdev/> is processed, a wrong union member is access: def->source.subsys.type instead of def->source.caps.type. Fortunately, both union members have .type as the very first member so no real harm is done. Nevertheless, we should access the correct union member. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
537d90437c
commit
46410c2be8
@ -1788,7 +1788,7 @@ virLXCControllerSetupHostdevCaps(virDomainDef *vmDef,
|
|||||||
virDomainHostdevDef *def,
|
virDomainHostdevDef *def,
|
||||||
virSecurityManager *securityDriver)
|
virSecurityManager *securityDriver)
|
||||||
{
|
{
|
||||||
switch (def->source.subsys.type) {
|
switch (def->source.caps.type) {
|
||||||
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE:
|
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE:
|
||||||
return virLXCControllerSetupHostdevCapsStorage(vmDef,
|
return virLXCControllerSetupHostdevCapsStorage(vmDef,
|
||||||
def,
|
def,
|
||||||
|
@ -85,7 +85,7 @@ int virLXCPrepareHostDevices(virLXCDriver *driver,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES:
|
case VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES:
|
||||||
switch (dev->source.subsys.type) {
|
switch (dev->source.caps.type) {
|
||||||
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE:
|
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE:
|
||||||
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_MISC:
|
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_MISC:
|
||||||
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET:
|
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET:
|
||||||
@ -93,7 +93,7 @@ int virLXCPrepareHostDevices(virLXCDriver *driver,
|
|||||||
default:
|
default:
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("Unsupported hostdev type %1$s"),
|
_("Unsupported hostdev type %1$s"),
|
||||||
virDomainHostdevSubsysTypeToString(dev->source.subsys.type));
|
virDomainHostdevSubsysTypeToString(dev->source.caps.type));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user