[ovs-dev] [PATCH 2/2] windows, ovn-nbctl: Add service_start call inside the server loop
Alin Gabriel Serdean
aserdean at ovn.org
Tue Aug 21 14:57:48 UTC 2018
Currently all ovn-nbctl (daemon) tests are failing due to the missing
call to `service_start` which is required on Windows.
Windows lacks fork so we need to pass all arguments, so we can spawn a new
process and interpret it properly when calling `service_start`.
Signed-off-by: Alin Gabriel Serdean <aserdean at ovn.org>
---
ovn/utilities/ovn-nbctl.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 35a3af3d5..096f1e7cb 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -117,7 +117,8 @@ static char * OVS_WARN_UNUSED_RESULT main_loop(const char *args,
size_t n_commands,
struct ovsdb_idl *idl,
const struct timer *);
-static void server_loop(struct ovsdb_idl *idl);
+static void server_loop(struct ovsdb_idl *idl, int argc OVS_UNUSED,
+ char *argv[] OVS_UNUSED);
int
main(int argc, char *argv[])
@@ -185,7 +186,11 @@ main(int argc, char *argv[])
ctl_fatal("non-option arguments not supported with --detach "
"(use --help for help)");
}
- server_loop(idl);
+#ifdef _WIN32
+ argc += optind;
+ argv -= optind;
+#endif
+ server_loop(idl, argc, argv);
} else {
struct ctl_command *commands;
size_t n_commands;
@@ -5271,11 +5276,13 @@ server_cmd_init(struct ovsdb_idl *idl, bool *exiting)
}
static void
-server_loop(struct ovsdb_idl *idl)
+server_loop(struct ovsdb_idl *idl, int argc OVS_UNUSED,
+ char *argv[] OVS_UNUSED)
{
struct unixctl_server *server = NULL;
bool exiting = false;
+ service_start(&argc, &argv);
daemonize_start(false);
int error = unixctl_server_create(unixctl_path, &server);
if (error) {
--
2.16.1.windows.1
More information about the dev
mailing list