QCOW/QCOW2 for win32
Hi,
A patch below fixes QCOW/QCOW2 for win32.
-snapshot option works. When -snapshot is used, a temporary file is created at C:\Documents and Settings\(user name)\Local Settings\temp.
In path_is_absolute in block.c, path separation '/' also works for win32.
A named snapshot works. I can make a named temporary file by qemu-img.exe and boots from it.
When I used qcow2, VM snapshots work.
localtime in block.c is thread-safe for win32.
For more information, see.
http://www.h7.dion.ne.jp/~qemu-win/HowToFloppyCdrom-en.html#snapshot
Patch.
http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20060906-qcow.patch
Binary.
http://www.h6.dion.ne.jp/~kazuw/qemu-win/qemu-20060906-qcow.zip
Regards,
Kazu
Quoted 9 lines · Kazu
Patch.
http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20060906-qcow.patchQuoted 6 lines
#ifdef
QEMU_TOOL(quoted diff) +1
-1- overlapped = 0; + overlapped = FILE_ATTRIBUTE_NORMAL; #else overlapped = FILE_FLAG_OVERLAPPED; #endif
I suspect the second value should be (FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED). But I'm no Win32 expert.
-- Jamie
Quoted 11 lines · Jamie Lokier
Quoted 9 lines · Kazu
Patch.
http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20060906-qcow.patchQuoted 6 lines
#ifdef
QEMU_TOOL(quoted diff) +1
-1- overlapped = 0; + overlapped = FILE_ATTRIBUTE_NORMAL; #else overlapped = FILE_FLAG_OVERLAPPED; #endif
Quoted 3 lines
I suspect the second value should be (
FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED). But I'm no Win32 expert.
I think FILE_ATTRIBUTE_NORMAL is only used without other options.
Regards,
Kazu
Quoted 11 lines · Kazu
Quoted 11 lines
Quoted 9 lines · Kazu
Patch.
http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20060906-qcow.patchQuoted 6 lines
#ifdef
QEMU_TOOL(quoted diff) +1
-1- overlapped = 0; + overlapped = FILE_ATTRIBUTE_NORMAL; #else overlapped = FILE_FLAG_OVERLAPPED; #endif
Quoted 4 lines
Quoted 2 lines
I suspect the second value should be (
FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED). But I'm no Win32 expert.I think
FILE_ATTRIBUTE_NORMALis only used without other options.
I think that is true only for "attribute" options, i.e. those beginning with FILE_ATTRIBUTE_* and not those beginning with FILE_FLAG_*.
The Microsoft CreateFile documentation is not very clear:
"FILE_ATTRIBUTE_NORMAL: A file does not have other attributes set. This attribute is valid only if used alone.". But it does distinguish between attributes and flags.
It also explains that the attributes are only used when creating a file, not when opening an existing one. Whereas the flags affect the operation of open file handles, even if the file already exists.
But as I say, I'm no win32 expert.
-- Jamie