|
|
43fe83 |
From b6784357c6f65806e2fd70d9b2e6982b89587685 Mon Sep 17 00:00:00 2001
|
|
|
43fe83 |
Message-Id: <b6784357c6f65806e2fd70d9b2e6982b89587685.1382534060.git.jdenemar@redhat.com>
|
|
|
43fe83 |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
43fe83 |
Date: Thu, 10 Oct 2013 13:56:35 +0200
|
|
|
43fe83 |
Subject: [PATCH] qemu: hostdev: Fix function spacing and header formatting
|
|
|
43fe83 |
|
|
|
43fe83 |
https://bugzilla.redhat.com/show_bug.cgi?id=1001738
|
|
|
43fe83 |
|
|
|
43fe83 |
(cherry picked from commit f24150b1f53530e0ec057405665b771c776af9ac)
|
|
|
43fe83 |
|
|
|
43fe83 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
43fe83 |
---
|
|
|
43fe83 |
src/qemu/qemu_hostdev.c | 60 ++++++++++++++++++++++++++++++++++---------------
|
|
|
43fe83 |
1 file changed, 42 insertions(+), 18 deletions(-)
|
|
|
43fe83 |
|
|
|
43fe83 |
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
|
|
|
43fe83 |
index 21fe47f..4127abd 100644
|
|
|
43fe83 |
--- a/src/qemu/qemu_hostdev.c
|
|
|
43fe83 |
+++ b/src/qemu/qemu_hostdev.c
|
|
|
43fe83 |
@@ -85,6 +85,7 @@ qemuGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
|
|
|
43fe83 |
return list;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
/*
|
|
|
43fe83 |
* qemuGetActivePciHostDeviceList - make a new list with a *copy* of
|
|
|
43fe83 |
* every virPCIDevice object that is found on the activePciHostdevs
|
|
|
43fe83 |
@@ -128,8 +129,10 @@ qemuGetActivePciHostDeviceList(virQEMUDriverPtr driver,
|
|
|
43fe83 |
return list;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
-int qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
|
|
|
43fe83 |
- virDomainDefPtr def)
|
|
|
43fe83 |
+
|
|
|
43fe83 |
+int
|
|
|
43fe83 |
+qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
|
|
|
43fe83 |
+ virDomainDefPtr def)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
virDomainHostdevDefPtr hostdev = NULL;
|
|
|
43fe83 |
virPCIDevicePtr dev = NULL;
|
|
|
43fe83 |
@@ -188,6 +191,7 @@ cleanup:
|
|
|
43fe83 |
return ret;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
int
|
|
|
43fe83 |
qemuUpdateActiveUsbHostdevs(virQEMUDriverPtr driver,
|
|
|
43fe83 |
virDomainDefPtr def)
|
|
|
43fe83 |
@@ -274,8 +278,10 @@ cleanup:
|
|
|
43fe83 |
return ret;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
static int
|
|
|
43fe83 |
-qemuDomainHostdevPciSysfsPath(virDomainHostdevDefPtr hostdev, char **sysfs_path)
|
|
|
43fe83 |
+qemuDomainHostdevPciSysfsPath(virDomainHostdevDefPtr hostdev,
|
|
|
43fe83 |
+ char **sysfs_path)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
virPCIDeviceAddress config_address;
|
|
|
43fe83 |
|
|
|
43fe83 |
@@ -287,6 +293,7 @@ qemuDomainHostdevPciSysfsPath(virDomainHostdevDefPtr hostdev, char **sysfs_path)
|
|
|
43fe83 |
return virPCIDeviceAddressGetSysfsFile(&config_address, sysfs_path);
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
int
|
|
|
43fe83 |
qemuDomainHostdevIsVirtualFunction(virDomainHostdevDefPtr hostdev)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
@@ -303,6 +310,7 @@ qemuDomainHostdevIsVirtualFunction(virDomainHostdevDefPtr hostdev)
|
|
|
43fe83 |
return ret;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
static int
|
|
|
43fe83 |
qemuDomainHostdevNetDevice(virDomainHostdevDefPtr hostdev, char **linkdev,
|
|
|
43fe83 |
int *vf)
|
|
|
43fe83 |
@@ -331,6 +339,7 @@ cleanup:
|
|
|
43fe83 |
return ret;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
static int
|
|
|
43fe83 |
qemuDomainHostdevNetConfigVirtPortProfile(const char *linkdev, int vf,
|
|
|
43fe83 |
virNetDevVPortProfilePtr virtPort,
|
|
|
43fe83 |
@@ -370,6 +379,7 @@ qemuDomainHostdevNetConfigVirtPortProfile(const char *linkdev, int vf,
|
|
|
43fe83 |
return ret;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
int
|
|
|
43fe83 |
qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
|
|
|
43fe83 |
const unsigned char *uuid,
|
|
|
43fe83 |
@@ -438,6 +448,7 @@ cleanup:
|
|
|
43fe83 |
return ret;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
int
|
|
|
43fe83 |
qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
|
|
|
43fe83 |
char *stateDir)
|
|
|
43fe83 |
@@ -474,11 +485,13 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
|
|
|
43fe83 |
return ret;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
-int qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
- const char *name,
|
|
|
43fe83 |
- const unsigned char *uuid,
|
|
|
43fe83 |
- virDomainHostdevDefPtr *hostdevs,
|
|
|
43fe83 |
- int nhostdevs)
|
|
|
43fe83 |
+
|
|
|
43fe83 |
+int
|
|
|
43fe83 |
+qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
+ const char *name,
|
|
|
43fe83 |
+ const unsigned char *uuid,
|
|
|
43fe83 |
+ virDomainHostdevDefPtr *hostdevs,
|
|
|
43fe83 |
+ int nhostdevs)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
virPCIDeviceListPtr pcidevs;
|
|
|
43fe83 |
int last_processed_hostdev_vf = -1;
|
|
|
43fe83 |
@@ -670,6 +683,7 @@ cleanup:
|
|
|
43fe83 |
return ret;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
int
|
|
|
43fe83 |
qemuPrepareHostdevUSBDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
const char *name,
|
|
|
43fe83 |
@@ -722,6 +736,7 @@ error:
|
|
|
43fe83 |
return -1;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
int
|
|
|
43fe83 |
qemuFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
|
|
|
43fe83 |
bool mandatory,
|
|
|
43fe83 |
@@ -809,6 +824,7 @@ out:
|
|
|
43fe83 |
return 0;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
static int
|
|
|
43fe83 |
qemuPrepareHostUSBDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
virDomainDefPtr def,
|
|
|
43fe83 |
@@ -878,6 +894,7 @@ cleanup:
|
|
|
43fe83 |
return ret;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
int
|
|
|
43fe83 |
qemuPrepareHostdevSCSIDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
const char *name,
|
|
|
43fe83 |
@@ -996,9 +1013,11 @@ cleanup:
|
|
|
43fe83 |
return -1;
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
-int qemuPrepareHostDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
- virDomainDefPtr def,
|
|
|
43fe83 |
- bool coldBoot)
|
|
|
43fe83 |
+
|
|
|
43fe83 |
+int
|
|
|
43fe83 |
+qemuPrepareHostDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
+ virDomainDefPtr def,
|
|
|
43fe83 |
+ bool coldBoot)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
if (!def->nhostdevs)
|
|
|
43fe83 |
return 0;
|
|
|
43fe83 |
@@ -1022,7 +1041,8 @@ int qemuPrepareHostDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
* Pre-condition: driver->inactivePciHostdevs & driver->activePciHostdevs
|
|
|
43fe83 |
* are locked
|
|
|
43fe83 |
*/
|
|
|
43fe83 |
-void qemuReattachPciDevice(virPCIDevicePtr dev, virQEMUDriverPtr driver)
|
|
|
43fe83 |
+void
|
|
|
43fe83 |
+qemuReattachPciDevice(virPCIDevicePtr dev, virQEMUDriverPtr driver)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
int retries = 100;
|
|
|
43fe83 |
|
|
|
43fe83 |
@@ -1052,10 +1072,11 @@ void qemuReattachPciDevice(virPCIDevicePtr dev, virQEMUDriverPtr driver)
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
|
|
|
43fe83 |
-void qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
- const char *name,
|
|
|
43fe83 |
- virDomainHostdevDefPtr *hostdevs,
|
|
|
43fe83 |
- int nhostdevs)
|
|
|
43fe83 |
+void
|
|
|
43fe83 |
+qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
+ const char *name,
|
|
|
43fe83 |
+ virDomainHostdevDefPtr *hostdevs,
|
|
|
43fe83 |
+ int nhostdevs)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
virPCIDeviceListPtr pcidevs;
|
|
|
43fe83 |
size_t i;
|
|
|
43fe83 |
@@ -1140,6 +1161,7 @@ cleanup:
|
|
|
43fe83 |
virObjectUnref(cfg);
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
static void
|
|
|
43fe83 |
qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
const char *name,
|
|
|
43fe83 |
@@ -1203,6 +1225,7 @@ qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
virObjectUnlock(driver->activeUsbHostdevs);
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
+
|
|
|
43fe83 |
void
|
|
|
43fe83 |
qemuDomainReAttachHostScsiDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
const char *name,
|
|
|
43fe83 |
@@ -1272,8 +1295,9 @@ qemuDomainReAttachHostScsiDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
virObjectUnlock(driver->activeScsiHostdevs);
|
|
|
43fe83 |
}
|
|
|
43fe83 |
|
|
|
43fe83 |
-void qemuDomainReAttachHostDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
- virDomainDefPtr def)
|
|
|
43fe83 |
+void
|
|
|
43fe83 |
+qemuDomainReAttachHostDevices(virQEMUDriverPtr driver,
|
|
|
43fe83 |
+ virDomainDefPtr def)
|
|
|
43fe83 |
{
|
|
|
43fe83 |
if (!def->nhostdevs)
|
|
|
43fe83 |
return;
|
|
|
43fe83 |
--
|
|
|
43fe83 |
1.8.4
|
|
|
43fe83 |
|