Reset migration source after failed VM start

This commit is contained in:
Daniel P. Berrange 2007-10-10 19:46:17 +00:00
parent 175e1711a6
commit af10d71cc2
2 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,8 @@
Wed Oct 10 15:44:53 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/qemu_driver.c: Reset migration source after failed attempt
to start a VM. (Jim Paris)
Wed Oct 10 13:48:53 EST 2007 Daniel P. Berrange <berrange@redhat.com> Wed Oct 10 13:48:53 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/xm_internal.c: Fixed procesing of vncunused, and vncdisplay * src/xm_internal.c: Fixed procesing of vncunused, and vncdisplay

View File

@ -2083,6 +2083,7 @@ static int qemudDomainRestore(virConnectPtr conn,
struct qemud_vm_def *def; struct qemud_vm_def *def;
struct qemud_vm *vm; struct qemud_vm *vm;
int fd; int fd;
int ret;
char *xml; char *xml;
struct qemud_save_header header; struct qemud_save_header header;
@ -2161,18 +2162,17 @@ static int qemudDomainRestore(virConnectPtr conn,
/* Set the migration source and start it up. */ /* Set the migration source and start it up. */
snprintf(vm->migrateFrom, sizeof(vm->migrateFrom), "stdio"); snprintf(vm->migrateFrom, sizeof(vm->migrateFrom), "stdio");
vm->stdin = fd; vm->stdin = fd;
ret = qemudStartVMDaemon(conn, driver, vm);
if (qemudStartVMDaemon(conn, driver, vm) < 0) { close(fd);
vm->migrateFrom[0] = '\0';
vm->stdin = -1;
if (ret < 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED, qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
"failed to start VM"); "failed to start VM");
if (!vm->configFile[0]) if (!vm->configFile[0])
qemudRemoveInactiveVM(driver, vm); qemudRemoveInactiveVM(driver, vm);
close(fd);
return -1; return -1;
} }
close(fd);
vm->migrateFrom[0] = '\0';
vm->stdin = -1;
/* If it was running before, resume it now. */ /* If it was running before, resume it now. */
if (header.was_running) { if (header.was_running) {