vmm: virtio-blk: Add sanity check
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 5 Oct 2017 18:26:46 +0000 (14:26 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 5 Oct 2017 21:06:41 +0000 (17:06 -0400)
The comments says there must be three IOVs; let's assert it to avoid any
problems.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/vmm/virtio_blk.c

index f1f9d00..071fb55 100644 (file)
@@ -78,6 +78,7 @@ void *blk_request(void *_vq)
                 * The second is the actual data.
                 * The third contains just the status byte.
                 */
+               assert(olen + ilen == 3);
 
                status = iov[2].iov_base;
                if (!status)