summaryrefslogtreecommitdiffstats
path: root/utils/sys-utils
diff options
context:
space:
mode:
authorManuel Bentele2020-09-11 13:54:22 +0200
committerManuel Bentele2020-09-16 07:37:56 +0200
commit1a73d12b95804a64e44ae3c455ca26d947928f49 (patch)
tree51be54fbe042ed2caa5814e900f7a9358e2d82ca /utils/sys-utils
parentRenamed losetup to xlosetup in man page (diff)
downloadxloop-1a73d12b95804a64e44ae3c455ca26d947928f49.tar.gz
xloop-1a73d12b95804a64e44ae3c455ca26d947928f49.tar.xz
xloop-1a73d12b95804a64e44ae3c455ca26d947928f49.zip
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.
Diffstat (limited to 'utils/sys-utils')
-rw-r--r--utils/sys-utils/xlosetup.c24
1 files changed, 0 insertions, 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;
}