xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* libxl: simple fix to enable user to configure vif names
@ 2011-12-29 11:14 Wei Liu
  2011-12-29 11:14 ` [PATCH 1/2] libxl: print out vifname in create dryrun Wei Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Wei Liu @ 2011-12-29 11:14 UTC (permalink / raw)
  To: xen-devel; +Cc: andy, florian.heigl, wei.liu2

This feature is required by some of our users.

Reported-by: Andy Smith <andy@strugglers.net>
Reported-by: Florian Heigl <florian.heigl@gmail.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/2] libxl: print out vifname in create dryrun.
  2011-12-29 11:14 libxl: simple fix to enable user to configure vif names Wei Liu
@ 2011-12-29 11:14 ` Wei Liu
  2012-01-03 10:16   ` Ian Campbell
  2011-12-29 11:14 ` [PATCH 2/2] libxl: write vifname in xenstore if set Wei Liu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Wei Liu @ 2011-12-29 11:14 UTC (permalink / raw)
  To: xen-devel; +Cc: andy, florian.heigl, wei.liu2

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 8270f34..8da8b88 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -419,6 +419,8 @@ static void printf_info(int domid,
     for (i = 0; i < d_config->num_vifs; i++) {
         printf("\t(device\n");
         printf("\t\t(vif\n");
+        if (d_config->vifs[i].ifname)
+            printf("\t\t\t(vifname %s)\n", d_config->vifs[i].ifname);
         printf("\t\t\t(backend_domid %d)\n", d_config->vifs[i].backend_domid);
         printf("\t\t\t(frontend_domid %d)\n", domid);
         printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid);
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] libxl: write vifname in xenstore if set.
  2011-12-29 11:14 libxl: simple fix to enable user to configure vif names Wei Liu
  2011-12-29 11:14 ` [PATCH 1/2] libxl: print out vifname in create dryrun Wei Liu
@ 2011-12-29 11:14 ` Wei Liu
  2012-01-03 10:16   ` Ian Campbell
  2011-12-31 15:01 ` libxl: simple fix to enable user to configure vif names Florian Heigl
  2012-01-04 12:42 ` Wei Liu
  3 siblings, 1 reply; 11+ messages in thread
From: Wei Liu @ 2011-12-29 11:14 UTC (permalink / raw)
  To: xen-devel; +Cc: andy, florian.heigl, wei.liu2

Simple fix to enable user to specify vif names.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2b8f8f4..3c086d5 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1534,6 +1534,12 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic)
                                           libxl_xen_script_dir_path(),
                                           nic->script));
     }
+
+    if (nic->ifname) {
+        flexarray_append(back, "vifname");
+        flexarray_append(back, nic->ifname);
+    }
+
     flexarray_append(back, "mac");
     flexarray_append(back,libxl__sprintf(gc,
                                     LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: libxl: simple fix to enable user to configure vif names
  2011-12-29 11:14 libxl: simple fix to enable user to configure vif names Wei Liu
  2011-12-29 11:14 ` [PATCH 1/2] libxl: print out vifname in create dryrun Wei Liu
  2011-12-29 11:14 ` [PATCH 2/2] libxl: write vifname in xenstore if set Wei Liu
@ 2011-12-31 15:01 ` Florian Heigl
  2012-01-01 11:56   ` Wei Liu
  2012-01-04 12:42 ` Wei Liu
  3 siblings, 1 reply; 11+ messages in thread
From: Florian Heigl @ 2011-12-31 15:01 UTC (permalink / raw)
  To: Wei Liu; +Cc: andy, xen-devel

Hi Wei,

2011/12/29 Wei Liu <wei.liu2@citrix.com>:
> This feature is required by some of our users.
>
> Reported-by: Andy Smith <andy@strugglers.net>
> Reported-by: Florian Heigl <florian.heigl@gmail.com>

Wow, thank you! :))


-- 
the purpose of libvirt is to provide an abstraction layer hiding all
xen features added since 2006 until they were finally understood and
copied by the kvm devs.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: libxl: simple fix to enable user to configure vif names
  2011-12-31 15:01 ` libxl: simple fix to enable user to configure vif names Florian Heigl
@ 2012-01-01 11:56   ` Wei Liu
  0 siblings, 0 replies; 11+ messages in thread
From: Wei Liu @ 2012-01-01 11:56 UTC (permalink / raw)
  To: Florian Heigl
  Cc: andy@strugglers.net, xen-devel@lists.xensource.com, wei.liu2

