From patchwork Mon Sep 12 14:19:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 114387 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 58C46B70C0 for ; Tue, 13 Sep 2011 01:28:37 +1000 (EST) Received: from localhost ([::1]:39844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R38R0-0006Za-UE for incoming@patchwork.ozlabs.org; Mon, 12 Sep 2011 11:28:34 -0400 Received: from eggs.gnu.org ([140.186.70.92]:38579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R37K1-0001qN-5E for qemu-devel@nongnu.org; Mon, 12 Sep 2011 10:17:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R37Jv-00078K-23 for qemu-devel@nongnu.org; Mon, 12 Sep 2011 10:17:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R37Ju-000786-MD for qemu-devel@nongnu.org; Mon, 12 Sep 2011 10:17:10 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8CEH882023849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Sep 2011 10:17:09 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p8CEGa2s030698; Mon, 12 Sep 2011 10:17:08 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 12 Sep 2011 16:19:22 +0200 Message-Id: <1315837174-15327-24-git-send-email-kwolf@redhat.com> In-Reply-To: <1315837174-15327-1-git-send-email-kwolf@redhat.com> References: <1315837174-15327-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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 23/35] block: Drop BlockDriverState member removable 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 It's a confused mess (see previous commit). No users remain. Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- block.c | 8 -------- block.h | 1 - block_int.h | 1 - blockdev.c | 5 ----- hw/fdc.c | 1 - hw/ide/core.c | 1 - hw/scsi-disk.c | 1 - hw/scsi-generic.c | 1 - hw/virtio-blk.c | 1 - 9 files changed, 0 insertions(+), 20 deletions(-) diff --git a/block.c b/block.c index fee45bf..d8193a3 100644 --- a/block.c +++ b/block.c @@ -1614,14 +1614,6 @@ BlockErrorAction bdrv_get_on_error(BlockDriverState *bs, int is_read) return is_read ? bs->on_read_error : bs->on_write_error; } -void bdrv_set_removable(BlockDriverState *bs, int removable) -{ - bs->removable = removable; - if (removable && bs == bs_snapshots) { - bs_snapshots = NULL; - } -} - int bdrv_is_read_only(BlockDriverState *bs) { return bs->read_only; diff --git a/block.h b/block.h index 860e30d..e4b5530 100644 --- a/block.h +++ b/block.h @@ -207,7 +207,6 @@ int bdrv_get_translation_hint(BlockDriverState *bs); void bdrv_set_on_error(BlockDriverState *bs, BlockErrorAction on_read_error, BlockErrorAction on_write_error); BlockErrorAction bdrv_get_on_error(BlockDriverState *bs, int is_read); -void bdrv_set_removable(BlockDriverState *bs, int removable); int bdrv_is_read_only(BlockDriverState *bs); int bdrv_is_sg(BlockDriverState *bs); int bdrv_enable_write_cache(BlockDriverState *bs); diff --git a/block_int.h b/block_int.h index f42af2c..f30563d 100644 --- a/block_int.h +++ b/block_int.h @@ -155,7 +155,6 @@ struct BlockDriverState { int read_only; /* if true, the media is read only */ int keep_read_only; /* if true, the media was requested to stay read only */ int open_flags; /* flags used to open the file, re-used for re-open */ - int removable; /* if true, the media can be removed */ int encrypted; /* if true, the media is encrypted */ int valid_key; /* if true, a valid encryption key has been set */ int sg; /* if true, the device is a /dev/sg* */ diff --git a/blockdev.c b/blockdev.c index ddf1f8f..154cc84 100644 --- a/blockdev.c +++ b/blockdev.c @@ -473,17 +473,12 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi) } break; case MEDIA_CDROM: - bdrv_set_removable(dinfo->bdrv, 1); dinfo->media_cd = 1; break; } break; case IF_SD: - /* FIXME: This isn't really a floppy, but it's a reasonable - approximation. */ case IF_FLOPPY: - bdrv_set_removable(dinfo->bdrv, 1); - break; case IF_PFLASH: case IF_MTD: break; diff --git a/hw/fdc.c b/hw/fdc.c index 1d44bbd..edade2b 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -1813,7 +1813,6 @@ static int fdctrl_connect_drives(FDCtrl *fdctrl) fd_revalidate(drive); if (drive->bs) { drive->media_changed = 1; - bdrv_set_removable(drive->bs, 1); bdrv_set_dev_ops(drive->bs, &fdctrl_block_ops, drive); } } diff --git a/hw/ide/core.c b/hw/ide/core.c index 18d3c62..716addc 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1864,7 +1864,6 @@ int ide_init_drive(IDEState *s, BlockDriverState *bs, IDEDriveKind kind, } ide_reset(s); - bdrv_set_removable(bs, s->drive_kind == IDE_CD); return 0; } diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index d6e838c..0f0cddc 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -1233,7 +1233,6 @@ static int scsi_initfn(SCSIDevice *dev, uint8_t scsi_type) s->qdev.type = scsi_type; qemu_add_vm_change_state_handler(scsi_dma_restart_cb, s); - bdrv_set_removable(s->bs, scsi_type == TYPE_ROM); add_boot_device_path(s->qdev.conf.bootindex, &dev->qdev, ",0"); return 0; } diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index cb5d4f1..5ce01af 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -450,7 +450,6 @@ static int scsi_generic_initfn(SCSIDevice *dev) } } DPRINTF("block size %d\n", s->qdev.blocksize); - bdrv_set_removable(s->bs, 0); return 0; } diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index d5d4757..6d1a7cf 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -599,7 +599,6 @@ VirtIODevice *virtio_blk_init(DeviceState *dev, BlockConf *conf, s->qdev = dev; register_savevm(dev, "virtio-blk", virtio_blk_id++, 2, virtio_blk_save, virtio_blk_load, s); - bdrv_set_removable(s->bs, 0); bdrv_set_dev_ops(s->bs, &virtio_block_ops, s); s->bs->buffer_alignment = conf->logical_block_size;