[libvirt] [PATCH 2/7] virsh-domain: Adapt to new error reporting

Michal Privoznik mprivozn at redhat.com
Fri Apr 4 13:09:31 UTC 2014


On 04.04.2014 11:12, Ján Tomko wrote:
> On 04/02/2014 02:43 PM, Michal Privoznik wrote:
>> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>> ---
>>   tests/vcpupin        |  1 -
>>   tools/virsh-domain.c | 75 +++++++++++++++++-----------------------------------
>>   2 files changed, 24 insertions(+), 52 deletions(-)
>>
>> diff --git a/tests/vcpupin b/tests/vcpupin
>> index a616216..638f62b 100755
>> --- a/tests/vcpupin
>> +++ b/tests/vcpupin
>> @@ -35,7 +35,6 @@ $abs_top_builddir/tools/virsh --connect test:///default vcpupin test a 0,1 > out
>>   test $? = 1 || fail=1
>>   cat <<\EOF > exp || fail=1
>>   error: Unable to parse integer parameter to --vcpu
>> -error: vcpupin: Invalid or missing vCPU number.
>>
>>   EOF
>>   compare exp out || fail=1
>> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
>> index 73414f8..6e1eb17 100644
>> --- a/tools/virsh-domain.c
>> +++ b/tools/virsh-domain.c
>> @@ -1120,7 +1120,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
>>           goto cleanup;
>>
>>       if ((rv = vshCommandOptULongLong(cmd, "total-bytes-sec", &value)) < 0) {
>> -        goto interror;
>> +        goto error;
>>       } else if (rv > 0) {
>>           if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
>>                                       VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC,
>> @@ -1129,7 +1129,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
>>       }
>>
>>       if ((rv = vshCommandOptULongLong(cmd, "read-bytes-sec", &value)) < 0) {
>> -        goto interror;
>> +        goto error;
>>       } else if (rv > 0) {
>>           if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
>>                                       VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC,
>> @@ -1138,7 +1138,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
>>       }
>>
>>       if ((rv = vshCommandOptULongLong(cmd, "write-bytes-sec", &value)) < 0) {
>> -        goto interror;
>> +        goto error;
>>       } else if (rv > 0) {
>>           if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
>>                                       VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC,
>> @@ -1147,7 +1147,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
>>       }
>>
>>       if ((rv = vshCommandOptULongLong(cmd, "total-iops-sec", &value)) < 0) {
>> -        goto interror;
>> +        goto error;
>>       } else if (rv > 0) {
>>           if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
>>                                       VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC,
>> @@ -1156,7 +1156,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
>>       }
>>
>>       if ((rv = vshCommandOptULongLong(cmd, "read-iops-sec", &value)) < 0) {
>> -        goto interror;
>> +        goto error;
>>       } else if (rv > 0) {
>>           if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
>>                                       VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC,
>> @@ -1165,7 +1165,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
>>       }
>>
>>       if ((rv = vshCommandOptULongLong(cmd, "write-iops-sec", &value)) < 0) {
>> -        goto interror;
>> +        goto error;
>>       } else if (rv > 0) {
>>           if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
>>                                       VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC,
>> @@ -1216,10 +1216,6 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
>>    error:
>>       vshError(ctl, "%s", _("Unable to change block I/O throttle"));
>>       goto cleanup;
>> -
>> - interror:
>> -    vshError(ctl, "%s", _("Unable to parse integer parameter"));
>> -    goto cleanup;
>>   }
>>
>
> These should jump to cleanup, not error.

Oh right, I've misread the label under interror. Since you're requesting 
the function signature change in 1/7 I'll post v2. However, this time 
it's going to be a single patch.

Michal




More information about the libvir-list mailing list