xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Edwin Zhai <edwin.zhai@intel.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Xen Developers <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Keir Fraser <Keir.Fraser@eu.citrix.com>
Subject: Re: issue in unplug qemu PCI devices
Date: Wed, 17 Feb 2010 18:04:38 +0800	[thread overview]
Message-ID: <f53cd79a1002170204y7c90cf30l757f1d7a7d382190@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1002121606100.1147@kaball-desktop>

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@eu.citrix.com> 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@eu.citrix.com>
>
> ---
>
> 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@lists.xensource.com
> http://lists.xensource.com/xen-devel
>



-- 
Best Rgds
Zhai Edwin

  parent reply	other threads:[~2010-02-17 10:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12  8:48 issue in unplug qemu PCI devices Zhai, Edwin
2010-02-12 17:14 ` Stefano Stabellini
2010-02-12 21:57   ` Ky Srinivasan
2010-02-15 14:10   ` Ian Jackson
2010-02-15 14:14     ` Stefano Stabellini
2010-02-17 10:04   ` Edwin Zhai [this message]
2010-02-17 11:08     ` Stefano Stabellini
2010-02-21  0:09       ` Zhai, Edwin
2010-02-15 14:07 ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f53cd79a1002170204y7c90cf30l757f1d7a7d382190@mail.gmail.com \
    --to=edwin.zhai@intel.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=Keir.Fraser@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).