qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, armbru@redhat.com, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] qemu-nbd: only send a limited number of errno codes on the wire
Date: Fri, 08 May 2015 07:02:57 -0600	[thread overview]
Message-ID: <554CB401.2060608@redhat.com> (raw)
In-Reply-To: <554CAF13.4030000@redhat.com>

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

On 05/08/2015 06:41 AM, Paolo Bonzini wrote:
> 
> 
> On 08/05/2015 14:40, Eric Blake wrote:
>> On 05/08/2015 03:50 AM, Paolo Bonzini wrote:
>>> Right now, NBD includes potentially platform-specific error values in
>>> the wire protocol.
>>>

>>
>> Do we also want to handle "case 0: return 0;" on either conversion, or
>> even "case 0: abort();" to ensure that callers are using these helpers
>> correctly?
> 
> Yes, it's much better that way.

Thinking about it a bit more: abort() is fine on the sending side, to
ensure we aren't putting garbage on the wire; but abort() on the
receiving side is a bit risky (we should be handling a corrupted
incoming stream gracefully - a malicious sender should not be able to
crash us).  Of course, once we've detected a corrupted incoming stream,
we can't do much for the block device the stream was supposed to
represent (perhaps treat it as EIO and declare the device dead), but
that's still better than aborting.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-05-08 13:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08  9:50 [Qemu-devel] [PATCH v2] qemu-nbd: only send a limited number of errno codes on the wire Paolo Bonzini
2015-05-08 10:12 ` Markus Armbruster
2015-05-08 10:27   ` Paolo Bonzini
2015-05-08 10:40     ` Richard W.M. Jones
2015-05-08 12:35     ` Eric Blake
2015-05-08 12:40 ` Eric Blake
2015-05-08 12:41   ` Paolo Bonzini
2015-05-08 13:02     ` Eric Blake [this message]
2015-05-08 13:04       ` Paolo Bonzini
2015-05-09 14:29 ` Thomas Schwinge

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=554CB401.2060608@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@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).