diff options
author | Kevin Wolf | 2014-04-11 19:16:36 +0200 |
---|---|---|
committer | Kevin Wolf | 2014-04-30 11:05:00 +0200 |
commit | 8bfea15ddac3a0ae832f181653c36e020f24f007 (patch) | |
tree | a099d37af1dd602f2a8a41a4866f4e6f6ce02043 /include/block | |
parent | block: Remove BDRV_O_COPY_ON_READ for bs->file (diff) | |
download | qemu-8bfea15ddac3a0ae832f181653c36e020f24f007.tar.gz qemu-8bfea15ddac3a0ae832f181653c36e020f24f007.tar.xz qemu-8bfea15ddac3a0ae832f181653c36e020f24f007.zip |
block: Unlink temporary files in raw-posix/win32
Instead of having unlink() calls in the generic block layer, where we
aren't even guarateed to have a file name, move them to those block
drivers that are actually used and that always have a filename. Gets us
rid of some #ifdefs as well.
The patch also converts bs->is_temporary to a new BDRV_O_TEMPORARY open
flag so that it is inherited in the protocol layer and the raw-posix and
raw-win32 drivers can unlink the file.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/block.h | 1 | ||||
-rw-r--r-- | include/block/block_int.h | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/include/block/block.h b/include/block/block.h index c12808a252..467fb2ba0a 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -92,6 +92,7 @@ typedef enum { #define BDRV_O_RDWR 0x0002 #define BDRV_O_SNAPSHOT 0x0008 /* open the file read only and save writes in a snapshot */ +#define BDRV_O_TEMPORARY 0x0010 /* delete the file after use */ #define BDRV_O_NOCACHE 0x0020 /* do not use the host page cache */ #define BDRV_O_CACHE_WB 0x0040 /* use write-back caching */ #define BDRV_O_NATIVE_AIO 0x0080 /* use native AIO instead of the thread pool */ diff --git a/include/block/block_int.h b/include/block/block_int.h index cd5bc7308a..9ffcb698d0 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -299,7 +299,6 @@ struct BlockDriverState { char backing_file[1024]; /* if non zero, the image is a diff of this file image */ char backing_format[16]; /* if non-zero and backing_file exists */ - int is_temporary; BlockDriverState *backing_hd; BlockDriverState *file; |