+Mon Aug 13 21:26:48 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+
+ * src/qemu_conf.c, src/qemu_conf.h, src/qemu_driver.c: Add support
+ for passing -incoming option to QEMU for migration/restore.
+
Mon Aug 13 21:18:48 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/util.h, src/util.c: Allow a file descriptor to be supplied
(vm->def->os.initrd[0] ? 2 : 0) + /* initrd */
(vm->def->os.cmdline[0] ? 2 : 0) + /* cmdline */
(vm->def->graphicsType == QEMUD_GRAPHICS_VNC ? 2 :
- (vm->def->graphicsType == QEMUD_GRAPHICS_SDL ? 0 : 1)); /* graphics */
+ (vm->def->graphicsType == QEMUD_GRAPHICS_SDL ? 0 : 1)) + /* graphics */
+ (vm->migrateFrom[0] ? 3 : 0); /* migrateFrom */
snprintf(memory, sizeof(memory), "%d", vm->def->memory/1024);
snprintf(vcpus, sizeof(vcpus), "%d", vm->def->vcpus);
/* SDL is the default. no args needed */
}
+ if (vm->migrateFrom[0]) {
+ if (!((*argv)[++n] = strdup("-S")))
+ goto no_memory;
+ if (!((*argv)[++n] = strdup("-incoming")))
+ goto no_memory;
+ if (!((*argv)[++n] = strdup(vm->migrateFrom)))
+ goto no_memory;
+ }
+
(*argv)[++n] = NULL;
return 0;
return NULL;
}
+ vm->stdin = -1;
vm->stdout = -1;
vm->stderr = -1;
vm->monitor = -1;
/* Guest VM runtime state */
struct qemud_vm {
+ int stdin;
int stdout;
int stderr;
int monitor;
char configFile[PATH_MAX];
char autostartLink[PATH_MAX];
+ char migrateFrom[PATH_MAX];
struct qemud_vm_def *def; /* The current definition */
struct qemud_vm_def *newDef; /* New definition to activate at shutdown */
errno, strerror(errno));
if (virExecNonBlock(conn, argv, &vm->pid,
- -1, &vm->stdout, &vm->stderr) == 0) {
+ vm->stdin, &vm->stdout, &vm->stderr) == 0) {
vm->id = driver->nextvmid++;
- vm->state = VIR_DOMAIN_RUNNING;
+ vm->state = vm->migrateFrom[0] ? VIR_DOMAIN_PAUSED : VIR_DOMAIN_RUNNING;
driver->ninactivevms--;
driver->nactivevms++;