Received: from eggs.gnu.org ([2001:4830:134:3::10]:41679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzWh-0007X3-47 for qemu-devel@nongnu.org; Mon, 20 Jun 2016 09:46:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEzWb-0002Vk-3v for qemu-devel@nongnu.org; Mon, 20 Jun 2016 09:46:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzWa-0002Vf-RU for qemu-devel@nongnu.org; Mon, 20 Jun 2016 09:46:01 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 161A2FFC9A for ; Mon, 20 Jun 2016 13:46:00 +0000 (UTC) Date: Mon, 20 Jun 2016 10:45:58 -0300 From: Eduardo Habkost Message-ID: <20160620134558.GB2048@thinpad.lan.raisama.net> References: <1466022773-8965-1-git-send-email-ehabkost@redhat.com> <1466022773-8965-6-git-send-email-ehabkost@redhat.com> <87y460b7k0.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y460b7k0.fsf@dusky.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH 05/10] qdev: GlobalProperty.errp field List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Marcel Apfelbaum , Paolo Bonzini , Igor Mammedov On Mon, Jun 20, 2016 at 10:14:55AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: [...] > > diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h > > index 24aa0a7..16e7cc0 100644 > > --- a/include/hw/qdev-core.h > > +++ b/include/hw/qdev-core.h > > @@ -256,6 +256,9 @@ struct PropertyInfo { > > > > /** > > * GlobalProperty: > > + * @errp: If set, error_propagate() will be called on errors when applying > > + * the property. &error_abort or &error_fatal may be used to make > > + * errors automatically abort or exit QEMU. > > "If set" is awkward, because it's not what we usually mean when we talk > about an error being set. Suggest "If non-null". Agreed. > > But what makes null special isn't that errors won't be propagated. In > fact, the code behaves as if they were (propagating to null frees the > error, which is exactly what the code does), *except* for one thing that > isn't mentioned here, but should be: we print a warning. > > What about: > > * @errp: Error destination, used like a first argument of error_setg(), > * except with null @errp, we print warnings instead of ignoring errors > * silently. Perfect. I will use it. Thanks! -- Eduardo