Print this page
NEX-16215 xvdi_init_dev() truncates the unit address to 7 characters
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
8019 Some PV devices should not be configured in HVM mode
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Basil Crow <basil.crow@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
re #13140 rb4270 hvm_sd module missing dependencies on scsi and cmlb
re #13166 rb4270 Check for Xen HVM even if CPUID signature returns Microsoft Hv
re #13187 rb4270 Fix Xen HVM related warnings

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/xen/os/xvdi.c
          +++ new/usr/src/uts/common/xen/os/xvdi.c
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27   27  /*
  28   28   * Copyright (c) 2014 by Delphix. All rights reserved.
       29 + * Copyright 2018 Nexenta Systems, Inc.
  29   30   */
  30   31  
  31   32  /*
  32   33   * Xen virtual device driver interfaces
  33   34   */
  34   35  
  35   36  /*
  36   37   * todo:
  37   38   * + name space clean up:
  38   39   *      xvdi_* - public xen interfaces, for use by all leaf drivers
↓ open down ↓ 206 lines elided ↑ open up ↑
 245  246          xendev_devclass_t devcls;
 246  247          int vdevnum;
 247  248          domid_t domid;
 248  249          struct xendev_ppd *pdp;
 249  250          i_xd_cfg_t *xdcp;
 250  251          boolean_t backend;
 251  252          char xsnamebuf[TYPICALMAXPATHLEN];
 252  253          char *xsname;
 253  254          void *prop_str;
 254  255          unsigned int prop_len;
 255      -        char unitaddr[8];
      256 +        char unitaddr[16];
 256  257  
 257  258          devcls = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
 258  259              DDI_PROP_DONTPASS, "devclass", XEN_INVAL);
 259  260          vdevnum = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
 260  261              DDI_PROP_DONTPASS, "vdev", VDEV_NOXS);
 261  262          domid = (domid_t)ddi_prop_get_int(DDI_DEV_T_ANY, dip,
 262  263              DDI_PROP_DONTPASS, "domain", DOMID_SELF);
 263  264  
 264  265          backend = (domid != DOMID_SELF);
 265  266          xdcp = i_xvdi_devclass2cfg(devcls);
↓ open down ↓ 60 lines elided ↑ open up ↑
 326  327          }
 327  328  
 328  329          if (backend)
 329  330                  return (DDI_SUCCESS);
 330  331  
 331  332          /*
 332  333           * The unit-address for frontend devices is the name of the
 333  334           * of the xenstore node containing the device configuration
 334  335           * and is contained in the 'vdev' property.
 335  336           * VIF devices are named using an incrementing integer.
 336      -         * VBD devices are either named using the 16-bit dev_t value
      337 +         * VBD devices are either named using the 32-bit dev_t value
 337  338           * for linux 'hd' and 'xvd' devices, or a simple integer value
 338  339           * in the range 0..767.  768 is the base value of the linux
 339  340           * dev_t namespace, the dev_t value for 'hda'.
 340  341           */
 341  342          (void) snprintf(unitaddr, sizeof (unitaddr), "%d", vdevnum);
 342  343          (void) ndi_prop_update_string(DDI_DEV_T_NONE, dip, "unit-address",
 343  344              unitaddr);
 344  345  
 345  346          switch (devcls) {
 346  347          case XEN_VNET:
↓ open down ↓ 2077 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX