[PATCH for-5.2 1/3] qga/qapi-schema: Document -1 for invalid PCI address fields

Thomas Huth posted 3 patches 5 years, 3 months ago
Maintainers: Michael Roth <mdroth@linux.vnet.ibm.com>
There is a newer version of this series
[PATCH for-5.2 1/3] qga/qapi-schema: Document -1 for invalid PCI address fields
Posted by Thomas Huth 5 years, 3 months ago
The "guest-get-fsinfo" could also be used for non-PCI devices in the
future. And the code in GuestPCIAddress() in qga/commands-win32.c seems
to be using "-1" for fields that it can not determine already. Thus
let's properly document "-1" as value for invalid PCI address fields.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qga/qapi-schema.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 4be9aad48e..408a662ea5 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -846,7 +846,7 @@
 ##
 # @GuestDiskAddress:
 #
-# @pci-controller: controller's PCI address
+# @pci-controller: controller's PCI address (fields are set to -1 if invalid)
 # @bus-type: bus type
 # @bus: bus id
 # @target: target id
-- 
2.18.1


Re: [PATCH for-5.2 1/3] qga/qapi-schema: Document -1 for invalid PCI address fields
Posted by Daniel P. Berrangé 5 years, 3 months ago
On Mon, Jul 20, 2020 at 01:01:31PM +0200, Thomas Huth wrote:
> The "guest-get-fsinfo" could also be used for non-PCI devices in the
> future. And the code in GuestPCIAddress() in qga/commands-win32.c seems
> to be using "-1" for fields that it can not determine already. Thus
> let's properly document "-1" as value for invalid PCI address fields.

Urgh that's a bit of a design flaw - "pci-controller" should have
been an optional field instead, but we can't fix that without
breaking compat with existing clients :-(

> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  qga/qapi-schema.json | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
> index 4be9aad48e..408a662ea5 100644
> --- a/qga/qapi-schema.json
> +++ b/qga/qapi-schema.json
> @@ -846,7 +846,7 @@
>  ##
>  # @GuestDiskAddress:
>  #
> -# @pci-controller: controller's PCI address
> +# @pci-controller: controller's PCI address (fields are set to -1 if invalid)
>  # @bus-type: bus type
>  # @bus: bus id
>  # @target: target id

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


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 :|