[PATCH v3 0/4] allow to deprecate objects and devices

Gerd Hoffmann posted 4 patches 5 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240606143010.1318226-1-kraxel@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Gerd Hoffmann <kraxel@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
include/qom/object.h        |  3 ++
hw/core/qdev.c              | 60 ++++++++++++++++++++++++++++++++++++-
hw/display/cirrus_vga.c     |  1 +
hw/display/cirrus_vga_isa.c |  1 +
hw/usb/dev-hub.c            |  1 +
qom/qom-qmp-cmds.c          |  8 +++++
system/qdev-monitor.c       |  8 +++++
qapi/qom.json               |  8 ++++-
8 files changed, 88 insertions(+), 2 deletions(-)
[PATCH v3 0/4] allow to deprecate objects and devices
Posted by Gerd Hoffmann 5 months, 3 weeks ago
Put some infrastructure in place to allow tagging objects (including
devices) as deprected.  Use it to mark the ohci pci host adapter and
the usb hub as deprecated.

v3:
 - switch to two properties: 'deprecated' and 'not secure' flags.
 - add rfc patch implementing policies for devices with flags.

v2:
 - pick up reviews.
 - drop ohci patch.
 - add cirrus vga patch.

Gerd Hoffmann (4):
  qom: allow to mark objects as deprecated or not secure.
  usb/hub: mark as deprecated
  vga/cirrus: mark as not secure
  qdev: add device policy [RfC]

 include/qom/object.h        |  3 ++
 hw/core/qdev.c              | 60 ++++++++++++++++++++++++++++++++++++-
 hw/display/cirrus_vga.c     |  1 +
 hw/display/cirrus_vga_isa.c |  1 +
 hw/usb/dev-hub.c            |  1 +
 qom/qom-qmp-cmds.c          |  8 +++++
 system/qdev-monitor.c       |  8 +++++
 qapi/qom.json               |  8 ++++-
 8 files changed, 88 insertions(+), 2 deletions(-)

-- 
2.45.2
Re: [PATCH v3 0/4] allow to deprecate objects and devices
Posted by Markus Armbruster 5 months, 2 weeks ago
Gerd Hoffmann <kraxel@redhat.com> writes:

> Put some infrastructure in place to allow tagging objects (including
> devices) as deprected.  Use it to mark the ohci pci host adapter and
> the usb hub as deprecated.

I can see usb-hub [PATCH 2], but not "ohci pci host adapter".  Peeking
at the change log below... dropped in v2?

> v3:
>  - switch to two properties: 'deprecated' and 'not secure' flags.
>  - add rfc patch implementing policies for devices with flags.
>
> v2:
>  - pick up reviews.
>  - drop ohci patch.
>  - add cirrus vga patch.
>
> Gerd Hoffmann (4):
>   qom: allow to mark objects as deprecated or not secure.
>   usb/hub: mark as deprecated
>   vga/cirrus: mark as not secure

This part isn't mentioned in the cover letter.

>   qdev: add device policy [RfC]

There's overlap with QAPI special feature 'deprecated'.

QMP command object_add has argument @qom-type, which is an enumeration
of (user-creatable) object types.  The proper way to mark one of these
deprecated is to tack feature 'deprecated' to it.  It is then subject to
policy set with -compat deprecated-input=XXX, and is visible in
query-qmp-schema.  Modern management applications should already know
how to deal with it there.

This is definitely how we should deprecate user-creatable objects.
Adding a second way to do it seems undesirable to me.

Trouble is QMP command device_add still mostly bypasses QAPI.  Its
argument @driver is a string.

QAPIfying device_add properly has been on our (unwritten) wishlist since
forever.  Kevin (cc'ed) explored it some not too long ago.

I figure you want the means to deprecate devices now rather than after
we figure out how to QAPIfy device_add.  That's fair.

I think we should limit this series just to devices.  It'll become
redundant if we ever succeed at QAPIfying device_add.  No need to worry
about that now.