diff mbox series

[v2,6/6] add UsageHints to QemuSupportState

Message ID 20181106102335.20027-7-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series Introducing QemuSupportState | expand

Commit Message

Gerd Hoffmann Nov. 6, 2018, 10:23 a.m. UTC
So we can add device usage recommendations to devices,
independant from support state.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/qemu/support-state.h |  1 +
 qapi/common.json             | 29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

Comments

Markus Armbruster Nov. 29, 2018, 7:10 p.m. UTC | #1
Gerd Hoffmann <kraxel@redhat.com> writes:

> So we can add device usage recommendations to devices,
> independant from support state.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  include/qemu/support-state.h |  1 +
>  qapi/common.json             | 29 +++++++++++++++++++++++++++++
>  2 files changed, 30 insertions(+)
>
> diff --git a/include/qemu/support-state.h b/include/qemu/support-state.h
> index 6567d8702b..6ea0d03bd5 100644
> --- a/include/qemu/support-state.h
> +++ b/include/qemu/support-state.h
> @@ -5,6 +5,7 @@
>  
>  typedef struct QemuSupportState {
>      SupportState state;
> +    UsageHints   hints;
>      const char   *help;
>  } QemuSupportState;
>  
> diff --git a/qapi/common.json b/qapi/common.json
> index 00374127b8..6952ea2074 100644
> --- a/qapi/common.json
> +++ b/qapi/common.json
> @@ -183,3 +183,32 @@
>              'unsupported',
>              'obsolete',
>              'deprecated' ] }
> +
> +##
> +# @UsageHints:
> +#
> +# Usage recommendations.
> +#
> +# @unspecified: not specified (zero-initialized).

(zero-initialized) is an implementation detail, which in my opinion
doesn't belong here.  Same in PATCH 2.

> +#
> +# @green: Best choice.  Typically paravirtual devices go into this
> +#         category.
> +#         Example (nic): virtio-net.
> +#         Example (usb); xhci.
> +#
> +# @yellow: Reasonable choice.  Typically emulated devices with
> +#          good performance go into this category.
> +#          Example (nic): e1000, e1000e
> +#
> +# @red: Bad choice.  Avoid this unless you run an old guest which
> +#       lacks support for something better.
> +#       Example (nic): rtl8139, pcnet, ne2k, ...
> +#       Example (usb): ehci, uhci, ohci
> +#
> +# Since: 3.2
> +##
> +{ 'enum': 'UsageHints',
> +  'data': [ 'unspecified',
> +            'green',
> +            'yellow',
> +            'red' ] }

Simple.  I like simple, as long as it's good enough.  Hard to tell
without actual users.
diff mbox series

Patch

diff --git a/include/qemu/support-state.h b/include/qemu/support-state.h
index 6567d8702b..6ea0d03bd5 100644
--- a/include/qemu/support-state.h
+++ b/include/qemu/support-state.h
@@ -5,6 +5,7 @@ 
 
 typedef struct QemuSupportState {
     SupportState state;
+    UsageHints   hints;
     const char   *help;
 } QemuSupportState;
 
diff --git a/qapi/common.json b/qapi/common.json
index 00374127b8..6952ea2074 100644
--- a/qapi/common.json
+++ b/qapi/common.json
@@ -183,3 +183,32 @@ 
             'unsupported',
             'obsolete',
             'deprecated' ] }
+
+##
+# @UsageHints:
+#
+# Usage recommendations.
+#
+# @unspecified: not specified (zero-initialized).
+#
+# @green: Best choice.  Typically paravirtual devices go into this
+#         category.
+#         Example (nic): virtio-net.
+#         Example (usb); xhci.
+#
+# @yellow: Reasonable choice.  Typically emulated devices with
+#          good performance go into this category.
+#          Example (nic): e1000, e1000e
+#
+# @red: Bad choice.  Avoid this unless you run an old guest which
+#       lacks support for something better.
+#       Example (nic): rtl8139, pcnet, ne2k, ...
+#       Example (usb): ehci, uhci, ohci
+#
+# Since: 3.2
+##
+{ 'enum': 'UsageHints',
+  'data': [ 'unspecified',
+            'green',
+            'yellow',
+            'red' ] }