From patchwork Wed Jul 20 16:23:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 105830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 25C56B6F62 for ; Thu, 21 Jul 2011 06:54:33 +1000 (EST) Received: from localhost ([::1]:48140 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjdml-0005Is-Na for incoming@patchwork.ozlabs.org; Wed, 20 Jul 2011 16:54:27 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjZZk-0003jj-5T for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:24:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjZZe-0008Oy-AV for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:24:40 -0400 Received: from oxygen.pond.sub.org ([78.46.104.156]:55526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjZZc-0008NV-23 for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:24:36 -0400 Received: from oxygen-old.pond.sub.org (unknown [IPv6:2a01:4f8:130:9021::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "oxygen.pond.sub.org", Issuer "CAcert Class 3 Root" (verified OK)) by oxygen.pond.sub.org (Postfix) with ESMTPS id 15B84A2480; Wed, 20 Jul 2011 18:24:32 +0200 (CEST) Received: from blackfin.pond.sub.org (p5B32D5F4.dip.t-dialin.net [91.50.213.244]) by oxygen-old.pond.sub.org (Postfix) with ESMTPA id E2E04276C53; Wed, 20 Jul 2011 18:24:31 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id 6D6162BE; Wed, 20 Jul 2011 18:24:30 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 20 Jul 2011 18:23:41 +0200 Message-Id: <1311179069-27882-8-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1311179069-27882-1-git-send-email-armbru@redhat.com> References: <1311179069-27882-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 78.46.104.156 Cc: kwolf@redhat.com, quintela@redhat.com, dbaryshkov@gmail.com, stefano.stabellini@eu.citrix.com, lcapitulino@redhat.com, amit.shah@redhat.com Subject: [Qemu-devel] [PATCH 07/55] block: Make BlockDriver method bdrv_set_locked() return void X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The only caller is bdrv_set_locked(), and it ignores the value. Callees always return 0, except for FreeBSD's cdrom_set_locked(), which returns -ENOTSUP when the device is in a terminally wedged state. Signed-off-by: Markus Armbruster --- block/raw-posix.c | 10 +++------- block/raw.c | 3 +-- block_int.h | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 34b64aa..14f8f62 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -1346,7 +1346,7 @@ static int cdrom_eject(BlockDriverState *bs, int eject_flag) return 0; } -static int cdrom_set_locked(BlockDriverState *bs, int locked) +static void cdrom_set_locked(BlockDriverState *bs, int locked) { BDRVRawState *s = bs->opaque; @@ -1357,8 +1357,6 @@ static int cdrom_set_locked(BlockDriverState *bs, int locked) */ /* perror("CDROM_LOCKDOOR"); */ } - - return 0; } static BlockDriver bdrv_host_cdrom = { @@ -1467,12 +1465,12 @@ static int cdrom_eject(BlockDriverState *bs, int eject_flag) return 0; } -static int cdrom_set_locked(BlockDriverState *bs, int locked) +static void cdrom_set_locked(BlockDriverState *bs, int locked) { BDRVRawState *s = bs->opaque; if (s->fd < 0) - return -ENOTSUP; + return; if (ioctl(s->fd, (locked ? CDIOCPREVENT : CDIOCALLOW)) < 0) { /* * Note: an error can happen if the distribution automatically @@ -1480,8 +1478,6 @@ static int cdrom_set_locked(BlockDriverState *bs, int locked) */ /* perror("CDROM_LOCKDOOR"); */ } - - return 0; } static BlockDriver bdrv_host_cdrom = { diff --git a/block/raw.c b/block/raw.c index b0f72d6..1398a9c 100644 --- a/block/raw.c +++ b/block/raw.c @@ -80,10 +80,9 @@ static int raw_eject(BlockDriverState *bs, int eject_flag) return bdrv_eject(bs->file, eject_flag); } -static int raw_set_locked(BlockDriverState *bs, int locked) +static void raw_set_locked(BlockDriverState *bs, int locked) { bdrv_set_locked(bs->file, locked); - return 0; } static int raw_ioctl(BlockDriverState *bs, unsigned long int req, void *buf) diff --git a/block_int.h b/block_int.h index f5d67c1..69cf222 100644 --- a/block_int.h +++ b/block_int.h @@ -111,7 +111,7 @@ struct BlockDriver { int (*bdrv_is_inserted)(BlockDriverState *bs); int (*bdrv_media_changed)(BlockDriverState *bs); int (*bdrv_eject)(BlockDriverState *bs, int eject_flag); - int (*bdrv_set_locked)(BlockDriverState *bs, int locked); + void (*bdrv_set_locked)(BlockDriverState *bs, int locked); /* to control generic scsi devices */ int (*bdrv_ioctl)(BlockDriverState *bs, unsigned long int req, void *buf);