mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
conf: Enable cold-plug of a mediated device
This merely introduces virDomainHostdevMatchSubsysMediatedDev method that is supposed to check whether device being cold-plugged does not already exist in the domain configuration. Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
606afafba4
commit
80c4defba3
@ -14375,6 +14375,19 @@ virDomainHostdevMatchSubsysSCSIiSCSI(virDomainHostdevDefPtr first,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
virDomainHostdevMatchSubsysMediatedDev(virDomainHostdevDefPtr a,
|
||||
virDomainHostdevDefPtr b)
|
||||
{
|
||||
virDomainHostdevSubsysMediatedDevPtr src_a = &a->source.subsys.u.mdev;
|
||||
virDomainHostdevSubsysMediatedDevPtr src_b = &b->source.subsys.u.mdev;
|
||||
|
||||
if (STREQ(src_a->uuidstr, src_b->uuidstr))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
virDomainHostdevMatchSubsys(virDomainHostdevDefPtr a,
|
||||
virDomainHostdevDefPtr b)
|
||||
@ -14406,6 +14419,7 @@ virDomainHostdevMatchSubsys(virDomainHostdevDefPtr a,
|
||||
else
|
||||
return 0;
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
||||
return virDomainHostdevMatchSubsysMediatedDev(a, b);
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user