Print this page
9250 remove xpv related code from bootadm

@@ -287,12 +287,10 @@
         "delete_all_entries",   OPT_ABSENT,     delete_all_entries, 0, /* PVT */
         "update_entry",         OPT_REQ,        update_entry, 0, /* menu */
         "update_temp",          OPT_OPTIONAL,   update_temp, 0, /* reboot */
         "upgrade",              OPT_ABSENT,     upgrade_menu, 0, /* menu */
         "list_setting",         OPT_OPTIONAL,   list_setting, 1, /* menu */
-        "disable_hypervisor",   OPT_ABSENT,     cvt_to_metal, 0, /* menu */
-        "enable_hypervisor",    OPT_ABSENT,     cvt_to_hyper, 0, /* menu */
         NULL,                   0,              NULL, 0 /* must be last */
 };
 
 /* Archive related sub commands */
 static subcmd_defn_t arch_subcmds[] = {

@@ -550,11 +548,11 @@
                         usage();
                         bam_exit(1);
         }
 
         if (ret != BAM_SUCCESS)
-                bam_exit((ret == BAM_NOCHANGE) ? 2 : 1);
+                bam_exit(1);
 
         bam_unlock();
         return (0);
 }
 

@@ -622,12 +620,10 @@
  *      -i install_bootloader           -- install-bootloader
  *      -m update_entry                 -- update-menu
  *      -m list_entry                   -- list-menu
  *      -m update_temp                  -- (reboot -- [boot-args])
  *      -m delete_all_entries           -- (called from install)
- *      -m enable_hypervisor [args]     -- cvt_to_hyper
- *      -m disable_hypervisor           -- cvt_to_metal
  *      -m list_setting [entry] [value] -- list_setting
  *
  * A set of private flags is there too:
  *      -F              -- purge the cache directories and rebuild them
  *      -e              -- use the (faster) archive update approach (used by

@@ -760,11 +756,11 @@
                                     "one of sun4u, sun4v or i86pc\n"),
                                     bam_platform);
                         }
                         break;
                 case 'X':
-                        bam_is_hv = BAM_HV_PRESENT;
+                        /* obsolete */
                         break;
                 case 'Z':
                         bam_zfs = 1;
                         break;
                 case 'e':

@@ -866,15 +862,15 @@
                         usage();
                         return (BAM_ERROR);
                 }
                 if (bam_argc == 1)
                         sync_menu = 0;
-        } else if (((strcmp(subcmd, "enable_hypervisor") != 0) &&
-            (strcmp(subcmd, "list_setting") != 0)) && (bam_argc || bam_argv)) {
+        } else if (strcmp(subcmd, "list_setting") != 0 &&
+            (bam_argc || bam_argv)) {
                 /*
-                 * Of the remaining subcommands, only "enable_hypervisor" and
-                 * "list_setting" take trailing arguments.
+                 * Of the remaining subcommands, only "list_setting" takes
+                 * trailing arguments.
                  */
                 bam_error(_("invalid trailing arguments\n"));
                 usage();
                 return (BAM_ERROR);
         }

