From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRu08-0001U7-4N for qemu-devel@nongnu.org; Wed, 01 Jun 2011 18:34:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRu06-0007Ar-7m for qemu-devel@nongnu.org; Wed, 01 Jun 2011 18:34:55 -0400 Received: from mail-yi0-f45.google.com ([209.85.218.45]:63563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRu05-0007Af-KE for qemu-devel@nongnu.org; Wed, 01 Jun 2011 18:34:53 -0400 Received: by yib19 with SMTP id 19so149099yib.4 for ; Wed, 01 Jun 2011 15:34:52 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1306929912-15484-1-git-send-email-kwolf@redhat.com> References: <1306929912-15484-1-git-send-email-kwolf@redhat.com> Date: Wed, 1 Jun 2011 23:34:52 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] bdrv_img_create: Fix segfault List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On Wed, Jun 1, 2011 at 1:05 PM, Kevin Wolf wrote: > Block drivers that don't support creating images don't have a size option= . Fail > gracefully instead of segfaulting when trying to access the option's valu= e. > > Signed-off-by: Kevin Wolf > --- > =A0block.c | =A0 =A05 +++-- > =A01 files changed, 3 insertions(+), 2 deletions(-) A command-line to reproduce the crash would be nice. I noticed this line above your fix: set_option_parameter_int(param, BLOCK_OPT_SIZE, img_size); If I follow correctly there should be an "Unknown option 'size'" error message before set_option_parameter_int() returns -1 (which we ignore) and then crash. Perhaps we should just catch the error when set_option_parameter_int() fail= s? Stefan