[PATCH v2 18/18] stubs: move monitor_fdsets_cleanup with other fdset stubs

Paolo Bonzini posted 7 patches 1 year, 10 months ago
Maintainers: Jason Wang <jasowang@redhat.com>, Andrew Melnychenko <andrew@daynix.com>, Yuri Benditovich <yuri.benditovich@daynix.com>, Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, "Alex Bennée" <alex.bennee@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
[PATCH v2 18/18] stubs: move monitor_fdsets_cleanup with other fdset stubs
Posted by Paolo Bonzini 1 year, 10 months ago
Even though monitor_get_fd() has to remain separate because it is mocked by
tests/unit/test-util-sockets, monitor_fdsets_cleanup() is logically part
of the stubs for monitor/fds.c, so move it there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 stubs/fdset.c            | 6 ++++++
 stubs/monitor-internal.c | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/stubs/fdset.c b/stubs/fdset.c
index 56b3663d588..d7c39a28acb 100644
--- a/stubs/fdset.c
+++ b/stubs/fdset.c
@@ -1,5 +1,7 @@
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "monitor/monitor.h"
+#include "../monitor/monitor-internal.h"
 
 int monitor_fdset_dup_fd_add(int64_t fdset_id, int flags)
 {
@@ -15,3 +17,7 @@ int64_t monitor_fdset_dup_fd_find(int dup_fd)
 void monitor_fdset_dup_fd_remove(int dupfd)
 {
 }
+
+void monitor_fdsets_cleanup(void)
+{
+}
diff --git a/stubs/monitor-internal.c b/stubs/monitor-internal.c
index 20786ac4ffb..4fece49d531 100644
--- a/stubs/monitor-internal.c
+++ b/stubs/monitor-internal.c
@@ -1,7 +1,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "monitor/monitor.h"
-#include "../monitor/monitor-internal.h"
 
 int monitor_get_fd(Monitor *mon, const char *name, Error **errp)
 {
@@ -12,7 +11,3 @@ int monitor_get_fd(Monitor *mon, const char *name, Error **errp)
 void monitor_init_hmp(Chardev *chr, bool use_readline, Error **errp)
 {
 }
-
-void monitor_fdsets_cleanup(void)
-{
-}
-- 
2.44.0
Re: [PATCH v2 18/18] stubs: move monitor_fdsets_cleanup with other fdset stubs
Posted by Richard Henderson 1 year, 10 months ago
On 4/8/24 05:53, Paolo Bonzini wrote:
> Even though monitor_get_fd() has to remain separate because it is mocked by
> tests/unit/test-util-sockets, monitor_fdsets_cleanup() is logically part
> of the stubs for monitor/fds.c, so move it there.
> 
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
> ---
>   stubs/fdset.c            | 6 ++++++
>   stubs/monitor-internal.c | 5 -----
>   2 files changed, 6 insertions(+), 5 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~