Skip to contentSkip to conversation

: xl: allow long listing of Domain 0

PATCH Applied Andre Przywara 4 participants 6 messages Aug 9, 2010 – Aug 10, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 : xl: allow long listing of Domain 0

Hi,

currently xl list aborts when one tries to list -l Domain 0 (either explicitly or by listing all domains):

# xl list -l 0
Neither kernel nor bootloader specified

Ignore this error message (which is invalid for Dom0). I haven't found an obvious way to check for Dom0 before printing this message, so I simply removed the exit() call here.

Regards,
Andre.

Signature · 3 lines
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 448-3567-12
tools/libxl/xl_cmdimpl.c +1 -2
diff -r 8992134dcfd0 tools/libxl/xl_cmdimpl.c
@@ -454,7 +454,7 @@
         printf("\t\t)\n");
     } else {
         printf("\t\t(linux %d)\n", b_info->hvm);
-        printf("\t\t\t(kernel %s)\n", b_info->kernel.path);
+        printf("\t\t\t(kernel %s)\n", b_info->kernel.path ?: "");
         printf("\t\t\t(cmdline %s)\n", b_info->u.pv.cmdline);
         printf("\t\t\t(ramdisk %s)\n", b_info->u.pv.ramdisk.path);
         printf("\t\t)\n");
@@ -706,7 +706,6 @@
 
         if (!b_info->u.pv.bootloader && !b_info->kernel.path) {
             fprintf(stderr, "Neither kernel nor bootloader specified\n");
-            exit(1);
         }
 
         b_info->u.pv.cmdline = cmdline;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Re: [PATCH 3/3]: xl: allow long listing of Domain 0'

Quoted 11 lines · Andre Przywara

Hi,

currently xl list aborts when one tries to list -l Domain 0 (either explicitly or by listing all domains):

# xl list -l 0
Neither kernel nor bootloader specified

Ignore this error message (which is invalid for Dom0). I haven't found an obvious way to check for Dom0 before printing this message, so I simply removed the exit() call here.

I would rather skip dom0 in the list_domains_details loop, I'll apply a patch that does that.

#2 lore raw

Re: [PATCH 3/3]: xl: allow long listing of Domain 0'

Quoted 8 lines · Stefano Stabellini
Quoted 7 lines · Andre Przywara

Hi,

currently xl list aborts when one tries to list -l Domain 0 (either explicitly or by listing all domains):

# xl list -l 0
Neither kernel nor bootloader specified
Quoted 7 lines
Quoted 4 lines

Ignore this error message (which is invalid for Dom0). I haven't found an obvious way to check for Dom0 before printing this message, so I simply removed the exit() call here.

I would rather skip dom0 in the list_domains_details loop, I'll apply a patch that does that.

FWIW I think that's the wrong fix. The config parser code ought not be the place to check for such things and should be handled in libxl (or perhaps elsewhere in xl) with reasonable error message. Seems like a work-around rather than a fix to not print dom0 info.

#3 lore raw

Re: [PATCH 3/3]: xl: allow long listing of Domain 0'

Quoted 14 lines · On Mon, 9 Aug 2010, Gianni Tedesco (3P) wrote:
Quoted 13 lines · Stefano Stabellini
Quoted 11 lines · Andre Przywara

Hi,

currently xl list aborts when one tries to list -l Domain 0 (either explicitly or by listing all domains):

# xl list -l 0
Neither kernel nor bootloader specified

Ignore this error message (which is invalid for Dom0). I haven't found an obvious way to check for Dom0 before printing this message, so I simply removed the exit() call here.

Quoted 9 lines
Quoted 2 lines

I would rather skip dom0 in the list_domains_details loop, I'll apply a patch that does that.

FWIW I think that's the wrong fix. The config parser code ought not be the place to check for such things and should be handled in libxl (or perhaps elsewhere in xl) with reasonable error message. Seems like a work-around rather than a fix to not print dom0 info.

I agree, that's why I added a check on dom0 in list_domains_details. The alternative would be to add a check on domid == 0 in libxl_userdata_retrieve, but considering that libxl_userdata_retrieve is supposed to be a generic libxl function, I preferred list_domains_details.

#4 lore raw

Re: [PATCH 3/3]: xl: allow long listing of Domain 0'

Quoted 25 lines · Stefano Stabellini
Quoted 14 lines · On Mon, 9 Aug 2010, Gianni Tedesco (3P) wrote:
Quoted 13 lines · Stefano Stabellini
Quoted 11 lines · Andre Przywara

Hi,

currently xl list aborts when one tries to list -l Domain 0 (either explicitly or by listing all domains):

# xl list -l 0
Neither kernel nor bootloader specified

Ignore this error message (which is invalid for Dom0). I haven't found an obvious way to check for Dom0 before printing this message, so I simply removed the exit() call here.

Quoted 9 lines
Quoted 2 lines

I would rather skip dom0 in the list_domains_details loop, I'll apply a patch that does that.

FWIW I think that's the wrong fix. The config parser code ought not be the place to check for such things and should be handled in libxl (or perhaps elsewhere in xl) with reasonable error message. Seems like a work-around rather than a fix to not print dom0 info.

Quoted 5 lines

I agree, that's why I added a check on dom0 in list_domains_details. The alternative would be to add a check on domid == 0 in libxl_userdata_retrieve, but considering that libxl_userdata_retrieve is supposed to be a generic libxl function, I preferred list_domains_details.

What I mean is that the kernel vs. bootloader check only affects domain create path right? Therefore the check ought to be deep in that code and dom0 not skipped in the list_domains_details().

#5 lore raw

Re: [PATCH 3/3]: xl: allow long listing of Domain 0'

Quoted 32 lines · Gianni Tedesco
Quoted 25 lines · Stefano Stabellini
Quoted 14 lines · On Mon, 9 Aug 2010, Gianni Tedesco (3P) wrote:
Quoted 13 lines · Stefano Stabellini
Quoted 11 lines · Andre Przywara

Hi,

currently xl list aborts when one tries to list -l Domain 0 (either explicitly or by listing all domains):

# xl list -l 0
Neither kernel nor bootloader specified

Ignore this error message (which is invalid for Dom0). I haven't found an obvious way to check for Dom0 before printing this message, so I simply removed the exit() call here.

Quoted 9 lines
Quoted 2 lines

I would rather skip dom0 in the list_domains_details loop, I'll apply a patch that does that.

FWIW I think that's the wrong fix. The config parser code ought not be the place to check for such things and should be handled in libxl (or perhaps elsewhere in xl) with reasonable error message. Seems like a work-around rather than a fix to not print dom0 info.

Quoted 5 lines

I agree, that's why I added a check on dom0 in list_domains_details. The alternative would be to add a check on domid == 0 in libxl_userdata_retrieve, but considering that libxl_userdata_retrieve is supposed to be a generic libxl function, I preferred list_domains_details.

Quoted 3 lines

What I mean is that the kernel vs. bootloader check only affects domain create path right? Therefore the check ought to be deep in that code and dom0 not skipped in the list_domains_details().

As the one who added the check in question to parse_config_data I agree that it would be better moved into the relevant caller(s).

Ian.