qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Avi Kivity <avi@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/3] move vm stop/start to migrate_set_state
Date: Mon, 13 Jul 2009 11:05:31 +0300	[thread overview]
Message-ID: <20090713080531.GE28046@redhat.com> (raw)
In-Reply-To: <20090713053139.GD28046@redhat.com>

On Mon, Jul 13, 2009 at 08:31:39AM +0300, Gleb Natapov wrote:
> On Sun, Jul 12, 2009 at 02:10:43PM -0500, Anthony Liguori wrote:
> > Avi Kivity wrote:
> >> On 07/12/2009 06:31 AM, Anthony Liguori wrote:
> >>> Jamie Lokier wrote:
> >>>> If you get an error during the last write(), I wouldn't trust that to
> >>>> mean the recipient will definitely not see the data you wrote.  (Enjoy
> >>>> the double negative).  It's another variation of the handshake
> >>>> uncertainty, this time reflected in what write() should report when
> >>>> it's uncertain about a network transmission.  If it reports an error
> >>>> when it's uncertain, then you can't trust that a write() error means
> >>>> the data was not written, only that a problem was detected.
> >>>
> >>> I think you're stretching here.  If it really were the case that  
> >>> write() could actually result in data being sent out the wire and yet 
> >>> still returning an error, it would make all error handling in Unix  
> >>> unmanagable.  I can't believe this is possible in Linux and without  
> >>> an actual counter-example, I'm inclined to believe the same is true  
> >>> for every other OS out there.
> >>
> >> It's actually a common scenario for block devices.  I don't know about  
> >> networking, but for disks a write can be completed and then report an  
> >> error if the cable or power was disconnected before the acknowledge  
> >> could arrive.
> >
> > Is it common that a disk cable is yanked out before the ack arrives?   
> > Are their gremlins in your servers :-)
> >
> >> It could conceivably happen with networking if the device reports an  
> >> error when it isn't sure if the data was sent out or not (but it  
> >> actually was), or if some path after the transmission required a  
> >> memory allocation, which failed.
> >
> > But does this actually happen or is this all theoretical?
> >
> With unreliable socket it doesn't matter what write() returns data may
> or may not reach the destination regardless, with reliable sockets
> write() succeeds only after data was acked by the receiver, but it still
> doesn't mean that data will be read from destination socket.
> 
Actually for reliable sockets the write() succeeds when data is copied
into in kernel buffer, not when it is acked. If you want to be sure the
data is sent you can check the length of a socket send queue, but this
still doesn't mean that data was actually delivered to the receiver
application. Only application level protocol may guaranty that.

--
			Gleb.

  reply	other threads:[~2009-07-13  8:05 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-09 11:47 [Qemu-devel] [PATCH 0/3] add "core dump"-like capability Paolo Bonzini
2009-07-09 11:47 ` [Qemu-devel] [PATCH 1/3] move state and mon_resume to struct MigrationState Paolo Bonzini
2009-07-09 11:47 ` [Qemu-devel] [PATCH 2/3] move vm stop/start to migrate_set_state Paolo Bonzini
2009-07-09 13:45   ` Anthony Liguori
2009-07-09 13:48     ` Paolo Bonzini
2009-07-09 13:53       ` Anthony Liguori
2009-07-09 13:58         ` Paolo Bonzini
2009-07-09 14:41           ` Anthony Liguori
2009-07-10 23:14         ` Jamie Lokier
2009-07-11  0:04           ` malc
2009-07-11  0:42             ` Jamie Lokier
2009-07-11  0:55             ` Anthony Liguori
2009-07-11  0:58           ` Anthony Liguori
2009-07-11  1:42             ` Jamie Lokier
2009-07-12  3:31               ` Anthony Liguori
2009-07-12 14:22                 ` Avi Kivity
2009-07-12 19:10                   ` Anthony Liguori
2009-07-12 19:30                     ` Avi Kivity
2009-07-13  5:31                     ` Gleb Natapov
2009-07-13  8:05                       ` Gleb Natapov [this message]
2009-07-13 14:52                       ` Anthony Liguori
2009-07-14  8:48                         ` Dor Laor
2009-07-14 14:41                           ` Paolo Bonzini
2009-07-09 11:47 ` [Qemu-devel] [PATCH 3/3] add live dumping capability Paolo Bonzini
2009-07-09 13:49   ` Anthony Liguori
2009-07-09 14:06     ` Paolo Bonzini
2009-07-09 14:43       ` Anthony Liguori
2009-07-10  8:32         ` Paolo Bonzini
2009-07-10 12:51           ` Anthony Liguori
2009-07-09 13:42 ` [Qemu-devel] [PATCH 0/3] add "core dump"-like capability Anthony Liguori
2009-07-09 13:46   ` Paolo Bonzini
2009-07-09 13:51     ` Anthony Liguori
2009-07-09 14:46     ` Gerd Hoffmann
2009-07-09 16:20       ` Paolo Bonzini

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=20090713080531.GE28046@redhat.com \
    --to=gleb@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).