[libvirt] [PATCH] esx: Fix esxVI_BuildSelectSet's invalid argument check

The check was altered in 8c48743b9737ad4d246ab6043fd299316f9a2091 and got too strict, I've no clue how that snuck in. This check makes every try to open a connection using the ESX driver fail with an invalid argument error. Revert the change to the check and add a comment to prevent future mistakes with this check. --- src/esx/esx_vi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index 1c6f6ff..2359e8f 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -1390,7 +1390,11 @@ esxVI_BuildSelectSet(esxVI_SelectionSpec **selectSet, esxVI_SelectionSpec *selectionSpec = NULL; const char *currentSelectSetName = NULL; - if (selectSet == NULL || *selectSet != NULL) { + if (selectSet == NULL) { + /* + * Don't check for *selectSet != NULL here because selectSet is a list + * and might contain items already. This function appends to selectSet. + */ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); return -1; } -- 1.7.0.4

On 08/26/2010 04:10 PM, Matthias Bolte wrote:
The check was altered in 8c48743b9737ad4d246ab6043fd299316f9a2091 and got too strict, I've no clue how that snuck in. This check makes every try to open a connection using the ESX driver fail with an invalid argument error.
Revert the change to the check and add a comment to prevent future mistakes with this check.
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2010/8/27 Eric Blake <eblake@redhat.com>:
On 08/26/2010 04:10 PM, Matthias Bolte wrote:
The check was altered in 8c48743b9737ad4d246ab6043fd299316f9a2091 and got too strict, I've no clue how that snuck in. This check makes every try to open a connection using the ESX driver fail with an invalid argument error.
Revert the change to the check and add a comment to prevent future mistakes with this check.
ACK.
Thanks, pushed. Matthias
participants (2)
-
Eric Blake
-
Matthias Bolte