qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] arch_init: Use stateless configuration for default


From: Ikey Doherty
Subject: [Qemu-devel] [PATCH] arch_init: Use stateless configuration for default target_${target}.conf
Date: Fri, 22 May 2015 16:42:51 +0100

The goal of stateless, and thus this change, is to separate OS configuration
from system administrator configuration. With this change we will read the
default configuration data from /usr/share/defaults/qemu, in the absence of
an overriding site administrator configuration in /etc/qemu.

A key advantage of this change is enabling a sane and immutable default OS
configuration, that is resiliant to upgrades. Ultimate power is still left
to the system administrator, with the ability to override the defaults if
required. Lastly, given that the sane defaults are always available, the
administrator may simply remove their site-config files to reset the
configuration to the "factory defaults" (i.e. OS configuration).

Signed-off-by: Ikey Doherty <address@hidden>
---
 Makefile    | 8 ++++----
 arch_init.c | 1 +
 configure   | 2 ++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index d945804..52635da 100644
--- a/Makefile
+++ b/Makefile
@@ -390,12 +390,12 @@ endif
 endif
 
 install-confdir:
-       $(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
+       $(INSTALL_DIR) "$(DESTDIR)$(qemu_defaultdir)"
 
-install-sysconfig: install-datadir install-confdir
-       $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf 
"$(DESTDIR)$(qemu_confdir)"
+install-defaultconfig: install-datadir install-confdir
+       $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf 
"$(DESTDIR)$(qemu_defaultdir)"
 
-install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig \
+install: all $(if $(BUILD_DOCS),install-doc) install-defaultconfig \
 install-datadir install-localstatedir
 ifneq ($(TOOLS),)
        $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
diff --git a/arch_init.c b/arch_init.c
index 23d3feb..f23fb1f 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -137,6 +137,7 @@ static struct defconfig_file {
 } default_config_files[] = {
     { CONFIG_QEMU_CONFDIR "/qemu.conf",                   true },
     { CONFIG_QEMU_CONFDIR "/target-" TARGET_NAME ".conf", true },
+    { CONFIG_QEMU_DEFAULTDIR "/target-" TARGET_NAME ".conf", true },
     { NULL }, /* end of list */
 };
 
diff --git a/configure b/configure
index f758f32..a0b6477 100755
--- a/configure
+++ b/configure
@@ -4303,6 +4303,7 @@ fi
 qemu_confdir=$sysconfdir$confsuffix
 qemu_moddir=$libdir$confsuffix
 qemu_datadir=$datadir$confsuffix
+qemu_defaultdir="$datadir/defaults$confsuffix"
 qemu_localedir="$datadir/locale"
 
 tools=""
@@ -4543,6 +4544,7 @@ echo "mandir=$mandir" >> $config_host_mak
 echo "sysconfdir=$sysconfdir" >> $config_host_mak
 echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
 echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
+echo "qemu_defaultdir=$qemu_defaultdir" >> $config_host_mak
 echo "qemu_docdir=$qemu_docdir" >> $config_host_mak
 echo "qemu_moddir=$qemu_moddir" >> $config_host_mak
 if test "$mingw32" = "no" ; then
-- 
1.9.1

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]