Re: [Qemu-devel] [patch] non-blocking disk IO

2005-10-04 Thread Jens Axboe
On Tue, Oct 04 2005, Troy Benjegerdes wrote:
 What we want is to be able to have the guest OS request some DMA
 I/O operation, and have qemu be able to use AIO so that the actual disk
 hardware can dump the data directly in the pages the userspace process
 on the guest OS ends up wanting it in, avoiding several expensive memcopy
 and context switch operations.

That should be easy enough to do already, with or without the
nonblocking patch. Just make sure to open the files O_DIRECT and align
the io buffers and lengths. With a 2.6 host, you can usually get away
with 512-b aligment, on 2.4 you may have to ensure 1k/4k alignment.

-- 
Jens Axboe



___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] tun/tap networking: patch for existing tun

2005-10-04 Thread Christian MICHON
no vde for windows hosts :(

On 10/3/05, Jean-Christian de Rivaz [EMAIL PROTECTED] wrote:
 Christian MICHON a écrit :
  to do so, does that mean we would need to launch a 1st qemu
  instance which would contain the dhcp server, and next qemu
  instances would connect to it ?
 
  if so, 'qemu -server' and 'qemu -client -connect_to server' could
  be useful...

 As I understand and with what I know, you can do that now using a
 virtual network (VDE for example). What matter is that fact that two
 qemu instances are connected on the same network. DHCP protocol (like
 any others netowrk protocol) is over that network and is not visible to
 qemu.

 To do what you wants, you have to use to different operating system
 image, one that contains a DHCP server, and the second that contain a
 DHCP client.

 1) create a virtual switch: vde_switch -s /tmp/my_switch.ctl

 2) start a virtual server: vdeq -s /tmp/my_switch.ctl qemu-softmmu -hda
 dhcp-server.bin [...]

 3) start a virtual client: vdeq -s /tmp/my_switch.ctl qemu-softmmu -hda
 dhcp-client.bin [...]

 --
 Jean-Christian de Rivaz


 ___
 Qemu-devel mailing list
 Qemu-devel@nongnu.org
 http://lists.nongnu.org/mailman/listinfo/qemu-devel



--
Christian


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [patch] non-blocking disk IO

2005-10-04 Thread John Coiner


Whoops. I had the mistaken belief that Qemu already used pthreads.

So, the makefiles and configure script need to handle pthreads somehow 
(especially on windows.) Pthreads-w32 is refusing to 'make install' 
itself into standard lib and include directories. Unlike SDL, there is 
no 'pthread-config' to tell us where it lives.


Suppose that on Windows, we tell people to unpack the pthread 
distribution within the qemu tree. Qemu's configure script could find 
it, build a static pthread library, and link that into Qemu.


This removes the need for the user to:
 * read pthreads-w32 documents,
 * issue a separate build command for pthreads-w32,
 * get confused before realizing that pthreads-w32 doesn't really 
support 'make install',

 * hack at qemu until it points to the uninstalled pthreads dir,
 * copy the pthreads DLL into c:\windows

I'll look at adding this to the configure script.

-john



Christian MICHON wrote:

I managed to make it work (qemu+non blocking IO on windows host),
with a rough estimation of 10% speed increase at the early stage of
windows setup. I expect more once windows installs itself in true
multitasking mode. :)

What you need to do is:
- download pthreads-w32-2-6-0-release.tar.gz and compile it from scratch
 (make clean GC)
- you also need to add the following lines inside block.c (usleep is not
present in win32/mingw32)

 #ifdef WIN32
void usleep(unsigned long usec)
{
Sleep(usec/1000);
}
#endif

- you need to update the link to include -lpthreadGC2 -lz, and
keep a copy of the pthreadGC2.dll where qemu.exe will be
(to pu it just in from of -lz is just my personal suggestion)

HIH,
Christian

On 10/3/05, Elefterios Stamatogiannakis [EMAIL PROTECTED] wrote:


With which pthreads library have you compiled it under windows?

I've tried it with the one here:

ftp://sources.redhat.com/pub/pthreads-win32/

