Patchwork [v3,02/10] Use machine_init() to register virtfs config options.

login
register
mail settings
Submitter Gerd Hoffmann
Date Aug. 25, 2010, 2:19 p.m.
Message ID <1282745970-11506-3-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/62682/
State New
Headers show

Comments

Gerd Hoffmann - Aug. 25, 2010, 2:19 p.m.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 fsdev/qemu-fsdev.c |    9 +++++++++
 vl.c               |    5 -----
 2 files changed, 9 insertions(+), 5 deletions(-)

Patch

diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c
index ad69b0e..280b8f5 100644
--- a/fsdev/qemu-fsdev.c
+++ b/fsdev/qemu-fsdev.c
@@ -16,6 +16,7 @@ 
 #include "qemu-queue.h"
 #include "osdep.h"
 #include "qemu-common.h"
+#include "qemu-config.h"
 
 static QTAILQ_HEAD(FsTypeEntry_head, FsTypeListEntry) fstype_entries =
     QTAILQ_HEAD_INITIALIZER(fstype_entries);
@@ -75,3 +76,11 @@  FsTypeEntry *get_fsdev_fsentry(char *id)
     }
     return NULL;
 }
+
+static void fsdev_register_config(void)
+{
+    qemu_add_opts(&qemu_fsdev_opts);
+    qemu_add_opts(&qemu_virtfs_opts);
+}
+machine_init(fsdev_register_config);
+
diff --git a/vl.c b/vl.c
index d90b275..40bf30b 100644
--- a/vl.c
+++ b/vl.c
@@ -1856,11 +1856,6 @@  int main(int argc, char **argv, char **envp)
     tb_size = 0;
     autostart= 1;
 
-#ifdef CONFIG_VIRTFS
-    qemu_add_opts(&qemu_fsdev_opts);
-    qemu_add_opts(&qemu_virtfs_opts);
-#endif
-
     /* first pass of option parsing */
     optind = 1;
     while (optind < argc) {