[Libvir] [PATCH] Another Report error in virsh.c code.

S.Sakamoto fj0588di at aa.jp.fujitsu.com
Tue Mar 11 10:19:57 UTC 2008


> On Tue, Mar 11, 2008 at 05:09:45PM +0900, S.Sakamoto wrote:
> > BTW, I think another message is needed here to inform the internal
> > error to user.
> > For example, the migrate command shows the following message when
> > "desturi" is missing:
> >     migrate: Missing desturi
> > But it does not show the error-message even though "migrateuri"
> > is missing because "migrateuri" is *not* a necessary option.
> 
> I'm not sure I follow what is wrong.  'desturi' is required, so if
> missing we get an error.  'migrateuri' is not required, so there is no
> error if it is missing.  And that's what the code does.
> 
> > So, I want to unify "virsh.c" with the following rules,
> >   - for necessary option
> >     show the message if error occur
> >   - for unnecessary option
> >     do not show the message even if error occur
> 
> Do you have a patch or another way to explain this, because I'm afraid
> I don't follow what you mean.
Sorry, My explanation is not enough...

What I meant to say was that I want to output to output error-message
at "vcpupin" as like "migrate".

I wish it is unified as follows.

***migrate***
2225    desturi = vshCommandOptString (cmd, "desturi", &found);
2226    if (!found) {
2227        vshError (ctl, FALSE, "%s", _("migrate: Missing desturi"));
2228        goto done;
2229    }

***vcpupin***
1731    if (!(cpulist = vshCommandOptString(cmd, "cpulist", NULL))) {
    +       vshError (ctl, FALSE, "%s", _("vcpupin: Missing cpulist"));
1732        virDomainFree(dom);
1733        return FALSE;
1734    }


Shigeki Sakamoto.




More information about the libvir-list mailing list