aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/lguest/lguest.c
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/lguest/lguest.c')
-rw-r--r--Documentation/lguest/lguest.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index f2668390e8f7..157f6a26b939 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -1342,7 +1342,7 @@ static bool service_io(struct device *dev)
1342 if (out->type & VIRTIO_BLK_T_SCSI_CMD) { 1342 if (out->type & VIRTIO_BLK_T_SCSI_CMD) {
1343 fprintf(stderr, "Scsi commands unsupported\n"); 1343 fprintf(stderr, "Scsi commands unsupported\n");
1344 in->status = VIRTIO_BLK_S_UNSUPP; 1344 in->status = VIRTIO_BLK_S_UNSUPP;
1345 wlen = sizeof(in); 1345 wlen = sizeof(*in);
1346 } else if (out->type & VIRTIO_BLK_T_OUT) { 1346 } else if (out->type & VIRTIO_BLK_T_OUT) {
1347 /* Write */ 1347 /* Write */
1348 1348
@@ -1363,7 +1363,7 @@ static bool service_io(struct device *dev)
1363 /* Die, bad Guest, die. */ 1363 /* Die, bad Guest, die. */
1364 errx(1, "Write past end %llu+%u", off, ret); 1364 errx(1, "Write past end %llu+%u", off, ret);
1365 } 1365 }
1366 wlen = sizeof(in); 1366 wlen = sizeof(*in);
1367 in->status = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); 1367 in->status = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR);
1368 } else { 1368 } else {
1369 /* Read */ 1369 /* Read */
@@ -1376,10 +1376,10 @@ static bool service_io(struct device *dev)
1376 ret = readv(vblk->fd, iov+1, in_num-1); 1376 ret = readv(vblk->fd, iov+1, in_num-1);
1377 verbose("READ from sector %llu: %i\n", out->sector, ret); 1377 verbose("READ from sector %llu: %i\n", out->sector, ret);
1378 if (ret >= 0) { 1378 if (ret >= 0) {
1379 wlen = sizeof(in) + ret; 1379 wlen = sizeof(*in) + ret;
1380 in->status = VIRTIO_BLK_S_OK; 1380 in->status = VIRTIO_BLK_S_OK;
1381 } else { 1381 } else {
1382 wlen = sizeof(in); 1382 wlen = sizeof(*in);
1383 in->status = VIRTIO_BLK_S_IOERR; 1383 in->status = VIRTIO_BLK_S_IOERR;
1384 } 1384 }
1385 } 1385 }