2010-12-16 16:10:54 +00:00
|
|
|
/*
|
|
|
|
* qemu_hostdev.c: QEMU hostdev management
|
|
|
|
*
|
2014-04-26 04:11:05 +00:00
|
|
|
* Copyright (C) 2006-2007, 2009-2014 Red Hat, Inc.
|
2010-12-16 16:10:54 +00:00
|
|
|
* Copyright (C) 2006 Daniel P. Berrange
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2010-12-16 16:10:54 +00:00
|
|
|
*
|
|
|
|
* Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2013-09-19 15:01:17 +00:00
|
|
|
#include <dirent.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
2010-12-16 16:10:54 +00:00
|
|
|
#include "qemu_hostdev.h"
|
2012-12-12 17:59:27 +00:00
|
|
|
#include "virlog.h"
|
2012-12-13 18:21:53 +00:00
|
|
|
#include "virerror.h"
|
2012-12-12 18:06:53 +00:00
|
|
|
#include "viralloc.h"
|
2012-12-13 14:52:25 +00:00
|
|
|
#include "virpci.h"
|
2012-12-12 17:04:51 +00:00
|
|
|
#include "virusb.h"
|
2013-05-03 18:07:29 +00:00
|
|
|
#include "virscsi.h"
|
2012-03-06 01:12:44 +00:00
|
|
|
#include "virnetdev.h"
|
2013-09-19 15:01:17 +00:00
|
|
|
#include "virfile.h"
|
2014-03-05 09:58:54 +00:00
|
|
|
#include "virhostdev.h"
|
2010-12-16 16:10:54 +00:00
|
|
|
|
2012-07-18 15:22:03 +00:00
|
|
|
#define VIR_FROM_THIS VIR_FROM_QEMU
|
|
|
|
|
2014-02-28 12:16:17 +00:00
|
|
|
VIR_LOG_INIT("qemu.qemu_hostdev");
|
|
|
|
|
|
|
|
|
2014-03-06 04:32:42 +00:00
|
|
|
int
|
2014-03-06 07:35:03 +00:00
|
|
|
qemuUpdateActivePCIHostdevs(virQEMUDriverPtr driver,
|
2014-03-06 04:32:42 +00:00
|
|
|
virDomainDefPtr def)
|
|
|
|
{
|
|
|
|
virHostdevManagerPtr mgr = driver->hostdevMgr;
|
|
|
|
|
|
|
|
if (!def->nhostdevs)
|
|
|
|
return 0;
|
|
|
|
|
2014-03-06 07:48:49 +00:00
|
|
|
return virHostdevUpdateActivePCIDevices(mgr, def->hostdevs, def->nhostdevs,
|
|
|
|
QEMU_DRIVER_NAME, def->name);
|
2014-03-06 04:32:42 +00:00
|
|
|
}
|
|
|
|
|
2014-03-06 04:45:16 +00:00
|
|
|
int
|
2014-03-06 07:35:03 +00:00
|
|
|
qemuUpdateActiveUSBHostdevs(virQEMUDriverPtr driver,
|
2014-03-06 04:45:16 +00:00
|
|
|
virDomainDefPtr def)
|
|
|
|
{
|
|
|
|
virHostdevManagerPtr mgr = driver->hostdevMgr;
|
|
|
|
|
|
|
|
if (!def->nhostdevs)
|
|
|
|
return 0;
|
|
|
|
|
2014-03-06 07:48:49 +00:00
|
|
|
return virHostdevUpdateActiveUSBDevices(mgr, def->hostdevs, def->nhostdevs,
|
|
|
|
QEMU_DRIVER_NAME, def->name);
|
2014-03-06 04:45:16 +00:00
|
|
|
}
|
|
|
|
|
2014-03-06 04:47:50 +00:00
|
|
|
int
|
2014-03-06 07:35:03 +00:00
|
|
|
qemuUpdateActiveSCSIHostdevs(virQEMUDriverPtr driver,
|
2014-03-06 04:47:50 +00:00
|
|
|
virDomainDefPtr def)
|
|
|
|
{
|
|
|
|
virHostdevManagerPtr mgr = driver->hostdevMgr;
|
|
|
|
|
|
|
|
if (!def->nhostdevs)
|
|
|
|
return 0;
|
|
|
|
|
2014-03-06 07:48:49 +00:00
|
|
|
return virHostdevUpdateActiveSCSIDevices(mgr, def->hostdevs, def->nhostdevs,
|
|
|
|
QEMU_DRIVER_NAME, def->name);
|
2014-03-06 04:47:50 +00:00
|
|
|
}
|
|
|
|
|
2013-10-08 13:47:36 +00:00
|
|
|
|
qemu: default to vfio for nodedev-detach
This patch resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1035188
Commit f094aaac48a6 changed the PCI device assignment in qemu domains
to default to using VFIO rather than legacy KVM device assignment
(when VFIO is available). It didn't change which driver was used by
default for virNodeDeviceDetachFlags(), though, so that API (and the
virsh nodedev-detach command) was still binding to the pci-stub
driver, used by legacy KVM assignment, by default.
This patch publicizes (only within the qemu module, though, so no
additions to the symbol exports are needed) the functions that check
for presence of KVM and VFIO device assignment, then uses those
functions to decide what to do when no driver is specified for
virNodeDeviceDetachFlags(); if the vfio driver is loaded, the device
will be bound to vfio-pci, or if legacy KVM assignment is supported on
this system, the device will be bound to pci-stub; if neither method
is available, the detach will fail.
2013-11-29 11:19:26 +00:00
|
|
|
bool
|
2013-09-19 15:01:17 +00:00
|
|
|
qemuHostdevHostSupportsPassthroughVFIO(void)
|
|
|
|
{
|
|
|
|
DIR *iommuDir = NULL;
|
|
|
|
struct dirent *iommuGroup = NULL;
|
|
|
|
bool ret = false;
|
2014-04-26 04:11:05 +00:00
|
|
|
int direrr;
|
2013-09-19 15:01:17 +00:00
|
|
|
|
|
|
|
/* condition 1 - /sys/kernel/iommu_groups/ contains entries */
|
|
|
|
if (!(iommuDir = opendir("/sys/kernel/iommu_groups/")))
|
|
|
|
goto cleanup;
|
|
|
|
|
2014-04-26 04:11:05 +00:00
|
|
|
while ((direrr = virDirRead(iommuDir, &iommuGroup, NULL)) > 0) {
|
2013-09-19 15:01:17 +00:00
|
|
|
/* skip ./ ../ */
|
|
|
|
if (STRPREFIX(iommuGroup->d_name, "."))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* assume we found a group */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-04-26 04:11:05 +00:00
|
|
|
if (direrr < 0 || !iommuGroup)
|
2013-09-19 15:01:17 +00:00
|
|
|
goto cleanup;
|
|
|
|
/* okay, iommu is on and recognizes groups */
|
|
|
|
|
|
|
|
/* condition 2 - /dev/vfio/vfio exists */
|
|
|
|
if (!virFileExists("/dev/vfio/vfio"))
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
ret = true;
|
|
|
|
|
2014-03-25 06:49:44 +00:00
|
|
|
cleanup:
|
2013-09-19 15:01:17 +00:00
|
|
|
if (iommuDir)
|
|
|
|
closedir(iommuDir);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if HAVE_LINUX_KVM_H
|
|
|
|
# include <linux/kvm.h>
|
qemu: default to vfio for nodedev-detach
This patch resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1035188
Commit f094aaac48a6 changed the PCI device assignment in qemu domains
to default to using VFIO rather than legacy KVM device assignment
(when VFIO is available). It didn't change which driver was used by
default for virNodeDeviceDetachFlags(), though, so that API (and the
virsh nodedev-detach command) was still binding to the pci-stub
driver, used by legacy KVM assignment, by default.
This patch publicizes (only within the qemu module, though, so no
additions to the symbol exports are needed) the functions that check
for presence of KVM and VFIO device assignment, then uses those
functions to decide what to do when no driver is specified for
virNodeDeviceDetachFlags(); if the vfio driver is loaded, the device
will be bound to vfio-pci, or if legacy KVM assignment is supported on
this system, the device will be bound to pci-stub; if neither method
is available, the detach will fail.
2013-11-29 11:19:26 +00:00
|
|
|
bool
|
2013-09-19 15:01:17 +00:00
|
|
|
qemuHostdevHostSupportsPassthroughLegacy(void)
|
|
|
|
{
|
|
|
|
int kvmfd = -1;
|
|
|
|
bool ret = false;
|
|
|
|
|
|
|
|
if ((kvmfd = open("/dev/kvm", O_RDONLY)) < 0)
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
# ifdef KVM_CAP_IOMMU
|
|
|
|
if ((ioctl(kvmfd, KVM_CHECK_EXTENSION, KVM_CAP_IOMMU)) <= 0)
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
ret = true;
|
|
|
|
# endif
|
|
|
|
|
2014-03-25 06:49:44 +00:00
|
|
|
cleanup:
|
2013-09-19 15:01:17 +00:00
|
|
|
VIR_FORCE_CLOSE(kvmfd);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
#else
|
qemu: default to vfio for nodedev-detach
This patch resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1035188
Commit f094aaac48a6 changed the PCI device assignment in qemu domains
to default to using VFIO rather than legacy KVM device assignment
(when VFIO is available). It didn't change which driver was used by
default for virNodeDeviceDetachFlags(), though, so that API (and the
virsh nodedev-detach command) was still binding to the pci-stub
driver, used by legacy KVM assignment, by default.
This patch publicizes (only within the qemu module, though, so no
additions to the symbol exports are needed) the functions that check
for presence of KVM and VFIO device assignment, then uses those
functions to decide what to do when no driver is specified for
virNodeDeviceDetachFlags(); if the vfio driver is loaded, the device
will be bound to vfio-pci, or if legacy KVM assignment is supported on
this system, the device will be bound to pci-stub; if neither method
is available, the detach will fail.
2013-11-29 11:19:26 +00:00
|
|
|
bool
|
2013-09-19 15:01:17 +00:00
|
|
|
qemuHostdevHostSupportsPassthroughLegacy(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
static bool
|
|
|
|
qemuPrepareHostdevPCICheckSupport(virDomainHostdevDefPtr *hostdevs,
|
2013-09-20 08:39:51 +00:00
|
|
|
size_t nhostdevs,
|
|
|
|
virQEMUCapsPtr qemuCaps)
|
2013-09-19 15:01:17 +00:00
|
|
|
{
|
|
|
|
bool supportsPassthroughKVM = qemuHostdevHostSupportsPassthroughLegacy();
|
|
|
|
bool supportsPassthroughVFIO = qemuHostdevHostSupportsPassthroughVFIO();
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
/* assign defaults for hostdev passthrough */
|
|
|
|
for (i = 0; i < nhostdevs; i++) {
|
|
|
|
virDomainHostdevDefPtr hostdev = hostdevs[i];
|
|
|
|
int *backend = &hostdev->source.subsys.u.pci.backend;
|
|
|
|
|
|
|
|
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
|
|
|
|
continue;
|
|
|
|
if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
|
|
|
|
continue;
|
|
|
|
|
2014-03-13 11:59:32 +00:00
|
|
|
switch ((virDomainHostdevSubsysPCIBackendType) *backend) {
|
2013-09-20 08:39:51 +00:00
|
|
|
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT:
|
|
|
|
if (supportsPassthroughVFIO &&
|
|
|
|
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
|
|
|
|
*backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO;
|
|
|
|
} else if (supportsPassthroughKVM &&
|
|
|
|
(virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCIDEVICE) ||
|
|
|
|
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))) {
|
|
|
|
*backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM;
|
|
|
|
} else {
|
|
|
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
|
|
_("host doesn't support passthrough of "
|
|
|
|
"host PCI devices"));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2013-09-19 15:01:17 +00:00
|
|
|
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO:
|
|
|
|
if (!supportsPassthroughVFIO) {
|
|
|
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
|
|
_("host doesn't support VFIO PCI passthrough"));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM:
|
|
|
|
if (!supportsPassthroughKVM) {
|
|
|
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
|
|
_("host doesn't support legacy PCI passthrough"));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2014-03-06 08:44:22 +00:00
|
|
|
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN:
|
2013-09-19 15:01:17 +00:00
|
|
|
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-03-05 11:37:51 +00:00
|
|
|
int
|
|
|
|
qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
|
|
|
|
const char *name,
|
|
|
|
const unsigned char *uuid,
|
|
|
|
virDomainHostdevDefPtr *hostdevs,
|
|
|
|
int nhostdevs,
|
|
|
|
virQEMUCapsPtr qemuCaps,
|
|
|
|
unsigned int flags)
|
|
|
|
{
|
|
|
|
int ret = -1;
|
|
|
|
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
|
|
|
|
|
|
|
|
if (!qemuPrepareHostdevPCICheckSupport(hostdevs, nhostdevs, qemuCaps))
|
|
|
|
goto out;
|
|
|
|
|
2014-03-05 11:47:40 +00:00
|
|
|
ret = virHostdevPreparePCIDevices(hostdev_mgr, QEMU_DRIVER_NAME,
|
|
|
|
name, uuid, hostdevs,
|
2014-03-05 11:37:51 +00:00
|
|
|
nhostdevs, flags);
|
2014-03-25 06:49:44 +00:00
|
|
|
out:
|
2010-12-16 16:10:54 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-03-06 05:31:47 +00:00
|
|
|
int
|
|
|
|
qemuPrepareHostUSBDevices(virQEMUDriverPtr driver,
|
|
|
|
const char *name,
|
|
|
|
virDomainHostdevDefPtr *hostdevs,
|
|
|
|
int nhostdevs,
|
|
|
|
unsigned int flags)
|
|
|
|
{
|
|
|
|
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
|
|
|
|
|
2014-03-06 05:42:19 +00:00
|
|
|
return virHostdevPrepareUSBDevices(hostdev_mgr, QEMU_DRIVER_NAME, name,
|
2014-03-06 05:31:47 +00:00
|
|
|
hostdevs, nhostdevs, flags);
|
|
|
|
}
|
|
|
|
|
2014-03-06 06:05:22 +00:00
|
|
|
int
|
|
|
|
qemuPrepareHostdevSCSIDevices(virQEMUDriverPtr driver,
|
|
|
|
const char *name,
|
|
|
|
virDomainHostdevDefPtr *hostdevs,
|
|
|
|
int nhostdevs)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
|
|
|
|
|
|
|
|
/* Loop 1: Add the shared scsi host device to shared device
|
|
|
|
* table.
|
|
|
|
*/
|
|
|
|
for (i = 0; i < nhostdevs; i++) {
|
|
|
|
virDomainDeviceDef dev;
|
|
|
|
|
|
|
|
dev.type = VIR_DOMAIN_DEVICE_HOSTDEV;
|
|
|
|
dev.data.hostdev = hostdevs[i];
|
|
|
|
|
|
|
|
if (qemuAddSharedDevice(driver, &dev, name) < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (qemuSetUnprivSGIO(&dev) < 0)
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2014-03-06 06:12:52 +00:00
|
|
|
return virHostdevPrepareSCSIDevices(hostdev_mgr, QEMU_DRIVER_NAME,
|
|
|
|
name, hostdevs, nhostdevs);
|
2014-03-06 06:05:22 +00:00
|
|
|
}
|
|
|
|
|
2013-10-08 13:47:36 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
qemuPrepareHostDevices(virQEMUDriverPtr driver,
|
|
|
|
virDomainDefPtr def,
|
2013-09-20 08:39:51 +00:00
|
|
|
virQEMUCapsPtr qemuCaps,
|
2014-03-05 10:56:26 +00:00
|
|
|
unsigned int flags)
|
2010-12-16 16:10:54 +00:00
|
|
|
{
|
|
|
|
if (!def->nhostdevs)
|
|
|
|
return 0;
|
|
|
|
|
2013-01-16 12:09:58 +00:00
|
|
|
if (qemuPrepareHostdevPCIDevices(driver, def->name, def->uuid,
|
2013-09-20 08:39:51 +00:00
|
|
|
def->hostdevs, def->nhostdevs,
|
2014-03-05 10:56:26 +00:00
|
|
|
qemuCaps, flags) < 0)
|
2010-12-16 16:10:54 +00:00
|
|
|
return -1;
|
|
|
|
|
2014-03-05 06:20:50 +00:00
|
|
|
if (qemuPrepareHostUSBDevices(driver, def->name,
|
2014-03-05 11:12:04 +00:00
|
|
|
def->hostdevs, def->nhostdevs, flags) < 0)
|
2010-12-16 16:10:54 +00:00
|
|
|
return -1;
|
|
|
|
|
2013-05-03 18:07:29 +00:00
|
|
|
if (qemuPrepareHostdevSCSIDevices(driver, def->name,
|
|
|
|
def->hostdevs, def->nhostdevs) < 0)
|
|
|
|
return -1;
|
|
|
|
|
2010-12-16 16:10:54 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-03-05 11:53:51 +00:00
|
|
|
void
|
|
|
|
qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
|
|
|
|
const char *name,
|
|
|
|
virDomainHostdevDefPtr *hostdevs,
|
|
|
|
int nhostdevs)
|
|
|
|
{
|
|
|
|
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
2014-03-12 16:01:39 +00:00
|
|
|
const char *oldStateDir = cfg->stateDir;
|
2014-03-05 11:53:51 +00:00
|
|
|
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
|
|
|
|
|
2014-03-05 11:55:45 +00:00
|
|
|
virHostdevReAttachPCIDevices(hostdev_mgr, QEMU_DRIVER_NAME, name,
|
2014-03-05 11:53:51 +00:00
|
|
|
hostdevs, nhostdevs, oldStateDir);
|
|
|
|
|
2013-01-10 21:03:14 +00:00
|
|
|
virObjectUnref(cfg);
|
2010-12-16 16:10:54 +00:00
|
|
|
}
|
|
|
|
|
2014-03-06 06:28:07 +00:00
|
|
|
void
|
2014-03-06 07:35:03 +00:00
|
|
|
qemuDomainReAttachHostUSBDevices(virQEMUDriverPtr driver,
|
2014-03-06 06:28:07 +00:00
|
|
|
const char *name,
|
|
|
|
virDomainHostdevDefPtr *hostdevs,
|
|
|
|
int nhostdevs)
|
|
|
|
{
|
|
|
|
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
|
|
|
|
|
2014-03-12 16:35:30 +00:00
|
|
|
virHostdevReAttachUSBDevices(hostdev_mgr, QEMU_DRIVER_NAME,
|
2014-03-06 06:33:29 +00:00
|
|
|
name, hostdevs, nhostdevs);
|
2014-03-06 06:28:07 +00:00
|
|
|
}
|
|
|
|
|
2014-03-06 06:45:23 +00:00
|
|
|
void
|
2014-03-06 07:35:03 +00:00
|
|
|
qemuDomainReAttachHostSCSIDevices(virQEMUDriverPtr driver,
|
2014-03-06 06:45:23 +00:00
|
|
|
const char *name,
|
|
|
|
virDomainHostdevDefPtr *hostdevs,
|
|
|
|
int nhostdevs)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
|
|
|
|
|
|
|
|
for (i = 0; i < nhostdevs; i++) {
|
|
|
|
virDomainHostdevDefPtr hostdev = hostdevs[i];
|
|
|
|
virDomainDeviceDef dev;
|
|
|
|
|
|
|
|
dev.type = VIR_DOMAIN_DEVICE_HOSTDEV;
|
|
|
|
dev.data.hostdev = hostdev;
|
|
|
|
|
|
|
|
ignore_value(qemuRemoveSharedDevice(driver, &dev, name));
|
|
|
|
}
|
|
|
|
|
2014-03-12 16:35:30 +00:00
|
|
|
virHostdevReAttachSCSIDevices(hostdev_mgr, QEMU_DRIVER_NAME,
|
|
|
|
name, hostdevs, nhostdevs);
|
2014-03-06 06:45:23 +00:00
|
|
|
}
|
|
|
|
|
2013-10-08 13:47:36 +00:00
|
|
|
void
|
|
|
|
qemuDomainReAttachHostDevices(virQEMUDriverPtr driver,
|
|
|
|
virDomainDefPtr def)
|
2010-12-16 16:10:54 +00:00
|
|
|
{
|
|
|
|
if (!def->nhostdevs)
|
|
|
|
return;
|
|
|
|
|
2012-03-06 01:12:44 +00:00
|
|
|
qemuDomainReAttachHostdevDevices(driver, def->name, def->hostdevs,
|
|
|
|
def->nhostdevs);
|
2012-03-26 14:40:01 +00:00
|
|
|
|
2014-03-06 07:35:03 +00:00
|
|
|
qemuDomainReAttachHostUSBDevices(driver, def->name, def->hostdevs,
|
2012-03-26 14:40:01 +00:00
|
|
|
def->nhostdevs);
|
2013-05-03 18:07:29 +00:00
|
|
|
|
2014-03-06 07:35:03 +00:00
|
|
|
qemuDomainReAttachHostSCSIDevices(driver, def->name, def->hostdevs,
|
2013-05-03 18:07:29 +00:00
|
|
|
def->nhostdevs);
|
2010-12-16 16:10:54 +00:00
|
|
|
}
|