[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] error when pass through device to guest with qemu-xen-dir-remote
Anthony PERARD wrote on 2012-09-19: > On Wed, Sep 19, 2012 at 1:06 AM, Zhang, Yang Z <yang.z.zhang@xxxxxxxxx> > 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. No. Old logic will unplug the passthrough device which mask as invalid. And this patch just ignores all passthrough device. I wonder whether this change will impact other part? If not, it should be ok. > 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 Best regards, Yang _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |