From: Marc-André Lureau
../hw/virtio/vhost-shadow-virtqueue.c:545:13: error: ‘r’ may be used
uninitialized [-Werror=maybe-uninitialized]
'' is not guaranteed to be assigned when calling -Werror=maybe-uninitialized.
Signed-off-by: Marc-André Lureau
---
hw/virtio/vhost-shadow-virtqueue.c | 2
From: Marc-André Lureau
vhost_svq_get_buf() may return a VirtQueueElement that should be freed.
It's unclear to me if the vhost_svq_get_buf() call should always return NULL.
Signed-off-by: Marc-André Lureau
---
hw/virtio/vhost-shadow-virtqueue.c | 4 +++-
1 file changed, 3 insertions(+), 1
From: Marc-André Lureau
../hw/nvme/ctrl.c:6081:21: error: ‘result’ may be used uninitialized
[-Werror=maybe-uninitialized]
It's not obvious that 'result' is set in all code paths. When is
a returned argument, it's even less clear.
Looking at various assignments, 0 seems to be a suitable
From: Marc-André Lureau
../tests/unit/test-block-iothread.c:773:17: error: ‘job’ may be used
uninitialized [-Werror=maybe-uninitialized]
/usr/include/glib-2.0/glib/gtestutils.h:73:53: error: ‘ret’ may be used
uninitialized [-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau
---
From: Marc-André Lureau
../hw/block/virtio-blk.c:1212:12: error: ‘rq’ may be used uninitialized
[-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau
---
hw/block/virtio-blk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/block/virtio-blk.c
From: Marc-André Lureau
../migration/ram.c:1873:23: error: ‘dirty’ may be used uninitialized
[-Werror=maybe-uninitialized]
When 'block' != NULL, 'dirty' is initialized.
Signed-off-by: Marc-André Lureau
---
migration/ram.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
From: Marc-André Lureau
../plugins/loader.c:405:15: error: ‘ctx’ may be used uninitialized
[-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau
---
plugins/loader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/loader.c b/plugins/loader.c
index
From: Marc-André Lureau
../migration/dirtyrate.c:186:5: error: ‘records’ may be used uninitialized
[-Werror=maybe-uninitialized]
../migration/dirtyrate.c:168:12: error: ‘gen_id’ may be used uninitialized
[-Werror=maybe-uninitialized]
../migration/migration.c:2273:5: error: ‘file’ may be used
From: Marc-André Lureau
../migration/block.c:966:16: error: ‘ret’ may be used uninitialized
[-Werror=maybe-uninitialized]
Given that "cluster_size" must be <= BLK_MIG_BLOCK_SIZE, the previous
loop is entered at least once, so 'ret' is assigned a value in all conditions.
Signed-off-by:
From: Marc-André Lureau
../hw/rdma/rdma_backend.c:129:8: error: ‘ne’ may be used uninitialized
[-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau
---
hw/rdma/rdma_backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/rdma/rdma_backend.c
From: Marc-André Lureau
../block/stream.c:193:19: error: ‘unfiltered_bs’ may be used uninitialized
[-Werror=maybe-uninitialized]
../block/stream.c:176:5: error: ‘len’ may be used uninitialized
[-Werror=maybe-uninitialized]
trace/trace-block.h:906:9: error: ‘ret’ may be used uninitialized
From: Marc-André Lureau
../hw/scsi/vhost-scsi.c:173:12: error: ‘ret’ may be used uninitialized
[-Werror=maybe-uninitialized]
It can be reached when num_queues=0. It probably doesn't make much sense
to instantiate a vhost-scsi with 0 IO queues though. For now, make
vhost_scsi_set_workers()
From: Marc-André Lureau
../hw/sd/sdhci.c:846:16: error: ‘res’ may be used uninitialized
[-Werror=maybe-uninitialized]
False-positive, because "length" is non-null.
Signed-off-by: Marc-André Lureau
---
hw/sd/sdhci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
From: Marc-André Lureau
../nbd/client-connection.c:419:8: error: ‘wait_co’ may be used uninitialized
[-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau
---
nbd/client-connection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nbd/client-connection.c
From: Marc-André Lureau
../hw/ide/ahci.c:989:58: error: ‘tbl_entry_size’ may be used uninitialized
[-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau
---
hw/ide/ahci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index
From: Marc-André Lureau
../block/mirror.c:1066:22: error: ‘iostatus’ may be used uninitialized
[-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau
---
block/mirror.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/mirror.c b/block/mirror.c
index
From: Marc-André Lureau
Hi,
Depending on -Doptimization=, GCC (13.2.1 here) produces different
maybe-uninitialized warnings:
- g: produces -Werror=maybe-uninitialized errors
- 0: clean build
- 1: produces -Werror=maybe-uninitialized errors
- 2: clean build
- 3: produces few
From: Marc-André Lureau
../hw/display/qxl.c:1352:5: error: ‘pci_region’ may be used uninitialized
[-Werror=maybe-uninitialized]
../hw/display/qxl.c:1365:22: error: ‘pci_start’ may be used uninitialized
[-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau
---
hw/display/qxl.c | 4
From: Marc-André Lureau
../util/qemu-timer.c:198:24: error: ‘expire_time’ may be used uninitialized
[-Werror=maybe-uninitialized]
../util/qemu-timer.c:476:8: error: ‘rearm’ may be used uninitialized
[-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau
---
util/qemu-timer.c | 6
From: Marc-André Lureau
../util/qemu-coroutine.c:150:8: error: ‘batch’ may be used uninitialized
[-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau
---
util/qemu-coroutine.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/qemu-coroutine.c
From: Marc-André Lureau
There is no simple way to distinguish when the callback is used for load
or save, AFAICT.
Signed-off-by: Marc-André Lureau
---
hw/virtio/virtio.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index
From: Marc-André Lureau
Check subsection support, and optional handling.
Signed-off-by: Marc-André Lureau
Reviewed-by: Juan Quintela
---
tests/unit/test-vmstate.c | 116 ++
1 file changed, 116 insertions(+)
diff --git a/tests/unit/test-vmstate.c
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
Reviewed-by: Juan Quintela
---
docs/devel/migration.rst | 17 -
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst
index 240eb16d90..22875ac40c 100644
---
From: Marc-André Lureau
Hi,
Surprisingly, the migration code doesn't check that required migration entries
and subsections are loaded. Either optional or required sections are both
ignored when missing. According to the documentation a "newer QEMU that knows
about a subsection can (with care)
From: Marc-André Lureau
Check that required subsections have been loaded.
Signed-off-by: Marc-André Lureau
Reviewed-by: Juan Quintela
---
migration/vmstate.c | 40 ++--
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/migration/vmstate.c
From: Marc-André Lureau
It is reconstructed during fdc_post_load()
Signed-off-by: Marc-André Lureau
---
hw/block/fdc.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index d7cc4d3ec1..fc71660ba0 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
Reviewed-by: Juan Quintela
---
migration/savevm.c | 43 +++
1 file changed, 43 insertions(+)
diff --git a/migration/savevm.c b/migration/savevm.c
index bc98c2ea6f..2ae65b8088 100644
---
From: Marc-André Lureau
Check that required subsections have been loaded.
Signed-off-by: Marc-André Lureau
---
migration/vmstate.c | 40 ++--
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/migration/vmstate.c b/migration/vmstate.c
index
From: Marc-André Lureau
commit 13cde50889237 ("vmstate: Return error in case of error") sets
QemuFile error to stop reading from it and report to the caller (checked
by unit tests). We should do the same on subsection loading error.
Signed-off-by: Marc-André Lureau
---
migration/vmstate.c | 1
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
---
migration/savevm.c | 43 +++
1 file changed, 43 insertions(+)
diff --git a/migration/savevm.c b/migration/savevm.c
index ca5c7cebe0..66c9c3095b 100644
--- a/migration/savevm.c
+++
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
---
docs/devel/migration.rst | 17 -
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst
index c3e1400c0c..50f313f178 100644
--- a/docs/devel/migration.rst
+++
From: Marc-André Lureau
Check subsection support, and optional handling.
Signed-off-by: Marc-André Lureau
---
tests/unit/test-vmstate.c | 116 ++
1 file changed, 116 insertions(+)
diff --git a/tests/unit/test-vmstate.c b/tests/unit/test-vmstate.c
index
From: Marc-André Lureau
The function is used on save at this point. The following commits will
use it on load.
Signed-off-by: Marc-André Lureau
---
include/migration/vmstate.h | 2 +-
migration/savevm.c | 2 +-
migration/vmstate.c | 4 ++--
3 files changed, 4 insertions(+), 4
From: Marc-André Lureau
Hi,
Surprisingly, the migration code doesn't check that required migration entries
and subsections are loaded. Either optional or required sections are both
ignored when missing. According to the documentation a "newer QEMU that knows
about a subsection can (with care)
From: Marc-André Lureau
There is no simple way to distinguish when the callback is used for load
or save, AFAICT.
Signed-off-by: Marc-André Lureau
---
hw/virtio/virtio.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index
From: Marc-André Lureau
Using always 0, QEMU will end up loading the same instance, even if
multiple have been saved.
Signed-off-by: Marc-André Lureau
---
net/slirp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/slirp.c b/net/slirp.c
index c33b3e02e7..af1451b60f
From: Marc-André Lureau
It is reconstructed during fdc_post_load()
Signed-off-by: Marc-André Lureau
---
hw/block/fdc.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index d7cc4d3ec1..fc71660ba0 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@
From: Marc-André Lureau
It is reconstructed during fdc_post_load()
Signed-off-by: Marc-André Lureau
---
hw/block/fdc.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index d7cc4d3ec1..fc71660ba0 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@
From: Marc-André Lureau
There is no simple way to distinguish when the callback is used for load
or save, AFAICT.
Signed-off-by: Marc-André Lureau
---
hw/virtio/virtio.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
---
migration/savevm.c | 43 +++
1 file changed, 43 insertions(+)
diff --git a/migration/savevm.c b/migration/savevm.c
index bb3e99194c..6a17bb0f73 100644
--- a/migration/savevm.c
+++
From: Marc-André Lureau
Using always 0, QEMU will end up loading the same instance, even if
multiple have been saved.
Signed-off-by: Marc-André Lureau
---
net/slirp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/slirp.c b/net/slirp.c
index c33b3e02e7..af1451b60f
From: Marc-André Lureau
Check that required subsections have been loaded.
Signed-off-by: Marc-André Lureau
---
migration/vmstate.c | 40 ++--
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/migration/vmstate.c b/migration/vmstate.c
index
From: Marc-André Lureau
Hi,
To my surprise, QEMU didn't seem to check that required migration entries and
subsections are loaded. I took a naive approach to add such check, by adding
some "visited" marks along the loading path, and checking by the end that all
required entries have been loaded.
From: Marc-André Lureau
docker.py is run during configure, and produces an error: No module
named 'pwd'.
Use a more portable and recommended alternative to lookup the user
"login name".
Signed-off-by: Marc-André Lureau
Reviewed-by: Philippe Mathieu-Daudé
Message-Id:
From: Marc-André Lureau
Currently, the function will simply fail if ancillary fds are not
provided, for ex on unsupported platforms.
This changes the failure from:
{"error": {"class": "GenericError", "desc": "No file descriptor
supplied via SCM_RIGHTS"}}
to:
{"error": {"class":
From: Marc-André Lureau
A more explicit version of qemu_socket_select() with no events.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-8-marcandre.lur...@redhat.com>
---
include/sysemu/os-win32.h | 2 ++
io/channel-socket.c | 4 ++--
From: Marc-André Lureau
Currently, the function will simply fail if ancillary fds are not
provided, for ex on unsupported platforms.
Signed-off-by: Marc-André Lureau
Reviewed-by: Markus Armbruster
Message-Id: <20230306122751.2355515-12-marcandre.lur...@redhat.com>
---
qapi/misc.json | 2
From: Marc-André Lureau
The caller is already closing the fd on failure.
Fixes: c3054a6e6a ("char: Factor out qmp_add_client() parts and move to
chardev/")
Signed-off-by: Marc-André Lureau
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Thomas Huth
Message-Id:
From: Marc-André Lureau
The caller is already closing the fd on failure.
Fixes: c3054a6e6a ("char: Factor out qmp_add_client() parts and move to
chardev/")
Signed-off-by: Marc-André Lureau
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Thomas Huth
Message-Id:
From: Marc-André Lureau
Manually implement a socketpair() function, using UNIX sockets and
simple peer credential checking.
QEMU doesn't make much use of socketpair, beside vhost-user which is not
available for win32 at this point. However, I intend to use it for
writing some new portable
From: Marc-André Lureau
Now that qtest_qmp_add_client() works on win32, we can enable the VNC
test.
Signed-off-by: Marc-André Lureau
Acked-by: Thomas Huth
Message-Id: <20230306122751.2355515-11-marcandre.lur...@redhat.com>
---
tests/qtest/vnc-display-test.c | 12 +++-
1 file changed,
From: Marc-André Lureau
Whether it is SPICE, VNC, D-Bus, or the socket chardev, they all
actually expect a socket kind or will fail in different ways at runtime.
Throw an error early if the given 'add_client' fd is not a socket, and
close it to avoid leaks.
This allows to replace the close()
From: Marc-André Lureau
The following changes since commit 29c8a9e31a982874ce4e2c15f2bf82d5f8dc3517:
Merge tag 'linux-user-for-8.0-pull-request' of
https://gitlab.com/laurent_vivier/qemu into staging (2023-03-12 10:57:00 +)
are available in the Git repository at:
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-9-marcandre.lur...@redhat.com>
---
include/block/aio.h | 8
util/aio-posix.c| 6 +++---
util/aio-win32.c| 7 ---
3 files changed, 3 insertions(+), 18
From: Marc-André Lureau
Fortunately, qemu_fork() is no longer used since commit
a95570e3e4d6 ("io/command: use glib GSpawn, instead of open-coding
fork/exec"). (GSpawn uses posix_spawn() whenever possible instead)
Signed-off-by: Marc-André Lureau
Reviewed-by: Daniel P. Berrangé
Message-Id:
From: Marc-André Lureau
We are about to make the QEMU socket API use file-descriptor space only,
but libslirp gives us SOCKET as fd, still.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-14-marcandre.lur...@redhat.com>
---
net/slirp.c | 10
From: Marc-André Lureau
The API is specific to win32.
Signed-off-by: Marc-André Lureau
Reviewed-by: Daniel P. Berrangé
Message-Id: <20230221124802.4103554-16-marcandre.lur...@redhat.com>
---
include/sysemu/os-posix.h | 1 -
1 file changed, 1 deletion(-)
diff --git
From: Marc-André Lureau
Because they are actually sockets...
Signed-off-by: Marc-André Lureau
Reviewed-by: Thomas Huth
Message-Id: <20230221124802.4103554-3-marcandre.lur...@redhat.com>
---
tests/unit/socket-helpers.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
From: Marc-André Lureau
docker.py is run during configure, and produces an error: No module
named 'pwd'.
Use a more portable and recommended alternative to lookup the user
"login name".
Signed-off-by: Marc-André Lureau
Reviewed-by: Philippe Mathieu-Daudé
Message-Id:
From: Marc-André Lureau
As per comment, presumably to avoid syscall in critical section.
Fixes: 0210c3b39bef08 ("monitor: Use LOCK_GUARD macros")
Signed-off-by: Marc-André Lureau
Reviewed-by: Philippe Mathieu-Daudé
Message-Id: <20230306122751.2355515-7-marcandre.lur...@redhat.com>
---
From: Marc-André Lureau
This is a wrapper for WSAEventSelect, with Error handling. By default,
it will produce a warning, so callers don't have to be modified
now, and yet we can spot potential mis-use.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id:
From: Marc-André Lureau
This can help debugging issues or develop, when error handling is
introduced.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-6-marcandre.lur...@redhat.com>
---
include/qapi/error.h | 6 ++
From: Marc-André Lureau
Because they are actually sockets...
Signed-off-by: Marc-André Lureau
Reviewed-by: Thomas Huth
Message-Id: <20230221124802.4103554-4-marcandre.lur...@redhat.com>
---
io/channel-socket.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
From: Marc-André Lureau
A process with enough capabilities can duplicate a socket to QEMU. Add a
QMP command to import it and add it to the monitor fd list, so it can be
later used by other commands.
Signed-off-by: Marc-André Lureau
Acked-by: Markus Armbruster
Message-Id:
From: Marc-André Lureau
Presumably, this is what should happen when the SOCKET is to be removed.
(it probably worked until now because closesocket() does it implicitly,
but we never now how the slirp library could use the SOCKET later)
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan
From: Marc-André Lureau
A process with enough capabilities can duplicate a socket to QEMU. Add a
QMP command to import it and add it to the monitor fd list, so it can be
later used by other commands.
Signed-off-by: Marc-André Lureau
Acked-by: Markus Armbruster
Message-Id:
From: Marc-André Lureau
Let's check if the argument is actually a SOCKET, else report an error
and return.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-10-marcandre.lur...@redhat.com>
---
util/aio-win32.c | 7 ++-
1 file changed, 6
From: Marc-André Lureau
Fortunately, qemu_fork() is no longer used since commit
a95570e3e4d6 ("io/command: use glib GSpawn, instead of open-coding
fork/exec"). (GSpawn uses posix_spawn() whenever possible instead)
Signed-off-by: Marc-André Lureau
Reviewed-by: Daniel P. Berrangé
Message-Id:
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-5-marcandre.lur...@redhat.com>
---
tests/unit/test-error-report.c | 121 +
tests/unit/meson.build | 1 +
2 files changed, 122
From: Marc-André Lureau
Open-code the socket registration where it's needed, to avoid
artificially used or unclear generic interface.
Furthermore, the following patches are going to make socket handling use
FD-only inside QEMU, but we need to handle win32 SOCKET from libslirp.
Signed-off-by:
From: Marc-André Lureau
Because they are actually sockets...
Signed-off-by: Marc-André Lureau
Reviewed-by: Thomas Huth
Message-Id: <20230221124802.4103554-3-marcandre.lur...@redhat.com>
---
tests/unit/socket-helpers.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
From: Marc-André Lureau
Now that qtest_qmp_add_client() works on win32, we can enable the VNC
test.
Signed-off-by: Marc-André Lureau
Acked-by: Thomas Huth
Message-Id: <20230306122751.2355515-11-marcandre.lur...@redhat.com>
---
tests/qtest/vnc-display-test.c | 12 +++-
1 file changed,
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Thomas Huth
Message-Id: <20230306122751.2355515-2-marcandre.lur...@redhat.com>
---
tests/unit/test-io-channel-command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
From: Marc-André Lureau
Use a close() wrapper instead, so that we don't need to worry about
closesocket() vs close() anymore, let's hope.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-17-marcandre.lur...@redhat.com>
---
From: Marc-André Lureau
Use the "get-win32-socket" function to pass an opened socket to QEMU,
instead of using "getfd", which relies on socket ancillary FD message
passing.
Signed-off-by: Marc-André Lureau
Reviewed-by: Daniel P. Berrangé
Message-Id:
From: Marc-André Lureau
Manually implement a socketpair() function, using UNIX sockets and
simple peer credential checking.
QEMU doesn't make much use of socketpair, beside vhost-user which is not
available for win32 at this point. However, I intend to use it for
writing some new portable
From: Marc-André Lureau
Until now, a win32 SOCKET handle is often cast to an int file
descriptor, as this is what other OS use for sockets. When necessary,
QEMU eventually queries whether it's a socket with the help of
fd_is_socket(). However, there is no guarantee of conflict between the
fd and
From: Marc-André Lureau
Whether it is SPICE, VNC, D-Bus, or the socket chardev, they all
actually expect a socket kind or will fail in different ways at runtime.
Throw an error early if the given 'add_client' fd is not a socket, and
close it to avoid leaks.
This allows to replace the close()
From: Marc-André Lureau
Because they are actually sockets...
Signed-off-by: Marc-André Lureau
Reviewed-by: Thomas Huth
Message-Id: <20230221124802.4103554-4-marcandre.lur...@redhat.com>
---
io/channel-socket.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
From: Marc-André Lureau
Open-code the socket registration where it's needed, to avoid
artificially used or unclear generic interface.
Furthermore, the following patches are going to make socket handling use
FD-only inside QEMU, but we need to handle win32 SOCKET from libslirp.
Signed-off-by:
From: Marc-André Lureau
Use a close() wrapper instead, so that we don't need to worry about
closesocket() vs close() anymore, let's hope.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-17-marcandre.lur...@redhat.com>
---
From: Marc-André Lureau
We are about to make the QEMU socket API use file-descriptor space only,
but libslirp gives us SOCKET as fd, still.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-14-marcandre.lur...@redhat.com>
---
net/slirp.c | 10
From: Marc-André Lureau
Use the "get-win32-socket" function to pass an opened socket to QEMU,
instead of using "getfd", which relies on socket ancillary FD message
passing.
Signed-off-by: Marc-André Lureau
Reviewed-by: Daniel P. Berrangé
Message-Id:
From: Marc-André Lureau
The API is specific to win32.
Signed-off-by: Marc-André Lureau
Reviewed-by: Daniel P. Berrangé
Message-Id: <20230221124802.4103554-16-marcandre.lur...@redhat.com>
---
include/sysemu/os-posix.h | 1 -
1 file changed, 1 deletion(-)
diff --git
From: Marc-André Lureau
Presumably, this is what should happen when the SOCKET is to be removed.
(it probably worked until now because closesocket() does it implicitly,
but we never now how the slirp library could use the SOCKET later)
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan
From: Marc-André Lureau
A more explicit version of qemu_socket_select() with no events.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-8-marcandre.lur...@redhat.com>
---
include/sysemu/os-win32.h | 2 ++
io/channel-socket.c | 4 ++--
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-9-marcandre.lur...@redhat.com>
---
include/block/aio.h | 8
util/aio-posix.c| 6 +++---
util/aio-win32.c| 7 ---
3 files changed, 3 insertions(+), 18
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Thomas Huth
Message-Id: <20230306122751.2355515-2-marcandre.lur...@redhat.com>
---
tests/unit/test-io-channel-command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
From: Marc-André Lureau
As per comment, presumably to avoid syscall in critical section.
Fixes: 0210c3b39bef08 ("monitor: Use LOCK_GUARD macros")
Signed-off-by: Marc-André Lureau
Reviewed-by: Philippe Mathieu-Daudé
Message-Id: <20230306122751.2355515-7-marcandre.lur...@redhat.com>
---
From: Marc-André Lureau
Until now, a win32 SOCKET handle is often cast to an int file
descriptor, as this is what other OS use for sockets. When necessary,
QEMU eventually queries whether it's a socket with the help of
fd_is_socket(). However, there is no guarantee of conflict between the
fd and
From: Marc-André Lureau
Let's check if the argument is actually a SOCKET, else report an error
and return.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-10-marcandre.lur...@redhat.com>
---
util/aio-win32.c | 7 ++-
1 file changed, 6
From: Marc-André Lureau
This can help debugging issues or develop, when error handling is
introduced.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-6-marcandre.lur...@redhat.com>
---
include/qapi/error.h | 6 ++
From: Marc-André Lureau
This is a wrapper for WSAEventSelect, with Error handling. By default,
it will produce a warning, so callers don't have to be modified
now, and yet we can spot potential mis-use.
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id:
From: Marc-André Lureau
Signed-off-by: Marc-André Lureau
Reviewed-by: Stefan Berger
Message-Id: <20230221124802.4103554-5-marcandre.lur...@redhat.com>
---
tests/unit/test-error-report.c | 121 +
tests/unit/meson.build | 1 +
2 files changed, 122
From: Marc-André Lureau
The following changes since commit 29c8a9e31a982874ce4e2c15f2bf82d5f8dc3517:
Merge tag 'linux-user-for-8.0-pull-request' of
https://gitlab.com/laurent_vivier/qemu into staging (2023-03-12 10:57:00 +)
are available in the Git repository at:
From: Marc-André Lureau
Use a close() wrapper instead, so that we don't need to worry about
closesocket() vs close() anymore, let's hope.
Signed-off-by: Marc-André Lureau
---
include/sysemu/os-posix.h | 2 --
include/sysemu/os-win32.h | 8 +++---
backends/tpm/tpm_emulator.c | 6 ++--
From: Marc-André Lureau
Because they are actually sockets...
Signed-off-by: Marc-André Lureau
Reviewed-by: Thomas Huth
---
tests/unit/socket-helpers.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/unit/socket-helpers.c b/tests/unit/socket-helpers.c
index
From: Marc-André Lureau
Until now, a win32 SOCKET handle is often cast to an int file
descriptor, as this is what other OS use for sockets. When necessary,
QEMU eventually queries whether it's a socket with the help of
fd_is_socket(). However, there is no guarantee of conflict between the
fd and
From: Marc-André Lureau
The API is specific to win32.
Signed-off-by: Marc-André Lureau
Reviewed-by: Daniel P. Berrangé
---
include/sysemu/os-posix.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index 58de7c994d..378213fc86 100644
From: Marc-André Lureau
Let's check if the argument is actually a SOCKET, else report an error
and return.
Signed-off-by: Marc-André Lureau
---
util/aio-win32.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/util/aio-win32.c b/util/aio-win32.c
index
1 - 100 of 234 matches
Mail list logo