]> git.ipfire.org Git - thirdparty/libvirt.git/commit
xen: make direct call when there is only one subdriver
authorEric Blake <eblake@redhat.com>
Thu, 21 Jul 2011 21:11:32 +0000 (15:11 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 28 Jul 2011 20:44:45 +0000 (14:44 -0600)
commita1e641a5506d1ddd2767ad3e565679a5a59707de
tree75c39c6186535a121bb585e936dbc0fc17ac7f9d
parent03e5f8bbbfda2d9975eb4122aa30ee78ea6969cf
xen: make direct call when there is only one subdriver

No need to use a for loop if we know there is exactly one client.
Found by:

for f in $(sed -n 's/.*Drv[^ ]* \([^;]*\);.*/\1/p' src/xen/xen_driver.h)
do
  git grep "\(\.\|->\)$f\b" src/xen
done | cat

and looking through the resulting list to see which callback struct
members are used exactly once.  The next patch will ensure that we
don't reintroduce uses of these callbacks.

* src/xen/xen_driver.c (xenUnifiedClose): Call close
unconditionally, to match xenUnifiedOpen.
(xenUnifiedNodeGetInfo, xenUnifiedDomainCreateXML)
(xenUnifiedDomainSave, xenUnifiedDomainRestore)
(xenUnifiedDomainCoreDump, xenUnifiedDomainUpdateDeviceFlags):
Make direct call to lone implementation.
* src/xen/xend_internal.h (xenDaemonDomainCoreDump)
(xenDaemonUpdateDeviceFlags, xenDaemonCreateXML): Add prototypes.
* src/xen/xend_internal.c (xenDaemonDomainCoreDump)
(xenDaemonUpdateDeviceFlags, xenDaemonCreateXML): Export.
src/xen/xen_driver.c
src/xen/xen_driver.h
src/xen/xend_internal.c
src/xen/xend_internal.h