All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"Shan, Haitao" <haitao.shan@intel.com>,
	"Zhou, Chao" <chao.zhou@intel.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: error when pass through device to guest with qemu-xen-dir-remote
Date: Wed, 19 Sep 2012 11:38:44 +0100	[thread overview]
Message-ID: <CAJJyHjLH38r-r+cTmPprMj4trU8eZpQrfp4ypBzdsmZHSL9BMw@mail.gmail.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E25BB14@SHSMSX101.ccr.corp.intel.com>

On Wed, Sep 19, 2012 at 1:06 AM, Zhang, Yang Z <yang.z.zhang@intel.com> wrote:
> Anthony PERARD wrote on 2012-09-18:
>>
>> Hi,
>>
>> So, we'll have to add a check in the unplug code of qemu to ignore
>> passthrough devices.
>>
>> Here is a patches, I did not test it.
>>
>> diff --git a/hw/xen_platform.c b/hw/xen_platform.c
>> index 0d6c2ff..2d3978e 100644
>> --- a/hw/xen_platform.c
>> +++ b/hw/xen_platform.c
>> @@ -85,8 +85,10 @@ static void log_writeb ...
>>
>>   static void unplug_nic(PCIBus *b, PCIDevice *d, void *o)
>>   {
>> +    /* We have to ignore passthrough devices */
>>       if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
>> -            PCI_CLASS_NETWORK_ETHERNET) {
>> +            PCI_CLASS_NETWORK_ETHERNET
>> +        && strcmp(d->name, "xen-pci-passthrough") != 0) {
>>           qdev_free(&d->qdev);
>>       }
>>   }
>
> In old qemu, we will free the invalid NIC through this function. And it will fail w/ your change. Shouldn't we follow the old logic?

I don't understand. Are you arguing this patch or the function it self?

My change is fine and follow the old logic: do not do anything for a
passthrough device.

I now have tested the change, and QEMU work as espected, it will
unplug the emulated NIC, and ignore any passthrough devices. So the
guest can the passthroughed NIC.

Thanks,

-- 
Anthony PERARD

  reply	other threads:[~2012-09-19 10:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03  2:59 error when pass through device to guest with qemu-xen-dir-remote Zhang, Yang Z
2012-08-03 10:29 ` Stefano Stabellini
2012-08-03 10:36   ` Ian Campbell
2012-08-09  6:49     ` Zhou, Chao
2012-08-14  1:17       ` Zhang, Yang Z
2012-08-22  5:56         ` Shan, Haitao
2012-08-22 10:54           ` Anthony PERARD
2012-08-27  3:03       ` Zhou, Chao
2012-09-11  7:49         ` Zhang, Yang Z
2012-09-18  0:46         ` Zhang, Yang Z
2012-09-18 10:49           ` Anthony PERARD
2012-09-19  0:06             ` Zhang, Yang Z
2012-09-19 10:38               ` Anthony PERARD [this message]
2012-09-19 23:30                 ` Zhang, Yang Z
2012-09-20 10:56                   ` Anthony PERARD

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=CAJJyHjLH38r-r+cTmPprMj4trU8eZpQrfp4ypBzdsmZHSL9BMw@mail.gmail.com \
    --to=anthony.perard@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=chao.zhou@intel.com \
    --cc=haitao.shan@intel.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yang.z.zhang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.