提交 a904410a 编写于 作者: P Paolo Bonzini 提交者: Anthony Liguori

pc_sysfw: remove the rom_only property

With the new semantics of pc_sysfw (no -pflash implies "old-style" ROM setup,
-pflash implies "new-style" ROM setup), there is no need anymore for a compat
property.  Old machines simply will never use -pflash, and thus will always
use old-style setup.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Message-id: 1376069702-22330-3-git-send-email-aliguori@us.ibm.com
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 133bb095
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
typedef struct PcSysFwDevice { typedef struct PcSysFwDevice {
SysBusDevice busdev; SysBusDevice busdev;
uint8_t rom_only;
uint8_t isapc_ram_fw; uint8_t isapc_ram_fw;
} PcSysFwDevice; } PcSysFwDevice;
...@@ -76,39 +75,6 @@ static void pc_isa_bios_init(MemoryRegion *rom_memory, ...@@ -76,39 +75,6 @@ static void pc_isa_bios_init(MemoryRegion *rom_memory,
memory_region_set_readonly(isa_bios, true); memory_region_set_readonly(isa_bios, true);
} }
static void pc_fw_add_pflash_drv(void)
{
QemuOpts *opts;
QEMUMachine *machine;
char *filename;
if (bios_name == NULL) {
bios_name = BIOS_FILENAME;
}
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (!filename) {
error_report("Can't open BIOS image %s", bios_name);
exit(1);
}
opts = drive_add(IF_PFLASH, -1, filename, "readonly=on");
g_free(filename);
if (opts == NULL) {
return;
}
machine = find_default_machine();
if (machine == NULL) {
return;
}
if (!drive_init(opts, machine->block_default_type)) {
qemu_opts_del(opts);
}
}
static void pc_system_flash_init(MemoryRegion *rom_memory, static void pc_system_flash_init(MemoryRegion *rom_memory,
DriveInfo *pflash_drv) DriveInfo *pflash_drv)
{ {
...@@ -216,40 +182,24 @@ void pc_system_firmware_init(MemoryRegion *rom_memory) ...@@ -216,40 +182,24 @@ void pc_system_firmware_init(MemoryRegion *rom_memory)
pflash_drv = drive_get(IF_PFLASH, 0, 0); pflash_drv = drive_get(IF_PFLASH, 0, 0);
if (pflash_drv == NULL) { if (sysfw_dev->isapc_ram_fw || pflash_drv == NULL) {
/* When a pflash drive is not found, use rom-mode */ /* When a pflash drive is not found, use rom-mode */
sysfw_dev->rom_only = 1;
} else if (kvm_enabled() && !kvm_readonly_mem_enabled()) {
/* Older KVM cannot execute from device memory. So, flash memory
* cannot be used unless the readonly memory kvm capability is present. */
fprintf(stderr, "qemu: pflash with kvm requires KVM readonly memory support\n");
exit(1);
}
/* If rom-mode is active, use the old pc system rom initialization. */
if (sysfw_dev->rom_only) {
old_pc_system_rom_init(rom_memory, sysfw_dev->isapc_ram_fw); old_pc_system_rom_init(rom_memory, sysfw_dev->isapc_ram_fw);
return; return;
} }
/* If a pflash drive is not found, then create one using if (kvm_enabled() && !kvm_readonly_mem_enabled()) {
the bios filename. */ /* Older KVM cannot execute from device memory. So, flash memory
if (pflash_drv == NULL) { * cannot be used unless the readonly memory kvm capability is present. */
pc_fw_add_pflash_drv(); fprintf(stderr, "qemu: pflash with kvm requires KVM readonly memory support\n");
pflash_drv = drive_get(IF_PFLASH, 0, 0);
}
if (pflash_drv != NULL) {
pc_system_flash_init(rom_memory, pflash_drv);
} else {
fprintf(stderr, "qemu: PC system firmware (pflash) not available\n");
exit(1); exit(1);
} }
pc_system_flash_init(rom_memory, pflash_drv);
} }
static Property pcsysfw_properties[] = { static Property pcsysfw_properties[] = {
DEFINE_PROP_UINT8("isapc_ram_fw", PcSysFwDevice, isapc_ram_fw, 0), DEFINE_PROP_UINT8("isapc_ram_fw", PcSysFwDevice, isapc_ram_fw, 0),
DEFINE_PROP_UINT8("rom_only", PcSysFwDevice, rom_only, 0),
DEFINE_PROP_END_OF_LIST(), DEFINE_PROP_END_OF_LIST(),
}; };
......
...@@ -496,10 +496,6 @@ static QEMUMachine pc_machine_v1_1 = { ...@@ -496,10 +496,6 @@ static QEMUMachine pc_machine_v1_1 = {
#define PC_COMPAT_1_0 \ #define PC_COMPAT_1_0 \
PC_COMPAT_1_1,\ PC_COMPAT_1_1,\
{\ {\
.driver = "pc-sysfw",\
.property = "rom_only",\
.value = stringify(1),\
}, {\
.driver = TYPE_ISA_FDC,\ .driver = TYPE_ISA_FDC,\
.property = "check_media_rate",\ .property = "check_media_rate",\
.value = "off",\ .value = "off",\
...@@ -746,11 +742,6 @@ static QEMUMachine isapc_machine = { ...@@ -746,11 +742,6 @@ static QEMUMachine isapc_machine = {
.init = pc_init_isa, .init = pc_init_isa,
.max_cpus = 1, .max_cpus = 1,
.compat_props = (GlobalProperty[]) { .compat_props = (GlobalProperty[]) {
{
.driver = "pc-sysfw",
.property = "rom_only",
.value = stringify(1),
},
{ {
.driver = "pc-sysfw", .driver = "pc-sysfw",
.property = "isapc_ram_fw", .property = "isapc_ram_fw",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册