提交 b99fdb60 编写于 作者: C Cole Robinson

libxl: Break out libxlCapsHasPVUSB

No functional change, but this will allow us to mock out the function
in the test suite
Reviewed-by: NJán Tomko <jtomko@redhat.com>
Signed-off-by: NCole Robinson <crobinso@redhat.com>
上级 deb3b59b
...@@ -671,6 +671,15 @@ libxlMakeDomainDeviceVideoCaps(virDomainCapsDeviceVideoPtr dev) ...@@ -671,6 +671,15 @@ libxlMakeDomainDeviceVideoCaps(virDomainCapsDeviceVideoPtr dev)
return 0; return 0;
} }
bool libxlCapsHasPVUSB(void)
{
#ifdef LIBXL_HAVE_PVUSB
return true;
#else
return false;
#endif
}
static int static int
libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdevPtr dev) libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdevPtr dev)
{ {
...@@ -688,10 +697,9 @@ libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdevPtr dev) ...@@ -688,10 +697,9 @@ libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdevPtr dev)
VIR_DOMAIN_CAPS_ENUM_SET(dev->subsysType, VIR_DOMAIN_CAPS_ENUM_SET(dev->subsysType,
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI); VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI);
#ifdef LIBXL_HAVE_PVUSB if (libxlCapsHasPVUSB())
VIR_DOMAIN_CAPS_ENUM_SET(dev->subsysType, VIR_DOMAIN_CAPS_ENUM_SET(dev->subsysType,
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB); VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB);
#endif
/* No virDomainHostdevCapsType for libxl */ /* No virDomainHostdevCapsType for libxl */
virDomainCapsEnumClear(&dev->capsType); virDomainCapsEnumClear(&dev->capsType);
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
* by libvirt for Xen, and cannot be used for a persistent network name. */ * by libvirt for Xen, and cannot be used for a persistent network name. */
# define LIBXL_GENERATED_PREFIX_XEN "vif" # define LIBXL_GENERATED_PREFIX_XEN "vif"
bool libxlCapsHasPVUSB(void);
virCapsPtr virCapsPtr
libxlMakeCapabilities(libxl_ctx *ctx); libxlMakeCapabilities(libxl_ctx *ctx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册