qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] NBD broken ?


From: Paolo Bonzini
Subject: Re: [Qemu-devel] NBD broken ?
Date: Mon, 05 Mar 2012 08:45:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

Il 04/03/2012 01:44, Laurent Vivier ha scritto:
> Hi,
> 
> since commit ae255e523, qemu with NBD hangs at startup (when it tries to
> access the disk):
> 
> commit ae255e523c256cf0708f1c16cb946ff96340a800
> Author: Paolo Bonzini <address@hidden>
> Date:   Thu Sep 8 14:28:59 2011 +0200
> 
>     nbd: switch to asynchronous operation
>     
>     Signed-off-by: Paolo Bonzini <address@hidden>
> 
> 
> Reverting this patch corrects the problem.
> 
> My system is an Ubuntu 11.04 x86_64 (But the bug is also seen on RHEL6).
> 
> qemu is configured only with "--target-list=x86_64-softmmu".
> 
> My test case is:
> 
> ./qemu-nbd -k /tmp/nbd-socket -t /ISO/ubuntu-11.04-desktop-i386.iso
> 
> ./x86_64-softmmu/qemu-system-x86_64 -cdrom nbd:unix:/tmp/nbd-socket
> 
> Same problem with a TCP socket, with/without KVM, with an x86_64 guest, with 
> -hda...

I can reproduce it.  I'm pretty sure it worked when I posted the patch,
though of course I may be wrong.  Perhaps I just didn't test IDE: virtio works.

It's a race:

[pid 17045] select(13, [0 3 4 6 8 12], [], [], {1, 0} <unfinished ...>
[pid 17046] sendmsg(6, {msg_name(0)=NULL, msg_iov(1)=[{"...", 28}], ...}, 0) = 
28
[pid 17046] select(7, [0 6], [], NULL, NULL) = 1 (in [6])
[pid 17045] <... select resumed> )      = 1 (in [6], left {0, 986176})
[pid 17046] recvfrom(6,  <unfinished ...>
[pid 17046] <... recvfrom resumed> "...", 16, 0, NULL, NULL) = 16
[pid 17046] recvmsg(6, {msg_name(0)=NULL, msg_iov(1)=[{"..." 512}], ...}, 0) = 
512
[pid 17045] recvfrom(6, 0x7fff5fee29d0, 16, 0, 0, 0) = -1 EAGAIN (Resource 
temporarily unavailable)
[pid 17045] recvfrom(6, 0x7fff5fee29d0, 16, 0, 0, 0) = -1 EAGAIN (Resource 
temporarily unavailable)
[pid 17045] recvfrom(6, 0x7fff5fee29d0, 16, 0, 0, 0) = -1 EAGAIN (Resource 
temporarily unavailable)

Two selects return a readable state at the same time, and when the second
handler is called it fails to retrieve the NBD header.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]