Re: [Qemu-devel] [PATCHv2] qemu-img: set nocow flag to new file
2013/11/15 Kevin Wolf kw...@redhat.com Am 15.11.2013 um 06:01 hat Chunyan Liu geschrieben: Set NOCOW flag to newly created images to solve performance issues on btrfs. Btrfs has terrible performance when hosting VM images, even more when the guest in those VM are also using btrfs as file system. One way to mitigate this bad performance is to turn off COW attributes on VM files (since having copy on write for this kind of data is not useful). Signed-off-by: Chunyan Liu cy...@suse.com diff --git a/include/qemu-common.h b/include/qemu-common.h index 5054836..fe7dd9b 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -50,6 +50,15 @@ #include sysemu/os-posix.h #endif +#ifdef __linux__ +#include linux/fs.h +#include sys/ioctl.h + +#ifndef FS_NOCOW_FL +#define FS_NOCOW_FL 0x0080 /* Do not cow file */ +#endif +#endif + #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif hw/block/m25p80.c:219: Fehler: expected identifier before numeric constant On RHEL 6, there seems to be a naming conflict for READ, which is present in linux/fs.h and used as a local enum value by m25p80.c. Will update for this and GETFLAGS SETFLAGS. Thanks, Chunyan Kevin
Re: [Qemu-devel] [PATCHv2] qemu-img: set nocow flag to new file
Am 15.11.2013 um 06:01 hat Chunyan Liu geschrieben: Set NOCOW flag to newly created images to solve performance issues on btrfs. Btrfs has terrible performance when hosting VM images, even more when the guest in those VM are also using btrfs as file system. One way to mitigate this bad performance is to turn off COW attributes on VM files (since having copy on write for this kind of data is not useful). Signed-off-by: Chunyan Liu cy...@suse.com diff --git a/include/qemu-common.h b/include/qemu-common.h index 5054836..fe7dd9b 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -50,6 +50,15 @@ #include sysemu/os-posix.h #endif +#ifdef __linux__ +#include linux/fs.h +#include sys/ioctl.h + +#ifndef FS_NOCOW_FL +#define FS_NOCOW_FL 0x0080 /* Do not cow file */ +#endif +#endif + #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif hw/block/m25p80.c:219: Fehler: expected identifier before numeric constant On RHEL 6, there seems to be a naming conflict for READ, which is present in linux/fs.h and used as a local enum value by m25p80.c. Kevin