From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTtsQ-0005Os-27 for qemu-devel@nongnu.org; Tue, 16 Sep 2014 10:37:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTtsI-0000ms-GB for qemu-devel@nongnu.org; Tue, 16 Sep 2014 10:37:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTtsI-0000mh-6h for qemu-devel@nongnu.org; Tue, 16 Sep 2014 10:36:58 -0400 Message-ID: <54184AEE.8020904@redhat.com> Date: Tue, 16 Sep 2014 16:36:30 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1410792279-2488-1-git-send-email-arei.gonglei@huawei.com> <54170C7F.8080409@redhat.com> <20140915174503.GB13548@redhat.com> <87wq94xc7v.fsf@blackfin.pond.sub.org> <5417F698.2060001@redhat.com> <87sijsq60x.fsf@blackfin.pond.sub.org> <5418040F.3020106@redhat.com> <871trbiqk3.fsf@blackfin.pond.sub.org> In-Reply-To: <871trbiqk3.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/3] Fix confused output for alias properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: weidong.huang@huawei.com, stefanha@redhat.com, "Michael S. Tsirkin" , qemu-devel@nongnu.org, agraf@suse.de, arei.gonglei@huawei.com, aliguori@amazon.com, peter.huangpeng@huawei.com, lcapitulino@redhat.com Il 16/09/2014 16:32, Markus Armbruster ha scritto: > Paolo Bonzini writes: > >> Il 16/09/2014 11:16, Markus Armbruster ha scritto: >>>> I think both "str" and "link" actually are a small degradation >>>> compared to "drive", and this is why I kept the legacy_name. But overall I >>>> think it's not really worth the layering violation that patches 2 and 3 are; >>>> and it's definitely not stable material. >>> >>> "str" is clearly a degradation for me. I breaks usage like >>> >>> for i in `qemu -device help 2>&1 | sed -n 's/^name "\([^"]*\)".*/\1/p'` >>> do qemu -device $i,help 2>&1 >>> done | grep =drive >>> >>> Finds all block device models. I've done such things many times. >> >> Just replace "grep =drive" with "fgrep .drive". Similarly: >> >> =chr -> .chardev (bonus: matches the command line option) >> =netdev -> .netdev >> =vlan -> .vlan >> =macaddr -> .mac > > Unlike =drive, this isn't guaranteed to work. If it doesn't, when we've been consistent so far, it's a bug. >> It is, but we're suprisingly consistent in the naming of such >> special-typed properties. So it's actually a good thing that >> legacy_name provides redundant information. > > Given our overall consistency track record: yes, it's surprising, and no, > I'm not comfortable relying on us being consistent :) The point of stuff like QOM is exactly to force us to be consistent. No, it doesn't always work. But patches 2 and 3 really are a layering violation. I have no idea how to bring back "drive" without introducing a layering violation somewhere, but this one is really too much... Paolo