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

[PATCH 1/2] Unplug: Set bit for NVME disk unplug



When issuing a DISK unplug command, set the bits for emulated IDE/SCSI
and emulated NVME devices.

Also defines and uses symbols to represent each bit in the unplug protocol.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xen/unplug.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/xen/unplug.c b/src/xen/unplug.c
index 282ed93..3b6593a 100644
--- a/src/xen/unplug.c
+++ b/src/xen/unplug.c
@@ -49,6 +49,12 @@
 
 #define UNPLUG_TAG  'LPNU'
 
+#define UNPLUG_FLAGS_IDE_SCSI_DISKS   0x0001
+#define UNPLUG_FLAGS_ALL_NICS         0x0002
+#define UNPLUG_FLAGS_AUX_IDE_DISKS    0x0004  // ignored if 
UNPLUG_FLAGS_IDE_SCSI_DISKS is set
+#define UNPLUG_FLAGS_NVME_DISKS       0x0008
+#define UNPLUG_FLAGS_ALL_DISKS        (UNPLUG_FLAGS_IDE_SCSI_DISKS | 
UNPLUG_FLAGS_NVME_DISKS)
+
 typedef struct _UNPLUG_DATA {
     PSTR        Name;
     BOOLEAN     Found;
@@ -116,19 +122,19 @@ UnplugDeviceType(
     case UNPLUG_DISKS:
         if (Context->BootEmulated) {
 #pragma prefast(suppress:28138)
-            WRITE_PORT_USHORT((PUSHORT)0x10, 0x0004);
+            WRITE_PORT_USHORT((PUSHORT)0x10, UNPLUG_FLAGS_AUX_IDE_DISKS);
 
             LogPrintf(LOG_LEVEL_WARNING, "UNPLUG: AUX DISKS\n");
         } else {
 #pragma prefast(suppress:28138)
-            WRITE_PORT_USHORT((PUSHORT)0x10, 0x0001);
+            WRITE_PORT_USHORT((PUSHORT)0x10, UNPLUG_FLAGS_ALL_DISKS);
 
             LogPrintf(LOG_LEVEL_WARNING, "UNPLUG: DISKS\n");
         }
         break;
     case UNPLUG_NICS:
 #pragma prefast(suppress:28138)
-        WRITE_PORT_USHORT((PUSHORT)0x10, 0x0002);
+        WRITE_PORT_USHORT((PUSHORT)0x10, UNPLUG_FLAGS_ALL_NICS);
 
         LogPrintf(LOG_LEVEL_WARNING, "UNPLUG: NICS\n");
         break;
-- 
2.51.2.windows.1




 


Rackspace

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