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-devel

Re: [Xen-devel] [PATCH 12/12] Unplug emulated disks and nics

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 12/12] Unplug emulated disks and nics
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Thu, 17 Jun 2010 19:00:59 +0100
Cc: "jeremy@xxxxxxxx" <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "ddutile@xxxxxxxxxx" <ddutile@xxxxxxxxxx>, "sheng@xxxxxxxxxxxxxxx" <sheng@xxxxxxxxxxxxxxx>
Delivery-date: Thu, 17 Jun 2010 11:04:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100617174622.GB17523@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1275570645-27189-1-git-send-email-stefano.stabellini@xxxxxxxxxxxxx> <1275570645-27189-12-git-send-email-stefano.stabellini@xxxxxxxxxxxxx> <20100614212017.GA8600@xxxxxxxxxxxxxxxxxxx> <alpine.DEB.2.00.1006171541490.3401@kaball-desktop> <20100617174622.GB17523@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Thu, 17 Jun 2010, Konrad Rzeszutek Wilk wrote:
> If was thinking of something like this in the header file:
> 
> 
> int xen_must_unplug_nics() {
> #if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \
>               defined(CONFIG_XEN_NETDEV_FRONTEND_MODULE)) && \
>               (defined(CONFIG_XEN_PLATFORM_PCI) || \
>                defined(CONFIG_XEN_PLATFORM_PCI_MODULE))
>       return 1;
> #else
>       return 0;
> }
> 
> and then your code would be:
> 
>       if (xen_must_unplug_nics()) {
>               printk(".. blah blah ");
>               xen_emul_unplug |- XEN_unPLIG_ALL_NICS;
>       }
> 
> and similar for the IDE disks.
> 

this seems actually better, I'll do that

> > 
> > 
> > > > +       }
> > > > +       /* Now unplug the emulated devices */
> > > > +       if (xen_platform_pci_enabled && !(xen_emul_unplug & 
> > > > XEN_UNPLUG_IGNORE))
> > > > +               outw(xen_emul_unplug, XEN_IOPORT_UNPLUG);
> > > > +}
> > > > +
> > > > +static int __init parse_xen_emul_unplug(char *arg)
> > > > +{
> > > > +       char *p, *q;
> > > > +
> > > > +       for (p = arg; p; p = q) {
> > > > +               q = strchr(arg, ',');
> > > > +               if (q)
> > > > +                       *q++ = '\0';
> > > > +               if (!strcmp(p, "all"))
> > > > +                       xen_emul_unplug |= XEN_UNPLUG_ALL;
> > > 
> > > strncmp..
> > > 
> > 
> > is it really needed considering that we know that both strings are NULL
> > terminated and one of them is a constant?
> 
> Please do.
> 

all right


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