Skip to contentSkip to conversation

tftp issue

Qemu-devel Ronald 3 participants 7 messages Oct 8, 2004 – Oct 9, 2004

lore
Share & tools
lore

Ronald

author
#0 lore raw

Hi all,

tonight I decided to give a try to tftp transfert between a windows 98 host and linux guest.
First thing I had to deal with was how to pass the tftp_prefix, I figured out that omiting the drive letter and his preceding slash is the right way (ie exporting C:\temp to guest consist in passing -tftp /temp to qemu). The issue I had next was with file transfert, I can get some files completely and only the first bytes for some others.
I don't know already on what it depends (size, file type ...?), but I thought I should let you know that.

#1 lore raw
Quoted 1 line · Ronald

Hi all,

Hi!

Quoted 9 lines

tonight I decided to give a try to tftp transfert between a windows 98 host and linux guest.
First thing I had to deal with was how to pass the tftp_prefix, I figured out that omiting the drive letter and his preceding slash is the right way (ie exporting C:\temp to guest consist in passing -tftp /temp to qemu). The issue I had next was with file transfert, I can get some files completely and only the first bytes for some others.
I don't know already on what it depends (size, file type ...?), but I thought I should let you know that.

Thank you for the report.

Please specify the version of QEMU and the name and version of the TFTP client used by the guest. Or even better, provide a link to a precompiled win32 snapshot of QEMU that behaves like you describe together with a pointer to a bootable image if available on the net.

Thanks!

/ magnus

author
#2 lore raw

Le Sat, 09 Oct 2004 21:45:47 +0200, Magnus Damm a écrit :

Quoted 15 lines · Ronald
Quoted 1 line

Hi all,

Hi!

Quoted 9 lines

tonight I decided to give a try to tftp transfert between a windows 98 host and linux guest.
First thing I had to deal with was how to pass the tftp_prefix, I figured out that omiting the drive letter and his preceding slash is the right way (ie exporting C:\temp to guest consist in passing -tftp /temp to qemu). The issue I had next was with file transfert, I can get some files completely and only the first bytes for some others. I don't know already on what it depends (size, file type ...?), but I thought I should let you know that.

Quoted 7 lines

Thank you for the report.

Please specify the version of QEMU and the name and version of the TFTP client used by the guest. Or even better, provide a link to a precompiled win32 snapshot of QEMU that behaves like you describe together with a pointer to a bootable image if available on the net.

Qemu version is yesterday cvs, tftp is netkit-tftp-0.17 from slackware 8. Binary for windows is avaible at ftp://ftp.freeoszoo.org/qemu/win32/daily/QemuInstall-20041008.exe. Image is not online, that's a minimal slackware 8 install from cdrom.

Quoted 3 lines

Thanks!

/ magnus

author
#3 lore raw

Le Sat, 09 Oct 2004 21:55:28 +0200, Ronald a écrit :

Quoted 4 lines

Qemu version is yesterday cvs, tftp is netkit-tftp-0.17 from slackware 8. Binary for windows is avaible at ftp://ftp.freeoszoo.org/qemu/win32/daily/QemuInstall-20041008.exe. Image is not online, that's a minimal slackware 8 install from cdrom.

More informations: under linux with the same image and the same files I get complete transfert, md5 checksum are the same for originals and transfered files on guest (tested with command.com, msdos.sys and license.txt :) if that matter)

#4 lore raw
Quoted 5 lines

More informations: under linux with the same image and the same files I get complete transfert, md5 checksum are the same for originals and transfered files on guest (tested with command.com, msdos.sys and license.txt :) if that matter)

Hm.. could it be the good old missing O_BINARY flag to open()?

/ magnus

#5 lore raw

Hi,

Quoted 7 lines · Magnus Damm
Quoted 5 lines

More informations: under linux with the same image and the same files I get complete transfert, md5 checksum are the same for originals and transfered files on guest (tested with command.com, msdos.sys and license.txt :) if that matter)

Hm.. could it be the good old missing O_BINARY flag to open()?

Indeed, in slirp/tftp.c:103, there is an open without O_BINARY.

BTW, I did a simple grep through all sources, and there are quite a few open()s without the O_BINARY flag, and even one (in dyngen.c) which uses the O_BINARY flag only on Windows. Is there any sane reason not to use O_BINARY *everytime* in an open()? After all, we are not dealing with text files here. And if we were, we would not like to change the line endings on the fly, and ^Z simulating an EOF on Windows...

Ciao,
Dscho

author
#6 lore raw
In reply to Magnus Damm

Le Sun, 10 Oct 2004 00:07:15 +0200, Magnus Damm a écrit :

Quoted 9 lines
Quoted 5 lines

More informations: under linux with the same image and the same files I get complete transfert, md5 checksum are the same for originals and transfered files on guest (tested with command.com, msdos.sys and license.txt :) if that matter)

Hm.. could it be the good old missing O_BINARY flag to open()?

/ magnus

Ok, this works now, I modified tftp.c to add O_BINARY (there is only one open( , easy :)).