mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
lib/create.c: Fix check after BLKDISCARD
We didn't correctly check for an error from the ioctl. Thus when using a raw block device you would often see a bogus warning in debugging output. Related: https://issues.redhat.com/browse/MTV-2441
This commit is contained in:
@@ -119,7 +119,7 @@ disk_create_raw_block (guestfs_h *g, const char *filename)
|
||||
if (ioctl (fd, BLKGETSIZE64, &size) == 0) {
|
||||
range[0] = 0;
|
||||
range[1] = size;
|
||||
if (ioctl (fd, BLKDISCARD, range) == 0)
|
||||
if (ioctl (fd, BLKDISCARD, range) == -1)
|
||||
debug (g, "disk_create: %s: BLKDISCARD failed on this device: %m",
|
||||
filename);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user