From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yqhvl-0001bs-WA for qemu-devel@nongnu.org; Fri, 08 May 2015 09:03:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yqhvg-0006sW-4v for qemu-devel@nongnu.org; Fri, 08 May 2015 09:03:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yqhvf-0006sL-TO for qemu-devel@nongnu.org; Fri, 08 May 2015 09:03:00 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t48D2wB2031466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 8 May 2015 09:02:59 -0400 Message-ID: <554CB401.2060608@redhat.com> Date: Fri, 08 May 2015 07:02:57 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431078628-7856-1-git-send-email-pbonzini@redhat.com> <554CAEC3.5030705@redhat.com> <554CAF13.4030000@redhat.com> In-Reply-To: <554CAF13.4030000@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qivsbrSOVS5giAsU72f7NASwoSrbSRpmo" Subject: Re: [Qemu-devel] [PATCH v2] qemu-nbd: only send a limited number of errno codes on the wire List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qivsbrSOVS5giAsU72f7NASwoSrbSRpmo Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/08/2015 06:41 AM, Paolo Bonzini wrote: >=20 >=20 > 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? >=20 > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --qivsbrSOVS5giAsU72f7NASwoSrbSRpmo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVTLQBAAoJEKeha0olJ0NqYBsH/2VlqcpLYNgabfXZoKyNVl1i Wdi1iZDT/znJFfy770MJFtWsKGLKdBboawX5m8Aa3+HN0TBBo0kXNZccGcp9IOnW ZTW6aaJvcDD1llA7UMbbdhq0FXstOnPx/Zzp/WIIVGDLOO8RNOW4wbj/ND3GYEil aBuKGa68MzfnU57S3Rv7qh93Md13eHfQKae68VJKRdHbkNCcgMTylzy5gYzUP80E pqMH2Ts4p4K6YgIz5TB/zwCEabICVeDzMvXWyfU/6RyugNUgFKrazpqjFZmXv3KR Rm+MOKOlyvlQhjDgblkLPNzlv0Gkj6UhFH8PJY/MbUhDCV2JcpXSNGJnsqZRYY8= =SrKo -----END PGP SIGNATURE----- --qivsbrSOVS5giAsU72f7NASwoSrbSRpmo--