From: yasuoka Date: Fri, 13 May 2022 00:17:20 +0000 (+0000) Subject: Follow the recent change that the unit of `imgsize' argument of X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7ac3f975abd0085ad3acd476aaa2cb53b9ced30c;p=openbsd 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 --- 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 @@ -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 @@ -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 @@ -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,