From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTqPl-0006c0-Dp for qemu-devel@nongnu.org; Tue, 16 Sep 2014 06:55:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTqPf-0001wi-9i for qemu-devel@nongnu.org; Tue, 16 Sep 2014 06:55:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTq8q-0005iD-0F for qemu-devel@nongnu.org; Tue, 16 Sep 2014 06:37:48 -0400 Date: Tue, 16 Sep 2014 13:37:09 +0300 From: "Michael S. Tsirkin" Message-ID: <20140916103709.GA17910@redhat.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5418040F.3020106@redhat.com> 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: Paolo Bonzini Cc: weidong.huang@huawei.com, aliguori@amazon.com, qemu-devel@nongnu.org, agraf@suse.de, Markus Armbruster , arei.gonglei@huawei.com, stefanha@redhat.com, peter.huangpeng@huawei.com, lcapitulino@redhat.com On Tue, Sep 16, 2014 at 11:34:07AM +0200, Paolo Bonzini wrote: > 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 > > We probably agree that having "=drive" work sometimes, but not always, > is the worst of both worlds. Still doesn't make it stable material, IMO. > > > Agree on the uselessness of "on/off". > > > > Agree on the uselessness of "blocksize" without a definition of the > > term. > > > > "chr" and "netdev" are like "drive", and replacing them by "str" is a > > degradation in my book. > > 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. str really should be for free-form strings. It makes as much sense to call it as string as it is to call an integer a string because you type a string of characters to specify it. > > Help for enum-valued properties in the form of "prop=ENUM-NAME" is not > > really helpful without a definition of ENUM-NAME. It's still useful for > > finding devices with this kind of property. > > Yes, but here you wouldn't have 'str', you would have the corresponding > QAPI enum name. This would be an improvement, though a minor one. > > Paolo