[libvirt] [PATCH] esx: Report an error for invalid arguments in esxList(Defined)Domains

--- src/esx/esx_driver.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 888ac10..eb06555 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -964,7 +964,8 @@ esxListDomains(virConnectPtr conn, int *ids, int maxids) int count = 0; if (ids == NULL || maxids < 0) { - goto failure; + ESX_ERROR(VIR_ERR_INVALID_ARG, "%s", _("Invalid arguemnt")); + return -1; } if (maxids == 0) { @@ -2255,7 +2256,8 @@ esxListDefinedDomains(virConnectPtr conn, char **const names, int maxnames) int i; if (names == NULL || maxnames < 0) { - goto failure; + ESX_ERROR(VIR_ERR_INVALID_ARG, "%s", _("Invalid arguemnt")); + return -1; } if (maxnames == 0) { -- 1.6.3.3

On Wed, Apr 07, 2010 at 11:55:41AM +0200, Matthias Bolte wrote:
--- src/esx/esx_driver.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 888ac10..eb06555 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -964,7 +964,8 @@ esxListDomains(virConnectPtr conn, int *ids, int maxids) int count = 0;
if (ids == NULL || maxids < 0) { - goto failure; + ESX_ERROR(VIR_ERR_INVALID_ARG, "%s", _("Invalid arguemnt")); + return -1; }
if (maxids == 0) { @@ -2255,7 +2256,8 @@ esxListDefinedDomains(virConnectPtr conn, char **const names, int maxnames) int i;
if (names == NULL || maxnames < 0) { - goto failure; + ESX_ERROR(VIR_ERR_INVALID_ARG, "%s", _("Invalid arguemnt")); + return -1; }
if (maxnames == 0) {
Looks fine, ACK Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

2010/4/7 Daniel Veillard <veillard@redhat.com>:
On Wed, Apr 07, 2010 at 11:55:41AM +0200, Matthias Bolte wrote:
--- src/esx/esx_driver.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 888ac10..eb06555 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -964,7 +964,8 @@ esxListDomains(virConnectPtr conn, int *ids, int maxids) int count = 0;
if (ids == NULL || maxids < 0) { - goto failure; + ESX_ERROR(VIR_ERR_INVALID_ARG, "%s", _("Invalid arguemnt")); + return -1; }
if (maxids == 0) { @@ -2255,7 +2256,8 @@ esxListDefinedDomains(virConnectPtr conn, char **const names, int maxnames) int i;
if (names == NULL || maxnames < 0) { - goto failure; + ESX_ERROR(VIR_ERR_INVALID_ARG, "%s", _("Invalid arguemnt")); + return -1; }
if (maxnames == 0) {
Looks fine, ACK
Daniel
There is a arguemnt vs argument typo. I've fixed it and pushed, thanks. Matthias
participants (2)
-
Daniel Veillard
-
Matthias Bolte