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

Re: [Xen-devel] [PATCH 2 of 4 RFC] xl/remus: Network buffering cmdline switch, setup/teardown



On Thu, 2013-07-25 at 00:09 -0700, Shriram Rajagopalan wrote:
> Add appropriate code to xl_cmdline.c to setup network buffers for
> each vif belonging to the guest.  Also provide a command line switch
> to explicitly "enable" network buffering.
> 
> Signed-off-by: Shriram Rajagopalan <rshriram@xxxxxxxxx>
> 
> diff -r 3ae38cbe535c -r 3cd67f6ff63a tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl     Wed Jul 24 22:55:00 2013 -0700
> +++ b/tools/libxl/libxl_types.idl     Thu Jul 25 00:02:19 2013 -0700
> @@ -521,6 +521,7 @@ libxl_domain_remus_info = Struct("domain
>      ("interval",     integer),
>      ("blackhole",    bool),
>      ("compression",  bool),
> +    ("netbuf_iflist", libxl_string_list),
>      ])
>  
>  libxl_event_type = Enumeration("event_type", [
> diff -r 3ae38cbe535c -r 3cd67f6ff63a tools/libxl/xl_cmdimpl.c
> --- a/tools/libxl/xl_cmdimpl.c        Wed Jul 24 22:55:00 2013 -0700
> +++ b/tools/libxl/xl_cmdimpl.c        Thu Jul 25 00:02:19 2013 -0700
> @@ -7039,10 +7039,109 @@ done:
>      return ret;
>  }
>  
> +static char **get_guest_vifnames(uint32_t domid, int *num_vifs)
> +{
> +    char **viflist;
> +    libxl_device_nic *nics;
> +    libxl_nicinfo nicinfo;
> +    int nb, i;
> +
> +    nics = libxl_device_nic_list(ctx, domid, &nb);
> +    if (!nics) { *num_vifs = 0; return NULL;}
> +
> +    viflist = calloc((nb + 1), sizeof(char *));
> +    if (!viflist) {
> +        perror("failed to allocate memory to hold vif names!");
> +        exit(-1);
> +    }
> +
> +    for (i = 0; i < nb; ++i) {
> +        if (!libxl_device_nic_getinfo(ctx, domid, &nics[i], &nicinfo))  {
> +            if (asprintf(&viflist[i], "vif%u.%d", domid, nicinfo.devid) < 0) 
> {

This doesn't account for the ifname field of the vif.

Also, I'm not sure how this is supposed to work when driver domains are
in use either, if this were done via libxl then it would naturally get
incorporated into Roger's work to make hotplug scripts etc work properly
with stub domains.

Most of the other comments I had would become invalid/irrelevant when
this was moved to libxl, since you'd naturally end up doing things
differently anyway.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.