qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] KVM freeze when using --serial
@ 2010-04-07 14:32 Thomas Kittel
  2010-04-07 14:52 ` [Qemu-devel] " Thomas Kittel
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Kittel @ 2010-04-07 14:32 UTC (permalink / raw)
  To: kvm; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1111 bytes --]

Hi there,

I already posted this problem to #kvm on freenode.

Please set me in CC: when replying to this mail, as I am not subscribed 
to this mailing lists right now.

The Scenario is as follows:

I got 2 VM processes in userspace.

The first is started with the parameter --monitor pty.
    => This results in a file /dev/pts/x in the host,
        (crw--w---- 1 kittel tty 136, 3 2010-04-07 15:51 /dev/pts/3 on 
my system)

Another VM is then started with the parameter --serial /dev/pts/3
    => This results in /dev/ttyS0 inside the second VM.

Both VMs are running debian lenny. The host (debian) uses qemu-kvm 0.12.3.
"startvms.sh start" is used to start the VMs.

Running the executable build from test.c in the second VM results in a 
freeze of this VM.
(The test.c included uses /dev/ttyS1 as /dev/ttyS0 is the VMs serial 
console in my setup.)
The process uses 100% CPU and is stuck in kvm_mutex_lock().

Trying to use the build in gdbserver didn´t work because it also locked.

Is there a way to tunnel one VMs monitor console to another VM?

Thanks Thomas





[-- Attachment #2: test.c --]
[-- Type: text/x-csrc, Size: 585 bytes --]

#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>

#include <signal.h>

#include <pthread.h>

void signal_handler(int signum){
	pthread_exit(NULL);
}

void *readFile(void * ptr){
	signal(SIGTERM, signal_handler);
	int fd;
	char buffer;
	fd = open("/dev/ttyS1", O_RDONLY);
	while(true){
		read(fd, &buffer, 1);
		printf("%c", buffer);
		fflush(stdout);
	}

	close(fd);
	pthread_exit(NULL);

}

int main(int argc, char** argv){
	pthread_t thread;

	pthread_create(&thread, NULL, &readFile, NULL);

	sleep(10);
		
	pthread_kill(thread, SIGTERM);
	pthread_join(thread, NULL);

}
	

[-- Attachment #3: startvms.sh --]
[-- Type: application/x-sh, Size: 1178 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: KVM freeze when using --serial
  2010-04-07 14:32 [Qemu-devel] KVM freeze when using --serial Thomas Kittel
@ 2010-04-07 14:52 ` Thomas Kittel
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Kittel @ 2010-04-07 14:52 UTC (permalink / raw)
  To: kvm; +Cc: qemu-devel

Hi again,

I just tried to use unix domain sockets.

So I used the parameter --monitor unix:monitor:server:nowait on the first VM
and the parameter --serial unix:monitor on the second VM,

And again the second VM freezes when running my test application.

cya Tom

Thomas Kittel wrote:
> Hi there,
>
> I already posted this problem to #kvm on freenode.
>
> Please set me in CC: when replying to this mail, as I am not 
> subscribed to this mailing lists right now.
>
> The Scenario is as follows:
>
> I got 2 VM processes in userspace.
>
> The first is started with the parameter --monitor pty.
>    => This results in a file /dev/pts/x in the host,
>        (crw--w---- 1 kittel tty 136, 3 2010-04-07 15:51 /dev/pts/3 on 
> my system)
>
> Another VM is then started with the parameter --serial /dev/pts/3
>    => This results in /dev/ttyS0 inside the second VM.
>
> Both VMs are running debian lenny. The host (debian) uses qemu-kvm 
> 0.12.3.
> "startvms.sh start" is used to start the VMs.
>
> Running the executable build from test.c in the second VM results in a 
> freeze of this VM.
> (The test.c included uses /dev/ttyS1 as /dev/ttyS0 is the VMs serial 
> console in my setup.)
> The process uses 100% CPU and is stuck in kvm_mutex_lock().
>
> Trying to use the build in gdbserver didn´t work because it also locked.
>
> Is there a way to tunnel one VMs monitor console to another VM?
>
> Thanks Thomas
>
>
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-07 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-07 14:32 [Qemu-devel] KVM freeze when using --serial Thomas Kittel
2010-04-07 14:52 ` [Qemu-devel] " Thomas Kittel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).