From patchwork Mon Jul 5 12:02:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 110210 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o65C31o8025905 for ; Mon, 5 Jul 2010 12:03:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752156Ab0GEMC7 (ORCPT ); Mon, 5 Jul 2010 08:02:59 -0400 Received: from mtagate5.de.ibm.com ([195.212.17.165]:41202 "EHLO mtagate5.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752021Ab0GEMC7 (ORCPT ); Mon, 5 Jul 2010 08:02:59 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.1/8.13.1) with ESMTP id o65C2wIZ027867 for ; Mon, 5 Jul 2010 12:02:58 GMT Received: from d12av03.megacenter.de.ibm.com (d12av03.megacenter.de.ibm.com [9.149.165.213]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o65C2vQA1749174 for ; Mon, 5 Jul 2010 14:02:57 +0200 Received: from d12av03.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av03.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o65C2vaR029435 for ; Mon, 5 Jul 2010 14:02:57 +0200 Received: from stefan-thinkpad.manchester-maybrook.uk.ibm.com (dyn-9-174-219-49.manchester-maybrook.uk.ibm.com [9.174.219.49]) by d12av03.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o65C2vjC029420; Mon, 5 Jul 2010 14:02:57 +0200 From: Stefan Hajnoczi To: Cc: Avi Kivity , Markus Armbruster , Stefan Hajnoczi Subject: [PATCH] block: Restore extboot functionality after mismerge Date: Mon, 5 Jul 2010 13:02:50 +0100 Message-Id: <1278331370-26353-1-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 05 Jul 2010 12:03:02 +0000 (UTC) diff --git a/blockdev.c b/blockdev.c index 90472a9..965a089 100644 --- a/blockdev.c +++ b/blockdev.c @@ -141,6 +141,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error) int on_read_error, on_write_error; const char *devaddr; DriveInfo *dinfo; + int is_extboot = 0; int snapshot = 0; int ret; @@ -302,6 +303,12 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error) } } + is_extboot = qemu_opt_get_bool(opts, "boot", 0); + if (is_extboot && extboot_drive) { + fprintf(stderr, "qemu: two bootable drives specified\n"); + return NULL; + } + on_write_error = BLOCK_ERR_STOP_ENOSPC; if ((buf = qemu_opt_get(opts, "werror")) != NULL) { if (type != IF_IDE && type != IF_SCSI && type != IF_VIRTIO && type != IF_NONE) { @@ -412,6 +419,10 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error) strncpy(dinfo->serial, serial, sizeof(dinfo->serial) - 1); QTAILQ_INSERT_TAIL(&drives, dinfo, next); + if (is_extboot) { + extboot_drive = dinfo; + } + bdrv_set_on_error(dinfo->bdrv, on_read_error, on_write_error); switch(type) {