uxc: fix create operation
authorDaniel Golle <daniel@makrotopia.org>
Tue, 28 Jul 2020 23:13:27 +0000 (00:13 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 29 Jul 2020 09:19:22 +0000 (10:19 +0100)
The 'create' operation needs uxc to reload it's configuration, so after
adding the container to uxc' persistent state tracking the follow-up
call to create the run-time can find it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
uxc.c

diff --git a/uxc.c b/uxc.c
index d43ac3e0ce870e9a1e4588b23bc269e4e579abc1..5d06aa1be053c0f13917de06a30bfc29a4431ba0 100644 (file)
--- a/uxc.c
+++ b/uxc.c
@@ -637,6 +637,12 @@ errout:
        return ret;
 }
 
+static void reload_conf(void)
+{
+       blob_buf_free(&conf);
+       conf_load(false);
+}
+
 int main(int argc, char **argv)
 {
        int ret = EINVAL;
@@ -718,8 +724,9 @@ int main(int argc, char **argv)
                        ret = uxc_set(argv[2], argv[3], autostart, true);
                        if (ret)
                                goto runtime_out;
-               }
 
+                       reload_conf();
+               }
                ret = uxc_create(argv[2], false);
        } else
                goto usage_out;