On 25.06.2014 19:22, Ján Tomko wrote:
Over-engineered to allow non-contiguous indexes. Free ports of a controller are stored in a virBitmap. These bitmaps are stored in a hash table, indexed by the controller index formatted as a string. Buses are ignored for now, QEMU doesn't seem to support anything else than .0 For virtconsoles, addresses are reserved silently, since we don't put those in the XML, but they occupy virtio-serial ports. Missing: auto-adding controllers when all ports are occupied Fixes https://bugzilla.redhat.com/show_bug.cgi?id=890606 Paritally fixes https://bugzilla.redhat.com/show_bug.cgi?id=1076708 --- RFC, since it hashes the string of an integer.
Yeah, out hash tables require pointers, and we don't like to see an integer taken as a pointer...
However, I like the idea (I mean the whole idea).
src/conf/domain_addr.c | 426 +++++++++++++++++++++ src/conf/domain_addr.h | 49 +++ src/conf/domain_conf.c | 30 -- src/libvirt_private.syms | 9 + src/qemu/qemu_command.c | 61 +++ src/qemu/qemu_domain.c | 1 + src/qemu/qemu_domain.h | 1 + src/qemu/qemu_hotplug.c | 31 +- tests/qemuhotplugtest.c | 2 +- .../qemuxml2argv-channel-virtio-auto.args | 8 +- .../qemuxml2argv-channel-virtio-autoassign.args | 10 +- .../qemuxml2xmlout-channel-virtio-auto.xml | 10 +- 12 files changed, 591 insertions(+), 47 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 9cd6a3e..6e4c456 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -367,6 +367,7 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver, char *devstr = NULL; qemuDomainObjPrivatePtr priv = vm->privateData; bool releaseaddr = false; + bool needs_remove = false;;
s/;;/;/
if (virDomainControllerFind(vm->def, controller->type, controller->idx) >= 0) { virReportError(VIR_ERR_OPERATION_FAILED,
I'd say ACK but since this is an RFC I let others to chime in. Michal -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list