Skip to content

Commit

Permalink
hw/ide: remove 'ide-drive' device
Browse files Browse the repository at this point in the history
The 'ide-hd' and 'ide-cd' devices provide suitable alternatives.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
  • Loading branch information
berrange committed Mar 18, 2021
1 parent 24e13a4 commit b501018
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 101 deletions.
2 changes: 1 addition & 1 deletion docs/qdev-device-use.txt
Expand Up @@ -388,7 +388,7 @@ type.
some DEVNAMEs:

default device suppressing DEVNAMEs
CD-ROM ide-cd, ide-drive, ide-hd, scsi-cd, scsi-hd
CD-ROM ide-cd, ide-hd, scsi-cd, scsi-hd
floppy floppy, isa-fdc
parallel isa-parallel
serial isa-serial
Expand Down
6 changes: 0 additions & 6 deletions docs/system/deprecated.rst
Expand Up @@ -278,12 +278,6 @@ this CPU is also deprecated.
System emulator devices
-----------------------

``ide-drive`` (since 4.2)
'''''''''''''''''''''''''

The 'ide-drive' device is deprecated. Users should use 'ide-hd' or
'ide-cd' as appropriate to get an IDE hard disk or CD-ROM as needed.

``scsi-disk`` (since 4.2)
'''''''''''''''''''''''''

Expand Down
8 changes: 8 additions & 0 deletions docs/system/removed-features.rst
Expand Up @@ -224,6 +224,14 @@ the upstream Linux kernel in 2018, and it has also been dropped from glibc, so
there is no new Linux development taking place with this architecture. For
running the old binaries, you can use older versions of QEMU.

System emulator devices
-----------------------

``ide-drive`` (removed in 6.0)
''''''''''''''''''''''''''''''

The 'ide-drive' device has been removed. Users should use 'ide-hd' or
'ide-cd' as appropriate to get an IDE hard disk or CD-ROM as needed.

Related binaries
----------------
Expand Down
1 change: 0 additions & 1 deletion hw/i386/pc.c
Expand Up @@ -341,7 +341,6 @@ GlobalProperty pc_compat_1_4[] = {
{ "scsi-disk", "discard_granularity", "0" },
{ "ide-hd", "discard_granularity", "0" },
{ "ide-cd", "discard_granularity", "0" },
{ "ide-drive", "discard_granularity", "0" },
{ "virtio-blk-pci", "discard_granularity", "0" },
/* DEV_NVECTORS_UNSPECIFIED as a uint32_t string: */
{ "virtio-serial-pci", "vectors", "0xFFFFFFFF" },
Expand Down
38 changes: 0 additions & 38 deletions hw/ide/qdev.c
Expand Up @@ -283,20 +283,6 @@ static void ide_cd_realize(IDEDevice *dev, Error **errp)
ide_dev_initfn(dev, IDE_CD, errp);
}

static void ide_drive_realize(IDEDevice *dev, Error **errp)
{
DriveInfo *dinfo = NULL;

warn_report("'ide-drive' is deprecated, "
"please use 'ide-hd' or 'ide-cd' instead");

if (dev->conf.blk) {
dinfo = blk_legacy_dinfo(dev->conf.blk);
}

ide_dev_initfn(dev, dinfo && dinfo->media_cd ? IDE_CD : IDE_HD, errp);
}

#define DEFINE_IDE_DEV_PROPERTIES() \
DEFINE_BLOCK_PROPERTIES(IDEDrive, dev.conf), \
DEFINE_BLOCK_ERROR_PROPERTIES(IDEDrive, dev.conf), \
Expand Down Expand Up @@ -355,29 +341,6 @@ static const TypeInfo ide_cd_info = {
.class_init = ide_cd_class_init,
};

static Property ide_drive_properties[] = {
DEFINE_IDE_DEV_PROPERTIES(),
DEFINE_PROP_END_OF_LIST(),
};

static void ide_drive_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
IDEDeviceClass *k = IDE_DEVICE_CLASS(klass);

k->realize = ide_drive_realize;
dc->fw_name = "drive";
dc->desc = "virtual IDE disk or CD-ROM (legacy)";
device_class_set_props(dc, ide_drive_properties);
}

static const TypeInfo ide_drive_info = {
.name = "ide-drive",
.parent = TYPE_IDE_DEVICE,
.instance_size = sizeof(IDEDrive),
.class_init = ide_drive_class_init,
};

static void ide_device_class_init(ObjectClass *klass, void *data)
{
DeviceClass *k = DEVICE_CLASS(klass);
Expand All @@ -402,7 +365,6 @@ static void ide_register_types(void)
type_register_static(&ide_bus_info);
type_register_static(&ide_hd_info);
type_register_static(&ide_cd_info);
type_register_static(&ide_drive_info);
type_register_static(&ide_device_type_info);
}

