Print this page
6581 cmd/format should be able label virtio BLKDEV drives
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Toomas Soome <tsoome@me.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/format/menu_command.c
          +++ new/usr/src/cmd/format/menu_command.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright 2012 Milan Jurik. All rights reserved.
  24   24   * Copyright 2014 Toomas Soome <tsoome@me.com>
  25   25   * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
       26 + * Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
  26   27   */
  27   28  
  28   29  /*
  29   30   * This file contains functions that implement the command menu commands.
  30   31   */
  31   32  
  32   33  #include "global.h"
  33   34  #include <time.h>
  34   35  #include <sys/time.h>
  35   36  #include <sys/resource.h>
↓ open down ↓ 1578 lines elided ↑ open up ↑
1614 1615                      (cur_disk->fdisk_part.numsect > 0))) {
1615 1616                          fmt_print("You must use fdisk to create a Solaris "
1616 1617                              "partition before you can convert the label.\n");
1617 1618                          return (-1);
1618 1619                  }
1619 1620  #endif
1620 1621  
1621 1622                  (void) memset((char *)&label, 0, sizeof (struct dk_label));
1622 1623  
1623 1624                  (void) strcpy(x86_devname, cur_disk->disk_name);
1624      -                if (cur_ctype->ctype_ctype == DKC_DIRECT)
     1625 +                if (cur_ctype->ctype_ctype == DKC_DIRECT ||
     1626 +                    cur_ctype->ctype_ctype == DKC_BLKDEV)
1625 1627                          dptr = auto_direct_get_geom_label(cur_file,  &label);
1626 1628                  else
1627 1629                          dptr = auto_sense(cur_file, 1, &label);
1628 1630                  if (dptr == NULL) {
1629 1631                          fmt_print("Autoconfiguration failed.\n");
1630 1632                          return (-1);
1631 1633                  }
1632 1634  
1633 1635                  pcyl = label.dkl_pcyl;
1634 1636                  ncyl = label.dkl_ncyl;
↓ open down ↓ 885 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX