Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.3
-
CentOS 6.3
Description
Using the libvirt module, vcld executes `virsh list --all` on a vmhost, which results in the following output
Id Name State
----------------------------------------------------
19 VM1 running
(Note: This bug reporting system seems to be trimming extra spaces from the above output.)
The name of the VM ("VM1") is then extracted as " VM1", and the command `virsh dumpxml " VM1"` fails.
From looking at libvirt.pm's get_domain_info function, it looks like the expectation is that there will only be one space between the id and name columns:
my ($id, $name, $state) = $line =~ /^\s*([\d\-])\s(.?)\s+(\w+|shut off)$/g;
I have worked around this issue by adding a '+' after the \s between id and name
my ($id, $name, $state) = $line =~ /^\s*([\d\-])\s(.?)\s(\w+|shut off)$/g;