sim-card
/
qemu
Archived
10
0
Fork 0

block: Drop BlockDriverState member removable

It's a confused mess (see previous commit).  No users remain.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Markus Armbruster 2011-09-06 18:58:52 +02:00 committed by Kevin Wolf
parent 2c6942fa7b
commit 9e6a4c9177
9 changed files with 0 additions and 20 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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* */

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;