qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] arch_init: Use stateless configuration for default target_${target}.conf
@ 2015-05-22 15:42 Ikey Doherty
  2015-05-22 21:58 ` Eric Blake
  0 siblings, 1 reply; 22+ messages in thread
From: Ikey Doherty @ 2015-05-22 15:42 UTC (permalink / raw)
  To: qemu-devel

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 <michael.i.doherty@intel.com>
---
 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.

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-05-27 14:02 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-22 15:42 [Qemu-devel] [PATCH] arch_init: Use stateless configuration for default target_${target}.conf Ikey Doherty
2015-05-22 21:58 ` Eric Blake
2015-05-26 11:11   ` [Qemu-devel] [PATCH v2] " Ikey Doherty
2015-05-26 11:23     ` Paolo Bonzini
2015-05-26 12:54       ` [Qemu-devel] [PATCH v3 1/2] arch_init: Drop target-x86_64.conf Ikey Doherty
2015-05-26 12:54         ` [Qemu-devel] [PATCH v3 2/2] qemu-bridge-helper: Use stateless configuration for bridge.conf Ikey Doherty
2015-05-26 14:00           ` Paolo Bonzini
2015-05-26 16:38           ` Eduardo Habkost
2015-05-26 16:41             ` Ikey Doherty
2015-05-26 16:57               ` Eduardo Habkost
2015-05-27 14:02                 ` Stefan Hajnoczi
2015-05-27 14:00           ` Stefan Hajnoczi
2015-05-26 14:00         ` [Qemu-devel] [PATCH v3 1/2] arch_init: Drop target-x86_64.conf Paolo Bonzini
2015-05-26 16:25           ` Eduardo Habkost
2015-05-26 16:29             ` Paolo Bonzini
2015-05-26 16:40               ` Eduardo Habkost
2015-05-26 16:51                 ` Paolo Bonzini
2015-05-26 16:59                   ` Eduardo Habkost
2015-05-26 16:30             ` Ikey Doherty
2015-05-26 15:37         ` Eric Blake
2015-05-26 17:01         ` Eduardo Habkost
2015-05-26 11:13   ` [Qemu-devel] [PATCH] arch_init: Use stateless configuration for default target_${target}.conf Ikey Doherty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).