[libvirt] [PATCHv2 2/9] phyp: avoid a logic bug
Matthias Bolte
matthias.bolte at googlemail.com
Fri Apr 15 20:09:48 UTC 2011
2011/4/14 Eric Blake <eblake at redhat.com>:
> Ever since commit ebc46f, the destroy function built two command
> variants but only used one. I went with the variant that matches
> the idiom used in the counterpart of phypBuildStoragePool.
>
> * src/phyp/phyp_driver.c (phypDestroyStoragePool): Avoid
> clobbering cmd. Fix error message typo.
> ---
> src/phyp/phyp_driver.c | 11 +----------
> 1 files changed, 1 insertions(+), 10 deletions(-)
>
> diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
> index 5742d95..7aa494d 100644
> --- a/src/phyp/phyp_driver.c
> +++ b/src/phyp/phyp_driver.c
> @@ -2936,19 +2936,10 @@ phypDestroyStoragePool(virStoragePoolPtr pool)
> return -1;
> }
> cmd = virBufferContentAndReset(&buf);
> -
> - if (virAsprintf(&cmd,
> - "viosvrcmd -m %s --id %d -c "
> - "'rmsp %s'", managed_system, vios_id,
> - pool->name) < 0) {
> - virReportOOMError();
> - goto cleanup;
> - }
> -
> ret = phypExec(session, cmd, &exit_status, conn);
>
> if (exit_status < 0) {
> - VIR_ERROR(_("Unable to create Storage Pool: %s"), ret);
> + VIR_ERROR(_("Unable to destroy Storage Pool: %s"), ret);
> goto cleanup;
> }
I just noticed that the driver uses VIR_ERROR in many places where
PHYP_ERROR should be used to report an actual libvirt API level error.
But that a problem for another patch.
ACK, to this one.
Matthias
More information about the libvir-list
mailing list