xl: allow nameless domains to be named
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 26 May 2010 07:12:15 +0000 (08:12 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 26 May 2010 07:12:15 +0000 (08:12 +0100)
At present, find_domain() will exit(2) if you specify a domain by
number, but that domain doesn't have a corresponding name.  However,
nothing seem to critically depend on common_domname being set, and the
test prevents dom0 or other nameless domains from being named.  So
just remove the check.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Yang Hongyang <yanghy@cn.fujitsu.com>
tools/libxl/xl_cmdimpl.c

index a790401923eef4422052c7d6cebb37bf4344c0f2..729d5c998bbbd989c87b41bb11066e6e65625ff6 100644 (file)
@@ -138,10 +138,6 @@ static void find_domain(const char *p)
         exit(2);
     }
     common_domname = was_name ? p : libxl_domid_to_name(&ctx, domid);
-    if (!common_domname) {
-        fprintf(stderr, "%s is an invalid domain identifier.\n", p);
-        exit(2);
-    }
 }
 
 #define LOG(_f, _a...)   dolog(__FILE__, __LINE__, __func__, _f "\n", ##_a)