Received: from eggs.gnu.org ([2001:4830:134:3::10]:45931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKOH6-0007mD-4i for qemu-devel@nongnu.org; Tue, 05 Jul 2016 07:12:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKOH1-0007fD-12 for qemu-devel@nongnu.org; Tue, 05 Jul 2016 07:12:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKOH0-0007f7-Of for qemu-devel@nongnu.org; Tue, 05 Jul 2016 07:12:14 -0400 Date: Tue, 5 Jul 2016 14:12:10 +0300 From: "Michael S. Tsirkin" Message-ID: <20160705141022-mutt-send-email-mst@redhat.com> References: <1466503372-28334-1-git-send-email-marcandre.lureau@redhat.com> <1466503372-28334-9-git-send-email-marcandre.lureau@redhat.com> <20160623072740-mutt-send-email-mst@redhat.com> <842458024.1343130.1466673244073.JavaMail.zimbra@redhat.com> <20160623200309-mutt-send-email-mst@redhat.com> <20160704184717-mutt-send-email-mst@redhat.com> <20160705013310-mutt-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 08/24] vhost-user: return a read error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau Cc: yuanhan liu , Victor Kaplansky , QEMU , jonshin@cisco.com, Tetsuya Mukawa On Tue, Jul 05, 2016 at 11:18:38AM +0200, Marc-Andr=E9 Lureau wrote: > Hi >=20 > On Tue, Jul 5, 2016 at 12:35 AM, Michael S. Tsirkin wr= ote: > > On Mon, Jul 04, 2016 at 11:56:56PM +0200, Marc-Andr=E9 Lureau wrote: > >> Hi > >> > >> On Mon, Jul 4, 2016 at 5:47 PM, Michael S. Tsirkin = wrote: > >> > Why does vhost_user_set_log_base need to return error? > >> > If backend is not there to handle this message, > >> > then it is not changing memory so it's ok to ignore the error. > >> > >> How do you know it's not changing the memory? > > > > either it closed socket intentionally or it exited > > and kernel cleaned up. >=20 > And if it closed intentionally during migration, we want to catch this > as a bug since it may still modify the memory You can't prevent backend bugs I think. > >> Furthermore, if the migration happened, it's because backend claim > >> VHOST_F_LOG_ALL, thus it should really not fail > > > > I don't see why - could you explain pls? >=20 > If the backend claims migration support, it shouldn't have bad > migration behaviour such as closing the vhost-user socket. But I don't see why it's bad. If it's not modifying memory then it does not need to log any changes. > >> > Same logic applies to many other messages. > >> > >> Pretty much all messages, the error can't be ignored, or operations > >> will just fail silentely randomly. I don't understand why vhost-user > >> io error can be ignored. Also it's quite inconsistent the way the co= de > >> is today, vhost_user_write() returns an error that is mostly ignored= , > >> while vhost_user_read() is checked. Why having an error later when y= ou > >> can report it earlier? I fail to understand the rationale of this > >> error handling. > > > > It's historical. the way I see it, most errors due to disconnect > > can be ignored except > > maybe for the initial feature negotiation which is needed > > so we know what to tell guest. >=20 > The way I see it is that errors should not be ignored because it makes > it harder to track what is going on. >=20 > > Errors due to e.g. buffer being full should cause an assert > > as it's an internal qemu error. >=20 > I don't see why qemu would be responsible for say, a suspended backend. Protocol limits # of messages in flight so it should not trigger even if backend is stuck. > > > > > >> > >> -- > >> Marc-Andr=E9 Lureau >=20 >=20 >=20 > --=20 > Marc-Andr=E9 Lureau