On Sat, 2011-12-31 at 15:01 +0000, Florian Heigl wrote:
> Hi Wei,
> 
> 2011/12/29 Wei Liu <wei.liu2@citrix.com>:
> > This feature is required by some of our users.
> >
> > Reported-by: Andy Smith <andy@strugglers.net>
> > Reported-by: Florian Heigl <florian.heigl@gmail.com>
> 
> Wow, thank you! :))
> 

Hi Florian

Have you tested these patches (patch 2 is essential)? Do they work for
you? I only took a glimpse of the code, I thought they should work. If
you encounter any further issue, please let me know.


Wei.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] libxl: write vifname in xenstore if set.
  2011-12-29 11:14 ` [PATCH 2/2] libxl: write vifname in xenstore if set Wei Liu
@ 2012-01-03 10:16   ` Ian Campbell
  2012-01-03 10:39     ` Wei Liu
  2012-01-05 17:14     ` Ian Jackson
  0 siblings, 2 replies; 11+ messages in thread
From: Ian Campbell @ 2012-01-03 10:16 UTC (permalink / raw)
  To: Wei Liu
  Cc: andy@strugglers.net, florian.heigl@gmail.com,
	xen-devel@lists.xensource.com

On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote:
> Simple fix to enable user to specify vif names.

Thanks. It is worth noting that the naming of the vif is implemented by
the hotplug scripts and not by netback (which always uses vifX.Y).

> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>

> ---
>  tools/libxl/libxl.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 2b8f8f4..3c086d5 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -1534,6 +1534,12 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic)
>                                            libxl_xen_script_dir_path(),
>                                            nic->script));
>      }
> +
> +    if (nic->ifname) {
> +        flexarray_append(back, "vifname");
> +        flexarray_append(back, nic->ifname);
> +    }
> +
>      flexarray_append(back, "mac");
>      flexarray_append(back,libxl__sprintf(gc,
>                                      LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] libxl: print out vifname in create dryrun.
  2011-12-29 11:14 ` [PATCH 1/2] libxl: print out vifname in create dryrun Wei Liu
@ 2012-01-03 10:16   ` Ian Campbell
  0 siblings, 0 replies; 11+ messages in thread
From: Ian Campbell @ 2012-01-03 10:16 UTC (permalink / raw)
  To: Wei Liu
  Cc: andy@strugglers.net, florian.heigl@gmail.com,
	xen-devel@lists.xensource.com

On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote:
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  tools/libxl/xl_cmdimpl.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 8270f34..8da8b88 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -419,6 +419,8 @@ static void printf_info(int domid,
>      for (i = 0; i < d_config->num_vifs; i++) {
>          printf("\t(device\n");
>          printf("\t\t(vif\n");
> +        if (d_config->vifs[i].ifname)
> +            printf("\t\t\t(vifname %s)\n", d_config->vifs[i].ifname);
>          printf("\t\t\t(backend_domid %d)\n", d_config->vifs[i].backend_domid);
>          printf("\t\t\t(frontend_domid %d)\n", domid);
>          printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid);

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] libxl: write vifname in xenstore if set.
  2012-01-03 10:16   ` Ian Campbell
@ 2012-01-03 10:39     ` Wei Liu
  2012-01-03 16:20       ` Florian Manschwetus
  2012-01-05 17:14     ` Ian Jackson
  1 sibling, 1 reply; 11+ messages in thread
From: Wei Liu @ 2012-01-03 10:39 UTC (permalink / raw)
  To: Ian Campbell
  Cc: andy@strugglers.net, florian.heigl@gmail.com,
	xen-devel@lists.xensource.com, wei.liu2

On Tue, 2012-01-03 at 10:16 +0000, Ian Campbell wrote:
> On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote:
> > Simple fix to enable user to specify vif names.
> 
> Thanks. It is worth noting that the naming of the vif is implemented by
> the hotplug scripts and not by netback (which always uses vifX.Y).
> 

Yes, I knew that after digging into hotplug scripts. :)

It seems that we need to backport these patches to earlier versions as
well.


Wei.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] libxl: write vifname in xenstore if set.
  2012-01-03 10:39     ` Wei Liu
@ 2012-01-03 16:20       ` Florian Manschwetus
  0 siblings, 0 replies; 11+ messages in thread
From: Florian Manschwetus @ 2012-01-03 16:20 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2112 bytes --]

This applies against 4.1.2, but untested, as I still have my Athlon X2
xen boot trouble.

