diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/block/nbd.h | 3 | ||||
-rw-r--r-- | include/hw/pci/pcie_aer.h | 4 | ||||
-rw-r--r-- | include/io/channel-socket.h | 4 | ||||
-rw-r--r-- | include/qapi/clone-visitor.h | 14 | ||||
-rw-r--r-- | include/qapi/qmp/qdict.h | 8 | ||||
-rw-r--r-- | include/qapi/qmp/qlist.h | 8 | ||||
-rw-r--r-- | include/qapi/visitor.h | 6 | ||||
-rw-r--r-- | include/qemu/sockets.h | 16 |
8 files changed, 47 insertions, 16 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h index 3e373f0..0ed0775 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -164,4 +164,7 @@ void nbd_client_new(NBDExport *exp, void nbd_client_get(NBDClient *client); void nbd_client_put(NBDClient *client); +void nbd_server_start(SocketAddress *addr, const char *tls_creds, + Error **errp); + #endif diff --git a/include/hw/pci/pcie_aer.h b/include/hw/pci/pcie_aer.h index 526802b..729a943 100644 --- a/include/hw/pci/pcie_aer.h +++ b/include/hw/pci/pcie_aer.h @@ -100,8 +100,4 @@ void pcie_aer_root_write_config(PCIDevice *dev, uint32_t addr, uint32_t val, int len, uint32_t root_cmd_prev); -/* error injection */ -int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err); -void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg); - #endif /* QEMU_PCIE_AER_H */ diff --git a/include/io/channel-socket.h b/include/io/channel-socket.h index 711f8bf..53801f6 100644 --- a/include/io/channel-socket.h +++ b/include/io/channel-socket.h @@ -205,7 +205,7 @@ void qio_channel_socket_dgram_async(QIOChannelSocket *ioc, * Get the string representation of the local socket * address. A pointer to the allocated address information * struct will be returned, which the caller is required to - * release with a call qapi_free_SocketAddress when no + * release with a call qapi_free_SocketAddress() when no * longer required. * * Returns: 0 on success, -1 on error @@ -222,7 +222,7 @@ qio_channel_socket_get_local_address(QIOChannelSocket *ioc, * Get the string representation of the local socket * address. A pointer to the allocated address information * struct will be returned, which the caller is required to - * release with a call qapi_free_SocketAddress when no + * release with a call qapi_free_SocketAddress() when no * longer required. * * Returns: the socket address struct, or NULL on error diff --git a/include/qapi/clone-visitor.h b/include/qapi/clone-visitor.h index b16177e..a4915c7 100644 --- a/include/qapi/clone-visitor.h +++ b/include/qapi/clone-visitor.h @@ -24,6 +24,9 @@ typedef struct QapiCloneVisitor QapiCloneVisitor; void *qapi_clone(const void *src, void (*visit_type)(Visitor *, const char *, void **, Error **)); +void qapi_clone_members(void *dst, const void *src, size_t sz, + void (*visit_type_members)(Visitor *, void *, + Error **)); /* * Deep-clone QAPI object @src of the given @type, and return the result. @@ -36,4 +39,15 @@ void *qapi_clone(const void *src, void (*visit_type)(Visitor *, const char *, (void (*)(Visitor *, const char *, void**, \ Error **))visit_type_ ## type)) +/* + * Copy deep clones of @type members from @src to @dst. + * + * Not usable on QAPI scalars (integers, strings, enums), nor on a + * QAPI object that references the 'any' type. + */ +#define QAPI_CLONE_MEMBERS(type, dst, src) \ + qapi_clone_members(dst, src, sizeof(type), \ + (void (*)(Visitor *, void *, \ + Error **))visit_type_ ## type ## _members) + #endif diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h index fe9a4c5..188440a 100644 --- a/include/qapi/qmp/qdict.h +++ b/include/qapi/qmp/qdict.h @@ -52,6 +52,14 @@ void qdict_destroy_obj(QObject *obj); #define qdict_put(qdict, key, obj) \ qdict_put_obj(qdict, key, QOBJECT(obj)) +/* Helpers for int, bool, and string */ +#define qdict_put_int(qdict, key, value) \ + qdict_put(qdict, key, qint_from_int(value)) +#define qdict_put_bool(qdict, key, value) \ + qdict_put(qdict, key, qbool_from_bool(value)) +#define qdict_put_str(qdict, key, value) \ + qdict_put(qdict, key, qstring_from_str(value)) + /* High level helpers */ double qdict_get_double(const QDict *qdict, const char *key); int64_t qdict_get_int(const QDict *qdict, const char *key); diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h index a84117e..5dc4ed9 100644 --- a/include/qapi/qmp/qlist.h +++ b/include/qapi/qmp/qlist.h @@ -29,6 +29,14 @@ typedef struct QList { #define qlist_append(qlist, obj) \ qlist_append_obj(qlist, QOBJECT(obj)) +/* Helpers for int, bool, and string */ +#define qlist_append_int(qlist, value) \ + qlist_append(qlist, qint_from_int(value)) +#define qlist_append_bool(qlist, value) \ + qlist_append(qlist, qbool_from_bool(value)) +#define qlist_append_str(qlist, value) \ + qlist_append(qlist, qstring_from_str(value)) + #define QLIST_FOREACH_ENTRY(qlist, var) \ for ((var) = ((qlist)->head.tqh_first); \ (var); \ diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h index 1a1b620..b0e233d 100644 --- a/include/qapi/visitor.h +++ b/include/qapi/visitor.h @@ -63,8 +63,10 @@ * The @name parameter of visit_type_FOO() describes the relation * between this QAPI value and its parent container. When visiting * the root of a tree, @name is ignored; when visiting a member of an - * object, @name is the key associated with the value; and when - * visiting a member of a list, @name is NULL. + * object, @name is the key associated with the value; when visiting a + * member of a list, @name is NULL; and when visiting the member of an + * alternate, @name should equal the name used for visiting the + * alternate. * * The visit_type_FOO() functions expect a non-null @obj argument; * they allocate *@obj during input visits, leave it unchanged on diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index af28532..5c326db 100644 --- a/include/qemu/sockets.h +++ b/include/qemu/sockets.h @@ -34,7 +34,7 @@ typedef void NonBlockingConnectHandler(int fd, Error *err, void *opaque); int inet_ai_family_from_address(InetSocketAddress *addr, Error **errp); -InetSocketAddress *inet_parse(const char *str, Error **errp); +int inet_parse(InetSocketAddress *addr, const char *str, Error **errp); int inet_connect(const char *str, Error **errp); int inet_connect_saddr(InetSocketAddress *saddr, NonBlockingConnectHandler *callback, void *opaque, @@ -65,7 +65,7 @@ int socket_init(void); * Get the string representation of the socket * address. A pointer to the allocated address information * struct will be returned, which the caller is required to - * release with a call qapi_free_SocketAddress when no + * release with a call qapi_free_SocketAddress() when no * longer required. * * Returns: the socket address struct, or NULL on error @@ -83,7 +83,7 @@ socket_sockaddr_to_address(struct sockaddr_storage *sa, * Get the string representation of the local socket * address. A pointer to the allocated address information * struct will be returned, which the caller is required to - * release with a call qapi_free_SocketAddress when no + * release with a call qapi_free_SocketAddress() when no * longer required. * * Returns: the socket address struct, or NULL on error @@ -98,7 +98,7 @@ SocketAddress *socket_local_address(int fd, Error **errp); * Get the string representation of the remote socket * address. A pointer to the allocated address information * struct will be returned, which the caller is required to - * release with a call qapi_free_SocketAddress when no + * release with a call qapi_free_SocketAddress() when no * longer required. * * Returns: the socket address struct, or NULL on error @@ -121,14 +121,14 @@ SocketAddress *socket_remote_address(int fd, Error **errp); char *socket_address_to_string(struct SocketAddress *addr, Error **errp); /** - * socket_address_crumple: - * @addr_flat: the socket address to crumple + * socket_address_flatten: + * @addr: the socket address to flatten * - * Convert SocketAddressFlat to SocketAddress. Caller is responsible + * Convert SocketAddressLegacy to SocketAddress. Caller is responsible * for freeing with qapi_free_SocketAddress(). * * Returns: the argument converted to SocketAddress. */ -SocketAddress *socket_address_crumple(SocketAddressFlat *addr_flat); +SocketAddress *socket_address_flatten(SocketAddressLegacy *addr); #endif /* QEMU_SOCKETS_H */ |