]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Remove unused qemuMonitorMigrateToFile
authorPeter Krempa <pkrempa@redhat.com>
Wed, 17 Feb 2016 11:56:07 +0000 (12:56 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 17 Feb 2016 14:54:44 +0000 (15:54 +0100)
With the currently supported qemus we always migrate to file
descriptors so the old function is not required any more.

Additionally QEMU_MONITOR_MIGRATE_TO_FILE_TRANSFER_SIZE macro is now
unused.

src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h

index 6b23e889fe896d688a7e3c83f2f195e944b33cb1..58a74754fece55a3bdfa97f00a75a8bfcfd5a3ac 100644 (file)
@@ -2212,67 +2212,6 @@ qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
 }
 
 
-int
-qemuMonitorMigrateToFile(qemuMonitorPtr mon,
-                         unsigned int flags,
-                         const char * const *argv,
-                         const char *target,
-                         unsigned long long offset)
-{
-    char *argstr;
-    char *dest = NULL;
-    int ret = -1;
-    char *safe_target = NULL;
-    virBuffer buf = VIR_BUFFER_INITIALIZER;
-    VIR_DEBUG("argv=%p target=%s offset=%llu flags=%x",
-              argv, target, offset, flags);
-
-    QEMU_CHECK_MONITOR(mon);
-
-    if (offset % QEMU_MONITOR_MIGRATE_TO_FILE_BS) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("file offset must be a multiple of %llu"),
-                       QEMU_MONITOR_MIGRATE_TO_FILE_BS);
-        return -1;
-    }
-
-    argstr = virArgvToString(argv);
-    if (!argstr)
-        goto cleanup;
-
-    /* Migrate to file */
-    virBufferEscapeShell(&buf, target);
-    if (virBufferCheckError(&buf) < 0)
-        goto cleanup;
-    safe_target = virBufferContentAndReset(&buf);
-
-    /* Two dd processes, sharing the same stdout, are necessary to
-     * allow starting at an alignment of 512, but without wasting
-     * padding to get to the larger alignment useful for speed.  Use
-     * <> redirection to avoid truncating a regular file.  */
-    if (virAsprintf(&dest, "exec:" VIR_WRAPPER_SHELL_PREFIX "%s | "
-                    "{ dd bs=%llu seek=%llu if=/dev/null && "
-                    "dd ibs=%llu obs=%llu; } 1<>%s" VIR_WRAPPER_SHELL_SUFFIX,
-                    argstr, QEMU_MONITOR_MIGRATE_TO_FILE_BS,
-                    offset / QEMU_MONITOR_MIGRATE_TO_FILE_BS,
-                    QEMU_MONITOR_MIGRATE_TO_FILE_TRANSFER_SIZE,
-                    QEMU_MONITOR_MIGRATE_TO_FILE_TRANSFER_SIZE,
-                    safe_target) < 0)
-        goto cleanup;
-
-    if (mon->json)
-        ret = qemuMonitorJSONMigrate(mon, flags, dest);
-    else
-        ret = qemuMonitorTextMigrate(mon, flags, dest);
-
- cleanup:
-    VIR_FREE(safe_target);
-    VIR_FREE(argstr);
-    VIR_FREE(dest);
-    return ret;
-}
-
-
 int
 qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
                          unsigned int flags,
index 9d7d5f37705f31aa930f3025a22a20e0c0dc9512..d731344211689cd0a9651090683b99c9cbb3819a 100644 (file)
@@ -569,13 +569,6 @@ int qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
  * larger but only aligned to the smaller block size.
  */
 # define QEMU_MONITOR_MIGRATE_TO_FILE_BS (1024llu * 4)
-# define QEMU_MONITOR_MIGRATE_TO_FILE_TRANSFER_SIZE (1024llu * 1024)
-
-int qemuMonitorMigrateToFile(qemuMonitorPtr mon,
-                             unsigned int flags,
-                             const char * const *argv,
-                             const char *target,
-                             unsigned long long offset);
 
 int qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
                              unsigned int flags,