fix list_domain_details: check config data length=0
PATCH 1/1 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".
--- tools/libxl/xl_cmdimpl.c | 2 ++ 1 file changed, 2 insertions(+)
tools/libxl/xl_cmdimpl.c +2 -0
@@ -3100,6 +3100,8 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain) rc =libxl_userdata_retrieve (ctx, info[i].domid,"xl" , &data, &len);if (rc)continue ; +if (len ==0 ) +continue ;CHK_SYSCALL (asprintf (&config_source,"<domid %d data>" , info[i].domid));libxl_domain_config_init (&d_config);parse_config_data (config_source, (char *)data, len, &d_config);
Signature · 1 line
1.8.4.5
Quoted 13 lines · Chunyan Liu
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 toparse_config_datain current code.Improve
list_domain_details:
If len of config data is 0, just pass, do not go forward toparse_config_data, otherwise, it will meet error like "Domain name not specified" and exit. This error is not expected, since if code enterslist_domain_details, domain name validness is already checked and domain does exist.
Quoted 7 lines
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_detailscould just show empty info, but not error like "Domain name not specified".Signed-off-by Chunyan Liu <[email protected]>
I think this issue is resolved by Wei's "libxl: synchronise domain configuration" series? That will save state in such a way that xl can list libvirt domains etc.
Ian.
Quoted 20 lines · Ian Campbell
Quoted 19 lines · Chunyan Liu
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 toparse_config_datain current code.Improve
list_domain_details:
If len of config data is 0, just pass, do not go forward toparse_config_data, otherwise, it will meet error like "Domain name not specified" and exit. This error is not expected, since if code enterslist_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_detailscould just show empty info, but not error like "Domain name not specified".
Quoted 6 lines
Quoted 1 line
Signed-off-by Chunyan Liu <[email protected]>I think this issue is resolved by Wei's "libxl: synchronise domain configuration" series? That will save state in such a way that xl can list libvirt domains etc.
If libvirt opt-in to use the new infrasturcture then yes, otherwise no.
So I think we need this patch until libvirt switches to make sure our new feature.
Wei.
Quoted 1 line
Ian.
Quoted 28 lines · Wei Liu
Quoted 20 lines · Ian Campbell
Quoted 19 lines · Chunyan Liu
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 toparse_config_datain current code.Improve
list_domain_details:
If len of config data is 0, just pass, do not go forward toparse_config_data, otherwise, it will meet error like "Domain name not specified" and exit. This error is not expected, since if code enterslist_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_detailscould just show empty info, but not error like "Domain name not specified".Quoted 6 lines
Quoted 1 line
Signed-off-by Chunyan Liu <[email protected]>I think this issue is resolved by Wei's "libxl: synchronise domain configuration" series? That will save state in such a way that xl can list libvirt domains etc.
Quoted 4 lines
If libvirt opt-in to use the new infrasturcture then yes, otherwise no.
So I think we need this patch until libvirt switches to make sure our new feature.
Isn't it all handled transparently inside libxl? At least from the PoV of libvirt creating a domain and xl list showing it?
Ian.
On Wed, Jul 23, 2014 at 11:10:56AM +0100, Ian Campbell wrote:
[...]
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 1 line
Signed-off-by Chunyan Liu <[email protected]>I think this issue is resolved by Wei's "libxl: synchronise domain configuration" series? That will save state in such a way that xl can list libvirt domains etc.
Quoted 8 lines
Quoted 4 lines
If libvirt opt-in to use the new infrasturcture then yes, otherwise no.
So I think we need this patch until libvirt switches to make sure our new feature.
Isn't it all handled transparently inside libxl? At least from the PoV of libvirt creating a domain and xl list showing it?
Yes, you are right.
I misread your message. Sorry.
Wei.
Quoted 2 lines
Ian.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
On 7/23/2014 at 05:53 PM, in message
<[email protected]>, Ian Campbell
Quoted 20 lines · <[email protected]> wrote:
Quoted 19 lines · Chunyan Liu
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 toparse_config_datain current code.Improve
list_domain_details:
If len of config data is 0, just pass, do not go forward toparse_config_data, otherwise, it will meet error like "Domain name not specified" and exit. This error is not expected, since if code enterslist_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_detailscould just show empty info, but not error like "Domain name not specified".
Quoted 5 lines
Quoted 1 line
Signed-off-by Chunyan Liu <[email protected]>I think this issue is resolved by Wei's "libxl: synchronise domain configuration" series? That will save state in such a way that xl can list libvirt domains etc.
Yes, right. I missed Wei's patch series. Just have a look at that, this issue is solved by that patch series. Thanks Wei and Ian!
- Chunyan
Quoted 5 lines
Ian.
Ian Jackson
Acked-byChun Yan Liu writes ("Re: [PATCH] fix list_domain_details: check config data length=0"):
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
On 7/23/2014 at 05:53 PM, in message
<[email protected]>, Ian Campbell
Quoted 3 lines · <[email protected]> wrote:
I think this issue is resolved by Wei's "libxl: synchronise domain configuration" series? That will save state in such a way that xl can list libvirt domains etc.
Yes, right. I missed Wei's patch series. Just have a look at that, this issue is solved by that patch series. Thanks Wei and Ian!
Maybe we should commit Chun's patch to -unstable now so that it can be tested and backported to earlier trees.
It looks like a reasonable change to me:
Ian.
Quoted 8 lines · Ian Jackson
Chun Yan Liu writes ("Re: [PATCH] fix
list_domain_details: check config data length=0"):Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
On 7/23/2014 at 05:53 PM, in message
<[email protected]>, Ian Campbell
Quoted 3 lines · <[email protected]> wrote:
I think this issue is resolved by Wei's "libxl: synchronise domain configuration" series? That will save state in such a way that xl can list libvirt domains etc.
Quoted 5 lines
Quoted 2 lines
Yes, right. I missed Wei's patch series. Just have a look at that, this issue is solved by that patch series. Thanks Wei and Ian!
Maybe we should commit Chun's patch to -unstable now so that it can be tested and backported to earlier trees.
I hadn't realised that libxl_userdata_retrieve signals ENOENT via datalen == 0 rather than an error code. So it could certainly be argued that a zero size userdata is something we should handle irrespective of Wei's series, yes.
Quoted 10 lines
It looks like a reasonable change to me:
Acked-by Ian Jackson <[email protected]>Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Ian Campbell
AppliedQuoted 12 lines · Ian Campbell
Quoted 11 lines · Ian Jackson
Chun Yan Liu writes ("Re: [PATCH] fix
list_domain_details: check config data length=0"):Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
On 7/23/2014 at 05:53 PM, in message
<[email protected]>, Ian Campbell
Quoted 3 lines · <[email protected]> wrote:
I think this issue is resolved by Wei's "libxl: synchronise domain configuration" series? That will save state in such a way that xl can list libvirt domains etc.
Yes, right. I missed Wei's patch series. Just have a look at that, this issue is solved by that patch series. Thanks Wei and Ian!
Quoted 11 lines
Quoted 2 lines
Maybe we should commit Chun's patch to -unstable now so that it can be tested and backported to earlier trees.
I hadn't realised that
libxl_userdata_retrievesignals ENOENT via datalen == 0 rather than an error code. So it could certainly be argued that a zero size userdata is something we should handle irrespective of Wei's series, yes.Quoted 3 lines
It looks like a reasonable change to me:
Acked-by Ian Jackson <[email protected]>
Applied.