[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/29] libvhost-user: Change dev->postcopy_ufd assignment to make
From: |
Paolo Bonzini |
Subject: |
[PULL 21/29] libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant |
Date: |
Tue, 10 Jan 2023 17:02:25 +0100 |
From: Marcel Holtmann <marcel@holtmann.org>
The assignment of dev->postcopy_ufd can be moved into an else clause and
then the code becomes C90 compliant.
CC libvhost-user.o
libvhost-user.c: In function ‘vu_set_postcopy_advise’:
libvhost-user.c:1625:5: error: ISO C90 forbids mixed declarations and code
[-Werror=declaration-after-statement]
1625 | struct uffdio_api api_struct;
| ^~~~~~
Understandable, it might be desired to avoid else clauses, but in this
case it seems clear enough and frankly the dev->postcopy_ufd is only
assigned once.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id:
<74db52afb1203c4580ffc7fa462b4b2ba260a353.1671741278.git.marcel@holtmann.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
subprojects/libvhost-user/libvhost-user.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index bf92cc85c086..b28b66cdb159 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -1599,12 +1599,13 @@ vu_set_config(VuDev *dev, VhostUserMsg *vmsg)
static bool
vu_set_postcopy_advise(VuDev *dev, VhostUserMsg *vmsg)
{
- dev->postcopy_ufd = -1;
#ifdef UFFDIO_API
struct uffdio_api api_struct;
dev->postcopy_ufd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
vmsg->size = 0;
+#else
+ dev->postcopy_ufd = -1;
#endif
if (dev->postcopy_ufd == -1) {
--
2.38.1
- [PULL 03/29] accel: introduce accelerator blocker API, (continued)
- [PULL 03/29] accel: introduce accelerator blocker API, Paolo Bonzini, 2023/01/10
- [PULL 02/29] i386: Emit correct error code for 64-bit IDT entry, Paolo Bonzini, 2023/01/10
- [PULL 10/29] hw/xen: use G_GNUC_PRINTF/SCANF for various functions, Paolo Bonzini, 2023/01/10
- [PULL 14/29] enforce use of G_GNUC_PRINTF attributes, Paolo Bonzini, 2023/01/10
- [PULL 07/29] chardev: clean up chardev-parallel.c, Paolo Bonzini, 2023/01/10
- [PULL 15/29] hw/display: avoid creating empty loadable modules, Paolo Bonzini, 2023/01/10
- [PULL 11/29] tools/virtiofsd: add G_GNUC_PRINTF for logging functions, Paolo Bonzini, 2023/01/10
- [PULL 17/29] libvhost-user: Replace typeof with __typeof__, Paolo Bonzini, 2023/01/10
- [PULL 24/29] libvduse: Fix assignment in vring_set_avail_event, Paolo Bonzini, 2023/01/10
- [PULL 22/29] libvduse: Provide _GNU_SOURCE when compiling outside of QEMU, Paolo Bonzini, 2023/01/10
- [PULL 21/29] libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant,
Paolo Bonzini <=
- [PULL 06/29] target/i386: Remove compilation errors when -Werror=maybe-uninitialized, Paolo Bonzini, 2023/01/10
- [PULL 09/29] disas: add G_GNUC_PRINTF to gstring_printf, Paolo Bonzini, 2023/01/10
- [PULL 12/29] util/error: add G_GNUC_PRINTF for various functions, Paolo Bonzini, 2023/01/10
- [PULL 08/29] gitlab: remove redundant setting of PKG_CONFIG_PATH, Paolo Bonzini, 2023/01/10