aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/s390-virtio-ccw.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-05-11 14:50:36 +0200
committerThomas Huth <thuth@redhat.com>2023-05-22 09:44:48 +0200
commita32b158a838e21197fef05aebe5ba066e62f45f5 (patch)
tree55aaa0dff8f2fd0b40f54e711d0074327a8b153d /hw/s390x/s390-virtio-ccw.c
parent053b7086274487c31a136940c75a665211bc2b4a (diff)
hw/s390x: Use MachineClass->default_nic in the s390x machine
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). Message-Id: <20230512124033.502654-7-thuth@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'hw/s390x/s390-virtio-ccw.c')
-rw-r--r--hw/s390x/s390-virtio-ccw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 2516b89b32..2dece8eab8 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -245,6 +245,7 @@ static void s390_create_sclpconsole(const char *type, Chardev *chardev)
static void ccw_init(MachineState *machine)
{
+ MachineClass *mc = MACHINE_GET_CLASS(machine);
int ret;
VirtualCssBus *css_bus;
DeviceState *dev;
@@ -292,7 +293,7 @@ static void ccw_init(MachineState *machine)
}
/* Create VirtIO network adapters */
- s390_create_virtio_net(BUS(css_bus), "virtio-net-ccw");
+ s390_create_virtio_net(BUS(css_bus), mc->default_nic);
/* init consoles */
if (serial_hd(0)) {
@@ -746,6 +747,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
hc->unplug_request = s390_machine_device_unplug_request;
nc->nmi_monitor_handler = s390_nmi;
mc->default_ram_id = "s390.ram";
+ mc->default_nic = "virtio-net-ccw";
object_class_property_add_bool(oc, "aes-key-wrap",
machine_get_aes_key_wrap,