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
This commit is contained in:
Daniel P. Berrange 2010-12-16 16:11:48 +00:00
parent 01abc8a1b8
commit 22f4cb855c
3 changed files with 12 additions and 9 deletions

View File

@ -60,6 +60,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;

View File

@ -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);

View File

@ -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);