Hi,
attached patch uses C99 initializers for virStateDriver. Makes reading
easier and extending the structure less error prone.
-- Guido
>From 61dd31fd378a1bf1db2b4f7cc871234a3c8fd51e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Guido=20G=C3=BCnther?= <[EMAIL PROTECTED]>
Date: Sun, 5 Oct 2008 13:46:25 +0200
Subject: [PATCH] use C99 initializers for virStateDriver
---
src/lxc_driver.c | 8 +++-----
src/qemu_driver.c | 9 ++++-----
src/remote_internal.c | 6 +-----
src/storage_driver.c | 9 ++++-----
4 files changed, 12 insertions(+), 20 deletions(-)
diff --git a/src/lxc_driver.c b/src/lxc_driver.c
index 0f4925a..e3e40ab 100644
--- a/src/lxc_driver.c
+++ b/src/lxc_driver.c
@@ -1214,11 +1214,9 @@ static virDriver lxcDriver = {
static virStateDriver lxcStateDriver = {
- lxcStartup,
- lxcShutdown,
- NULL, /* reload */
- lxcActive,
- NULL,
+ .initialize = lxcStartup,
+ .cleanup = lxcShutdown,
+ .active = lxcActive,
};
int lxcRegister(void)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index a1e7285..b003b00 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -4104,11 +4104,10 @@ static virNetworkDriver qemuNetworkDriver = {
#ifdef WITH_LIBVIRTD
static virStateDriver qemuStateDriver = {
- qemudStartup,
- qemudShutdown,
- qemudReload,
- qemudActive,
- NULL
+ .initialize = qemudStartup,
+ .cleanup = qemudShutdown,
+ .reload = qemudReload,
+ .active = qemudActive,
};
#endif
diff --git a/src/remote_internal.c b/src/remote_internal.c
index 66de9d5..da1ced6 100644
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -4937,11 +4937,7 @@ static virStorageDriver storage_driver = {
#ifdef WITH_LIBVIRTD
static virStateDriver state_driver = {
- remoteStartup,
- NULL,
- NULL,
- NULL,
- NULL
+ .initialize = remoteStartup,
};
#endif
diff --git a/src/storage_driver.c b/src/storage_driver.c
index 84b4bc6..221bdec 100644
--- a/src/storage_driver.c
+++ b/src/storage_driver.c
@@ -1267,11 +1267,10 @@ static virStorageDriver storageDriver = {
static virStateDriver stateDriver = {
- storageDriverStartup,
- storageDriverShutdown,
- storageDriverReload,
- storageDriverActive,
- NULL
+ .initialize = storageDriverStartup,
+ .cleanup = storageDriverShutdown,
+ .reload = storageDriverReload,
+ .active = storageDriverActive,
};
int storageRegister(void) {
--
1.6.0.1
--
Libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list