From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwu83-0005NN-PG for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:13:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wwu7w-0004Gt-9E for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:12:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwu7w-0004Gp-1J for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:12:44 -0400 Message-ID: <53A04CD7.3080100@redhat.com> Date: Tue, 17 Jun 2014 16:12:39 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1402505369-12526-1-git-send-email-pbonzini@redhat.com> <1402505369-12526-6-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/5] mc146818rtc: add "rtc" link to "/machine" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Marcelo Tosatti , "qemu-devel@nongnu.org Developers" , Stefan Hajnoczi , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Il 17/06/2014 16:09, Peter Crosthwaite ha scritto: >> > + >> > + object_property_add_alias(qdev_get_machine(), "rtc", >> > + OBJECT(s), NULL, &error_abort); > This will fail if anyone wants to add two such devices to a machine > model. It seems a bit board specific to assume that this device is > only valid as a singleton. Perhaps s/&error_abort/local_err/ and > raising a warning explaining that only the first RTC in the system > gets the alias? &error_warn? :) But then, /machine/rtc.tm is the only supported interface, and it should be the same for all RTC devices so perhaps a NULL error pointer is enough. > The other options is arrayification using your (hot off the press) > "[*]" proposal: > > + object_property_add_alias(qdev_get_machine(), "rtc[*]", > + OBJECT(s), NULL, &error_abort); This could make sense, but would leave /machine/rtc[0] in the common case. I prefer raising a warning. Paolo