Received: from eggs.gnu.org ([2001:4830:134:3::10]:57257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXjS3-0002Se-CF for qemu-devel@nongnu.org; Tue, 26 Jun 2018 04:35:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXjS2-000631-7l for qemu-devel@nongnu.org; Tue, 26 Jun 2018 04:35:51 -0400 From: Markus Armbruster References: <20180625164239.13794-1-kwolf@redhat.com> Date: Tue, 26 Jun 2018 10:35:38 +0200 In-Reply-To: <20180625164239.13794-1-kwolf@redhat.com> (Kevin Wolf's message of "Mon, 25 Jun 2018 18:42:39 +0200") Message-ID: <87h8lqkkrp.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] usb-storage: Add rerror/werror properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-block@nongnu.org, pkrempa@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, mreitz@redhat.com, kraxel@redhat.com, pbonzini@redhat.com Kevin Wolf writes: > The error handling policy was traditionally set with -drive, but with > -blockdev it is no longer possible to set frontend options. scsi-disk > (and other block devices) have long supported qdev properties to > configure the error handling policy, so let's add these options to > usb-storage as well and just forward them to the internal scsi-disk > instance. > > Signed-off-by: Kevin Wolf Let's see whether I remember / figure out how this stuff works. Not all devices support error handling policy, but scsi-disk does. The preferred way to configure error handling policy is with qdev properties rerror, werror. blkconf_apply_backend_options() propagates them to the associated BlockBackend. The outmoded way is with -drive parameters rerror, werror. blockdev_init() propagates them to the BlockBackend. If you use both ways, qdev properties win. usb-storage is a hack: it tries to look like a block device, but it's really a SCSI controller that can serve only a single scsi-disk device, which it creates automatically. We want to deprecate -drive. We also want to deprecate usb-storage, but I guess we're still not ready for that (it's a complicated story). To deprecate -drive without also deprecating usb-storage, we need to preserve features. The outmoded way works with usb-storage: the automatically created scsi-disk is associated with the BlockBackend that got its error handling policy from -drive. The preferred way doesn't, because usb-storage lacks the qdev properties. This patch adds them. Kind of sad, but it's either that or deprecating usb-storage. Patch looks good to me, thus Reviewed-by: Markus Armbruster Feel free to work whatever parts of my ramblings you find useful into your commit message.