From 1ad78ea51aad7978638299a27004049935c2d913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 22 Jun 2015 18:20:18 +0200 Subject: char: add qemu_chr_free() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a chardev is allowed to be created outside of QMP, then it must be also possible to free it. This is useful for ivshmem that creates chardev anonymously and must be able to free them. Signed-off-by: Marc-André Lureau Acked-by: Paolo Bonzini Reviewed-by: Claudio Fontana --- include/sysemu/char.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sysemu/char.h b/include/sysemu/char.h index edf7669..aff193f 100644 --- a/include/sysemu/char.h +++ b/include/sysemu/char.h @@ -128,11 +128,19 @@ CharDriverState *qemu_chr_new(const char *label, const char *filename, /** * @qemu_chr_delete: * - * Destroy a character backend. + * Destroy a character backend and remove it from the list of + * identified character backends. */ void qemu_chr_delete(CharDriverState *chr); /** + * @qemu_chr_free: + * + * Destroy a character backend. + */ +void qemu_chr_free(CharDriverState *chr); + +/** * @qemu_chr_fe_set_echo: * * Ask the backend to override its normal echo setting. This only really -- cgit v1.1 From c246a62f26e5afa8285b21e641b33456f1e69c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 18 Jun 2015 14:05:13 +0200 Subject: msix: add VMSTATE_MSIX_TEST MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ivshmem is going to use MSIX state conditionally. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- include/hw/pci/msix.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h index 954d82b..72e5f93 100644 --- a/include/hw/pci/msix.h +++ b/include/hw/pci/msix.h @@ -46,12 +46,16 @@ void msix_unset_vector_notifiers(PCIDevice *dev); extern const VMStateDescription vmstate_msix; -#define VMSTATE_MSIX(_field, _state) { \ - .name = (stringify(_field)), \ - .size = sizeof(PCIDevice), \ - .vmsd = &vmstate_msix, \ - .flags = VMS_STRUCT, \ - .offset = vmstate_offset_value(_state, _field, PCIDevice), \ +#define VMSTATE_MSIX_TEST(_field, _state, _test) { \ + .name = (stringify(_field)), \ + .size = sizeof(PCIDevice), \ + .vmsd = &vmstate_msix, \ + .flags = VMS_STRUCT, \ + .offset = vmstate_offset_value(_state, _field, PCIDevice), \ + .field_exists = (_test) \ } +#define VMSTATE_MSIX(_f, _s) \ + VMSTATE_MSIX_TEST(_f, _s, NULL) + #endif -- cgit v1.1 From 12f0b68c82356e4dd24f2f0d370b21eb17f1f42e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 13 Oct 2015 12:12:16 +0200 Subject: util: const event_notifier_get_fd() argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau --- include/qemu/event_notifier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/qemu/event_notifier.h b/include/qemu/event_notifier.h index 88b57af..a8f2854 100644 --- a/include/qemu/event_notifier.h +++ b/include/qemu/event_notifier.h @@ -38,7 +38,7 @@ int event_notifier_set_handler(EventNotifier *, EventNotifierHandler *); #ifdef CONFIG_POSIX void event_notifier_init_fd(EventNotifier *, int fd); -int event_notifier_get_fd(EventNotifier *); +int event_notifier_get_fd(const EventNotifier *); #else HANDLE event_notifier_get_handle(EventNotifier *); #endif -- cgit v1.1 From 5105b1d8c2d1ad4a25b8806e86c0f012936b2eed Mon Sep 17 00:00:00 2001 From: David Marchand Date: Tue, 16 Jun 2015 17:43:34 +0200 Subject: ivshmem: add check on protocol version in QEMU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Send a protocol version as the first message from server, clients must close communication if they don't support this protocol version. Older QEMUs should be fine with this change in the protocol since they overrides their own vm_id on reception of an id associated to no eventfd. Signed-off-by: David Marchand Signed-off-by: Marc-André Lureau [use fifo_update_and_get()] Reviewed-by: Claudio Fontana --- include/hw/misc/ivshmem.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/hw/misc/ivshmem.h (limited to 'include') diff --git a/include/hw/misc/ivshmem.h b/include/hw/misc/ivshmem.h new file mode 100644 index 0000000..433ef53 --- /dev/null +++ b/include/hw/misc/ivshmem.h @@ -0,0 +1,25 @@ + +/* + * Inter-VM Shared Memory PCI device. + * + * Author: + * Cam Macdonell + * + * Based On: cirrus_vga.c + * Copyright (c) 2004 Fabrice Bellard + * Copyright (c) 2004 Makoto Suzuki (suzu) + * + * and rtl8139.c + * Copyright (c) 2006 Igor Kovalenko + * + * This code is licensed under the GNU GPL v2. + * + * Contributions after 2012-01-13 are licensed under the terms of the + * GNU GPL, version 2 or (at your option) any later version. + */ +#ifndef IVSHMEM_H +#define IVSHMEM_H + +#define IVSHMEM_PROTOCOL_VERSION 0 + +#endif /* IVSHMEM_H */ -- cgit v1.1