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

[virt-tools-list] [PATCH 1/6] Add "hostname" prop to install-script-config



It is desirable to configure the hostname of the new virtual
machine during initial automated provisioning
---
 osinfo/libosinfo.syms          |    1 +
 osinfo/osinfo_install_config.c |   13 +++++++++++++
 osinfo/osinfo_install_config.h |    6 ++++++
 3 files changed, 20 insertions(+)

diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms
index f22ad37..2f90183 100644
--- a/osinfo/libosinfo.syms
+++ b/osinfo/libosinfo.syms
@@ -263,6 +263,7 @@ LIBOSINFO_0.2.0 {
 	osinfo_install_config_set_user_realname;
 	osinfo_install_config_set_user_administrator;
 	osinfo_install_config_set_user_autologin;
+	osinfo_install_config_set_hostname;
 	osinfo_install_script_get_type;
 	osinfo_install_script_new;
 	osinfo_install_script_new_data;
diff --git a/osinfo/osinfo_install_config.c b/osinfo/osinfo_install_config.c
index 80643b1..eb50680 100644
--- a/osinfo/osinfo_install_config.c
+++ b/osinfo/osinfo_install_config.c
@@ -314,6 +314,19 @@ const gchar *osinfo_install_config_get_reg_product_key(OsinfoInstallConfig *conf
                                          OSINFO_INSTALL_CONFIG_PROP_REG_PRODUCTKEY);
 }
 
+void osinfo_install_config_set_hostname(OsinfoInstallConfig *config,
+                                        const gchar *hostname)
+{
+    osinfo_entity_set_param(OSINFO_ENTITY(config),
+                            OSINFO_INSTALL_CONFIG_PROP_HOSTNAME,
+                            hostname);
+}
+
+const gchar *osinfo_install_config_get_hostname(OsinfoInstallConfig *config)
+{
+    return osinfo_entity_get_param_value(OSINFO_ENTITY(config),
+                                         OSINFO_INSTALL_CONFIG_PROP_HOSTNAME);
+}
 
 
 /*
diff --git a/osinfo/osinfo_install_config.h b/osinfo/osinfo_install_config.h
index 2d1c065..32fe370 100644
--- a/osinfo/osinfo_install_config.h
+++ b/osinfo/osinfo_install_config.h
@@ -54,6 +54,8 @@
 #define OSINFO_INSTALL_CONFIG_PROP_REG_PASSWORD   "reg-password"
 #define OSINFO_INSTALL_CONFIG_PROP_REG_PRODUCTKEY "reg-product-key"
 
+#define OSINFO_INSTALL_CONFIG_PROP_HOSTNAME "hostname"
+
 
 typedef struct _OsinfoInstallConfig        OsinfoInstallConfig;
 typedef struct _OsinfoInstallConfigClass   OsinfoInstallConfigClass;
@@ -146,6 +148,10 @@ void osinfo_install_config_set_reg_product_key(OsinfoInstallConfig *config,
                                                const gchar *key);
 const gchar *osinfo_install_config_get_reg_product_key(OsinfoInstallConfig *config);
 
+void osinfo_install_config_set_hostname(OsinfoInstallConfig *config,
+                                        const gchar *hostname);
+const gchar *osinfo_install_config_get_hostname(OsinfoInstallConfig *config);
+
 
 #endif /* __OSINFO_INSTALL_CONFIG_H__ */
 /*
-- 
1.7.10.4


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