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

[libvirt] [PATCH 08/10] Move QEMU driver lock helpers to a separate file



To allow their use from other source files, move qemuDriverLock
and qemuDriverUnlock to qemu_conf.h and make them non-static

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add qemuDriverLock
  qemuDriverUnlock
* src/qemu/qemu_driver.c: Remove qemuDriverLock and qemuDriverUnlock
---
 src/qemu/qemu_conf.c   |   10 ++++++++++
 src/qemu/qemu_conf.h   |    2 ++
 src/qemu/qemu_driver.c |    9 ---------
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index e600a5b..a300a0e 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -61,6 +61,16 @@
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
+void qemuDriverLock(struct qemud_driver *driver)
+{
+    virMutexLock(&driver->lock);
+}
+void qemuDriverUnlock(struct qemud_driver *driver)
+{
+    virMutexUnlock(&driver->lock);
+}
+
+
 int qemudLoadDriverConfig(struct qemud_driver *driver,
                           const char *filename) {
     virConfPtr conf;
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 4c61891..83ddedd 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -150,6 +150,8 @@ struct _qemuDomainCmdlineDef {
                          __FUNCTION__, __LINE__, __VA_ARGS__)
 
 
+void qemuDriverLock(struct qemud_driver *driver);
+void qemuDriverUnlock(struct qemud_driver *driver);
 int qemudLoadDriverConfig(struct qemud_driver *driver,
                           const char *filename);
 
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5d8aef3..9f2e536 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -109,15 +109,6 @@ static void processWatchdogEvent(void *data, void *opaque);
 
 static int qemudShutdown(void);
 
-static void qemuDriverLock(struct qemud_driver *driver)
-{
-    virMutexLock(&driver->lock);
-}
-static void qemuDriverUnlock(struct qemud_driver *driver)
-{
-    virMutexUnlock(&driver->lock);
-}
-
 static void qemuDomainEventFlush(int timer, void *opaque);
 static void qemuDomainEventQueue(struct qemud_driver *driver,
                                  virDomainEventPtr event);
-- 
1.7.2.3


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