[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/4] hw/pci: Convert rom_bar into OnOffAuto
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH 3/4] hw/pci: Convert rom_bar into OnOffAuto |
Date: |
Mon, 8 Jul 2024 09:00:50 +0100 |
User-agent: |
Mutt/2.2.12 (2023-09-09) |
On Sat, Jul 06, 2024 at 06:29:23PM +0900, Akihiko Odaki wrote:
> rom_bar is tristate but was defined as uint32_t so convert it into
> OnOffAuto to clarify that. For compatibility, a uint32 value set via
> QOM will be converted into OnOffAuto.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> docs/igd-assign.txt | 2 +-
> include/hw/pci/pci_device.h | 2 +-
> hw/pci/pci.c | 57
> +++++++++++++++++++++++++++++++++++++--
> hw/vfio/pci-quirks.c | 2 +-
> hw/vfio/pci.c | 11 ++++----
> hw/xen/xen_pt_load_rom.c | 4 +--
> tests/qtest/virtio-net-failover.c | 32 +++++++++++-----------
> 7 files changed, 81 insertions(+), 29 deletions(-)
> +static void rom_bar_set(Object *obj, Visitor *v, const char *name, void
> *opaque,
> + Error **errp)
> +{
> + Property *prop = opaque;
> + Error *local_err = NULL;
> + int *ptr = object_field_prop_ptr(obj, prop);
> + uint32_t value;
> +
> + visit_type_enum(v, name, ptr, prop->info->enum_table, &local_err);
> + if (!local_err) {
> + return;
> + }
> +
> + if (visit_type_uint32(v, name, &value, NULL)) {
> + if (value) {
> + *ptr = ON_OFF_AUTO_ON;
> + warn_report("Specifying a number for rombar is deprecated;
> replace a non-zero value with 'on'");
> + } else {
> + *ptr = ON_OFF_AUTO_OFF;
> + warn_report("Specifying a number for rombar is deprecated;
> replace 0 with 'off'");
> + }
If you're going to say something is deprecated, you need to update
the deprecated.rst docs to make this visible to users.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|