[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC 4/8] ioregionfd: Introduce IORegionDFObject type
From: |
Markus Armbruster |
Subject: |
Re: [RFC 4/8] ioregionfd: Introduce IORegionDFObject type |
Date: |
Fri, 11 Feb 2022 14:46:47 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Elena Ufimtseva <elena.ufimtseva@oracle.com> writes:
> Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
[...]
> diff --git a/qapi/qom.json b/qapi/qom.json
> index eeb5395ff3..439fb94c93 100644
> --- a/qapi/qom.json
> +++ b/qapi/qom.json
> @@ -689,6 +689,29 @@
> 'data': { 'chardev': 'str',
> '*log': 'str' } }
>
> +##
> +# @IORegionFDObjectProperties:
> +#
> +# Describes ioregionfd for the device
> +#
> +# @devid: the id of the device to be associated with the ioregionfd
> +#
> +# @iofd: File descriptor
> +#
> +# @bar: BAR number to use with ioregionfd
> +#
> +# @start: offset from the BAR start address of ioregionfd
> +#
> +# @size: size of the ioregionfd
> +##
> +# Since: 2.9
> +{ 'struct': 'IORegionFDObjectProperties',
> + 'data': { 'devid': 'str',
> + 'iofd': 'str',
> + 'bar': 'int',
> + '*start': 'int',
> + '*size':'int' } }
Should these three be 'uint32' to match struct IORegionFD?
> +
> ##
> # @RemoteObjectProperties:
> #
> @@ -842,8 +865,10 @@
> 'tls-creds-psk',
> 'tls-creds-x509',
> 'tls-cipher-suites',
> - { 'name': 'x-remote-object', 'features': [ 'unstable' ] }
> - ] }
> + { 'name': 'x-remote-object', 'features': [ 'unstable' ] },
> + { 'name' :'ioregionfd-object',
> + 'if': 'CONFIG_IOREGIONFD' }
> + ] }
>
> ##
> # @ObjectOptions:
> @@ -905,7 +930,8 @@
> 'tls-creds-psk': 'TlsCredsPskProperties',
> 'tls-creds-x509': 'TlsCredsX509Properties',
> 'tls-cipher-suites': 'TlsCredsProperties',
> - 'x-remote-object': 'RemoteObjectProperties'
> + 'x-remote-object': 'RemoteObjectProperties',
> + 'ioregionfd-object': 'IORegionFDObjectProperties'
> } }
>
> ##
> diff --git a/include/hw/remote/ioregionfd.h b/include/hw/remote/ioregionfd.h
> new file mode 100644
> index 0000000000..c8a8b32ee0
> --- /dev/null
> +++ b/include/hw/remote/ioregionfd.h
> @@ -0,0 +1,40 @@
> +/*
> + * Ioregionfd headers
> + *
> + * Copyright © 2018, 2022 Oracle and/or its affiliates.
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + *
> + */
> +
> +#ifndef IOREGIONFD_H
> +#define IOREGIONFD_H
> +
> +#define PCI_BARS_NR 6
> +
> +typedef struct {
> + uint64_t val;
> + bool memory;
> +} IORegionFDOp;
> +
> +typedef struct {
> + int fd;
> + char *devid;
> + uint32_t bar;
> + uint32_t start;
> + uint32_t size;
> + bool memory;
> +} IORegionFD;
> +
> +struct IORegionFDObject {
> + /* private */
> + Object parent;
> +
> + IORegionFD ioregfd;
> + QTAILQ_ENTRY(IORegionFDObject) next;
> +};
> +
> +typedef struct IORegionFDObject IORegionFDObject;
> +
> +#endif /* IOREGIONFD_H */
[...]
- [RFC 0/8] ioregionfd introduction, Elena Ufimtseva, 2022/02/08
- [RFC 2/8] multiprocess: place RemoteObject definition in a header file, Elena Ufimtseva, 2022/02/08
- [RFC 1/8] ioregionfd: introduce a syscall and memory API, Elena Ufimtseva, 2022/02/08
- [RFC 7/8] multiprocess: add ioregionfd memory region in proxy, Elena Ufimtseva, 2022/02/08
- [RFC 5/8] multiprocess: prepare ioregionfds for remote device, Elena Ufimtseva, 2022/02/08
- [RFC 3/8] ioregionfd: introduce memory API functions, Elena Ufimtseva, 2022/02/08