]> Git Repo - qemu.git/commitdiff
virtio-ccw: respond to READ_STATUS command
authorPierre Morel <[email protected]>
Wed, 7 Sep 2016 10:58:40 +0000 (12:58 +0200)
committerCornelia Huck <[email protected]>
Mon, 19 Sep 2016 09:05:51 +0000 (11:05 +0200)
This patch adds the response to the READ_STATUS CCW command.

Signed-off-by: Pierre Morel <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
hw/s390x/virtio-ccw.c
hw/s390x/virtio-ccw.h

index 96789569a7149e986c275ed506fc4c4ca537ea93..0a997e17b610f09ef95419dfc97c536b2534b240 100644 (file)
@@ -455,6 +455,26 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
             }
         }
         break;
+    case CCW_CMD_READ_STATUS:
+        if (check_len) {
+            if (ccw.count != sizeof(status)) {
+                ret = -EINVAL;
+                break;
+            }
+        } else if (ccw.count < sizeof(status)) {
+            /* Can't execute command. */
+            ret = -EINVAL;
+            break;
+        }
+        if (!ccw.cda) {
+            ret = -EFAULT;
+        } else {
+            address_space_stb(&address_space_memory, ccw.cda, vdev->status,
+                                        MEMTXATTRS_UNSPECIFIED, NULL);
+            sch->curr_status.scsw.count = ccw.count - sizeof(vdev->status);;
+            ret = 0;
+        }
+        break;
     case CCW_CMD_WRITE_STATUS:
         if (check_len) {
             if (ccw.count != sizeof(status)) {
index b58ab21d4cab1d165878ee90235fe7751b15c4d8..6ef940a98c5e0b98139292578b657a03ee5d1b9b 100644 (file)
@@ -45,6 +45,7 @@
 #define CCW_CMD_SET_IND      0x43
 #define CCW_CMD_SET_CONF_IND 0x53
 #define CCW_CMD_READ_VQ_CONF 0x32
+#define CCW_CMD_READ_STATUS  0x72
 #define CCW_CMD_SET_IND_ADAPTER 0x73
 #define CCW_CMD_SET_VIRTIO_REV 0x83
 
This page took 0.026429 seconds and 4 git commands to generate.