From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzoS9-00068q-Qf for qemu-devel@nongnu.org; Wed, 25 Jun 2014 10:45:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzoS3-0006CN-SL for qemu-devel@nongnu.org; Wed, 25 Jun 2014 10:45:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzoS3-0006CI-KM for qemu-devel@nongnu.org; Wed, 25 Jun 2014 10:45:31 -0400 Date: Wed, 25 Jun 2014 16:45:15 +0200 From: Igor Mammedov Message-ID: <20140625164515.2e435fc0@nial.usersys.redhat.com> In-Reply-To: References: <1403696543-2458-1-git-send-email-imammedo@redhat.com> <1403696543-2458-4-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/4] machine: convert ram_size, maxram_size, ram_slots to properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Batuzov Cc: marcel.a@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, pbonzini@redhat.com, afaerber@suse.de, stefano.stabellini@eu.citrix.com On Wed, 25 Jun 2014 18:09:52 +0400 (MSK) Kirill Batuzov wrote: > On Wed, 25 Jun 2014, Igor Mammedov wrote: > > > > > + if (ram_size) { > > + object_property_set_int(OBJECT(current_machine), ram_size, > > + MACHINE_MEMORY_SIZE_OPT, &local_err); > > + if (local_err) { > > + error_report("%s", error_get_pretty(local_err)); > > + error_free(local_err); > > + exit(EXIT_FAILURE); > > + } > > + } > > You can use &error_abort (global variable) instead of &local_err and let > error_set handle the rest. Like this: > > if (ram_size) { > object_property_set_int(OBJECT(current_machine), ram_size, > MACHINE_MEMORY_SIZE_OPT, &error_abort); > } > thanks, I'll use error_abort.