lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1006171900110.3401@kaball-desktop>
Date:	Thu, 17 Jun 2010 19:00:59 +0100
From:	Stefano Stabellini <stefano.stabellini@...citrix.com>
To:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
CC:	Stefano Stabellini <Stefano.Stabellini@...citrix.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"jeremy@...p.org" <jeremy@...p.org>,
	"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
	"ddutile@...hat.com" <ddutile@...hat.com>,
	"sheng@...ux.intel.com" <sheng@...ux.intel.com>
Subject: Re: [Xen-devel] [PATCH 12/12] Unplug emulated disks and nics

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