
On Tue, Dec 15, 2009 at 06:30:30PM +0100, Wolfgang Mauerer wrote:
Hi,
Daniel P. Berrange wrote:
From: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
This patch allows for explicit hotplug/unplug of SCSI controllers. Ordinarily this is not required, since QEMU/libvirt will attach a new SCSI controller whenever one is required. Allowing explicit hotplug of controllers though, enables the caller to specify a static PCI address, instead of auto-assigning the next available PCI slot. Or it will when we have static PCI addressing.
This patch is derived from Wolfgang Mauerer's disk controller patch series.
* src/qemu/qemu_driver.c: Support hotplug & unplug of SCSI controllers * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h, src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add new API for attaching PCI SCSI controllers (...) +int qemuMonitorTextAttachPCIDiskController(qemuMonitorPtr mon, + const char *bus, + virDomainDevicePCIAddress *guestAddr) +{ + char *cmd = NULL; + char *reply = NULL; + int tryOldSyntax = 0; + int ret = -1; + +try_command: + if (virAsprintf(&cmd, "pci_add %s storage if=%s", + (tryOldSyntax ? "0": "pci_addr=auto"), bus) < 0) { + virReportOOMError(NULL); + goto cleanup; + }
I just realised that qemu-kvm HEAD prohibits adding empty SCSI controllers currently, they consider this to be a bug. I've asked to revert the corresponding patch on qemu-devel, but if this does not happen, we will need to devise some other mechanism.
I posted a patch to QEMU last week for that too and they accepted it but it hasn't been merged for some reason Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|