From 1a73d12b95804a64e44ae3c455ca26d947928f49 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Fri, 11 Sep 2020 13:54:22 +0200 Subject: xlosetup: removed warning about unsuitable backing file size Warning might be flase positiv if a QCOW backing file is loaded. The correct check of the file format size is already implemented in the xloop Linux kernel module and not needed in xlosetup anymore. --- utils/sys-utils/xlosetup.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/utils/sys-utils/xlosetup.c b/utils/sys-utils/xlosetup.c index 8a215ec..60fa0ba 100644 --- a/utils/sys-utils/xlosetup.c +++ b/utils/sys-utils/xlosetup.c @@ -463,29 +463,6 @@ static void __attribute__((__noreturn__)) usage(void) exit(EXIT_SUCCESS); } -static void warn_size(const char *filename, uint64_t size, uint64_t offset, int flags) -{ - struct stat st; - - if (!size) { - if (stat(filename, &st) || S_ISBLK(st.st_mode)) - return; - size = st.st_size; - - if (flags & LOOPDEV_FL_OFFSET) - size -= offset; - } - - if (size < 512) - warnx(_("%s: Warning: file is smaller than 512 bytes; the xloop device " - "may be useless or invisible for system tools."), - filename); - else if (size % 512) - warnx(_("%s: Warning: file does not fit into a 512-byte sector; " - "the end of the file will be ignored."), - filename); -} - static int create_loop(struct loopdev_cxt *lc, int nooverlap, int lo_flags, int flags, const char *file, uint64_t offset, uint64_t sizelimit, @@ -876,7 +853,6 @@ int main(int argc, char **argv) if (res == 0) { if (showdev) printf("%s\n", loopcxt_get_device(&lc)); - warn_size(file, sizelimit, offset, flags); if (set_dio) goto lo_set_dio; } -- cgit v1.2.3-55-g7522