summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorASOU Masato <asou@cvs.openbsd.org>2023-05-28 05:28:51 +0000
committerASOU Masato <asou@cvs.openbsd.org>2023-05-28 05:28:51 +0000
commitdf67ea38b371d2568e6dbafe6a5dc21ca9502bfb (patch)
tree4a52f9b498b74fcde1dcb924c1ad39ac6cf85f7d
parentb445cb448c86994e39315707ce725064affafc25 (diff)
Used number of bytes instead of number of 512 byte sectors.
ok dv@
-rw-r--r--usr.sbin/vmd/vioblk.c4
-rw-r--r--usr.sbin/vmd/vioqcow2.c4
-rw-r--r--usr.sbin/vmd/vioraw.c6
3 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/vmd/vioblk.c b/usr.sbin/vmd/vioblk.c
index 33d447a9438..7bc76c4daed 100644
--- a/usr.sbin/vmd/vioblk.c
+++ b/usr.sbin/vmd/vioblk.c
@@ -1,4 +1,4 @@
-/* $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>
@@ -144,7 +144,7 @@ vioblk_main(int fd, int fd_vmm)
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);
diff --git a/usr.sbin/vmd/vioqcow2.c b/usr.sbin/vmd/vioqcow2.c
index 96f830d58bf..c648d668132 100644
--- a/usr.sbin/vmd/vioqcow2.c
+++ b/usr.sbin/vmd/vioqcow2.c
@@ -1,4 +1,4 @@
-/* $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>
@@ -130,7 +130,7 @@ virtio_qcow2_init(struct virtio_backing *file, off_t *szp, int *fd, size_t nfd)
file->pread = qc2_pread;
file->pwrite = qc2_pwrite;
file->close = qc2_close;
- *szp = diskp->disksz / 512;
+ *szp = diskp->disksz;
return 0;
}
diff --git a/usr.sbin/vmd/vioraw.c b/usr.sbin/vmd/vioraw.c
index 4050efd1a5d..fb74303c915 100644
--- a/usr.sbin/vmd/vioraw.c
+++ b/usr.sbin/vmd/vioraw.c
@@ -1,4 +1,4 @@
-/* $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>
*
@@ -47,7 +47,7 @@ raw_close(void *file, int stayopen)
/*
* 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)
@@ -70,7 +70,7 @@ 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);
}