Expand Down
13 changes: 0 additions & 13 deletions hw/ppc/mac_newworld.c
Expand Up @@ -539,8 +539,6 @@ static char *core99_fw_dev_path(FWPathProvider *p, BusState *bus,
DeviceState *dev)
{
PCIDevice *pci;
IDEBus *ide_bus;
IDEState *ide_s;
MACIOIDEState *macio_ide;

if (!strcmp(object_get_typename(OBJECT(dev)), "macio-newworld")) {
Expand All @@ -553,17 +551,6 @@ static char *core99_fw_dev_path(FWPathProvider *p, BusState *bus,
return g_strdup_printf("ata-3@%x", macio_ide->addr);
}

if (!strcmp(object_get_typename(OBJECT(dev)), "ide-drive")) {
ide_bus = IDE_BUS(qdev_get_parent_bus(dev));
ide_s = idebus_active_if(ide_bus);

if (ide_s->drive_kind == IDE_CD) {
return g_strdup("cdrom");
}

return g_strdup("disk");
}

if (!strcmp(object_get_typename(OBJECT(dev)), "ide-hd")) {
return g_strdup("disk");
}
Expand Down
13 changes: 0 additions & 13 deletions hw/ppc/mac_oldworld.c
Expand Up @@ -384,8 +384,6 @@ static char *heathrow_fw_dev_path(FWPathProvider *p, BusState *bus,
DeviceState *dev)
{
PCIDevice *pci;
IDEBus *ide_bus;
IDEState *ide_s;
MACIOIDEState *macio_ide;

if (!strcmp(object_get_typename(OBJECT(dev)), "macio-oldworld")) {
Expand All @@ -398,17 +396,6 @@ static char *heathrow_fw_dev_path(FWPathProvider *p, BusState *bus,
return g_strdup_printf("ata-3@%x", macio_ide->addr);
}

if (!strcmp(object_get_typename(OBJECT(dev)), "ide-drive")) {
ide_bus = IDE_BUS(qdev_get_parent_bus(dev));
ide_s = idebus_active_if(ide_bus);

if (ide_s->drive_kind == IDE_CD) {
return g_strdup("cdrom");
}

return g_strdup("disk");
}

if (!strcmp(object_get_typename(OBJECT(dev)), "ide-hd")) {
return g_strdup("disk");
}
Expand Down
15 changes: 0 additions & 15 deletions hw/sparc64/sun4u.c
Expand Up @@ -749,9 +749,6 @@ static char *sun4u_fw_dev_path(FWPathProvider *p, BusState *bus,
DeviceState *dev)
{
PCIDevice *pci;
IDEBus *ide_bus;
IDEState *ide_s;
int bus_id;

if (!strcmp(object_get_typename(OBJECT(dev)), "pbm-bridge")) {
pci = PCI_DEVICE(dev);
Expand All @@ -764,18 +761,6 @@ static char *sun4u_fw_dev_path(FWPathProvider *p, BusState *bus,
}
}

if (!strcmp(object_get_typename(OBJECT(dev)), "ide-drive")) {
ide_bus = IDE_BUS(qdev_get_parent_bus(dev));
ide_s = idebus_active_if(ide_bus);
bus_id = ide_bus->bus_id;

if (ide_s->drive_kind == IDE_CD) {
return g_strdup_printf("ide@%x/cdrom", bus_id);
}

return g_strdup_printf("ide@%x/disk", bus_id);
}

if (!strcmp(object_get_typename(OBJECT(dev)), "ide-hd")) {
return g_strdup("disk");
}
Expand Down
1 change: 0 additions & 1 deletion scripts/device-crash-test
Expand Up @@ -76,7 +76,6 @@ ERROR_RULE_LIST = [
{'device':'ics', 'expected':True}, # ics_base_realize: required link 'xics' not found: Property '.xics' not found
# "-device ide-cd" does work on more recent QEMU versions, so it doesn't have expected=True
{'device':'ide-cd'}, # No drive specified
{'device':'ide-drive', 'expected':True}, # No drive specified
{'device':'ide-hd', 'expected':True}, # No drive specified
{'device':'ipmi-bmc-extern', 'expected':True}, # IPMI external bmc requires chardev attribute
{'device':'isa-debugcon', 'expected':True}, # Can't create serial device, empty char device
Expand Down
1 change: 0 additions & 1 deletion softmmu/vl.c
Expand Up @@ -177,7 +177,6 @@ static struct {
{ .driver = "floppy", .flag = &default_floppy },
{ .driver = "ide-cd", .flag = &default_cdrom },
{ .driver = "ide-hd", .flag = &default_cdrom },
{ .driver = "ide-drive", .flag = &default_cdrom },
{ .driver = "scsi-cd", .flag = &default_cdrom },
{ .driver = "scsi-hd", .flag = &default_cdrom },
{ .driver = "VGA", .flag = &default_vga },
Expand Down
2 changes: 0 additions & 2 deletions tests/qemu-iotests/051
Expand Up @@ -185,7 +185,6 @@ case "$QEMU_DEFAULT_MACHINE" in
pc)
run_qemu -drive if=none,id=disk -device ide-cd,drive=disk
run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
run_qemu -drive if=none,id=disk -device ide-drive,drive=disk
run_qemu -drive if=none,id=disk -device ide-hd,drive=disk
run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
Expand Down Expand Up @@ -238,7 +237,6 @@ case "$QEMU_DEFAULT_MACHINE" in
pc)
run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk
run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-drive,drive=disk
run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk
run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
Expand Down
10 changes: 0 additions & 10 deletions tests/qemu-iotests/051.pc.out
Expand Up @@ -156,11 +156,6 @@ Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) quit

Testing: -drive if=none,id=disk -device ide-drive,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-drive,drive=disk: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead
QEMU_PROG: -device ide-drive,drive=disk: Device needs media, but drive is empty

Testing: -drive if=none,id=disk -device ide-hd,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-hd,drive=disk: Device needs media, but drive is empty
Expand Down Expand Up @@ -228,11 +223,6 @@ Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) quit

Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-drive,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-drive,drive=disk: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead
QEMU_PROG: -device ide-drive,drive=disk: Block node is read-only

Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-hd,drive=disk
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-hd,drive=disk: Block node is read-only
Expand Down

0 comments on commit b501018

Please sign in to comment.