[libvirt] [PATCH] vsh: Using vshError rather than virReportError
Madhu Pavan
kmp at linux.vnet.ibm.com
Tue Oct 18 17:25:16 UTC 2016
On 10/18/2016 07:33 PM, Peter Krempa wrote:
> On Tue, Oct 18, 2016 at 07:39:16 -0400, Kothapally Madhu Pavan wrote:
>> Correcting the error reporting method by using vshError
>> instead of virReportError
>>
>> Signed-off-by: Kothapally Madhu Pavan <kmp at linux.vnet.ibm.com>
>> ---
>> tools/virsh-domain.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
>> index 050e7fb..c9fabf2 100644
>> --- a/tools/virsh-domain.c
>> +++ b/tools/virsh-domain.c
>> @@ -10475,9 +10475,9 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd)
>>
>> if (vshCommandOptBool(cmd, "postcopy-after-precopy")) {
>> if (!vshCommandOptBool(cmd, "postcopy")) {
>> - virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
>> - _("--postcopy-after-precopy can only be used with "
>> - "--postcopy"));
>> + vshError(ctl, "%s",
>> + _("argument unsupported: --postcopy-after-precopy can only "
>> + "be used with --postcopy"));
>> goto cleanup;
> I think the above code can be avoided by simply using
> VSH_REQUIRE_OPTION.
Yes, it can be avoided by using VSH_REQUIRE_OPTION. Sending a new patch.
Thanks,
Madhu Pavan.
More information about the libvir-list
mailing list