Received: from eggs.gnu.org ([140.186.70.92]:37927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qog73-0002kT-MY for qemu-devel@nongnu.org; Wed, 03 Aug 2011 14:24:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qog72-0007Ns-MU for qemu-devel@nongnu.org; Wed, 03 Aug 2011 14:24:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qog72-0007Nk-Da for qemu-devel@nongnu.org; Wed, 03 Aug 2011 14:24:12 -0400 From: Markus Armbruster References: <1311179069-27882-1-git-send-email-armbru@redhat.com> <1311179069-27882-45-git-send-email-armbru@redhat.com> Date: Wed, 03 Aug 2011 20:24:03 +0200 In-Reply-To: (andrzej zaborowski's message of "Wed, 3 Aug 2011 19:26:11 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 44/55] spitz tosa: Simplify "drive is suitable for microdrive" test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: andrzej zaborowski Cc: kwolf@redhat.com, Peter Maydell , quintela@redhat.com, dbaryshkov@gmail.com, stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, amit.shah@redhat.com andrzej zaborowski writes: > On 3 August 2011 18:38, Markus Armbruster wrote: >> andrzej zaborowski writes: >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A02. if the >>> underlaying storage can disappear for any other reason if that's >>> possible to check. >> >> bdrv_is_removable() *isn't* such a check. > > Obviously I wasn't claiming it is, just that it might be useful, but > not necessrily possible. After all pretty much any storage can be > "ejected" with enough force, depending on how far you want to go. > >>>> What's wrong with that again? All sounds sensible to me. >>> >>> I'm not claiming otherwise, just double-checking this is what you want. > > So first you said you had a problem with _is_removable, and then you > said nothing was wrong with the implementation you outlined, plase > make up your mind. I don't appreciate you quoting me out of context like that. The sentence you quoted was in the middle of my attempt to get you to explain what you're trying to accomplish there. I started with analyzing what your code does. You asked "what's wrong with that", and I replied that I'm not passing judgement on whether your code is right or wrong, I just want to know what you're trying to do. I'm getting tired of our misunderstandings, but let me try one more time, and tiresomely verbose: 1. bdrv_is_removable() is ill-defined junk, and needs to go away. It is true when an ide-cd, scsi-cd or floppy qdev is attached, or when the BlockDriverState was created with -drive if=3D{floppy,sd} or -drive if=3D{ide,scsi,xen,none},media=3Dcdrom ("created removable"), except when an ide-hd, scsi-hd, scsi-generic or virtio-blk qdev is attached. That's not semantics, that's an embarrassment. 2. I don't have an opinion on what should be done in tosa_microdrive_attach() and spitz_microdrive_attach(). Heck, I wouldn't touch it with a 9ft pole if I could help it. But I have to, because it uses bdrv_is_removable(). 3. My first try was to preserve the current behavior. You don't like the result. Fine. 4. For my second try, I tried to understand what you're trying to accomplish there. Turns out you want to check whether "the underlaying storage can disappear for any other reason if that's possible to check." Thanks for explaining that. 5. Sorry, that's not what the code there does. 6. The block layer does not offer an API to check that. You're quite welcome to create it. 7. For what it's worth, IDE disks, SCSI disks and all the other non-removable decive models other than microdrives happily work without such a check. What now?