[libvirt] problem in pciFindStubDriver

For Xen PV guests, pciback is the only working driver, pci-stub doesn't work. Current function finds pci-stub driver first, if pci-stub doesn't exist, find pciback. It won't work for Xen PV guests since it will find pci-stub driver and return, but in fact it needs pciback. One way is to prefer pciback rather than pci-stub like in following patch. But that will change the behaviour of other drivers too. Is there any preferred aprroach to handle this? diff --git a/src/util/virpci.c b/src/util/virpci.c index 5971764..c0a1c05 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -861,22 +861,22 @@ pciFindStubDriver(void) int probed = 0; recheck: - if (pciDriverDir(&drvpath, "pci-stub") < 0) { + if (pciDriverDir(&drvpath, "pciback") < 0) { return NULL; } if (virFileExists(drvpath)) { VIR_FREE(drvpath); - return "pci-stub"; + return "pciback"; } - if (pciDriverDir(&drvpath, "pciback") < 0) { + if (pciDriverDir(&drvpath, "pci-stub") < 0) { return NULL; } if (virFileExists(drvpath)) { VIR_FREE(drvpath); - return "pciback"; + return "pci-stub"; } VIR_FREE(drvpath);

On Fri, Jan 04, 2013 at 10:22:09AM +0800, Chunyan Liu wrote:
For Xen PV guests, pciback is the only working driver, pci-stub doesn't work. Current function finds pci-stub driver first, if pci-stub doesn't exist, find pciback. It won't work for Xen PV guests since it will find pci-stub driver and return, but in fact it needs pciback.
One way is to prefer pciback rather than pci-stub like in following patch. But that will change the behaviour of other drivers too. Is there any preferred aprroach to handle this?
Hmm, I wonder if we should let the virt driver simply pass in the name of its desired stub, rather than trying todo magic fallback. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Chunyan Liu
-
Daniel P. Berrange