[libvirt] [PATCHv2] virsh: fix no error output when parse cpulist fail
Michal Privoznik
mprivozn at redhat.com
Thu May 14 12:33:06 UTC 2015
On 11.05.2015 10:25, Luyao Huang wrote:
> When we pass a invalid cpulist or the lastcpu in the
> cpulist exceed the maxcpu, we cannot get any error.
> like this:
>
> # virsh vcpupin test3 1 aaa
>
> # virsh vcpupin test3 1 1000
>
> Because virBitmapParse() use virReportError() to set
> the error message, vshCommandRun would output the error
> in vshReportError, but in the meantime it is overwriten
> by the virResetLastError in virDomainFree. If we want use
> the error which set by virReportError(), we need vshSaveLibvirtError
> to help us. However the error from virBitmap is not clearly
> enough, i chose use vshError to output error when parse failed.
>
> Signed-off-by: Luyao Huang <lhuang at redhat.com>
> ---
> v2:
> Add the check in vshParseCPUList, because this will make
> get last cpu more easier when the cpulist is a bitmap.
>
> tools/virsh-domain.c | 21 +++++++++++++++------
> 1 file changed, 15 insertions(+), 6 deletions(-)
Reworded the commit message a bit, ACKed and pushed.
Michal
More information about the libvir-list
mailing list