mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/armbru/tags/pull-block-2017-02-21' into staging
Changes to -drive without if= and with if=scsi # gpg: Signature made Tue 21 Feb 2017 12:22:35 GMT # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-block-2017-02-21: hw/i386: Deprecate -drive if=scsi with PC machine types hw: Deprecate -drive if=scsi with non-onboard HBAs hw/scsi: Concentrate -drive if=scsi auto-create in one place hw: Drop superfluous special checks for orphaned -drive blockdev: Make orphaned -drive fatal blockdev: Improve message for orphaned -drive hw/arm/highbank: Default -drive to if=ide instead of if=scsi hw: Default -drive to if=none instead of scsi when scsi cannot work hw: Default -drive to if=none instead of ide when ide cannot work hw/arm/cubieboard hw/arm/xlnx-ep108: Fix units_per_default_bus hw: Default -drive to if=ide explicitly where it works Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+13
-10
@@ -227,27 +227,30 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool drive_check_orphaned(void)
|
||||
void drive_check_orphaned(void)
|
||||
{
|
||||
BlockBackend *blk;
|
||||
DriveInfo *dinfo;
|
||||
bool rs = false;
|
||||
Location loc;
|
||||
bool orphans = false;
|
||||
|
||||
for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
|
||||
dinfo = blk_legacy_dinfo(blk);
|
||||
/* If dinfo->bdrv->dev is NULL, it has no device attached. */
|
||||
/* Unless this is a default drive, this may be an oversight. */
|
||||
if (!blk_get_attached_dev(blk) && !dinfo->is_default &&
|
||||
dinfo->type != IF_NONE) {
|
||||
fprintf(stderr, "Warning: Orphaned drive without device: "
|
||||
"id=%s,file=%s,if=%s,bus=%d,unit=%d\n",
|
||||
blk_name(blk), blk_bs(blk) ? blk_bs(blk)->filename : "",
|
||||
if_name[dinfo->type], dinfo->bus, dinfo->unit);
|
||||
rs = true;
|
||||
loc_push_none(&loc);
|
||||
qemu_opts_loc_restore(dinfo->opts);
|
||||
error_report("machine type does not support"
|
||||
" if=%s,bus=%d,unit=%d",
|
||||
if_name[dinfo->type], dinfo->bus, dinfo->unit);
|
||||
loc_pop(&loc);
|
||||
orphans = true;
|
||||
}
|
||||
}
|
||||
|
||||
return rs;
|
||||
if (orphans) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
DriveInfo *drive_get_by_index(BlockInterfaceType type, int index)
|
||||
|
||||
@@ -177,6 +177,7 @@ static void clipper_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "Alpha DP264/CLIPPER";
|
||||
mc->init = clipper_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->max_cpus = 4;
|
||||
mc->is_default = 1;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,8 @@ static void cubieboard_init(MachineState *machine)
|
||||
memory_region_add_subregion(get_system_memory(), AW_A10_SDRAM_BASE,
|
||||
&s->sdram);
|
||||
|
||||
/* TODO create and connect IDE devices for ide_drive_get() */
|
||||
|
||||
cubieboard_binfo.ram_size = machine->ram_size;
|
||||
cubieboard_binfo.kernel_filename = machine->kernel_filename;
|
||||
cubieboard_binfo.kernel_cmdline = machine->kernel_cmdline;
|
||||
@@ -82,6 +84,8 @@ static void cubieboard_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "cubietech cubieboard";
|
||||
mc->init = cubieboard_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->units_per_default_bus = 1;
|
||||
}
|
||||
|
||||
DEFINE_MACHINE("cubieboard", cubieboard_machine_init)
|
||||
|
||||
+6
-2
@@ -363,6 +363,8 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 2, pic[82]);
|
||||
}
|
||||
|
||||
/* TODO create and connect IDE devices for ide_drive_get() */
|
||||
|
||||
highbank_binfo.ram_size = ram_size;
|
||||
highbank_binfo.kernel_filename = kernel_filename;
|
||||
highbank_binfo.kernel_cmdline = kernel_cmdline;
|
||||
@@ -405,7 +407,8 @@ static void highbank_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
mc->desc = "Calxeda Highbank (ECX-1000)";
|
||||
mc->init = highbank_init;
|
||||
mc->block_default_type = IF_SCSI;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->units_per_default_bus = 1;
|
||||
mc->max_cpus = 4;
|
||||
}
|
||||
|
||||
@@ -421,7 +424,8 @@ static void midway_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
mc->desc = "Calxeda Midway (ECX-2000)";
|
||||
mc->init = midway_init;
|
||||
mc->block_default_type = IF_SCSI;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->units_per_default_bus = 1;
|
||||
mc->max_cpus = 4;
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -259,7 +259,7 @@ static void realview_init(MachineState *machine,
|
||||
}
|
||||
n = drive_get_max_bus(IF_SCSI);
|
||||
while (n >= 0) {
|
||||
pci_create_simple(pci_bus, -1, "lsi53c895a");
|
||||
lsi53c895a_create(pci_bus);
|
||||
n--;
|
||||
}
|
||||
}
|
||||
@@ -443,7 +443,6 @@ static void realview_pbx_a9_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
mc->desc = "ARM RealView Platform Baseboard Explore for Cortex-A9";
|
||||
mc->init = realview_pbx_a9_init;
|
||||
mc->block_default_type = IF_SCSI;
|
||||
mc->max_cpus = 4;
|
||||
}
|
||||
|
||||
|
||||
@@ -998,6 +998,7 @@ static void spitzpda_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
mc->desc = "Sharp SL-C3000 (Spitz) PDA (PXA270)";
|
||||
mc->init = spitz_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
}
|
||||
|
||||
static const TypeInfo spitzpda_type = {
|
||||
@@ -1012,6 +1013,7 @@ static void borzoipda_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
mc->desc = "Sharp SL-C3100 (Borzoi) PDA (PXA270)";
|
||||
mc->init = borzoi_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
}
|
||||
|
||||
static const TypeInfo borzoipda_type = {
|
||||
@@ -1026,6 +1028,7 @@ static void terrierpda_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
mc->desc = "Sharp SL-C3200 (Terrier) PDA (PXA270)";
|
||||
mc->init = terrier_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
}
|
||||
|
||||
static const TypeInfo terrierpda_type = {
|
||||
|
||||
@@ -263,6 +263,7 @@ static void tosapda_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "Sharp SL-6000 (Tosa) PDA (PXA255)";
|
||||
mc->init = tosa_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
}
|
||||
|
||||
DEFINE_MACHINE("tosa", tosapda_machine_init)
|
||||
|
||||
@@ -290,7 +290,7 @@ static void versatile_init(MachineState *machine, int board_id)
|
||||
}
|
||||
n = drive_get_max_bus(IF_SCSI);
|
||||
while (n >= 0) {
|
||||
pci_create_simple(pci_bus, -1, "lsi53c895a");
|
||||
lsi53c895a_create(pci_bus);
|
||||
n--;
|
||||
}
|
||||
|
||||
|
||||
@@ -752,7 +752,6 @@ static void vexpress_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
mc->desc = "ARM Versatile Express";
|
||||
mc->init = vexpress_common_init;
|
||||
mc->block_default_type = IF_SCSI;
|
||||
mc->max_cpus = 4;
|
||||
}
|
||||
|
||||
|
||||
@@ -323,7 +323,6 @@ static void zynq_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "Xilinx Zynq Platform Baseboard for Cortex-A9";
|
||||
mc->init = zynq_init;
|
||||
mc->block_default_type = IF_SCSI;
|
||||
mc->max_cpus = 1;
|
||||
mc->no_sdcard = 1;
|
||||
}
|
||||
|
||||
@@ -106,6 +106,8 @@ static void xlnx_ep108_init(MachineState *machine)
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->soc.spi[i]), 1, cs_line);
|
||||
}
|
||||
|
||||
/* TODO create and connect IDE devices for ide_drive_get() */
|
||||
|
||||
xlnx_ep108_binfo.ram_size = ram_size;
|
||||
xlnx_ep108_binfo.kernel_filename = machine->kernel_filename;
|
||||
xlnx_ep108_binfo.kernel_cmdline = machine->kernel_cmdline;
|
||||
@@ -118,6 +120,8 @@ static void xlnx_ep108_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "Xilinx ZynqMP EP108 board";
|
||||
mc->init = xlnx_ep108_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->units_per_default_bus = 1;
|
||||
}
|
||||
|
||||
DEFINE_MACHINE("xlnx-ep108", xlnx_ep108_machine_init)
|
||||
@@ -126,6 +130,8 @@ static void xlnx_zcu102_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "Xilinx ZynqMP ZCU102 board";
|
||||
mc->init = xlnx_ep108_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->units_per_default_bus = 1;
|
||||
}
|
||||
|
||||
DEFINE_MACHINE("xlnx-zcu102", xlnx_zcu102_machine_init)
|
||||
|
||||
@@ -1650,9 +1650,15 @@ void pc_pci_device_init(PCIBus *pci_bus)
|
||||
int max_bus;
|
||||
int bus;
|
||||
|
||||
/* Note: if=scsi is deprecated with PC machine types */
|
||||
max_bus = drive_get_max_bus(IF_SCSI);
|
||||
for (bus = 0; bus <= max_bus; bus++) {
|
||||
pci_create_simple(pci_bus, -1, "lsi53c895a");
|
||||
/*
|
||||
* By not creating frontends here, we make
|
||||
* scsi_legacy_handle_cmdline() create them, and warn that
|
||||
* this usage is deprecated.
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2339,6 +2345,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
|
||||
mc->query_hotpluggable_cpus = pc_query_hotpluggable_cpus;
|
||||
mc->default_boot_order = "cad";
|
||||
mc->hot_add_cpu = pc_hot_add_cpu;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->max_cpus = 255;
|
||||
mc->reset = pc_machine_reset;
|
||||
hc->pre_plug = pc_machine_device_pre_plug_cb;
|
||||
|
||||
@@ -2840,23 +2840,6 @@ const VMStateDescription vmstate_ide_bus = {
|
||||
void ide_drive_get(DriveInfo **hd, int n)
|
||||
{
|
||||
int i;
|
||||
int highest_bus = drive_get_max_bus(IF_IDE) + 1;
|
||||
int max_devs = drive_get_max_devs(IF_IDE);
|
||||
int n_buses = max_devs ? (n / max_devs) : n;
|
||||
|
||||
/*
|
||||
* Note: The number of actual buses available is not known.
|
||||
* We compute this based on the size of the DriveInfo* array, n.
|
||||
* If it is less than max_devs * <num_real_buses>,
|
||||
* We will stop looking for drives prematurely instead of overfilling
|
||||
* the array.
|
||||
*/
|
||||
|
||||
if (highest_bus > n_buses) {
|
||||
error_report("Too many IDE buses defined (%d > %d)",
|
||||
highest_bus, n_buses);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
hd[i] = drive_get_by_index(IF_IDE, i);
|
||||
|
||||
@@ -387,6 +387,7 @@ static void mips_fulong2e_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "Fulong 2e mini pc";
|
||||
mc->init = mips_fulong2e_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
}
|
||||
|
||||
DEFINE_MACHINE("fulong2e", mips_fulong2e_machine_init)
|
||||
|
||||
@@ -291,10 +291,6 @@ static void mips_jazz_init(MachineState *machine,
|
||||
qdev_get_gpio_in(rc4030, 5), &esp_reset, &dma_enable);
|
||||
|
||||
/* Floppy */
|
||||
if (drive_get_max_bus(IF_FLOPPY) >= MAX_FD) {
|
||||
fprintf(stderr, "qemu: too many floppy drives\n");
|
||||
exit(1);
|
||||
}
|
||||
for (n = 0; n < MAX_FD; n++) {
|
||||
fds[n] = drive_get(IF_FLOPPY, 0, n);
|
||||
}
|
||||
|
||||
@@ -1264,6 +1264,7 @@ static void mips_malta_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "MIPS Malta Core LV";
|
||||
mc->init = mips_malta_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->max_cpus = 16;
|
||||
mc->is_default = 1;
|
||||
}
|
||||
|
||||
@@ -306,6 +306,7 @@ static void mips_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "mips r4k platform";
|
||||
mc->init = mips_r4k_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
}
|
||||
|
||||
DEFINE_MACHINE("mips", mips_machine_init)
|
||||
|
||||
@@ -518,6 +518,7 @@ static void core99_machine_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
mc->desc = "Mac99 based PowerMAC";
|
||||
mc->init = ppc_core99_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->max_cpus = MAX_CPUS;
|
||||
mc->default_boot_order = "cd";
|
||||
mc->kvm_type = core99_kvm_type;
|
||||
|
||||
@@ -368,6 +368,7 @@ static void heathrow_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "Heathrow based PowerMAC";
|
||||
mc->init = ppc_heathrow_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->max_cpus = MAX_CPUS;
|
||||
#ifndef TARGET_PPC64
|
||||
mc->is_default = 1;
|
||||
|
||||
@@ -684,6 +684,7 @@ static void prep_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "PowerPC PREP platform";
|
||||
mc->init = ppc_prep_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
mc->max_cpus = MAX_CPUS;
|
||||
mc->default_boot_order = "cad";
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user