[libvirt] [PATCH 2/9] Remove unneccessary uri_in parameter from virMigratePrepareTunnel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since virMigratePrepareTunnel() is used for migration over the
native libvirt connection, there is never any need to pass the
target URI to this method.

* daemon/remote.c, src/driver.h, src/libvirt.c, src/libvirt_internal.h,
  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
  src/remote/remote_protocol.c, src/remote/remote_protocol.h,
  src/remote/remote_protocol.x: Remove 'uri_in' parameter from
  virMigratePrepareTunnel() method
---
 daemon/remote.c              |    4 +---
 src/driver.h                 |    1 -
 src/libvirt.c                |    7 +++----
 src/libvirt_internal.h       |    9 ++++-----
 src/qemu/qemu_driver.c       |    8 +-------
 src/remote/remote_driver.c   |    2 --
 src/remote/remote_protocol.c |    2 --
 src/remote/remote_protocol.h |    1 -
 src/remote/remote_protocol.x |    1 -
 9 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index 6a7790e..4296fc3 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -1503,12 +1503,10 @@ remoteDispatchDomainMigratePrepareTunnel(struct qemud_server *server ATTRIBUTE_U
                                          void *ret ATTRIBUTE_UNUSED)
 {
     int r;
-    char *uri_in;
     char *dname;
     struct qemud_client_stream *stream;
     CHECK_CONN (client);
 
-    uri_in = args->uri_in == NULL ? NULL : *args->uri_in;
     dname = args->dname == NULL ? NULL : *args->dname;
 
     stream = remoteCreateClientStream(conn, hdr);
@@ -1517,7 +1515,7 @@ remoteDispatchDomainMigratePrepareTunnel(struct qemud_server *server ATTRIBUTE_U
         return -1;
     }
 
-    r = virDomainMigratePrepareTunnel(conn, stream->st, uri_in,
+    r = virDomainMigratePrepareTunnel(conn, stream->st,
                                       args->flags, dname, args->resource,
                                       args->dom_xml);
     if (r == -1) {
diff --git a/src/driver.h b/src/driver.h
index 2773a95..0c8f923 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -332,7 +332,6 @@ typedef int
     (*virDrvDomainMigratePrepareTunnel)
                     (virConnectPtr conn,
                      virStreamPtr st,
-                     const char *uri_in,
                      unsigned long flags,
                      const char *dname,
                      unsigned long resource,
diff --git a/src/libvirt.c b/src/libvirt.c
index 1ed4804..2839273 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -3487,15 +3487,14 @@ error:
 int
 virDomainMigratePrepareTunnel(virConnectPtr conn,
                               virStreamPtr st,
-                              const char *uri_in,
                               unsigned long flags,
                               const char *dname,
                               unsigned long bandwidth,
                               const char *dom_xml)
 
 {
-    VIR_DEBUG("conn=%p, stream=%p, uri_in=%s, flags=%lu, dname=%s, "
-              "bandwidth=%lu, dom_xml=%s", conn, st, uri_in, flags,
+    VIR_DEBUG("conn=%p, stream=%p, flags=%lu, dname=%s, "
+              "bandwidth=%lu, dom_xml=%s", conn, st, flags,
               NULLSTR(dname), bandwidth, dom_xml);
 
     virResetLastError();
@@ -3516,7 +3515,7 @@ virDomainMigratePrepareTunnel(virConnectPtr conn,
     }
 
     if (conn->driver->domainMigratePrepareTunnel) {
-        int rv = conn->driver->domainMigratePrepareTunnel(conn, st, uri_in,
+        int rv = conn->driver->domainMigratePrepareTunnel(conn, st,
                                                           flags, dname,
                                                           bandwidth, dom_xml);
         if (rv < 0)
diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h
index d3edcfa..d7cfd95 100644
--- a/src/libvirt_internal.h
+++ b/src/libvirt_internal.h
@@ -67,14 +67,14 @@ int virDomainMigratePrepare (virConnectPtr dconn,
                              char **uri_out,
                              unsigned long flags,
                              const char *dname,
-                             unsigned long bandwidth);
+                             unsigned long resource);
 int virDomainMigratePerform (virDomainPtr domain,
                              const char *cookie,
                              int cookielen,
                              const char *uri,
                              unsigned long flags,
                              const char *dname,
-                             unsigned long bandwidth);
+                             unsigned long resource);
 virDomainPtr virDomainMigrateFinish (virConnectPtr dconn,
                                      const char *dname,
                                      const char *cookie,
@@ -88,7 +88,7 @@ int virDomainMigratePrepare2 (virConnectPtr dconn,
                               char **uri_out,
                               unsigned long flags,
                               const char *dname,
-                              unsigned long bandwidth,
+                              unsigned long resource,
                               const char *dom_xml);
 virDomainPtr virDomainMigrateFinish2 (virConnectPtr dconn,
                                       const char *dname,
@@ -97,9 +97,8 @@ virDomainPtr virDomainMigrateFinish2 (virConnectPtr dconn,
                                       const char *uri,
                                       unsigned long flags,
                                       int retcode);
-int virDomainMigratePrepareTunnel(virConnectPtr conn,
+int virDomainMigratePrepareTunnel(virConnectPtr dconn,
                                   virStreamPtr st,
-                                  const char *uri_in,
                                   unsigned long flags,
                                   const char *dname,
                                   unsigned long resource,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 95e672b..1c5cb19 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6075,7 +6075,6 @@ static virStreamDriver qemuStreamMigDrv = {
 static int
 qemudDomainMigratePrepareTunnel(virConnectPtr dconn,
                                 virStreamPtr st,
-                                const char *uri_in,
                                 unsigned long flags,
                                 const char *dname,
                                 unsigned long resource ATTRIBUTE_UNUSED,
@@ -6098,11 +6097,6 @@ qemudDomainMigratePrepareTunnel(virConnectPtr dconn,
                          "%s", _("no domain XML passed"));
         goto cleanup;
     }
-    if (!uri_in) {
-        qemudReportError(dconn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                         "%s", _("no URI passed"));
-        goto cleanup;
-    }
     if (!(flags & VIR_MIGRATE_TUNNELLED)) {
         qemudReportError(dconn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
                          "%s", _("PrepareTunnel called but no TUNNELLED flag set"));
@@ -6459,7 +6453,7 @@ static int doTunnelMigrate(virDomainPtr dom,
         goto close_stream;
     }
 
-    internalret = dconn->driver->domainMigratePrepareTunnel(dconn, st, uri,
+    internalret = dconn->driver->domainMigratePrepareTunnel(dconn, st,
                                                             flags, dname,
                                                             resource, dom_xml);
     VIR_FREE(dom_xml);
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 25aaf32..284593a 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -7053,7 +7053,6 @@ static virStreamDriver remoteStreamDrv = {
 static int
 remoteDomainMigratePrepareTunnel(virConnectPtr conn,
                                  virStreamPtr st,
-                                 const char *uri_in,
                                  unsigned long flags,
                                  const char *dname,
                                  unsigned long resource,
@@ -7072,7 +7071,6 @@ remoteDomainMigratePrepareTunnel(virConnectPtr conn,
     st->driver = &remoteStreamDrv;
     st->privateData = privst;
 
-    args.uri_in = uri_in == NULL ? NULL : (char **) &uri_in;
     args.flags = flags;
     args.dname = dname == NULL ? NULL : (char **) &dname;
     args.resource = resource;
diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c
index 8c61712..1449ed4 100644
--- a/src/remote/remote_protocol.c
+++ b/src/remote/remote_protocol.c
@@ -2701,8 +2701,6 @@ bool_t
 xdr_remote_domain_migrate_prepare_tunnel_args (XDR *xdrs, remote_domain_migrate_prepare_tunnel_args *objp)
 {
 
-         if (!xdr_remote_string (xdrs, &objp->uri_in))
-                 return FALSE;
          if (!xdr_uint64_t (xdrs, &objp->flags))
                  return FALSE;
          if (!xdr_remote_string (xdrs, &objp->dname))
diff --git a/src/remote/remote_protocol.h b/src/remote/remote_protocol.h
index 245f411..d87e8bc 100644
--- a/src/remote/remote_protocol.h
+++ b/src/remote/remote_protocol.h
@@ -1530,7 +1530,6 @@ struct remote_secret_lookup_by_usage_ret {
 typedef struct remote_secret_lookup_by_usage_ret remote_secret_lookup_by_usage_ret;
 
 struct remote_domain_migrate_prepare_tunnel_args {
-        remote_string uri_in;
         uint64_t flags;
         remote_string dname;
         uint64_t resource;
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 537a838..2b3c03b 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -1356,7 +1356,6 @@ struct remote_secret_lookup_by_usage_ret {
 };
 
 struct remote_domain_migrate_prepare_tunnel_args {
-    remote_string uri_in;
     unsigned hyper flags;
     remote_string dname;
     unsigned hyper resource;
-- 
1.6.2.5

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]