[libvirt] [PATCH 10/10] Move QEMU hotplug helper code out of the QEMU driver

Eric Blake eblake at redhat.com
Thu Dec 16 21:18:30 UTC 2010


On 12/16/2010 09:50 AM, Daniel P. Berrange wrote:
> The QEMU driver file is far too large. Move all the hotplug
> helper code out into a separate file. No functional change.
> 
> * src/qemu/qemu_hotplug.c, src/qemu/qemu_hotplug.h,
>   src/Makefile.am: Add hotplug helper file
> * src/qemu/qemu_driver.c: Delete hotplug code
> ---
>  src/Makefile.am         |    1 +
>  src/qemu/qemu_driver.c  | 2019 ++++------------------------------------------
>  src/qemu/qemu_hotplug.c | 1711 +++++++++++++++++++++++++++++++++++++++
>  src/qemu/qemu_hotplug.h |  103 +++
>  4 files changed, 1991 insertions(+), 1843 deletions(-)
>  create mode 100644 src/qemu/qemu_hotplug.c
>  create mode 100644 src/qemu/qemu_hotplug.h


> -static int qemudDomainDetachSCSIDiskDevice(struct qemud_driver *driver,
> -                                           virDomainObjPtr vm,
> -                                           virDomainDeviceDefPtr dev,
> -                                           unsigned long long qemuCmdFlags)
> +static int qemudDomainAttachDevice(virDomainPtr dom,
> +                                   const char *xml)
>  {
> -    int i, ret = -1;
> -    virDomainDiskDefPtr detach = NULL;
> -    qemuDomainObjPrivatePtr priv = vm->privateData;
> +    struct qemud_driver *driver = dom->conn->privateData;
> +    virDomainObjPtr vm;
> +    virDomainDeviceDefPtr dev = NULL;
> +    unsigned long long qemuCmdFlags;

Oh gross. git botched that diff, making this area of the patch harder to
review than any of the prior patches.  (Possibly because of the renames
from qemud to qemu?).  But even with that munging, the overall result
looks good to me.


> +int qemudDomainAttachHostDevice(struct qemud_driver *driver,
> +                                virDomainObjPtr vm,
> +                                virDomainHostdevDefPtr hostdev,
> +                                unsigned long long qemuCmdFlags);
> +int qemuDomainChangeGraphics(struct qemud_driver *driver,
> +                             virDomainObjPtr vm,
> +                             virDomainGraphicsDefPtr dev);

So, given that some, but not all, of the functions in this file start
with qemudDomain, should we change them to all be qemuDomain?  Or maybe
separate the move and the rename into two separate patches, so that git
diff won't botch it so badly?

At any rate, ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101216/ebd73f39/attachment-0001.sig>


More information about the libvir-list mailing list