[libvirt PATCH 1/3] openvzDomainMigratePrepare3Params: correctly use hostname

Ján Tomko jtomko at redhat.com
Thu Nov 19 10:33:27 UTC 2020


In case no uri_in was supplied, we forgot to set the hostname
to the current hostname and formatted a useless uri_out.

src/util/glibcompat.h:57:26: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  57 | # define g_strdup_printf vir_g_strdup_printf
src/openvz/openvz_driver.c:2136:16: note: in expansion of macro ‘g_strdup_printf’
2136 |     *uri_out = g_strdup_printf("ssh://%s", hostname);

Signed-off-by: Ján Tomko <jtomko at redhat.com>
Reported-by: Jaroslav Suchanek <jsuchane at redhat.com>
Fixes: e3c626a61d6c3d808555653684c0fb1e7c4d74ec
---
 src/openvz/openvz_driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 62bf418027..4fa7511f88 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -2113,6 +2113,8 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn,
                              " but migration requires an FQDN"));
             goto error;
         }
+
+        hostname = my_hostname;
     } else {
         uri = virURIParse(uri_in);
 
-- 
2.26.2




More information about the libvir-list mailing list