800917b5a2
- Update to Xen 4.1.2_rc2 c/s 23152 - bnc#716695 - domUs using tap devices will not start updated multi-xvdp.patch - Upstream patches from Jan 23803-intel-pmu-models.patch 23800-x86_64-guest-addr-range.patch 23795-intel-ich10-quirk.patch 23804-x86-IPI-counts.patch - bnc#706106 - Inconsistent reporting of VM names during migration xend-migration-domname-fix.patch - bnc#712823 - L3:Xen guest does not start reliable when rebooted xend-vcpu-affinity-fix.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=143
75 lines
2.8 KiB
Diff
75 lines
2.8 KiB
Diff
Print a warning and exit xl if xend is running. It is not
|
|
recommened to use libxenlight in conjunction with legacy xend
|
|
toolstack.
|
|
|
|
xl could be useful even when xend is running, e.g. to debug
|
|
xend itself, so add a '-f' option to override the exit.
|
|
|
|
Index: xen-4.1.2-testing/tools/libxl/xl.c
|
|
===================================================================
|
|
--- xen-4.1.2-testing.orig/tools/libxl/xl.c
|
|
+++ xen-4.1.2-testing/tools/libxl/xl.c
|
|
@@ -88,12 +88,16 @@ int main(int argc, char **argv)
|
|
char *config_file;
|
|
void *config_data = 0;
|
|
int config_len = 0;
|
|
+ int force = 0;
|
|
|
|
- while ((opt = getopt(argc, argv, "+v")) >= 0) {
|
|
+ while ((opt = getopt(argc, argv, "+vf")) >= 0) {
|
|
switch (opt) {
|
|
case 'v':
|
|
if (minmsglevel > 0) minmsglevel--;
|
|
break;
|
|
+ case 'f':
|
|
+ force = 1;
|
|
+ break;
|
|
default:
|
|
fprintf(stderr, "unknown global option\n");
|
|
exit(2);
|
|
@@ -107,6 +111,22 @@ int main(int argc, char **argv)
|
|
exit(1);
|
|
}
|
|
opterr = 0;
|
|
+ /*
|
|
+ * On SUSE, if xend is running (and user isn't asking for help),
|
|
+ * print a warning and exit unless forced.
|
|
+ */
|
|
+ if ((system("/usr/sbin/xend status") == 0) && strcmp(cmd, "help")) {
|
|
+ if (force == 0) {
|
|
+ fprintf(stderr, "WARNING: xend is running! It is not recommended "
|
|
+ "using libxenlight in\nconjunction with the legacy xend "
|
|
+ "toolstack. Use -f (force) to override\n");
|
|
+ exit(1);
|
|
+ } else {
|
|
+ fprintf(stderr, "WARNING: xend is running! It is not recommended "
|
|
+ "using libxenlight in\nconjunction with the legacy xend "
|
|
+ "toolstack.\n\n");
|
|
+ }
|
|
+ }
|
|
|
|
logger = xtl_createlogger_stdiostream(stderr, minmsglevel, 0);
|
|
if (!logger) exit(1);
|
|
Index: xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c
|
|
===================================================================
|
|
--- xen-4.1.2-testing.orig/tools/libxl/xl_cmdimpl.c
|
|
+++ xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c
|
|
@@ -1725,7 +1725,7 @@ void help(const char *command)
|
|
struct cmd_spec *cmd;
|
|
|
|
if (!command || !strcmp(command, "help")) {
|
|
- printf("Usage xl [-v] <subcommand> [args]\n\n");
|
|
+ printf("Usage xl [-v] [-f] <subcommand> [args]\n\n");
|
|
printf("xl full list of subcommands:\n\n");
|
|
for (i = 0; i < cmdtable_len; i++)
|
|
printf(" %-20s%s\n",
|
|
@@ -1733,7 +1733,7 @@ void help(const char *command)
|
|
} else {
|
|
cmd = cmdtable_lookup(command);
|
|
if (cmd) {
|
|
- printf("Usage: xl [-v] %s %s\n\n%s.\n\n",
|
|
+ printf("Usage: xl [-v] [-f] %s %s\n\n%s.\n\n",
|
|
cmd->cmd_name,
|
|
cmd->cmd_usage,
|
|
cmd->cmd_desc);
|