int ret = -1;
xmlURIPtr uribits = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
- unsigned int background_flags = 0;
+ unsigned int background_flags = QEMU_MONITOR_MIGRATE_BACKGROUND;
/* Issue the migrate command. */
if (STRPREFIX(uri, "tcp:") && !STRPREFIX(uri, "tcp://")) {
int qemuMonitorMigrateToHost(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char *hostname,
int port)
{
int ret;
- DEBUG("mon=%p hostname=%s port=%d",
- mon, hostname, port);
+ DEBUG("mon=%p hostname=%s port=%d flags=%u",
+ mon, hostname, port, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
}
if (mon->json)
- ret = qemuMonitorJSONMigrateToHost(mon, background, hostname, port);
+ ret = qemuMonitorJSONMigrateToHost(mon, flags, hostname, port);
else
- ret = qemuMonitorTextMigrateToHost(mon, background, hostname, port);
+ ret = qemuMonitorTextMigrateToHost(mon, flags, hostname, port);
return ret;
}
int qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char * const *argv)
{
int ret;
- DEBUG("mon=%p argv=%p",
- mon, argv);
+ DEBUG("mon=%p argv=%p flags=%u",
+ mon, argv, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
}
if (mon->json)
- ret = qemuMonitorJSONMigrateToCommand(mon, background, argv);
+ ret = qemuMonitorJSONMigrateToCommand(mon, flags, argv);
else
- ret = qemuMonitorTextMigrateToCommand(mon, background, argv);
+ ret = qemuMonitorTextMigrateToCommand(mon, flags, argv);
return ret;
}
int qemuMonitorMigrateToFile(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char * const *argv,
const char *target,
unsigned long long offset)
{
int ret;
- DEBUG("mon=%p argv=%p target=%s offset=%llu",
- mon, argv, target, offset);
+ DEBUG("mon=%p argv=%p target=%s offset=%llu flags=%u",
+ mon, argv, target, offset, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
}
if (mon->json)
- ret = qemuMonitorJSONMigrateToFile(mon, background, argv, target, offset);
+ ret = qemuMonitorJSONMigrateToFile(mon, flags, argv, target, offset);
else
- ret = qemuMonitorTextMigrateToFile(mon, background, argv, target, offset);
+ ret = qemuMonitorTextMigrateToFile(mon, flags, argv, target, offset);
return ret;
}
int qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char *unixfile)
{
int ret;
- DEBUG("mon=%p, unixfile=%s",
- mon, unixfile);
+ DEBUG("mon=%p, unixfile=%s flags=%u",
+ mon, unixfile, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
}
if (mon->json)
- ret = qemuMonitorJSONMigrateToUnix(mon, background, unixfile);
+ ret = qemuMonitorJSONMigrateToUnix(mon, flags, unixfile);
else
- ret = qemuMonitorTextMigrateToUnix(mon, background, unixfile);
+ ret = qemuMonitorTextMigrateToUnix(mon, flags, unixfile);
return ret;
}
} QEMU_MONITOR_MIGRATE;
int qemuMonitorMigrateToHost(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char *hostname,
int port);
int qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char * const *argv);
/* In general, BS is the smallest fundamental block size we can use to
# define QEMU_MONITOR_MIGRATE_TO_FILE_TRANSFER_SIZE (1024llu * 1024)
int qemuMonitorMigrateToFile(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char * const *argv,
const char *target,
unsigned long long offset);
int qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char *unixfile);
int qemuMonitorMigrateCancel(qemuMonitorPtr mon);
static int qemuMonitorJSONMigrate(qemuMonitorPtr mon,
- int background,
+ unsigned int flags,
const char *uri)
{
int ret;
- virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("migrate",
- "i:detach", background ? 1 : 0,
- "s:uri", uri,
- NULL);
+ virJSONValuePtr cmd =
+ qemuMonitorJSONMakeCommand("migrate",
+ "i:detach", flags & QEMU_MONITOR_MIGRATE_BACKGROUND ? 1 : 0,
+ "i:blk", flags & QEMU_MONITOR_MIGRATE_NON_SHARED_DISK ? 1 : 0,
+ "i:inc", flags & QEMU_MONITOR_MIGRATE_NON_SHARED_INC ? 1 : 0,
+ "s:uri", uri,
+ NULL);
virJSONValuePtr reply = NULL;
if (!cmd)
int qemuMonitorJSONMigrateToHost(qemuMonitorPtr mon,
- int background,
+ unsigned int flags,
const char *hostname,
int port)
{
return -1;
}
- ret = qemuMonitorJSONMigrate(mon, background, uri);
+ ret = qemuMonitorJSONMigrate(mon, flags, uri);
VIR_FREE(uri);
int qemuMonitorJSONMigrateToCommand(qemuMonitorPtr mon,
- int background,
+ unsigned int flags,
const char * const *argv)
{
char *argstr;
goto cleanup;
}
- ret = qemuMonitorJSONMigrate(mon, background, dest);
+ ret = qemuMonitorJSONMigrate(mon, flags, dest);
cleanup:
VIR_FREE(argstr);
}
int qemuMonitorJSONMigrateToFile(qemuMonitorPtr mon,
- int background,
+ unsigned int flags,
const char * const *argv,
const char *target,
unsigned long long offset)
goto cleanup;
}
- ret = qemuMonitorJSONMigrate(mon, background, dest);
+ ret = qemuMonitorJSONMigrate(mon, flags, dest);
cleanup:
VIR_FREE(safe_target);
}
int qemuMonitorJSONMigrateToUnix(qemuMonitorPtr mon,
- int background,
+ unsigned int flags,
const char *unixfile)
{
char *dest = NULL;
return -1;
}
- ret = qemuMonitorJSONMigrate(mon, background, dest);
+ ret = qemuMonitorJSONMigrate(mon, flags, dest);
VIR_FREE(dest);
unsigned long long *total);
int qemuMonitorJSONMigrateToHost(qemuMonitorPtr mon,
- int background,
+ unsigned int flags,
const char *hostname,
int port);
int qemuMonitorJSONMigrateToCommand(qemuMonitorPtr mon,
- int background,
+ unsigned int flags,
const char * const *argv);
int qemuMonitorJSONMigrateToFile(qemuMonitorPtr mon,
- int background,
+ unsigned int flags,
const char * const *argv,
const char *target,
unsigned long long offset);
int qemuMonitorJSONMigrateToUnix(qemuMonitorPtr mon,
- int background,
+ unsigned int flags,
const char *unixfile);
int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon);
static int qemuMonitorTextMigrate(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char *dest)
{
char *cmd = NULL;
return -1;
}
- if (background & QEMU_MONITOR_MIGRATE_BACKGROUND)
+ if (flags & QEMU_MONITOR_MIGRATE_BACKGROUND)
virBufferAddLit(&extra, " -d");
- if (background & QEMU_MONITOR_MIGRATE_NON_SHARED_DISK)
+ if (flags & QEMU_MONITOR_MIGRATE_NON_SHARED_DISK)
virBufferAddLit(&extra, " -b");
- if (background & QEMU_MONITOR_MIGRATE_NON_SHARED_INC)
+ if (flags & QEMU_MONITOR_MIGRATE_NON_SHARED_INC)
virBufferAddLit(&extra, " -i");
if (virBufferError(&extra)) {
virBufferFreeAndReset(&extra);
}
int qemuMonitorTextMigrateToHost(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char *hostname,
int port)
{
return -1;
}
- ret = qemuMonitorTextMigrate(mon, background, uri);
+ ret = qemuMonitorTextMigrate(mon, flags, uri);
VIR_FREE(uri);
int qemuMonitorTextMigrateToCommand(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char * const *argv)
{
char *argstr;
goto cleanup;
}
- ret = qemuMonitorTextMigrate(mon, background, dest);
+ ret = qemuMonitorTextMigrate(mon, flags, dest);
cleanup:
VIR_FREE(argstr);
}
int qemuMonitorTextMigrateToFile(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char * const *argv,
const char *target,
unsigned long long offset)
goto cleanup;
}
- ret = qemuMonitorTextMigrate(mon, background, dest);
+ ret = qemuMonitorTextMigrate(mon, flags, dest);
cleanup:
VIR_FREE(safe_target);
}
int qemuMonitorTextMigrateToUnix(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char *unixfile)
{
char *dest = NULL;
return -1;
}
- ret = qemuMonitorTextMigrate(mon, background, dest);
+ ret = qemuMonitorTextMigrate(mon, flags, dest);
VIR_FREE(dest);
unsigned long long *total);
int qemuMonitorTextMigrateToHost(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char *hostname,
int port);
int qemuMonitorTextMigrateToCommand(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char * const *argv);
int qemuMonitorTextMigrateToFile(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char * const *argv,
const char *target,
unsigned long long offset);
int qemuMonitorTextMigrateToUnix(qemuMonitorPtr mon,
- unsigned int background,
+ unsigned int flags,
const char *unixfile);
int qemuMonitorTextMigrateCancel(qemuMonitorPtr mon);