[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Interpret "removable" and "info" flags correctly


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Durrant, Paul" <xadimgnik@xxxxxxxxx>
  • Date: Tue, 30 Nov 2021 13:21:01 -0800
  • Delivery-date: Tue, 30 Nov 2021 21:21:09 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 30/11/2021 08:06, Owen Smith wrote:
"removable" relates to the ability to remove the device (not media)

   "removable" = "1" is used to indicate the device can be hot unplugged, as
   PV devices should support hot plug/unplug in the majority of cases.
   "removable" = "0" is used to indicate that the device is being prevented
   from hot unplug by the tool stack. This will allow XenVbd to report the
   correct device capabilities to the OS to indicate that this disk is not
   capable of being removed. This will allow certain policies to be applied
   which restrict access to removable disks (for security and to prevent data
   exfiltration)

"info" contains various flags for the media (not device)

   VDISK_CDROM implies RemovableMedia (a specific case of VDISK_REMOVABLE)
   VDISK_REMOVABLE imples RemovableMedia (underlying disk has 
GENHD_FL_REMOVABLE)
   VDISK_READONLY implies a READ_ONLY_DIRECT_ACCESS_DEVICE

   'Standard' disks usually set no flags (i.e. media is RW and not removable)
   A CDROM will set VDISK_CDROM | VDISK_READONLY, to indicate the media is RO
   and removable.

STOR_FEATURE_FULL_PNP_DEVICE_CAPABILITIES must be set, otherwise StorPort will
not use the values provided for EjectSupported and SurpriseRemovalOK in the
STOR_DEVICE_CAPABILITIES_EX structure. Without this, CM_DEVCAP_EJECTSUPPORTED
and CM_DEVCAP_SURPRISEREMOVALOK are left unchanged, and prevents a non-removable
device from identifying correctly as non-removable.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>

Acked-by: Paul Durrant <paul@xxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.