提交 80c4defb 编写于 作者: E Erik Skultety

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: NErik Skultety <eskultet@redhat.com>
上级 606afafb
...@@ -14375,6 +14375,19 @@ virDomainHostdevMatchSubsysSCSIiSCSI(virDomainHostdevDefPtr first, ...@@ -14375,6 +14375,19 @@ virDomainHostdevMatchSubsysSCSIiSCSI(virDomainHostdevDefPtr first,
return 0; 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 static int
virDomainHostdevMatchSubsys(virDomainHostdevDefPtr a, virDomainHostdevMatchSubsys(virDomainHostdevDefPtr a,
virDomainHostdevDefPtr b) virDomainHostdevDefPtr b)
...@@ -14406,6 +14419,7 @@ virDomainHostdevMatchSubsys(virDomainHostdevDefPtr a, ...@@ -14406,6 +14419,7 @@ virDomainHostdevMatchSubsys(virDomainHostdevDefPtr a,
else else
return 0; return 0;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
return virDomainHostdevMatchSubsysMediatedDev(a, b);
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册