@@ -1429,12 +1425,11 @@
          * final step now.
          */
         if (strcmp(subcmd, "set_option") == 0) {
                 assert(largc == 1 && largv[0] && largv[1] == NULL);
                 opt = largv[0];
-        } else if ((strcmp(subcmd, "enable_hypervisor") != 0) &&
-            (strcmp(subcmd, "list_setting") != 0)) {
+        } else if (strcmp(subcmd, "list_setting") != 0) {
                 assert(largc == 0 && largv == NULL);
         }
 
         ret = get_boot_cap(bam_root);
         if (ret != BAM_SUCCESS) {

@@ -1453,64 +1448,10 @@
         } else if (strcmp(subcmd, "list_entry") == 0) {
                 ret = f(menu, menu_path, opt);
         } else if (strcmp(subcmd, "list_setting") == 0) {
                 ret = f(menu, ((largc > 0) ? largv[0] : ""),
                     ((largc > 1) ? largv[1] : ""));
-        } else if (strcmp(subcmd, "disable_hypervisor") == 0) {
-                if (is_sparc()) {
-                        bam_error(_("%s operation unsupported on SPARC "
-                            "machines\n"), subcmd);
-                        ret = BAM_ERROR;
-                } else {
-                        ret = f(menu, bam_root, NULL);
-                }
-        } else if (strcmp(subcmd, "enable_hypervisor") == 0) {
-                if (is_sparc()) {
-                        bam_error(_("%s operation unsupported on SPARC "
-                            "machines\n"), subcmd);
-                        ret = BAM_ERROR;
-                } else {
-                        char *extra_args = NULL;
-
-                        /*
-                         * Compress all arguments passed in the largv[] array
-                         * into one string that can then be appended to the
-                         * end of the kernel$ string the routine to enable the
-                         * hypervisor will build.
-                         *
-                         * This allows the caller to supply arbitrary unparsed
-                         * arguments, such as dom0 memory settings or APIC
-                         * options.
-                         *
-                         * This concatenation will be done without ANY syntax
-                         * checking whatsoever, so it's the responsibility of
-                         * the caller to make sure the arguments are valid and
-                         * do not duplicate arguments the conversion routines
-                         * may create.
-                         */
-                        if (largc > 0) {
-                                int extra_len, i;
-
-                                for (extra_len = 0, i = 0; i < largc; i++)
-                                        extra_len += strlen(largv[i]);
-
-                                /*
-                                 * Allocate space for argument strings,
-                                 * intervening spaces and terminating NULL.
-                                 */
-                                extra_args = alloca(extra_len + largc);
-
-                                (void) strcpy(extra_args, largv[0]);
-
-                                for (i = 1; i < largc; i++) {
-                                        (void) strcat(extra_args, " ");
-                                        (void) strcat(extra_args, largv[i]);
-                                }
-                        }
-
-                        ret = f(menu, bam_root, extra_args);
-                }
         } else
                 ret = f(menu, NULL, opt);
 
         if (ret == BAM_WRITE) {
                 BAM_DPRINTF(("%s: writing menu to clean-menu-root: <%s>\n",

@@ -4627,13 +4568,10 @@
         } else if (strncmp(arg, MULTI_BOOT_FAILSAFE,
             sizeof (MULTI_BOOT_FAILSAFE) - 1) == 0) {
                 BAM_DPRINTF(("%s: setting MULTIBOOT|MULTIBOOT_FAILSAFE "
                     "flag: %s\n", fcn, arg));
                 entry->flags |= BAM_ENTRY_MULTIBOOT | BAM_ENTRY_FAILSAFE;
-        } else if (strstr(arg, XEN_KERNEL_SUBSTR)) {
-                BAM_DPRINTF(("%s: setting XEN HV flag: %s\n", fcn, arg));
-                entry->flags |= BAM_ENTRY_HV;
         } else if (!(entry->flags & (BAM_ENTRY_BOOTADM|BAM_ENTRY_LU))) {
                 BAM_DPRINTF(("%s: is HAND kernel flag: %s\n", fcn, arg));
                 return (BAM_ERROR);
         } else if (strncmp(arg, KERNEL_PREFIX, strlen(KERNEL_PREFIX)) == 0 &&
             strstr(arg, UNIX_SPACE)) {

@@ -4670,13 +4608,11 @@
             strcmp(arg, DIRECT_BOOT_ARCHIVE_32) == 0 ||
             strcmp(arg, DIRECT_BOOT_ARCHIVE_64) == 0 ||
             strcmp(arg, MULTIBOOT_ARCHIVE) == 0 ||
             strcmp(arg, FAILSAFE_ARCHIVE) == 0 ||
             strcmp(arg, FAILSAFE_ARCHIVE_32) == 0 ||
-            strcmp(arg, FAILSAFE_ARCHIVE_64) == 0 ||
-            strcmp(arg, XEN_KERNEL_MODULE_LINE) == 0 ||
-            strcmp(arg, XEN_KERNEL_MODULE_LINE_ZFS) == 0) {
+            strcmp(arg, FAILSAFE_ARCHIVE_64) == 0) {
                 BAM_DPRINTF(("%s: bootadm or LU module cmd: %s\n", fcn, arg));
                 return (BAM_SUCCESS);
         } else if (!(entry->flags & BAM_ENTRY_BOOTADM) &&
             !(entry->flags & BAM_ENTRY_LU)) {
                 /* don't emit warning for hand entries */

@@ -8251,17 +8187,13 @@
                     kernel, lp->arg));
 
                 /*
                  * Check for matching module entry (failsafe or normal).
                  * If it fails to match, we go around the loop again.
-                 * For xpv entries, there are two module lines, so we
-                 * do the check twice.
                  */
                 lp = lp->next;  /* advance to module line */
-                if (check_cmd(lp->cmd, MODULE_CMD, lp->arg, module) ||
-                    (((lp = lp->next) != NULL) &&
-                    check_cmd(lp->cmd, MODULE_CMD, lp->arg, module))) {
+                if (check_cmd(lp->cmd, MODULE_CMD, lp->arg, module)) {
                         /* match found */
                         BAM_DPRINTF(("%s: module match: %s, %s\n", fcn,
                             module, lp->arg));
                         break;
                 }

@@ -8586,24 +8518,14 @@
                     (bam_zfs ? DIRECT_BOOT_KERNEL_ZFS : DIRECT_BOOT_KERNEL),
                     NULL, DIRECT_BOOT_ARCHIVE,
                     root_optional(osroot, menu_root));
                 BAM_DPRINTF(("%s: updated boot entry bam_zfs=%d, "
                     "grubsign = %s\n", fcn, bam_zfs, grubsign));
-                if ((entry != BAM_ERROR) && (bam_is_hv == BAM_HV_PRESENT)) {
-                        (void) update_boot_entry(mp, NEW_HV_ENTRY, grubsign,
-                            grubroot, XEN_MENU, bam_zfs ?
-                            XEN_KERNEL_MODULE_LINE_ZFS : XEN_KERNEL_MODULE_LINE,
-                            DIRECT_BOOT_ARCHIVE,
-                            root_optional(osroot, menu_root));
-                        BAM_DPRINTF(("%s: updated HV entry bam_zfs=%d, "
-                            "grubsign = %s\n", fcn, bam_zfs, grubsign));
-                }
         } else {
                 entry = update_boot_entry(mp, title, grubsign, grubroot,
                     MULTI_BOOT, NULL, MULTIBOOT_ARCHIVE,
                     root_optional(osroot, menu_root));
-
                 BAM_DPRINTF(("%s: updated MULTIBOOT entry grubsign = %s\n",
                     fcn, grubsign));
         }
 
         /*