but it didn't compile.

teris.




___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel





___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [patch] non-blocking disk IO

2005-10-04 Thread Christian MICHON
I did not manage a static link on win32 yesterday. I needed the
pthread dll in the same directory as qemu.exe.

I'll look more into it.

On 10/4/05, John Coiner [EMAIL PROTECTED] wrote:
 Suppose that on Windows, we tell people to unpack the pthread
 distribution within the qemu tree. Qemu's configure script could find
 it, build a static pthread library, and link that into Qemu.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] about DHCP server in qemu

2005-10-04 Thread Christian MICHON
do you happen to have vde for win32 ?
If yes, please point it to me, because I've googled for one with no
luck... :)

On 10/3/05, Henrik Nordstrom [EMAIL PROTECTED] wrote:
 On Mon, 3 Oct 2005, Christian MICHON wrote:

  I think you meant guests instead of hosts.
  I second that. I would still like to use qemu to
  perform network simulations myself...

 This is done very nicely by VDE.

 Regards
 Henrik



--
Christian


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] tun/tap networking: patch for existing tun

2005-10-04 Thread Jean-Christian de Rivaz

Christian MICHON a écrit :

no vde for windows hosts :(


Have you tryed ? Because the VDE code don't interract to mutch with the 
system (only require POSIX OS) and contains a lot of win32 test as you 
can see in the attachement. But there is no document how to compile 
that. Since there are win32 test into the configure, I think this will 
require Cygwin tools.


--
Jean-Christian de Rivaz


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] $BDLC#$7$?$$;v$,M-$j$^$7$F!!!(B

