[libvirt] [PATCH] esx: Fix and improve esxListAllDomains function

Matthias Bolte matthias.bolte at googlemail.com
Sun Sep 9 15:57:51 UTC 2012


2012/9/9 Matthias Bolte <matthias.bolte at googlemail.com>:
> Avoid requesting information such as identity or power state when it
> is not necessary.
>
> Lookup virtual machine list with the required fields (configStatus,
> name, and config.uuid) to make esxVI_GetVirtualMachineIdentity work.
>
> No need to call esxVI_GetNumberOfSnapshotTrees. rootSnapshotTreeList
> can be tested for emptiness by checking it for NULL.
>
> esxVI_LookupRootSnapshotTreeList already does the error reporting,
> don't overwrite it.
>
> Check if autostart is enabled at all before looking up the individual
> autostart setting of a virtual machine.
>
> Reorder VIR_EXPAND_N(doms, ndoms, 1) to avoid leaking the result of
> the call to virGetDomain if VIR_EXPAND_N fails.
>
> If virGetDomain fails it already reports an error, don't overwrite it
> with an OOM error.
>
> All items in doms up to the count-th one are valid, no need to double
> check before freeing them.
>
> Finally, don't leak autoStartDefaults and powerInfoList.
> ---
>  src/esx/esx_driver.c |  116 ++++++++++++++++++++++++++++++++-----------------
>  1 files changed, 76 insertions(+), 40 deletions(-)

I replaced this patch by this one

https://www.redhat.com/archives/libvir-list/2012-September/msg00486.html

-- 
Matthias Bolte
http://photron.blogspot.com




More information about the libvir-list mailing list