* libxl: Allow specification of backend domains for vifs
@ 2010-08-09 14:28 Mihir Nanavati
2010-08-09 16:42 ` Stefano Stabellini
2010-08-10 16:44 ` Ian Jackson
0 siblings, 2 replies; 5+ messages in thread
From: Mihir Nanavati @ 2010-08-09 14:28 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 1672 bytes --]
Allow specification of backend domains for vifs, either in the config
file or via network-attach.
Signed-off-by: Mihir Nanavati <mihirn@cs.ubc.ca>
diff -r 8992134dcfd0 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Wed Aug 04 19:24:17 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c Mon Aug 09 15:02:56 2010 +0100
@@ -833,6 +833,11 @@
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")) {
@@ -4001,10 +4006,9 @@
} 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)) {
[-- Attachment #2: xlnetattach.patch --]
[-- Type: text/x-patch, Size: 1523 bytes --]
diff -r 8992134dcfd0 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Wed Aug 04 19:24:17 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c Mon Aug 09 15:02:56 2010 +0100
@@ -833,6 +833,11 @@
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")) {
@@ -4001,10 +4006,9 @@
} 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)) {
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libxl: Allow specification of backend domains for vifs
2010-08-09 14:28 libxl: Allow specification of backend domains for vifs Mihir Nanavati
@ 2010-08-09 16:42 ` Stefano Stabellini
2010-08-10 16:44 ` Ian Jackson
1 sibling, 0 replies; 5+ messages in thread
From: Stefano Stabellini @ 2010-08-09 16:42 UTC (permalink / raw)
To: Mihir Nanavati; +Cc: xen-devel
On Mon, 9 Aug 2010, Mihir Nanavati wrote:
> Allow specification of backend domains for vifs, either in the config
> file or via network-attach.
>
> Signed-off-by: Mihir Nanavati <mihirn@cs.ubc.ca>
applied, thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libxl: Allow specification of backend domains for vifs
2010-08-09 14:28 libxl: Allow specification of backend domains for vifs Mihir Nanavati
2010-08-09 16:42 ` Stefano Stabellini
@ 2010-08-10 16:44 ` Ian Jackson
2010-08-10 21:13 ` Mihir Nanavati
1 sibling, 1 reply; 5+ messages in thread
From: Ian Jackson @ 2010-08-10 16:44 UTC (permalink / raw)
To: Mihir Nanavati; +Cc: xen-devel
Mihir Nanavati writes ("[Xen-devel] libxl: Allow specification of backend domains for vifs"):
> Allow specification of backend domains for vifs, either in the config
> file or via network-attach.
What happens if you do this in the config file for an HVM guest ?
Ian.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libxl: Allow specification of backend domains for vifs
2010-08-10 16:44 ` Ian Jackson
@ 2010-08-10 21:13 ` Mihir Nanavati
2010-08-10 21:28 ` Vincent Hanquez
0 siblings, 1 reply; 5+ messages in thread
From: Mihir Nanavati @ 2010-08-10 21:13 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
It works fine with stub domains. I haven't really played around with
it on regular HVM guests, but I suspect it might cause some issues.
Will give it a spin tomorrow.
~M
On Tue, Aug 10, 2010 at 5:44 PM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> Mihir Nanavati writes ("[Xen-devel] libxl: Allow specification of backend domains for vifs"):
>> Allow specification of backend domains for vifs, either in the config
>> file or via network-attach.
>
> What happens if you do this in the config file for an HVM guest ?
>
> Ian.
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: libxl: Allow specification of backend domains for vifs
2010-08-10 21:13 ` Mihir Nanavati
@ 2010-08-10 21:28 ` Vincent Hanquez
0 siblings, 0 replies; 5+ messages in thread
From: Vincent Hanquez @ 2010-08-10 21:28 UTC (permalink / raw)
To: Mihir Nanavati; +Cc: xen-devel, Ian Jackson
On 10/08/10 22:13, Mihir Nanavati wrote:
> It works fine with stub domains. I haven't really played around with
> it on regular HVM guests, but I suspect it might cause some issues.
> Will give it a spin tomorrow.
There's nothing different in this case. exposing the backend domid for
hvm guest is a perfectly valid thing to do.
--
Vincent
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-08-10 21:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09 14:28 libxl: Allow specification of backend domains for vifs Mihir Nanavati
2010-08-09 16:42 ` Stefano Stabellini
2010-08-10 16:44 ` Ian Jackson
2010-08-10 21:13 ` Mihir Nanavati
2010-08-10 21:28 ` Vincent Hanquez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).