qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Ashijeet Acharya" <ashijeetacharya@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Revert "Change net/socket.c to use socket_*() functions" again
Date: Mon, 5 Jun 2017 12:00:54 +0800	[thread overview]
Message-ID: <8ea542c3-d13a-488f-9266-746b6ac1c491@redhat.com> (raw)
In-Reply-To: <20170505162305.15763-1-berrange@redhat.com>



On 2017年05月06日 00:23, Daniel P. Berrange wrote:
> This reverts commit 883e4f7624e10b98d16d9adaffb8b1795664d899.
>
> This code changed net/socket.c from using socket()+connect(),
> to using socket_connect(). In theory this is great, but in
> practice this has completely broken the ability to connect
> the frontend and backend:
>
>    $ ./x86_64-softmmu/qemu-system-x86_64 \
>         -device e1000,id=e0,netdev=hn0,mac=DE:AD:BE:EF:AF:05 \
>         -netdev socket,id=hn0,connect=localhost:1234
>    qemu-system-x86_64: -device e1000,id=e0,netdev=hn0,mac=DE:AD:BE:EF:AF:05: Property 'e1000.netdev' can't find value 'hn0'
>
> The old code would call net_socket_fd_init() synchronously,
> while letting the connect() complete in the backgorund. The
> new code moved net_socket_fd_init() so that it is only called
> after connect() completes in the background.
>
> Thus at the time we initialize the NIC frontend, the backend
> does not exist.
>
> The socket_connect() conversion as done is a bad fit for the
> current code, since it did not try to change the way it deals
> with async connection completion. Rather than try to fix this,
> just revert the socket_connect() conversion entirely.
>
> The code is about to be converted to use QIOChannel which
> will let the problem be solved in a cleaner manner. This
> revert is more suitable for stable branches in the meantime.
>
> Signed-off-by: Daniel P. Berrange<berrange@redhat.com>
> ---
>   net/socket.c | 127 ++++++++++++++++++++++++++---------------------------------
>   1 file changed, 56 insertions(+), 71 deletions(-)

Applied in -net.

Thanks

      parent reply	other threads:[~2017-06-05  4:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 16:23 [Qemu-devel] [PATCH] Revert "Change net/socket.c to use socket_*() functions" again Daniel P. Berrange
2017-05-05 19:36 ` no-reply
2017-05-09  2:47   ` Jason Wang
2017-05-08 17:05 ` Stefan Hajnoczi
2017-06-05  4:00 ` Jason Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ea542c3-d13a-488f-9266-746b6ac1c491@redhat.com \
    --to=jasowang@redhat.com \
    --cc=ashijeetacharya@gmail.com \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).