improve the error message in "xl list --long"
PATCH 1/1 improve the error message in "xl list --long"
it is a bug reported by customer, xl will output the following message when issue "xl list --long domain_name":
Domain name must be specified.
the error message is completely unclear. this error is because such domain is not created by xl itself. xl could saw the domain name but could not get the domain configuration.
---
change since RFC:
raise the error in list_domains_details instead of modifying the libxl_userdata_retrieve itself.
there are four command would invoke the libxl_userdata_retrieve: create, save, migrate, list. issue create command mean the domain is not called from other toolstack, and there is libxl_userdata_retrieve return value check in save and migrate. So, the only place need to check is in list_domain_details.
tools/libxl/xl_cmdimpl.c | 5 +++++ 1 file changed, 5 insertions(+)
tools/libxl/xl_cmdimpl.c +5 -0
@@ -3064,6 +3064,11 @@ 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 ) { +fprintf (stderr,"No xl userdata found. Is domain id" +"'%u' owned by another toolstack?" , info[i].domid); +continue ; + }CHK_ERRNO (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,NULL );
Signature · 1 line
1.8.1.4
Quoted 8 lines · Bamvor Jian Zhang
it is a bug reported by customer, xl will output the following message when issue "xl list --long
domain_name":
Domain name must be specified.the error message is completely unclear. this error is because such domain is not created by xl itself. xl could saw the domain name but could not get the domain configuration.
The root cause is that there is no sotred config file in xl's private storage. This can be caused by the reason you stated above.
Another posibility is that Xen fails to clean up a domain after its death. That domain remains visible in Xen, however at that time the stored config file is already deleted.
IMHO we can skip this domain without printing this info. Or this info needs to cover all the situations.
Wei.
Quoted 38 lines
Signed-off-by Bamvor Jian Zhang <[email protected]>---
change since RFC:
raise the error inlist_domains_detailsinstead of modifying thelibxl_userdata_retrieveitself.
there are four command would invoke thelibxl_userdata_retrieve: create, save, migrate, list. issue create command mean the domain is not called from other toolstack, and there islibxl_userdata_retrievereturn value check in save and migrate. So, the only place need to check is inlist_domain_details.tools/libxl/xl_cmdimpl.c | 5 +++++ 1 file changed, 5 insertions(+)tools/libxl/xl_cmdimpl.c +5
-0@@ -3064,6 +3064,11 @@ 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 ) { +fprintf (stderr,"No xl userdata found. Is domain id" +"'%u' owned by another toolstack?" , info[i].domid); +continue ; + }CHK_ERRNO (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,NULL );Signature · 7 lines
1.8.1.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Wei Liu writes ("Re: [Xen-devel] [PATCH] improve the error message in "xl list --long""):
Quoted 6 lines
Another posibility is that Xen fails to clean up a domain after its death. That domain remains visible in Xen, however at that time the stored config file is already deleted.
IMHO we can skip this domain without printing this info. Or this info needs to cover all the situations.
I think for now (that is, until we can reconstruct the domain config from the running state) we should not skip the domain, but instead simply not include the missing info in the long output.
Ian.
Quoted 5 lines · Ian Jackson
Wei Liu writes ("Re: [Xen-devel] [PATCH] improve the error message in "xl list --long""):
Quoted 4 lines
Another posibility is that Xen fails to clean up a domain after its death. That domain remains visible in Xen, however at that time the stored config file is already deleted.
Quoted 7 lines
Quoted 2 lines
IMHO we can skip this domain without printing this info. Or this info needs to cover all the situations.
I think for now (that is, until we can reconstruct the domain config from the running state) we should not skip the domain, but instead simply not include the missing info in the long output.
TBH I'm confused... You seemed to agree to skip in another patch.
Wei.
Quoted 1 line
Ian.
Wei Liu writes ("Re: [Xen-devel] [PATCH] improve the error message in "xl list --long""):
Quoted 9 lines · Ian Jackson
Quoted 8 lines
Wei Liu writes ("Re: [Xen-devel] [PATCH] improve the error message in "xl list --long""):
Quoted 6 lines
Another posibility is that Xen fails to clean up a domain after its death. That domain remains visible in Xen, however at that time the stored config file is already deleted.
IMHO we can skip this domain without printing this info. Or this info needs to cover all the situations.
Quoted 6 lines
Quoted 3 lines
I think for now (that is, until we can reconstruct the domain config from the running state) we should not skip the domain, but instead simply not include the missing info in the long output.
TBH I'm confused... You seemed to agree to skip in another patch. <[email protected]>
Yes, sorry, but, I think I was wrong earlier.
I don't think missing an existing domain out of the listing can be right. That would make it just appear to vanish!
Ian.
Quoted 14 lines · Ian Jackson
Wei Liu writes ("Re: [Xen-devel] [PATCH] improve the error message in "xl list --long""):
Quoted 13 lines · Ian Jackson
Quoted 11 lines
Wei Liu writes ("Re: [Xen-devel] [PATCH] improve the error message in "xl list --long""):
Quoted 6 lines
Another posibility is that Xen fails to clean up a domain after its death. That domain remains visible in Xen, however at that time the stored config file is already deleted.
IMHO we can skip this domain without printing this info. Or this info needs to cover all the situations.
I think for now (that is, until we can reconstruct the domain config from the running state) we should not skip the domain, but instead simply not include the missing info in the long output.
Quoted 8 lines
Quoted 2 lines
TBH I'm confused... You seemed to agree to skip in another patch. <[email protected]>
Yes, sorry, but, I think I was wrong earlier.
I don't think missing an existing domain out of the listing can be right. That would make it just appear to vanish!
Rereading your earlier comment.
"we should not skip the domain, but instead not include the missing info in the long output"
This is what <[email protected]> and this patch does -- only that this patch prints one more line to info user the situation. The problem I'm seeing with this patch is that the info doesn't seem to cover all the cases.
This patch and the one I proposed skips zero-length domain in long output. You can still see the domain in short output -- it doesn't vanish. :-)
Wei.
Quoted 1 line
Ian.
Wei Liu writes ("Re: [Xen-devel] [PATCH] improve the error message in "xl list --long""):
Quoted 11 lines
"we should not skip the domain, but instead not include the missing info in the long output"
This is what <[email protected]> and this patch does -- only that this patch prints one more line to info user the situation. The problem I'm seeing with this patch is that the info doesn't seem to cover all the cases.
This patch and the one I proposed skips zero-length domain in long output. You can still see the domain in short output -- it doesn't vanish. :-)
What I mean is that I think that domains shouldn't appear in the short output but not the long output.
Ian.
Quoted 11 lines · Ian Jackson
Wei Liu writes ("Re: [Xen-devel] [PATCH] improve the error message in "xl list --long""):
Quoted 6 lines
Another posibility is that Xen fails to clean up a domain after its death. That domain remains visible in Xen, however at that time the stored config file is already deleted.
IMHO we can skip this domain without printing this info. Or this info needs to cover all the situations.
I think for now (that is, until we can reconstruct the domain config from the running state) we should not skip the domain, but instead simply not include the missing info in the long output.
I agree. What can't be reconstructed today? Is there a list somewhere?
--msw
Matt Wilson writes ("Re: [Xen-devel] [PATCH] improve the error message in "xl list --long""):
Quoted 6 lines · Ian Jackson
Quoted 3 lines
I think for now (that is, until we can reconstruct the domain config from the running state) we should not skip the domain, but instead simply not include the missing info in the long output.
I agree. What can't be reconstructed today? Is there a list somewhere?
Currently there is no code at all that attempts to do this. Instead, we rely on saving the text of the config file.
Ian.
Quoted 9 lines · Ian Jackson
Matt Wilson writes ("Re: [Xen-devel] [PATCH] improve the error message in "xl list --long""):
Quoted 6 lines · Ian Jackson
Quoted 3 lines
I think for now (that is, until we can reconstruct the domain config from the running state) we should not skip the domain, but instead simply not include the missing info in the long output.
I agree. What can't be reconstructed today? Is there a list somewhere?
Currently there is no code at all that attempts to do this.
I made a hacky start in <[email protected]>. I think most of what is required is there in xenstore or the results of hypervalls, or can be easily enough stashed somewhere in xenstore on create, but we won't know until someone keeps running with it...
Ian.
Hi, Wei
Quoted 13 lines · Bamvor Jian Zhang
Quoted 8 lines
it is a bug reported by customer, xl will output the following message when issue "xl list --long
domain_name":
Domain name must be specified.the error message is completely unclear. this error is because such domain is not created by xl itself. xl could saw the domain name but could not get the domain configuration.
The root cause is that there is no sotred config file in xl's private storage. This can be caused by the reason you stated above.
Quoted 7 lines
Another posibility is that Xen fails to clean up a domain after its death. That domain remains visible in Xen, however at that time the stored config file is already deleted.
IMHO we can skip this domain without printing this info. Or this info needs to cover all the situations.
sorry reply this so late.
this issue is reported to us because our user using libvirt and xl at the same time. in xend times, it is ok to combine with libvirt and xend. We should tell user should not do it with xl. as I said in my first email, there is no prompt for missing config in "xl list --long" compare with other command.
how about print like this:
fprintf(stderr, "No xl userdata found. Is domain id"
"'%u' owned by another toolstack or fail in cleanup? ", info[i].domid);
Bamvor
Quoted 1 line
Wei.