From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLbzi-0000Ru-8i for qemu-devel@nongnu.org; Mon, 16 Sep 2013 12:49:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLbzc-00041W-J1 for qemu-devel@nongnu.org; Mon, 16 Sep 2013 12:49:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLbzc-00041R-A6 for qemu-devel@nongnu.org; Mon, 16 Sep 2013 12:49:44 -0400 Date: Mon, 16 Sep 2013 19:51:50 +0300 From: "Michael S. Tsirkin" Message-ID: <20130916165150.GB4386@redhat.com> References: <20130915172331.GA2821@redhat.com> <5236A5ED.3000804@suse.de> <20130916123303.GA2992@redhat.com> <523722BE.90202@suse.de> <20130916154851.GB4141@redhat.com> <52372A48.1040803@redhat.com> <20130916160127.GD4141@redhat.com> <52372CC5.8090408@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52372CC5.8090408@redhat.com> Subject: Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Igor Mammedov , Stefan Hajnoczi , Andreas =?iso-8859-1?Q?F=E4rber?= , Anthony Liguori , qemu-devel@nongnu.org On Mon, Sep 16, 2013 at 06:07:33PM +0200, Paolo Bonzini wrote: > Il 16/09/2013 18:01, Michael S. Tsirkin ha scritto: > > On Mon, Sep 16, 2013 at 05:56:56PM +0200, Paolo Bonzini wrote: > >> Il 16/09/2013 17:48, Michael S. Tsirkin ha scritto: > >>> http://sweng.the-davies.net/Home/rustys-api-design-manifesto > >>> > >>> Even then: it will be at best > >>> "5. Do it right or it will always break at runtime." > >>> > >>> We need to switch to APIs at > >>> "9. The compiler/linker won't let you get it wrong." > >> > >> We definitely can get at least to "make check won't let you get it > >> wrong", which is somewhere in the middle. > >> > >> Paolo > > > > We can't. > > make check just runs unit tests. > > So it can catch changes, but it can not catch bugs in new > > interfaces. > > We can have "make check" run QEMU once for each board, which would trap > things that will always break at runtime such as a misspelled property. > Similarly, we could have tests that try to instantiate every device, > even if they do not do anything with the guest-visible device. Such > dummy tests can catch bugs in interface changes. They won't catch bugs for properties that 1. change after device is instanciated 2. are accessed after device is instanciated > I look forward to discussing the future of qos and qtest at KVM Forum... :) > > Paolo This is not the topic I started really. Testing isn't a replacement for type safety. C is a compiled language for a reason, qom needs a set of wrappers to get that back, strings should only be used for external interfaces. -- MST