All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gianni Tedesco <gianni.tedesco@citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: [PATCH 0 of 4] Domain creation for python libxl binding v2
Date: Wed, 12 Jan 2011 14:18:58 +0000	[thread overview]
Message-ID: <patchbomb.1294841938@localhost6.localdomain6> (raw)

This is a repost of patches 7 through 10 from  'libxl python binding updates'.
The main change is to remove an undocumented change to libxl API regarding the
const char *features field in domain_build_info struct. These are now handled
correctly in the python binding without changing the libxl API. The patches
have also been tidied up and some parts re-based relative to each other so that
redundant changes are removed and the split is more logical.

Below is the diff between all libxl C code before and after applying this series.

Gianni

--

diff -purN libxl.1/libxl_create.c libxl.2/libxl_create.c
--- libxl.1/libxl_create.c  2011-01-12 14:08:36.651279949 +0000
+++ libxl.2/libxl_create.c  2011-01-12 14:16:34.226240348 +0000
@@ -27,39 +27,6 @@
 #include "libxl_internal.h"
 #include "flexarray.h"
 
-void libxl_domain_config_destroy(libxl_domain_config *d_config)
-{
-    int i;
-
-    for (i=0; i<d_config->num_disks; i++)
-        libxl_device_disk_destroy(&d_config->disks[i]);
-    free(d_config->disks);
-
-    for (i=0; i<d_config->num_vifs; i++)
-        libxl_device_nic_destroy(&d_config->vifs[i]);
-    free(d_config->vifs);
-
-    for (i=0; i<d_config->num_vif2s; i++)
-        libxl_device_net2_destroy(&d_config->vif2s[i]);
-    free(d_config->vif2s);
-
-    for (i=0; i<d_config->num_pcidevs; i++)
-        libxl_device_pci_destroy(&d_config->pcidevs[i]);
-    free(d_config->pcidevs);
-
-    for (i=0; i<d_config->num_vfbs; i++)
-        libxl_device_vfb_destroy(&d_config->vfbs[i]);
-    free(d_config->vfbs);
-
-    for (i=0; i<d_config->num_vkbs; i++)
-        libxl_device_vkb_destroy(&d_config->vkbs[i]);
-    free(d_config->vkbs);
-
-    libxl_domain_create_info_destroy(&d_config->c_info);
-    libxl_domain_build_info_destroy(&d_config->b_info);
-    libxl_device_model_info_destroy(&d_config->dm_info);
-}
-
 void libxl_init_create_info(libxl_domain_create_info *c_info)
 {
     memset(c_info, '\0', sizeof(*c_info));
diff -purN libxl.1/libxl.h libxl.2/libxl.h
--- libxl.1/libxl.h 2011-01-12 14:08:36.651279949 +0000
+++ libxl.2/libxl.h 2011-01-12 14:16:34.226240348 +0000
@@ -205,6 +205,18 @@ typedef struct libxl__cpuid_policy libxl
 typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
 void libxl_cpuid_destroy(libxl_cpuid_policy_list *cpuid_list);
 
+enum libxl_action_on_shutdown {
+    LIBXL_ACTION_DESTROY,
+
+    LIBXL_ACTION_RESTART,
+    LIBXL_ACTION_RESTART_RENAME,
+
+    LIBXL_ACTION_PRESERVE,
+
+    LIBXL_ACTION_COREDUMP_DESTROY,
+    LIBXL_ACTION_COREDUMP_RESTART,
+};
+
 #define LIBXL_PCI_FUNC_ALL (~0U)
 
 #include "_libxl_types.h"
@@ -241,38 +253,6 @@ enum {
 
 #define LIBXL_VERSION 0
 
-enum libxl_action_on_shutdown {
-    LIBXL_ACTION_DESTROY,
-
-    LIBXL_ACTION_RESTART,
-    LIBXL_ACTION_RESTART_RENAME,
-
-    LIBXL_ACTION_PRESERVE,
-
-    LIBXL_ACTION_COREDUMP_DESTROY,
-    LIBXL_ACTION_COREDUMP_RESTART,
-};
-
-typedef struct {
-    libxl_domain_create_info c_info;
-    libxl_domain_build_info b_info;
-    libxl_device_model_info dm_info;
-
-    int num_disks, num_vifs, num_vif2s, num_pcidevs, num_vfbs, num_vkbs;
-
-    libxl_device_disk *disks;
-    libxl_device_nic *vifs;
-    libxl_device_net2 *vif2s;
-    libxl_device_pci *pcidevs;
-    libxl_device_vfb *vfbs;
-    libxl_device_vkb *vkbs;
-
-    enum libxl_action_on_shutdown on_poweroff;
-    enum libxl_action_on_shutdown on_reboot;
-    enum libxl_action_on_shutdown on_watchdog;
-    enum libxl_action_on_shutdown on_crash;
-} libxl_domain_config;
-
 /* context functions */
 int libxl_ctx_init(libxl_ctx *ctx, int version, xentoollog_logger*);
 int libxl_ctx_free(libxl_ctx *ctx);
@@ -286,7 +266,6 @@ void libxl_init_dm_info(libxl_device_mod
 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_destroy(libxl_domain_config *d_config);
 int libxl_domain_suspend(libxl_ctx *ctx, libxl_domain_suspend_info *info,
                           uint32_t domid, int fd);
 int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid);
diff -purN libxl.1/_libxl_types.c libxl.2/_libxl_types.c
--- libxl.1/_libxl_types.c  2011-01-12 14:08:36.661284022 +0000
+++ libxl.2/_libxl_types.c  2011-01-12 14:16:34.226240348 +0000
@@ -159,3 +159,30 @@ void libxl_net2info_destroy(libxl_net2in
     memset(p, LIBXL_DTOR_POISON, sizeof(*p));
 }
 
+void libxl_domain_config_destroy(libxl_domain_config *p)
+{
+    int i;
+    libxl_domain_create_info_destroy(&p->c_info);
+    libxl_domain_build_info_destroy(&p->b_info);
+    libxl_device_model_info_destroy(&p->dm_info);
+    for(i = 0; i < p->num_disks; i++)
+        libxl_device_disk_destroy(&p->disks[i]);
+    free(p->disks);
+    for(i = 0; i < p->num_vifs; i++)
+        libxl_device_nic_destroy(&p->vifs[i]);
+    free(p->vifs);
+    for(i = 0; i < p->num_vif2s; i++)
+        libxl_device_net2_destroy(&p->vif2s[i]);
+    free(p->vif2s);
+    for(i = 0; i < p->num_pcidevs; i++)
+        libxl_device_pci_destroy(&p->pcidevs[i]);
+    free(p->pcidevs);
+    for(i = 0; i < p->num_vfbs; i++)
+        libxl_device_vfb_destroy(&p->vfbs[i]);
+    free(p->vfbs);
+    for(i = 0; i < p->num_vkbs; i++)
+        libxl_device_vkb_destroy(&p->vkbs[i]);
+    free(p->vkbs);
+    memset(p, LIBXL_DTOR_POISON, sizeof(*p));
+}
+
diff -purN libxl.1/_libxl_types.h libxl.2/_libxl_types.h
--- libxl.1/_libxl_types.h  2011-01-12 14:08:36.661284022 +0000
+++ libxl.2/_libxl_types.h  2011-01-12 14:16:34.226240348 +0000
@@ -453,4 +453,27 @@ typedef struct {
 } libxl_net2info;
 void libxl_net2info_destroy(libxl_net2info *p);
 
+typedef struct {
+    libxl_domain_create_info c_info;
+    libxl_domain_build_info b_info;
+    libxl_device_model_info dm_info;
+    int num_disks;
+    libxl_device_disk * disks;
+    int num_vifs;
+    libxl_device_nic * vifs;
+    int num_vif2s;
+    libxl_device_net2 * vif2s;
+    int num_pcidevs;
+    libxl_device_pci * pcidevs;
+    int num_vfbs;
+    libxl_device_vfb * vfbs;
+    int num_vkbs;
+    libxl_device_vkb * vkbs;
+    enum libxl_action_on_shutdown on_poweroff;
+    enum libxl_action_on_shutdown on_reboot;
+    enum libxl_action_on_shutdown on_watchdog;
+    enum libxl_action_on_shutdown on_crash;
+} libxl_domain_config;
+void libxl_domain_config_destroy(libxl_domain_config *p);
+
 #endif /* __LIBXL_TYPES_H */

             reply	other threads:[~2011-01-12 14:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-12 14:18 Gianni Tedesco [this message]
2011-01-12 14:18 ` [PATCH 1 of 4] pyxl: Recursively scan type-tree to produce complete binding boilerplate Gianni Tedesco
2011-01-12 14:19 ` [PATCH 2 of 4] xl: support array types in IDL Gianni Tedesco
2011-01-12 14:19 ` [PATCH 3 of 4] xl: Implement enum " Gianni Tedesco
2011-01-12 14:19 ` [PATCH 4 of 4] pyxl: Export libxl_domain_create_new() to python binding Gianni Tedesco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patchbomb.1294841938@localhost6.localdomain6 \
    --to=gianni.tedesco@citrix.com \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.