summaryrefslogtreecommitdiff
path: root/usr.sbin/vmctl
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2022-05-13 00:17:21 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2022-05-13 00:17:21 +0000
commit09dd1623827bdcf7431f9189efb873114555c6ae (patch)
treebfa4886557a7aae9218877c1bcea9358445c2873 /usr.sbin/vmctl
parent3446a8236fe5c611a53d6a8dfb830ff72989c63d (diff)
Follow the recent change that the unit of `imgsize' argument of
create_imagefile() became MB. Also change the arguement's type from long to uint64_t that is preferred. ok dv
Diffstat (limited to 'usr.sbin/vmctl')
-rw-r--r--usr.sbin/vmctl/main.c7
-rw-r--r--usr.sbin/vmctl/vmctl.c4
-rw-r--r--usr.sbin/vmctl/vmctl.h4
3 files changed, 7 insertions, 8 deletions
diff --git a/usr.sbin/vmctl/main.c b/usr.sbin/vmctl/main.c
index d5b7f937414..c244d8c142c 100644
--- a/usr.sbin/vmctl/main.c
+++ b/usr.sbin/vmctl/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.70 2022/05/04 23:17:25 dv Exp $ */
+/* $OpenBSD: main.c,v 1.71 2022/05/13 00:17:20 yasuoka Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -660,9 +660,8 @@ ctl_convert(const char *srcfile, const char *dstfile, int dsttype, size_t dstsiz
/* align to megabytes */
dst.size = ALIGNSZ(dstsize, 1048576);
- if ((ret = create_imagefile(dst.type, dst.disk, NULL,
- dst.size / 1048576, &format)) != 0) {
- errno = ret;
+ if ((ret = create_imagefile(dst.type, dst.disk, NULL, dst.size,
+ &format)) != 0) {
errstr = "failed to create destination image file";
goto done;
}
diff --git a/usr.sbin/vmctl/vmctl.c b/usr.sbin/vmctl/vmctl.c
index 2b2d61b123f..19dd2f6d4e7 100644
--- a/usr.sbin/vmctl/vmctl.c
+++ b/usr.sbin/vmctl/vmctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmctl.c,v 1.82 2022/05/04 23:17:25 dv Exp $ */
+/* $OpenBSD: vmctl.c,v 1.83 2022/05/13 00:17:20 yasuoka Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
@@ -935,7 +935,7 @@ open_imagefile(int type, const char *imgfile_path, int flags,
*/
int
create_imagefile(int type, const char *imgfile_path, const char *base_path,
- long imgsize, const char **format)
+ uint64_t imgsize, const char **format)
{
int ret;
diff --git a/usr.sbin/vmctl/vmctl.h b/usr.sbin/vmctl/vmctl.h
index f7016dec085..95691edc92e 100644
--- a/usr.sbin/vmctl/vmctl.h
+++ b/usr.sbin/vmctl/vmctl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmctl.h,v 1.36 2022/05/04 23:17:25 dv Exp $ */
+/* $OpenBSD: vmctl.h,v 1.37 2022/05/13 00:17:20 yasuoka Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -90,7 +90,7 @@ __dead void
/* vmctl.c */
int open_imagefile(int, const char *, int,
struct virtio_backing *, off_t *);
-int create_imagefile(int, const char *, const char *, long, const char **);
+int create_imagefile(int, const char *, const char *, uint64_t, const char **);
int create_raw_imagefile(const char *, long);
int create_qc2_imagefile(const char *, const char *, long);
int vm_start(uint32_t, const char *, size_t, int, char **, int,