You need to sign in or sign up before continuing.
  • E
    xen: make direct call when there is only one subdriver · a1e641a5
    Eric Blake 提交于
    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.
    a1e641a5
xen_driver.c 66.9 KB