[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/15] hw/mips: Use MachineClass->default_nic in the virt machine
From: |
Thomas Huth |
Subject: |
[PULL 07/15] hw/mips: Use MachineClass->default_nic in the virt machine |
Date: |
Fri, 26 May 2023 11:08:32 +0200 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Mark the default NIC via the new MachineClass->default_nic setting
so that the machine-defaults code in vl.c can decide whether the
default NIC is usable or not (for example when compiling with the
"--without-default-devices" configure switch).
Inspired-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230524122559.28863-1-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/mips/loongson3_virt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
index 25534288dd..216812f660 100644
--- a/hw/mips/loongson3_virt.c
+++ b/hw/mips/loongson3_virt.c
@@ -406,6 +406,7 @@ static inline void loongson3_virt_devices_init(MachineState
*machine,
PCIBus *pci_bus;
DeviceState *dev;
MemoryRegion *mmio_reg, *ecam_reg;
+ MachineClass *mc = MACHINE_GET_CLASS(machine);
LoongsonMachineState *s = LOONGSON_MACHINE(machine);
dev = qdev_new(TYPE_GPEX_HOST);
@@ -456,7 +457,7 @@ static inline void loongson3_virt_devices_init(MachineState
*machine,
NICInfo *nd = &nd_table[i];
if (!nd->model) {
- nd->model = g_strdup("virtio");
+ nd->model = g_strdup(mc->default_nic);
}
pci_nic_init_nofail(nd, pci_bus, nd->model, NULL);
@@ -619,6 +620,7 @@ static void loongson3v_machine_class_init(ObjectClass *oc,
void *data)
mc->default_ram_size = 1600 * MiB;
mc->kvm_type = mips_kvm_type;
mc->minimum_page_bits = 14;
+ mc->default_nic = "virtio-net-pci";
}
static const TypeInfo loongson3_machine_types[] = {
--
2.31.1
- [PULL 00/15] Improve --without-default-devices testing, fix CVE-2023-0330, Thomas Huth, 2023/05/26
- [PULL 02/15] hw/alpha: Use MachineClass->default_nic in the alpha machine, Thomas Huth, 2023/05/26
- [PULL 01/15] hw/hppa: Use MachineClass->default_nic in the hppa machine, Thomas Huth, 2023/05/26
- [PULL 04/15] hw/loongarch64: Use MachineClass->default_nic in the virt machine, Thomas Huth, 2023/05/26
- [PULL 03/15] hw/arm: Use MachineClass->default_nic in the virt machine, Thomas Huth, 2023/05/26
- [PULL 06/15] hw/arm: Use MachineClass->default_nic in the sbsa-ref machine, Thomas Huth, 2023/05/26
- [PULL 05/15] hw/xtensa: Use MachineClass->default_nic in the virt machine, Thomas Huth, 2023/05/26
- [PULL 08/15] tests/qtest/usb-hcd-uhci-test: Check whether "usb-storage" is available, Thomas Huth, 2023/05/26
- [PULL 10/15] tests/qtest/rtl8139-test: Check whether the rtl8139 device is available, Thomas Huth, 2023/05/26
- [PULL 07/15] hw/mips: Use MachineClass->default_nic in the virt machine,
Thomas Huth <=
- [PULL 09/15] tests/qtest: Check for virtio-blk before using -cdrom with the arm virt machine, Thomas Huth, 2023/05/26
- [PULL 11/15] tests/qtest/usb-hcd-ehci-test: Check for EHCI and UHCI HCDs before using them, Thomas Huth, 2023/05/26
- [PULL 13/15] machine: do not crash if default RAM backend name has been stolen, Thomas Huth, 2023/05/26
- [PULL 14/15] lsi53c895a: disable reentrancy detection for MMIO region, too, Thomas Huth, 2023/05/26
- [PULL 15/15] hw/scsi/lsi53c895a: Fix reentrancy issues in the LSI controller (CVE-2023-0330), Thomas Huth, 2023/05/26
- [PULL 12/15] tests/qtest/ac97-test: add up-/downsampling tests, Thomas Huth, 2023/05/26
- Re: [PULL 00/15] Improve --without-default-devices testing, fix CVE-2023-0330, Richard Henderson, 2023/05/26