<div dir="ltr">Hi All, <div><br></div><div>I am exploring how to go about supporting multi-function hot-plug/unplug support from libvirt now that Qemu has enabled it.</div><div><br></div><div>The Qemu semantics is that, qemu queues the notification to guest until function 0 is hot-</div><div>plugged and on function 0 hot-plug, all the previously added devices in the slot are</div><div>notified to the guest.</div><div>For hot-unplug - On x86, unplug of any device in the slot would unplug all the functions of</div><div>the slot. On PPC, unplug all non-zero functions first, then unplug the function zero which</div><div>triggers the unplug of all the functions in the slot.</div><div><br></div><div>On Libvirt, I had a brief chat with Laine Stump on IRC and we "think" the below semantics</div><div>would be appropriate.<br></div><div>1) Change the virDomainAttachDeviceFlags() to recognize multiple devices in the XML</div><div>and the application should make one call to attach all the functions for the slot at one</div><div>time.</div><div>2) The libvirt qemu driver to translate this into multiple attach device commands to qemu</div><div>with the final operation being for function 0.</div><div>3) The XML now needs to accept multiple devices and there is a need for single parent </div><div>element. I am thinking if we should have all devices to be enclosed in <device></device> </div><div>parent element. Note that this is only when all the devices should go to the same slot. We</div><div>probably should disallow user attempting to hot-plug to different slots with this.</div><div>4) For the hot-unplug, the application to send all the devices the same way enclosed in </div><div><device></devices> and libvirt to go ahead with unplug only if all the devices are </div><div>specified in the XML for the slot.</div><div><br></div><div>Want to know if you foresee any problem with using <device></device> semantics Or you</div><div>have any different approach/suggestions. Any comments greatly appreciated.</div><div><br></div><div>Thanks and Regards,</div><div>Shivaprasad</div></div>