question on virtio ccw
I see this in ccw in qemu:
if (virtio_set_status(vdev, status) == 0) {
if (vdev->status == 0) {
virtio_ccw_reset_virtio(dev, vdev);
}
if (status & VIRTIO_CONFIG_S_DRIVER_OK) {
virtio_ccw_start_ioeventfd(dev);
}
sch->curr_status.scsw.count = ccw.count - sizeof(status);
ret = 0;
} else {
/* Trigger a command reject. */
ret = -ENOSYS;
}virtio_set_status on success sets vdev->status to status. Why check vdev->status in one place and status in another?
Signature · 1 line
MST
Quoted 16 lines · On Thu, 7 Dec 2017 19:18:44 +0200 "Michael S. Tsirkin" <[email protected]> wrote:
I see this in ccw in qemu:
if (virtio_set_status(vdev, status) == 0) { if (vdev->status == 0) { virtio_ccw_reset_virtio(dev, vdev); } if (status & VIRTIO_CONFIG_S_DRIVER_OK) { virtio_ccw_start_ioeventfd(dev); } sch->curr_status.scsw.count = ccw.count - sizeof(status); ret = 0; } else { /* Trigger a command reject. */ ret = -ENOSYS; }
Quoted 3 lines
virtio_set_statuson success setsvdev->statusto status. Why checkvdev->statusin one place and status in another?
Probably for symmetry with the check whether to stop ioeventfd right above. But it does not really matter one way or the other.