From patchwork Tue Sep 6 15:39:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 113592 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 08FCDB6F6F for ; Wed, 7 Sep 2011 02:04:50 +1000 (EST) Received: from localhost ([::1]:41027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xic-0003CZ-N7 for incoming@patchwork.ozlabs.org; Tue, 06 Sep 2011 11:37:46 -0400 Received: from eggs.gnu.org ([140.186.70.92]:54997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xi3-0001YO-7C for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0xhw-0003ku-Sx for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xhw-0003km-LM for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:04 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p86Fb3fG017270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Sep 2011 11:37:03 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p86FamTN015671; Tue, 6 Sep 2011 11:37:02 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Tue, 6 Sep 2011 17:39:26 +0200 Message-Id: <1315323586-23840-12-git-send-email-kwolf@redhat.com> In-Reply-To: <1315323586-23840-1-git-send-email-kwolf@redhat.com> References: <1315323586-23840-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 11/31] block/raw: Fix to forward method bdrv_media_changed() 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 From: Markus Armbruster Block driver "raw" forwards most methods to the underlying block driver. However, it doesn't implement method bdrv_media_changed(). Makes bdrv_media_changed() always return -ENOTSUP. I believe -fda /dev/fd0 gives you raw over host_floppy, and disk change detection (fdc register 7 bit 7) is broken. Testing my theory requires a computer museum, though. Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- block/raw.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/block/raw.c b/block/raw.c index 555db4f..f197479 100644 --- a/block/raw.c +++ b/block/raw.c @@ -75,6 +75,11 @@ static int raw_is_inserted(BlockDriverState *bs) return bdrv_is_inserted(bs->file); } +static int raw_media_changed(BlockDriverState *bs) +{ + return bdrv_media_changed(bs->file); +} + static void raw_eject(BlockDriverState *bs, int eject_flag) { bdrv_eject(bs->file, eject_flag); @@ -137,8 +142,10 @@ static BlockDriver bdrv_raw = { .bdrv_discard = raw_discard, .bdrv_is_inserted = raw_is_inserted, + .bdrv_media_changed = raw_media_changed, .bdrv_eject = raw_eject, .bdrv_set_locked = raw_set_locked, + .bdrv_ioctl = raw_ioctl, .bdrv_aio_ioctl = raw_aio_ioctl,