]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: clean out unused migrate to unix
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Tue, 20 Dec 2016 07:05:49 +0000 (10:05 +0300)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 21 Dec 2016 15:24:59 +0000 (16:24 +0100)
src/qemu/qemu_migration.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h

index 2e570e6f097d8143cafa1e85d67265876752fab3..0f4a6cf212f181e67cef6b06df17bb1a1ff25153 100644 (file)
@@ -4355,7 +4355,6 @@ qemuMigrationConfirm(virConnectPtr conn,
 enum qemuMigrationDestinationType {
     MIGRATION_DEST_HOST,
     MIGRATION_DEST_CONNECT_HOST,
-    MIGRATION_DEST_UNIX,
     MIGRATION_DEST_FD,
 };
 
@@ -4375,11 +4374,6 @@ struct _qemuMigrationSpec {
             int port;
         } host;
 
-        struct {
-            char *file;
-            int sock;
-        } unix_socket;
-
         struct {
             int qemu;
             int local;
@@ -4816,11 +4810,6 @@ qemuMigrationRun(virQEMUDriverPtr driver,
         /* handled above and transformed into MIGRATION_DEST_FD */
         break;
 
-    case MIGRATION_DEST_UNIX:
-        ret = qemuMonitorMigrateToUnix(priv->mon, migrate_flags,
-                                       spec->dest.unix_socket.file);
-        break;
-
     case MIGRATION_DEST_FD:
         if (spec->fwdType != MIGRATION_FWD_DIRECT) {
             fd = spec->dest.fd.local;
@@ -4840,25 +4829,6 @@ qemuMigrationRun(virQEMUDriverPtr driver,
     /* From this point onwards we *must* call cancel to abort the
      * migration on source if anything goes wrong */
 
-    if (spec->destType == MIGRATION_DEST_UNIX) {
-        /* It is also possible that the migrate didn't fail initially, but
-         * rather failed later on.  Check its status before waiting for a
-         * connection from qemu which may never be initiated.
-         */
-        if (qemuMigrationCheckJobStatus(driver, vm,
-                                        QEMU_ASYNC_JOB_MIGRATION_OUT,
-                                        false) < 0)
-            goto cancel;
-
-        while ((fd = accept(spec->dest.unix_socket.sock, NULL, NULL)) < 0) {
-            if (errno == EAGAIN || errno == EINTR)
-                continue;
-            virReportSystemError(errno, "%s",
-                                 _("failed to accept connection from qemu"));
-            goto cancel;
-        }
-    }
-
     if (spec->fwdType != MIGRATION_FWD_DIRECT) {
         if (!(iothread = qemuMigrationStartTunnel(spec->fwd.stream, fd)))
             goto cancel;
@@ -5081,7 +5051,6 @@ static int doTunnelMigrate(virQEMUDriverPtr driver,
                            qemuMigrationCompressionPtr compression,
                            qemuMonitorMigrationParamsPtr migParams)
 {
-    virNetSocketPtr sock = NULL;
     int ret = -1;
     qemuMigrationSpec spec;
     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
@@ -5120,13 +5089,8 @@ static int doTunnelMigrate(virQEMUDriverPtr driver,
                            compression, migParams);
 
  cleanup:
-    if (spec.destType == MIGRATION_DEST_FD) {
-        VIR_FORCE_CLOSE(spec.dest.fd.qemu);
-        VIR_FORCE_CLOSE(spec.dest.fd.local);
-    } else {
-        virObjectUnref(sock);
-        VIR_FREE(spec.dest.unix_socket.file);
-    }
+    VIR_FORCE_CLOSE(spec.dest.fd.qemu);
+    VIR_FORCE_CLOSE(spec.dest.fd.local);
 
     virObjectUnref(cfg);
     return ret;
index 648168ded911010254c8018347da75d379b7681c..815610b6d09a1a1ed8c893a26a15995567e0028f 100644 (file)
@@ -2621,30 +2621,6 @@ qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
 }
 
 
-int
-qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
-                         unsigned int flags,
-                         const char *unixfile)
-{
-    char *dest = NULL;
-    int ret = -1;
-    VIR_DEBUG("unixfile=%s flags=%x", unixfile, flags);
-
-    QEMU_CHECK_MONITOR(mon);
-
-    if (virAsprintf(&dest, "unix:%s", unixfile) < 0)
-        return -1;
-
-    if (mon->json)
-        ret = qemuMonitorJSONMigrate(mon, flags, dest);
-    else
-        ret = qemuMonitorTextMigrate(mon, flags, dest);
-
-    VIR_FREE(dest);
-    return ret;
-}
-
-
 int
 qemuMonitorMigrateCancel(qemuMonitorPtr mon)
 {
index 4d7fb9fa6431cd608619cccbc6955abfa26a97b7..dce516afd6594c2577e135836179be833d761f57 100644 (file)
@@ -682,10 +682,6 @@ int qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
                                 unsigned int flags,
                                 const char * const *argv);
 
-int qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
-                             unsigned int flags,
-                             const char *unixfile);
-
 int qemuMonitorMigrateCancel(qemuMonitorPtr mon);
 
 int qemuMonitorGetDumpGuestMemoryCapability(qemuMonitorPtr mon,