WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xl: support backend domid in config file

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: support backend domid in config file for vifs
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 11 Aug 2010 13:56:01 -0700
Delivery-date: Wed, 11 Aug 2010 14:00:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Stefano Stabellini <sstabellini@xxxxxxxxxxxxx>
# Date 1281372241 -3600
# Node ID 36c9f6ea97827a26e06b5a6abc3003597b9e9292
# Parent  1d67dd785ef465da73181f26db4d468932fe61e7
xl: support backend domid in config file for vifs

Allow specification of backend domains for vifs, either in the config
file or via network-attach.

Signed-off-by: Mihir Nanavati <mihirn@xxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r 1d67dd785ef4 -r 36c9f6ea9782 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Mon Aug 09 17:43:18 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Mon Aug 09 17:44:01 2010 +0100
@@ -833,6 +833,11 @@ static void parse_config_data(const char
                     nic->script = strdup(p2 + 1);
                 } else if (!strcmp(p, "vifname")) {
                     nic->ifname = strdup(p2 + 1);
+                } else if (!strcmp(p, "backend")) {
+                    if(libxl_name_to_domid(&ctx, (p2 + 1), 
&(nic->backend_domid))) {
+                        fprintf(stderr, "Specified backend domain does not 
exist, defaulting to Dom0\n");
+                        nic->backend_domid = 0;
+                    }
                 } else if (!strcmp(p, "rate")) {
                     fprintf(stderr, "the rate parameter for vifs is currently 
not supported\n");
                 } else if (!strcmp(p, "accel")) {
@@ -4012,10 +4017,9 @@ int main_networkattach(int argc, char **
         } else if (!strncmp("script=", *argv, 6)) {
             nic.script = (*argv) + 6;
         } else if (!strncmp("backend=", *argv, 8)) {
-            val = strtoul((*argv) + 8, &endptr, 10);
-            if (((*argv) + 8) == endptr) {
-                fprintf(stderr, "Invalid parameter `backend'.\n");
-                return 1;
+            if(libxl_name_to_domid(&ctx, ((*argv) + 8), &val)) {
+                fprintf(stderr, "Specified backend domain does not exist, 
defaulting to Dom0\n");
+                val = 0;
             }
             nic.backend_domid = val;
         } else if (!strncmp("vifname=", *argv, 8)) {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xl: support backend domid in config file for vifs, Xen patchbot-unstable <=