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

[Xen-changelog] [xen-unstable] xl: xl network-attach -N (dry run) option



# HG changeset patch
# User Mathieu Gagne <mgagne@xxxxxxxx>
# Date 1334686432 -3600
# Node ID e6b20ec1824c76a01382ee8b6fd67450c12a944b
# Parent  882f925234d8f581dc918bfd37741c9e70dad04a
xl: xl network-attach -N (dry run) option

Add dryrun for testing and debugging purposes.

Signed-off-by: Mathieu Gagne <mgagne@xxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---


diff -r 882f925234d8 -r e6b20ec1824c tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Apr 17 19:13:19 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Tue Apr 17 19:13:52 2012 +0100
@@ -4916,6 +4916,16 @@ int main_networkattach(int argc, char **
             return 1;
         }
     }
+
+    if (dryrun_only) {
+        char *json = libxl_device_nic_to_json(ctx, &nic);
+        printf("vif: %s\n", json);
+        free(json);
+        libxl_device_nic_dispose(&nic);
+        if (ferror(stdout) || fflush(stdout)) { perror("stdout"); exit(-1); }
+        return 0;
+    }
+
     if (libxl_device_nic_add(ctx, domid, &nic)) {
         fprintf(stderr, "libxl_device_nic_add failed.\n");
         return 1;
diff -r 882f925234d8 -r e6b20ec1824c tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c Tue Apr 17 19:13:19 2012 +0100
+++ b/tools/libxl/xl_cmdtable.c Tue Apr 17 19:13:52 2012 +0100
@@ -288,7 +288,7 @@ struct cmd_spec cmd_table[] = {
       "",
     },
     { "network-attach",
-      &main_networkattach, 0,
+      &main_networkattach, 1,
       "Create a new virtual network device",
       "<Domain> [type=<type>] [mac=<mac>] [bridge=<bridge>] "
       "[ip=<ip>] [script=<script>] [backend=<BackDomain>] [vifname=<name>] "

_______________________________________________
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®.