|
@@ -283,6 +283,11 @@ static void ide_cd_realize(IDEDevice *dev, Error **errp)
|
|
|
ide_dev_initfn(dev, IDE_CD, errp);
|
|
|
}
|
|
|
|
|
|
+static void ide_cf_realize(IDEDevice *dev, Error **errp)
|
|
|
+{
|
|
|
+ ide_dev_initfn(dev, IDE_CFATA, errp);
|
|
|
+}
|
|
|
+
|
|
|
#define DEFINE_IDE_DEV_PROPERTIES() \
|
|
|
DEFINE_BLOCK_PROPERTIES(IDEDrive, dev.conf), \
|
|
|
DEFINE_BLOCK_ERROR_PROPERTIES(IDEDrive, dev.conf), \
|
|
@@ -341,6 +346,32 @@ static const TypeInfo ide_cd_info = {
|
|
|
.class_init = ide_cd_class_init,
|
|
|
};
|
|
|
|
|
|
+static Property ide_cf_properties[] = {
|
|
|
+ DEFINE_IDE_DEV_PROPERTIES(),
|
|
|
+ DEFINE_BLOCK_CHS_PROPERTIES(IDEDrive, dev.conf),
|
|
|
+ DEFINE_PROP_BIOS_CHS_TRANS("bios-chs-trans",
|
|
|
+ IDEDrive, dev.chs_trans, BIOS_ATA_TRANSLATION_AUTO),
|
|
|
+ DEFINE_PROP_END_OF_LIST(),
|
|
|
+};
|
|
|
+
|
|
|
+static void ide_cf_class_init(ObjectClass *klass, void *data)
|
|
|
+{
|
|
|
+ DeviceClass *dc = DEVICE_CLASS(klass);
|
|
|
+ IDEDeviceClass *k = IDE_DEVICE_CLASS(klass);
|
|
|
+
|
|
|
+ k->realize = ide_cf_realize;
|
|
|
+ dc->fw_name = "drive";
|
|
|
+ dc->desc = "virtual CompactFlash card";
|
|
|
+ device_class_set_props(dc, ide_cf_properties);
|
|
|
+}
|
|
|
+
|
|
|
+static const TypeInfo ide_cf_info = {
|
|
|
+ .name = "ide-cf",
|
|
|
+ .parent = TYPE_IDE_DEVICE,
|
|
|
+ .instance_size = sizeof(IDEDrive),
|
|
|
+ .class_init = ide_cf_class_init,
|
|
|
+};
|
|
|
+
|
|
|
static void ide_device_class_init(ObjectClass *klass, void *data)
|
|
|
{
|
|
|
DeviceClass *k = DEVICE_CLASS(klass);
|
|
@@ -365,6 +396,7 @@ 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_cf_info);
|
|
|
type_register_static(&ide_device_type_info);
|
|
|
}
|
|
|
|