Elena Ufimtseva <elena.ufimts...@oracle.com> writes: > Signed-off-by: Elena Ufimtseva <elena.ufimts...@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 */ [...]