fix list_domain_details: check config data length=0
authorChunyan Liu <cyliu@suse.com>
Wed, 23 Jul 2014 09:42:09 +0000 (17:42 +0800)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 24 Jul 2014 15:23:19 +0000 (16:23 +0100)
commitef8cf0d4902c90595a0b0766e2a9a6ecbcbc4581
tree3e7d9f7c0ad972957129d809056314f40f16c341
parente40f01f4d5181feb7e280410bf9bf05e8301279a
fix list_domain_details: check config data length=0

If domain is created through virsh, then in xl, one could see it
with 'xl list', but with 'xl list --long domU', it reports:
"Domain name must be specified."
The reason is xl config data does not exist but it still tries
to parse_config_data in current code.

Improve list_domain_details:
If len of config data is 0, just pass, do not go forward to
parse_config_data, otherwise, it will meet error like
"Domain name not specified" and exit. This error is not expected,
since if code enters list_domain_details, domain name validness
is already checked and domain does exist.

Length of config data is 0 may means: config data does not exist due
to some reason, like: domain is created by libvirt, or in destroying
domain process config data is cleared but domain fails to clean up.
No matter in which case, list_domain_details could just show empty
info, but not error like "Domain name not specified".

Signed-off-by: Chunyan Liu <cyliu@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c