Re: [Qemu-devel] [PATCH 4/5] implement -no-user-config command-line option

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

 



On 04/18/2012 03:02 PM, Eduardo Habkost wrote:
Signed-off-by: Eduardo Habkost<ehabkost@xxxxxxxxxx>
---
  arch_init.c     |   10 +++++++---
  arch_init.h     |    2 +-
  qemu-options.hx |   16 +++++++++++++---
  vl.c            |    6 +++++-
  4 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index 62332e9..c5fc00f 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -114,19 +114,23 @@ const uint32_t arch_type = QEMU_ARCH;

  static struct defconfig_file {
      const char *filename;
+    /* If non-zero, this is a user config file (disabled by -no-user-config) */
+    int userconfig;
  } default_config_files[] = {
-    { CONFIG_QEMU_CONFDIR "/qemu.conf" },
-    { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf" },
+    { CONFIG_QEMU_CONFDIR "/qemu.conf",                   1 },
+    { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", 1 },
      { NULL }, /* end of list */
  };


-int qemu_read_default_config_files(void)
+int qemu_read_default_config_files(int userconfig)
  {
      int ret;
      struct defconfig_file *f;

      for (f = default_config_files; f->filename; f++) {
+        if (!userconfig&&  f->userconfig)
+            continue;

Coding style is off here.  While you're at it, you should make userconfig a bool.


          ret = qemu_read_config_file(f->filename);
          if (ret<  0&&  ret != -ENOENT) {
              return ret;
diff --git a/arch_init.h b/arch_init.h
index 495871b..07510cf 100644
--- a/arch_init.h
+++ b/arch_init.h
@@ -32,6 +32,6 @@ int xen_available(void);

  /* Read default Qemu config files
   */
-int qemu_read_default_config_files(void);
+int qemu_read_default_config_files(int userconfig);

Let's use a bool here and move this to qemu-config.h. The declaration can live there even if the definition is in arch_init.c

Regards,

Anthony Liguori

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]