From: Anthony PERARD <anthony.perard@citrix.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>
Cc: xen-devel <xen-devel@lists.xen.org>,
Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
"Shan, Haitao" <haitao.shan@intel.com>,
"Zhou, Chao" <chao.zhou@intel.com>,
Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: error when pass through device to guest with qemu-xen-dir-remote
Date: Tue, 18 Sep 2012 11:49:51 +0100 [thread overview]
Message-ID: <505851CF.2090000@citrix.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E258EF6@SHSMSX101.ccr.corp.intel.com>
On 09/18/2012 01:46 AM, Zhang, Yang Z wrote:
> Zhang, Yang Z wrote on 2012-09-11:
>> wrote on August 09, 2012 2:49 PM To: Ian Campbell; Stefano Stabellini:
>>> I rebuild the upstream QEMU according to the wiki, but device static
>>> assignment doesn't work, no lspci output in guest. However hotplug &
>>> unplug works fine.
>>>
>>> -----Original Message----- From: xen-devel-bounces@lists.xen.org
>>> [mailto:xen-devel-bounces@lists.xen.org] On Behalf Of Ian Campbell Sent:
>>> Friday, August 03, 2012 6:36 PM To: Stefano Stabellini Cc: Zhang, Yang
>>> Z; Anthony Perard; xen-devel Subject: Re: [Xen-devel] error when pass
>>> through device to guest with qemu-xen-dir-remote
>>>
>>> On Fri, 2012-08-03 at 11:29 +0100, Stefano Stabellini wrote:
>>>> On Fri, 3 Aug 2012, Zhang, Yang Z wrote:
>>>>> When create guest with device assigned, it shows the error and the
>>>>> device wasn't able to work inside guest: libxl: error:
>>>>> libxl_qmp.c:288:qmp_handle_error_response: received an error message
>>>>> from QMP server: Parameter 'driver' expects a driver name
>>>>>
>>>>> It only fails with qemu-xen-dir-remote(Is this tree more close to
>>>>> upstream qemu?). I don't see the error with the traditional Qemu. I
>>>>> also tried qemu-upstream, but it fails when I try to enable pci
>>>>> pass-through
>>> for xen. I think Anthony's patch to add pci pass-through support for Xen is
>>> accepted by qemu-upstream, am I right?
>>>>
>>>> Yes, it was accepted, but it is present only in upstream QEMU (from
>>>> git://git.qemu.org/qemu.git), not the tree we are currently using in
>>>> xen-unstable for development
>>>> (git://xenbits.xensource.com/qemu-upstream-unstable.git).
>>>> Make sure you are using the right tree!
>>>
>>> http://wiki.xen.org/wiki/QEMU_Upstream has some notes on how to use the
>>> upstream qemu tree instead of our stable branch of upstream.
>>>
>>>>
>>>> Anthony is currently on vacation and is going to be back in about a
>>>> week.
>>>>
>>>>> Another question:
>>>>> Now I am trying to add some features (relevant to pass through device) to
>>> Qemu, which tree should I use? Since traditional qemu is great
>>> different from qemu-upstream, it is too old to develop patch base on
>>> it. But besides the old one, I cannot find a working qemu.
>>>>
>>>> You should use upstream QEMU, I am going to rebase our tree on that
>>>> early on in the 4.3 release cycle.
>>
>> Hi Anthony
>>
>> I found the issue is caused by PV driver. Since RHEL6 integrated PV driver by
>> default, when booting rhel6 as guest, it will load the PV driver and write the xen
>> platform device to notify qemu to unplug all NICs including the pass through
>> device. This definitely is wrong. We only need to unplug the emulator device, and
>> leave pass through device.
>
> Hi Anthony,
>
> Any comments for this?
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);
}
}
Thanks,
--
Anthony PERARD
next prev parent reply other threads:[~2012-09-18 10:49 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 [this message]
2012-09-19 0:06 ` Zhang, Yang Z
2012-09-19 10:38 ` Anthony PERARD
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=505851CF.2090000@citrix.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.