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] issue in unplug qemu PCI devices

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] issue in unplug qemu PCI devices
From: Edwin Zhai <edwin.zhai@xxxxxxxxx>
Date: Wed, 17 Feb 2010 18:04:38 +0800
Cc: Xen Developers <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Delivery-date: Wed, 17 Feb 2010 02:07:36 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=L2oi7e0ppAycQEHU6a6RNi6wgvOS1HDM1P9uzS62wX0=; b=Ru9VP/6kH+/N2IFn4Ln7c147AC55J3a1/4YYTspBHT/5n3y5885k2tlcpOhRyuWc7t EsAVT7go8r1ekIFlbOuW/nNa/QmsSzciBH8Cr52Xpm53mF+J2Xp9ghEmw8vatHpibQQM uXBK8jQUxWUusejzuMzk4SNAj/CZzSgTpwgWA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=mNkTwAkrVCpN0EQBuOQDO4MaMNtFljvQHZPPYrhrVaCQYsqp0lX10jcERJOmm9b+0q CNN+DT2lxbQREuW/dkwBAXqfF6FGgmknx5KI4tBRVV7WO9sRUHILMV9YM1yrEwPTIxZ0 hI62vKn5RlyhwVDS4VbHHTXUAw4b92bqK5i0M=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1002121606100.1147@kaball-desktop>
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: <4B7515D9.7060407@xxxxxxxxx> <alpine.DEB.2.00.1002121606100.1147@kaball-desktop>
Reply-to: edwin.zhai@xxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Stefano,
Thanks for your fix. I'm in leave now and will have a test after back.
BTW, do you think we need fix issue 2? You know some OSV will install
and load the platform_pci module in guest by default. If end user
doesn't config valid PV device in config file, guest would crash after
unplugging emulated device. Is it necessary that we check if having a
valid backend in xenstore before unplug related emulated device?

Thanks,


On Sat, Feb 13, 2010 at 1:14 AM, Stefano Stabellini
<stefano.stabellini@xxxxxxxxxxxxx> wrote:
> On Fri, 12 Feb 2010, Zhai, Edwin wrote:
>> BTW, the unplug logic itself has some issues also:
>> 1. Pass-through NICs are also unplugged, although them have different
>> path with vnif and emulated NIC.
>> 2. Unplug happens as long as inserting the xen_platform_pci module
>> regardless of existence of PVed device in the config file. End user
>> likely to unplug all the PCI device by accident.
>> 3. Inserting xen_platform_pci module would unplug all the devices, which
>> is not reasonable. E.g. end user only has vbd driver, but all NICs are
>> also unplugged.
>>
>
> You are right, that is a bug and this patch should fix it.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
>
> ---
>
> diff --git a/hw/pci.c b/hw/pci.c
> index d7c516e..01eff8d 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -826,7 +826,8 @@ void pci_unplug_netifs(void)
>            dev = bus->devices[x];
>            if (dev &&
>                dev->config[0xa] == 0 &&
> -               dev->config[0xb] == 2) {
> +               dev->config[0xb] == 2 &&
> +               test_pci_slot(x >> 3) != 1) {
>                /* Found a netif.  Remove it from the bus.  Note that
>                   we don't free it here, since there could still be
>                   references to it floating around.  There are only
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>



-- 
Best Rgds
Zhai Edwin

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