mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xl: tell the user about non-existent domains
The error message when one wants to list a non-existent domain is at best misleading (libxl_domain_info failed (code -5)). This patch catches this specific error and tells the user that the requested domain does not exist: Error: Domain '42' does not exist. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
This commit is contained in:
1 parent
4d52a08194
commit
8b3be172a3
1 file changed
+5
@@ -3003,6 +3003,11 @@ int main_list(int argc, char **argv)
|
||||
} else if (optind == argc-1) {
|
||||
find_domain(argv[optind]);
|
||||
rc = libxl_domain_info(&ctx, &info_buf, domid);
|
||||
if (rc == ERROR_INVAL) {
|
||||
fprintf(stderr, "Error: Domain \'%s\' does not exist.\n",
|
||||
argv[optind]);
|
||||
return -rc;
|
||||
}
|
||||
if (rc) {
|
||||
fprintf(stderr, "libxl_domain_info failed (code %d).\n", rc);
|
||||
return -rc;
|
||||
|
||||