diff --git tools/libxl/libxl.c tools/libxl/libxl.c
index 2b8f8f4..3c086d5 100644
--- tools/libxl/libxl.c
+++ tools/libxl/libxl.c
@@ -1229,6 +1229,12 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t
domid, libxl_device_nic *nic)
     flexarray_append(back, libxl__sprintf(&gc, "%d", 1));
     flexarray_append(back, "script");
     flexarray_append(back, nic->script);
+
+    if (nic->ifname) {
+        flexarray_append(back, "vifname");
+        flexarray_append(back, nic->ifname);
+    }
+
     flexarray_append(back, "mac");
     flexarray_append(back, libxl__sprintf(&gc,
"%02x:%02x:%02x:%02x:%02x:%02x",
                                                  nic->mac[0],
nic->mac[1], nic->mac[2],
diff --git tools/libxl/xl_cmdimpl.c tools/libxl/xl_cmdimpl.c
index 8270f34..8da8b88 100644
--- tools/libxl/xl_cmdimpl.c
+++ tools/libxl/xl_cmdimpl.c
@@ -393,6 +393,8 @@
     for (i = 0; i < d_config->num_vifs; i++) {
         printf("\t(device\n");
         printf("\t\t(vif\n");
+        if (d_config->vifs[i].ifname)
+            printf("\t\t\t(vifname %s)\n", d_config->vifs[i].ifname);
         printf("\t\t\t(backend_domid %d)\n",
d_config->vifs[i].backend_domid);
         printf("\t\t\t(frontend_domid %d)\n", domid);
         printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid);

Am 03.01.2012 11:39, schrieb Wei Liu:
> On Tue, 2012-01-03 at 10:16 +0000, Ian Campbell wrote:
>> On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote:
>>> Simple fix to enable user to specify vif names.
>>
>> Thanks. It is worth noting that the naming of the vif is implemented by
>> the hotplug scripts and not by netback (which always uses vifX.Y).
>>
> 
> Yes, I knew that after digging into hotplug scripts. :)
> 
> It seems that we need to backport these patches to earlier versions as
> well.
> 
> 
> Wei.
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 



[-- Attachment #1.2: S/MIME Kryptografische Unterschrift --]
[-- Type: application/pkcs7-signature, Size: 2332 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: libxl: simple fix to enable user to configure vif names
  2011-12-29 11:14 libxl: simple fix to enable user to configure vif names Wei Liu
                   ` (2 preceding siblings ...)
  2011-12-31 15:01 ` libxl: simple fix to enable user to configure vif names Florian Heigl
@ 2012-01-04 12:42 ` Wei Liu
  3 siblings, 0 replies; 11+ messages in thread
From: Wei Liu @ 2012-01-04 12:42 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel@lists.xensource.com, wei.liu2

On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote:
> This feature is required by some of our users.
> 
> Reported-by: Andy Smith <andy@strugglers.net>
> Reported-by: Florian Heigl <florian.heigl@gmail.com>
> 

Ian, ping?


Wei.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] libxl: write vifname in xenstore if set.
  2012-01-03 10:16   ` Ian Campbell
  2012-01-03 10:39     ` Wei Liu
@ 2012-01-05 17:14     ` Ian Jackson
  1 sibling, 0 replies; 11+ messages in thread
From: Ian Jackson @ 2012-01-05 17:14 UTC (permalink / raw)
  To: Ian Campbell
  Cc: andy@strugglers.net, florian.heigl@gmail.com,
	xen-devel@lists.xensource.com, Wei Liu

Ian Campbell writes ("Re: [Xen-devel] [PATCH 2/2] libxl: write vifname in xenstore if set."):
> On Thu, 2011-12-29 at 11:14 +0000, Wei Liu wrote:
> > Simple fix to enable user to specify vif names.
...
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Acked-by: Ian Campbell <Ian.Campbell@citrix.com>

both

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-01-05 17:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-29 11:14 libxl: simple fix to enable user to configure vif names Wei Liu
2011-12-29 11:14 ` [PATCH 1/2] libxl: print out vifname in create dryrun Wei Liu
2012-01-03 10:16   ` Ian Campbell
2011-12-29 11:14 ` [PATCH 2/2] libxl: write vifname in xenstore if set Wei Liu
2012-01-03 10:16   ` Ian Campbell
2012-01-03 10:39     ` Wei Liu
2012-01-03 16:20       ` Florian Manschwetus
2012-01-05 17:14     ` Ian Jackson
2011-12-31 15:01 ` libxl: simple fix to enable user to configure vif names Florian Heigl
2012-01-01 11:56   ` Wei Liu
2012-01-04 12:42 ` Wei Liu

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).