hypervisor api: new virNodeDeviceDetachFlags

The existing virNodeDeviceDettach() assumes that there is only a
single PCI device assignment backend driver appropriate for any
hypervisor. This is no longer true, as the qemu driver is getting
support for PCI device assignment via VFIO. The new API
virNodeDeviceDetachFlags adds a driverName arg that should be set to
the exact same string set in a domain <hostdev>'s <driver name='x'/>
element (i.e. "vfio", "kvm", or NULL for default). It also adds a
flags arg for good measure (and because it's possible we may need it
when we start dealing with VFIO's "device groups").
This commit is contained in:
Laine Stump
2013-04-24 12:56:10 -04:00
parent cc0a918872
commit 353941961a
4 changed files with 84 additions and 1 deletions

View File

@@ -4,7 +4,7 @@
* Description: Provides the interfaces of the libvirt library to handle
* virtualized domains
*
* Copyright (C) 2005-2006, 2010-2012 Red Hat, Inc.
* Copyright (C) 2005-2006, 2010-2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -3289,6 +3289,9 @@ int virNodeDeviceRef (virNodeDevicePtr dev);
int virNodeDeviceFree (virNodeDevicePtr dev);
int virNodeDeviceDettach (virNodeDevicePtr dev);
int virNodeDeviceDetachFlags(virNodeDevicePtr dev,
const char *driverName,
unsigned int flags);
int virNodeDeviceReAttach (virNodeDevicePtr dev);
int virNodeDeviceReset (virNodeDevicePtr dev);