Browse Source

hw/char/virtio-serial: Do not expose the 'emergency-write' property

The VIRTIO_CONSOLE_F_EMERG_WRITE feature bit was only set
in the hw_compat_2_7[] array, via the 'emergency-write=off'
property. We removed all machines using that array, lets remove
that property. All instances have this feature bit set and
it can not be disabled. VirtIOSerial::host_features mask is
now unused, remove it.

Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20260108033051.777361-28-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
master
Philippe Mathieu-Daudé 3 months ago
committed by Paolo Bonzini
parent
commit
d0660e5b7f
  1. 9
      hw/char/virtio-serial-bus.c
  2. 2
      include/hw/virtio/virtio-serial.h

9
hw/char/virtio-serial-bus.c

@ -557,7 +557,7 @@ static uint64_t get_features(VirtIODevice *vdev, uint64_t features,
vser = VIRTIO_SERIAL(vdev);
features |= vser->host_features;
features |= BIT_ULL(VIRTIO_CONSOLE_F_EMERG_WRITE);
if (vser->bus.max_nr_ports > 1) {
virtio_add_feature(&features, VIRTIO_CONSOLE_F_MULTIPORT);
}
@ -587,8 +587,7 @@ static void set_config(VirtIODevice *vdev, const uint8_t *config_data)
VirtIOSerialPortClass *vsc;
uint8_t emerg_wr_lo;
if (!virtio_has_feature(vser->host_features,
VIRTIO_CONSOLE_F_EMERG_WRITE) || !config->emerg_wr) {
if (!config->emerg_wr) {
return;
}
@ -1040,7 +1039,7 @@ static void virtio_serial_device_realize(DeviceState *dev, Error **errp)
return;
}
if (!virtio_has_feature(vser->host_features,
if (!virtio_has_feature(vdev->host_features,
VIRTIO_CONSOLE_F_EMERG_WRITE)) {
config_size = offsetof(struct virtio_console_config, emerg_wr);
}
@ -1156,8 +1155,6 @@ static const VMStateDescription vmstate_virtio_console = {
static const Property virtio_serial_properties[] = {
DEFINE_PROP_UINT32("max_ports", VirtIOSerial, serial.max_virtserial_ports,
31),
DEFINE_PROP_BIT64("emergency-write", VirtIOSerial, host_features,
VIRTIO_CONSOLE_F_EMERG_WRITE, true),
};
static void virtio_serial_class_init(ObjectClass *klass, const void *data)

2
include/hw/virtio/virtio-serial.h

@ -186,8 +186,6 @@ struct VirtIOSerial {
struct VirtIOSerialPostLoad *post_load;
virtio_serial_conf serial;
uint64_t host_features;
};
/* Interface to the virtio-serial bus */

Loading…
Cancel
Save