Skip to contentSkip to conversation

Location of temporary file for sectors on Windows (XP)

Qemu-devel W. Craig Scratchley 4 participants 6 messages Dec 2, 2005 – Dec 6, 2005

lore
Share & tools
lore
#0 lore raw

The user manual reads:

"If you use the option -snapshot', all disk images are considered as read only. When sectors in written, they are written in a temporary file created in /tmp'."

On Windows (XP), however, I am getting files of the form s??? in the C:\
directory. This is causing problems at SFU because student accounts don't have write access to the C:\ directory and this seems to be causing Qemu to immediately crash.

Note that I do have a directory C:\tmp, but it is not being used for this temporary file. Also, my system has environment variables TMP and TEMP, and these are not being consulted.

Then, I entered the following line:

set QEMU_TMPDIR=c:\tmp

But this also had no effect.

Finally, note that the s??? files in my C:\ directory are not being deleted by Qemu, which means an arbitrary amount of space can get taken up by the files over time.

Seems like an issue which has not yet been addressed for Windows builds.

Thanks,

Craig Scratchley, Simon Fraser University

p.s. I am now successfully using Qemu for QNX 6.3.0 as a guest (seems I must use the -isa option for Qemu to get networking). The -loadvm option is great, as QNX is very slow to boot in QNX (it is much faster for me in Bochs).

#1 lore raw

Hi,

Quoted 8 lines · W. Craig Scratchley

On Windows (XP), however, I am getting files of the form s??? in the C:\
directory. This is causing problems at SFU because student accounts don't have write access to the C:\ directory and this seems to be causing Qemu to immediately crash.

[...]

Seems like an issue which has not yet been addressed for Windows builds.

Correct. The culprit is the function get_tmp_filename() in block.c. Since you cannot remove a file, but still keep a filehandle open (on windblows), there is no really nice way to go about that.

You *could* make an array of temporary files, and register a cleanup function with atexit(), but I do not know if that would be called when closing the window by hitting the "x" button (after all, this is my favorite way to exit QEmu when I called it with -snapshot).

Hth,
Dscho

#2 lore raw
Quoted 9 lines · Johannes Schindelin

Hi,

Quoted 5 lines · W. Craig Scratchley

On Windows (XP), however, I am getting files of the form s??? in the C:\
directory. This is causing problems at SFU because student accounts don't have write access to the C:\ directory and this seems to be causing Qemu to immediately crash.

Quoted 7 lines
Quoted 3 lines

[...]

Seems like an issue which has not yet been addressed for Windows builds.

Correct. The culprit is the function get_tmp_filename() in block.c. Since you cannot remove a file, but still keep a filehandle open (on windblows), there is no really nice way to go about that.

I would venture a gues that winblows is windows in which case you are not really correct:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfile.asp

FILE_SHARE_DELETE and all that

Signature · 1 line
mailto:[email protected]
#3 lore raw

Hi,

Quoted 16 lines · malc
Quoted 14 lines · Johannes Schindelin

Hi,

Quoted 9 lines · W. Craig Scratchley

On Windows (XP), however, I am getting files of the form s??? in the C:\
directory. This is causing problems at SFU because student accounts don't have write access to the C:\ directory and this seems to be causing Qemu to
immediately crash.

[...]

Seems like an issue which has not yet been addressed for Windows builds.

Quoted 8 lines
Quoted 3 lines

Correct. The culprit is the function get_tmp_filename() in block.c. Since you cannot remove a file, but still keep a filehandle open (on windblows), there is no really nice way to go about that.

I would venture a gues that winblows is windows in which case you are not really correct:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfile.asp

I cannot access that link...

Quoted 1 line

FILE_SHARE_DELETE and all that

... but having had lots of fun with win32 I gather this is not really backwards compatible? Or, alternatively, it fails on FAT?

Ciao,
Dscho

#4 lore raw
Quoted 7 lines · Johannes Schindelin
Quoted 5 lines

I would venture a gues that winblows is windows in which case you are not really correct:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfile.asp

I cannot access that link...

Strange..
Just search msdn for CreateFile

Quoted 5 lines
Quoted 2 lines

FILE_SHARE_DELETE and all that

... but having had lots of fun with win32 I gather this is not really backwards compatible? Or, alternatively, it fails on FAT?

It's not supported on Win 98/95/Me

Signature · 1 line
mailto:[email protected]
#5 lore raw

Re: [Qemu-devel] Location of temporary file for sectors on Windows

In reply to Johannes Schindelin
Quoted 3 lines · Johannes Schindelin
Quoted 1 line

FILE_SHARE_DELETE and all that

... but having had lots of fun with win32 I gather this is not really backwards compatible? Or, alternatively, it fails on FAT?

MSDN says:

,----- [ FILE_SHARE_DELETE ]

| Enables subsequent open operations on an object to request delete access.
| 
| Otherwise, other processes cannot open the object if they request delete
| access.
| 
| If this flag is not specified, but the object has been opened for delete
| access, the function fails.
| 
|    Windows Me/98/95:  This flag is not supported.

`-----

Signature · 4 lines
< Jernej Simončič ><><><><>< http://deepthought.ena.si/ >

If the shoe fits, it's ugly. If it's good, they discontinue it.
       -- Law of Consumer Economics