2005-10-04 Thread info
$B!Z$40';![!'(B
$B!!Ev%5!%/%k$O!6bA,E*$K7C$^$l$F$$$k1|[EMAIL PROTECTED],[EMAIL PROTECTED](B
$B%5%]!%H%0%k![EMAIL PROTECTED])$5$l!g$K![EMAIL PROTECTED]uITK~(B
[EMAIL PROTECTED]%H$9$kL\E*$K3hF0$r$7$F$*$j$^$9!#(B
$B!!:#2s!Jg=8$5$;[EMAIL PROTECTED]/$N$O$3$N$h$[EMAIL PROTECTED]j(B
[EMAIL PROTECTED]:P0J[EMAIL PROTECTED](B
$B!!$3$NEY!5.J}$N%%+%%s%H(B($BG[?.$5$l$?%%I%l%9(B)$B$+$i$N$4EPO?(B
$B$OA4$FL5NA$K$J$C$F$*$j$^$9!#(B
$B!z!y!z4JC1$JL5NAEPO?!Bh1~Jg40N;!z!y!z(B
$B!!(Bhttp://www.news-caster.net?num=2525

$B99$K$9$P$i$7$$$N$O%3%A%i*(B

$B#(B1,000$B1_J,L5NA%]%$%s%H(B
$BG'ZITMW$G!Z(B1,000$B1_![J,$NL5NA%]%$%s%H$r?JDhCW$7$^$9!#HV9fG'Z8e$5$i$K#1#2!$#0#0#01_J,[EMAIL
 
PROTECTED](B!$BL5NA%]%$%s%H$G%a!%k$N$d$j$H$j!%W%m%U%#!%k$N1\Mw!L??$N3NG'$J$I(B
$BA4$F$N5!G=$,;H$($^$9$N$G!$4+M3$K$4MxMQ2$5$$!#(B

$B#!L(!ML%aIU$-D%aR2p(B
[EMAIL PROTECTED]$h$j!:G?7EPO?pJs$rL%aE:IU$GG[?.$Ne!D%a(B
$B$NR2p$r9T$$$^$9!#4uK[EMAIL PROTECTED]@[EMAIL PROTECTED]%k$,(B
$BF~$C$F$/[EMAIL PROTECTED][EMAIL PROTECTED]pJs$r?o;~%A%'%C%/(B
$B$7$^$7$g$!*!*!*(B

$B$4F~l$r$*BT$A$7$F$*$j$^$9!#(B

$B!J2q0wEPO?!K(Bhttp://www.news-caster.net?num=2525











$BG[?.ITMW$NJ}$O:!J}(B
$B!Z(BReception refusal address$B![(B
[EMAIL PROTECTED] 


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [patch] non-blocking disk IO

2005-10-04 Thread Christian MICHON
Then all is good and I should not use (2) as a benchmark.
Thanks for clarifying :)

On 10/4/05, John Coiner [EMAIL PROTECTED] wrote:
 (1) is a parallel task -- 'tar' and 'bunzip2' run concurrently. You see
 a benefit here when one process can use the CPU while the other is
 blocked waiting for IO.

 (2) is a serial task. It can't benefit from non-blocking IO. 'make -j 2'
 should benefit, in cases where the host file cache is cold.
--
Christian


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] bad performance accessing nfs exports on qemu host

2005-10-04 Thread Henning Sprang
Hi,
First of all, this is more a question about qemu usage, not development,
but the link to the qemu user forum on the qemu website
( http://www.dad-answers.com/qemu-forum/index.php )is broken (404), and
I don't see any other place to get qemu help for users. If there is a
better place for this question, please tell me so.

I am trying to use qemu for helping me with the development of an
automatic installation software for Debian Linux (FAI, that is).

Therefore I need a qemu guest system (FAI install client) mounting it's
root file system from an nfs server on the qemu host, and unpacking a
tar.gz file from that root into a directory from it's local virtual
harddisk.

While all the other services involved (dhcp, dns, ssh) seem to work with
no problems, I have serious performance trouble with NFS when I want to
copy  or unzip the file mentioned. I get a mount, and, when copying the
file, the whole qemu guest system turns incredibly slow, and it takes
approximately half an hour to copy a 40M file from the nfsroot to it's
local disk. In that time, also any command given on the qemu guest's
shell executes extremly slow. Copying files with ftp is much faster.
There is not big  CPU load or anything to be seen on neither guest or
host. So finally everything works, and my automatic install comes to an
end, but with a very long delay, taking a sum of more than an hour, of
which most of the seems to be spent on just copying a 40M file.

There's no firewall blocking NFS access on the host, I restarted all
services after starting the qemu vm, so all services are restarted with
a tun0 device existing (not doing so seems to confuse some of the
services mentiones). I cannot see any messages in any log files which
would help me getting rid of that problem.

What could it be causing this behaviour? Is there a known problem with
using especially NFS between the qemu host and client?

Please tell me if you need any further information to answer my
question, I might have forgotten an important detail.


Thanks in Advance,
Henning



___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [patch] non-blocking disk IO

2005-10-04 Thread Troy Benjegerdes
On Mon, Oct 03, 2005 at 11:16:18PM -0400, John Coiner wrote:
 
 
 Troy Benjegerdes wrote:
 I am also haveing trouble getting a fresh win2k install under qemu to 
 actually
 be able to run windows update.
 
 I had to download and install Win2k SP4, then Win2k SP4 Hotfixes, and 
 also an IE6 upgrade, before windows update ran.

Are you running with a tun/tap device, or -user-net ? I'm still unable
to get windowsupdate to work. Getting it to work in vmware seems to work
on the first try.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Wrong date in a linux Client under Windows host

2005-10-04 Thread Helmut Auer

[EMAIL PROTECTED] wrote:

Hello,
When starting a linux client under Win2K I got a wrong date from the system.
Sometimes its nearly ok, the next time its 2 months ago ...
Any idea what can cause this behaviour or how to avoid it ?
Bye
Helmut

Hi,
Can anyone give me a hint which module is responsible for setting the 
system time on a linux client under a windows host ?
The problem is really annoying, because I do not have network access for 
getting the time via ntp.


--
Helmut Auer, [EMAIL PROTECTED] 




___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] tap device and two nics

2005-10-04 Thread Don Kitchen
Hi, it looks like I stirred up some change by asking about tun and tap.
(and definately it's important to know that tun is a tap device!)

In case anyone's interested, here is a tapdev2.c that I put together
to make use of two virtual nics as tap devices. Maybe also the script
setup will interest people for the regular tapdev.c. Apologies for the
clumsy way I use perl.

#define _GNU_SOURCE /* asprintf */
#include stdio.h
#include string.h
#include sys/types.h
#include pwd.h
#include grp.h
#include sys/stat.h
#include sys/ioctl.h
#include fcntl.h
#include unistd.h
#include stdlib.h
#include net/if.h
#include linux/if_tun.h

/* Tiny code to open two tap devices, and hand the fds to qemu.
   Run as root, drops to given user. 

   Based on tundev.c freely distributed at in
   http://fabrice.bellard.free.fr/qemu/tetrinet.tar.gz
   Assuming that code is available under BSD or GPL license, these
   modifications are under GPL.

   Linux usage:

DEVS=`./tapdev2 root log /usr/bin/qemu ... `
DEV1=`echo $DEVS | perl -pe 's/^([^ ]*) *([^ ]*)/$1/'`
DEV2=`echo $DEVS | perl -pe 's/^([^ ]*) *([^ ]*)/$2/'`
/sbin/ifconfig $DEV1 0.0.0.0 promisc up
/sbin/ifconfig $DEV2 0.0.0.0 promisc up
/sbin/ifconfig br0  /dev/null || (/usr/sbin/brctl addbr br0  /sbin/ifconfig
br0 up)
/usr/sbin/brctl addif br0 $DEV1
echo br0 device $DEV1   other device $DEV2

*/
int main(int argc, char *argv[])
{
struct ifreq ifr1;
struct ifreq ifr2;
struct passwd *p;
unsigned int i;
char *newargs[argc];
int fd1, fd2;

#define JUNKARGS 3
#define TWONICS 2
#define TAPFD 2

if (argc  4) {
fprintf(stderr,
Usage: tapdev2 switchuser logfile qemu qemu 
options...\n);
exit(1);
}

fd1 = open(/dev/net/tun, O_RDWR);
if (fd1  0) {
perror(1 Could not open /dev/net/tun);
exit(1);
}
fd2 = open(/dev/net/tun, O_RDWR);
if (fd2  0) {
perror(2 Could not open /dev/net/tun);
exit(1);
}

memset(ifr1, 0, sizeof(ifr1));
ifr1.ifr_flags = IFF_TAP | IFF_NO_PI;
strncpy(ifr1.ifr_name, tap%d, IFNAMSIZ);
memset(ifr2, 0, sizeof(ifr2));
ifr2.ifr_flags = IFF_TAP | IFF_NO_PI;
strncpy(ifr2.ifr_name, tap%d, IFNAMSIZ);
if (ioctl(fd1, TUNSETIFF, (void *) ifr1) != 0) {
perror(1 Could not get tun device);
exit(1);
}
if (ioctl(fd2, TUNSETIFF, (void *) ifr2) != 0) {
perror(2 Could not get tun device);
exit(1);
}

/* Set userid. */
p = getpwnam(argv[JUNKARGS-2]);
if (!p) {
fprintf(stderr, No user '%s'\n, argv[JUNKARGS-2]);
exit(1);
}
setgroups(0, NULL);
setgid(p-pw_gid);
if (setuid(p-pw_uid) != 0) {
perror(setting uid);
exit(1);
}

/* arg# 0  12   3   4   5  6  7   8
   old:   tapdev2 user  - qemu-hda blah...

   new:   qemu-nics 2 -tun-fd   x  -tun-fd x-hda blah ...
*/

/* Insert -nics 2 -tun-fd, delete other args */
newargs[0] = argv[0+JUNKARGS];
asprintf(newargs[1], -nics);
asprintf(newargs[2], 2);
asprintf(newargs[TWONICS+1], -tun-fd);
asprintf(newargs[TWONICS+2], %d, fd1);
asprintf(newargs[TWONICS+TAPFD+1], -tun-fd);
asprintf(newargs[TWONICS+TAPFD+2], %d, fd2);

for (i = JUNKARGS+1; i = argc; i++)
newargs[i-JUNKARGS+TWONICS+TAPFD+TAPFD] = argv[i];

if (strcmp(argv[JUNKARGS-1], -) == 0) {
printf(%s %s\n, ifr1.ifr_name, ifr2.ifr_name);
execvp(newargs[0], newargs);
exit(1);
}

switch (fork()) {
case 0: {
close(1);
close(2);
open(argv[JUNKARGS-1], O_WRONLY|O_APPEND);
open(argv[JUNKARGS-1], O_WRONLY|O_APPEND);
close(0);
execvp(newargs[0], newargs);
exit(1);
}
case -1:
perror(fork failed);
exit(1);
}
printf(%s %s\n, ifr1.ifr_name, ifr2.ifr_name);
exit(0);
}


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [patch] non-blocking disk IO

2005-10-04 Thread John Coiner


I had to download and install Win2k SP4, then Win2k SP4 Hotfixes, and 
also an IE6 upgrade, before windows update ran.


Are you running with a tun/tap device, or -user-net ? I'm still unable
to get windowsupdate to work. Getting it to work in vmware seems to work
on the first try.


I've been running -user-net.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] bad performance accessing nfs exports on qemu host

2005-10-04 Thread Henning Sprang
Hi,
I found some answers/help to my questions by further looking:

On Tue, 2005-10-04 at 15:41 +0200, Henning Sprang wrote:
 Hi,
 First of all, this is more a question about qemu usage, not development,
 but the link to the qemu user forum on the qemu website
 ( http://www.dad-answers.com/qemu-forum/index.php )is broken (404), and
 I don't see any other place to get qemu help for users. If there is a
 better place for this question, please tell me so.

The Link on the website is really broken, but I found the user forum on
http://qemu.dad-answers.com/ - it could help users and developers a lot
if that link could be fixed.

I also wonder why there is no Mailing list for users.


 
 I am trying to use qemu for helping me with the development of an
 automatic installation software for Debian Linux (FAI, that is).
 
 Therefore I need a qemu guest system (FAI install client) mounting it's
 root file system from an nfs server on the qemu host, and unpacking a
 tar.gz file from that root into a directory from it's local virtual
 harddisk.
 
 While all the other services involved (dhcp, dns, ssh) seem to work with
 no problems, I have serious performance trouble with NFS when I want to
 copy  or unzip the file mentioned. I get a mount, and, when copying the
 file, the whole qemu guest system turns incredibly slow, and it takes
 approximately half an hour to copy a 40M file from the nfsroot to it's
 local disk. In that time, also any command given on the qemu guest's
 shell executes extremly slow. Copying files with ftp is much faster.
 There is not big  CPU load or anything to be seen on neither guest or
 host. So finally everything works, and my automatic install comes to an
 end, but with a very long delay, taking a sum of more than an hour, of
 which most of the seems to be spent on just copying a 40M file.
 

I found a workaround for that - when I enable NFS over TCP by giving my
install client a line like this with dhcp:

  option root-path
/usr/lib/fai/nfsroot,rsize=8192,wsize=8192,acregmin=1800,acregmax=1800,acdirmin=1800,acdirmax=1800,tcp;

- most important is the last part tcp - then everything goes much much
faster. It seems like qemu doesn't work well for udp packets, maybe the
developers have a better idea and explanation for that?!

Anyway, have a nice day - mine is made by this great thing I found, now
I can use qemu for real nice testing of FAI installation without
spending lots of money for hardware.

Henning





___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] Rolex is what I want you to wear.

2005-10-04 Thread Miriam Livingston
designer replicas
http://upgrade.nrik.com/rep/dir/


A good scare is worth more to a man than good advice. 
When a thing is funny, search it carefully for a hidden truth. 
The cautious seldom err. 

Just to be is a blessing. Just to live is holy.  
Religion is pickled God. 

To travel hopefully is a better thing than to arrive.   
Can I ever know you Or you know me?
You don't get anything clean without getting something else dirty.   
Believing where we cannot prove.




___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel