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

[Xen-changelog] [xen-unstable] libxl: provide libxl_domain_config_init.


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Mon, 14 May 2012 16:31:59 +0000
  • Delivery-date: Mon, 14 May 2012 16:32:05 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1333533071 -3600
# Node ID 31489be80c511940ca83056c5e4df1068da30a8d
# Parent  7872b091890196b4d170de1e89a5d221506301c6
libxl: provide libxl_domain_config_init.

Currently this struct is too complicated for the IDL to represent (arrays) so
for now implement by hand.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 7872b0918901 -r 31489be80c51 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Tue Apr 24 18:51:56 2012 +0100
+++ b/tools/libxl/libxl.h       Wed Apr 04 10:51:11 2012 +0100
@@ -466,6 +466,7 @@ int libxl_ctx_free(libxl_ctx *ctx /* 0 i
 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, 
libxl_console_ready cb, void *priv, uint32_t *domid);
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, 
libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
+void libxl_domain_config_init(libxl_domain_config *d_config);
 void libxl_domain_config_dispose(libxl_domain_config *d_config);
 int libxl_domain_suspend(libxl_ctx *ctx, libxl_domain_suspend_info *info,
                           uint32_t domid, int fd);
diff -r 7872b0918901 -r 31489be80c51 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Tue Apr 24 18:51:56 2012 +0100
+++ b/tools/libxl/libxl_create.c        Wed Apr 04 10:51:11 2012 +0100
@@ -22,6 +22,13 @@
 #include <xc_dom.h>
 #include <xenguest.h>
 
+void libxl_domain_config_init(libxl_domain_config *d_config)
+{
+    memset(d_config, 0, sizeof(*d_config));
+    libxl_domain_create_info_init(&d_config->c_info);
+    libxl_domain_build_info_init(&d_config->b_info);
+}
+
 void libxl_domain_config_dispose(libxl_domain_config *d_config)
 {
     int i;
diff -r 7872b0918901 -r 31489be80c51 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Apr 24 18:51:56 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Wed Apr 04 10:51:11 2012 +0100
@@ -549,8 +549,6 @@ static void parse_config_data(const char
         exit(1);
     }
 
-    libxl_domain_create_info_init(c_info);
-
     if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
                                     &c_info->ssidref);
@@ -596,7 +594,6 @@ static void parse_config_data(const char
         exit(1);
     }
 
-    libxl_domain_build_info_init(b_info);
     libxl_domain_build_info_init_type(b_info, c_info->type);
 
     /* the following is the actual config parsing with overriding values in 
the structures */
@@ -1523,7 +1520,7 @@ static int create_domain(struct domain_c
     pid_t child_console_pid = -1;
     struct save_file_header hdr;
 
-    memset(&d_config, 0x00, sizeof(d_config));
+    libxl_domain_config_init(&d_config);
 
     if (restore_file) {
         uint8_t *optdata_begin = 0;
@@ -1836,7 +1833,7 @@ start:
 
                 /* Reparse the configuration in case it has changed */
                 libxl_domain_config_dispose(&d_config);
-                memset(&d_config, 0, sizeof(d_config));
+                libxl_domain_config_init(&d_config);
                 parse_config_data(config_file, config_data, config_len,
                                   &d_config);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.