[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 18/22] xen: implement virNodeDeviceReAttachFlags



Since the xen driver doesn't support the vfio driver (which is the
only one that would benefit from the VIR_NODE_DEVICE_REATTACH_GROUP
flag), the Xen version of this function
(xenUnifiedNodeDeviceReAttachFlags()) just validates that flags == 0,
but is otherwise identical to the old xenUnifiedNodeDeviceReAttach()
---
 src/xen/xen_driver.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index c9e4db8..e745318 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -2318,14 +2318,18 @@ out:
     return ret;
 }
 
+
 static int
-xenUnifiedNodeDeviceReAttach(virNodeDevicePtr dev)
+xenUnifiedNodeDeviceReAttachFlags(virNodeDevicePtr dev,
+                                  unsigned int flags)
 {
     virPCIDevicePtr pci;
     unsigned domain, bus, slot, function;
     int ret = -1;
     int domid;
 
+    virCheckFlags(0, -1);
+
     if (xenUnifiedNodeDeviceGetPciInfo(dev, &domain, &bus, &slot, &function) < 0)
         return -1;
 
@@ -2350,6 +2354,14 @@ out:
     return ret;
 }
 
+
+static int
+xenUnifiedNodeDeviceReAttach(virNodeDevicePtr dev)
+{
+    return xenUnifiedNodeDeviceReAttachFlags(dev, 0);
+}
+
+
 static int
 xenUnifiedNodeDeviceReset(virNodeDevicePtr dev)
 {
@@ -2544,6 +2556,7 @@ static virDriver xenUnifiedDriver = {
     .nodeDeviceDettach = xenUnifiedNodeDeviceDettach, /* 0.6.1 */
     .nodeDeviceDetachFlags = xenUnifiedNodeDeviceDetachFlags, /* 1.0.5 */
     .nodeDeviceReAttach = xenUnifiedNodeDeviceReAttach, /* 0.6.1 */
+    .nodeDeviceReAttachFlags = xenUnifiedNodeDeviceReAttachFlags, /* 1.0.7 */
     .nodeDeviceReset = xenUnifiedNodeDeviceReset, /* 0.6.1 */
     .connectIsEncrypted = xenUnifiedConnectIsEncrypted, /* 0.7.3 */
     .connectIsSecure = xenUnifiedConnectIsSecure, /* 0.7.3 */
-- 
1.7.11.7


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]