-/* $OpenBSD: vioblk.c,v 1.3 2023/05/13 23:15:28 dv Exp $ */
+/* $OpenBSD: vioblk.c,v 1.4 2023/05/28 05:28:50 asou Exp $ */
/*
* Copyright (c) 2023 Dave Voutila <dv@openbsd.org>
log_warnx("failed to init disk %s image", disk_type(type));
goto fail;
}
- vioblk->sz = szp;
+ vioblk->sz = szp / 512;
log_debug("%s: initialized vioblk[%d] with %s image (sz=%lld)",
__func__, vioblk->idx, disk_type(type), vioblk->sz);
-/* $OpenBSD: vioqcow2.c,v 1.22 2023/04/28 18:52:22 dv Exp $ */
+/* $OpenBSD: vioqcow2.c,v 1.23 2023/05/28 05:28:50 asou Exp $ */
/*
* Copyright (c) 2018 Ori Bernstein <ori@eigenstate.org>
file->pread = qc2_pread;
file->pwrite = qc2_pwrite;
file->close = qc2_close;
- *szp = diskp->disksz / 512;
+ *szp = diskp->disksz;
return 0;
}
-/* $OpenBSD: vioraw.c,v 1.9 2023/04/27 22:47:27 dv Exp $ */
+/* $OpenBSD: vioraw.c,v 1.10 2023/05/28 05:28:50 asou Exp $ */
/*
* Copyright (c) 2018 Ori Bernstein <ori@eigenstate.org>
*
/*
* Initializes a raw disk image backing file from an fd. Stores the
- * number of 512-byte sectors in *szp, returning -1 for error, 0 for success.
+ * number of bytes in *szp, returning -1 for error, 0 for success.
*/
int
virtio_raw_init(struct virtio_backing *file, off_t *szp, int *fd, size_t nfd)
file->pread = raw_pread;
file->pwrite = raw_pwrite;
file->close = raw_close;
- *szp = sz / 512;
+ *szp = sz;
return (0);
}