goto error;
}
}
-
- /* Log, but ignore failures to write logfile for VM */
- if (safewrite(vm->logfile, buf, strlen(buf)) < 0) {
- char ebuf[1024];
- VIR_WARN(_("Unable to log VM console data: %s\n"),
- virStrerror(errno, ebuf, sizeof ebuf));
- }
-
*reply = buf;
return 0;
error:
- if (buf) {
- /* Log, but ignore failures to write logfile for VM */
- if (safewrite(vm->logfile, buf, strlen(buf)) < 0) {
- char ebuf[1024];
- VIR_WARN(_("Unable to log VM console data: %s\n"),
- virStrerror(errno, ebuf, sizeof ebuf));
- }
- VIR_FREE(buf);
- }
+ VIR_FREE(buf);
return -1;
}
goto cleanup;
}
- DEBUG ("balloon reply: '%s'", reply);
+ DEBUG ("%s: balloon reply: '%s'", vm->def->name, reply);
if ((offset = strstr(reply, BALLOON_PREFIX)) != NULL) {
unsigned int memMB;
char *end;
/* If the command failed qemu prints: 'unknown command'
* No message is printed on success it seems */
- DEBUG ("balloon reply: %s", reply);
+ DEBUG ("%s: balloon reply: %s",vm->def->name, reply);
if (strstr(reply, "\nunknown command:")) {
/* Don't set error - it is expected memory balloon fails on many qemu */
ret = 0;
goto cleanup;
}
- DEBUG ("migrate reply: %s", info);
+ DEBUG ("%s: migrate reply: %s", vm->def->name, info);
/* If the command isn't supported then qemu prints:
* unknown command: migrate" */
/* If the command failed qemu prints:
* device not found, device is locked ...
* No message is printed on success it seems */
- DEBUG ("ejectable media change reply: %s", reply);
+ DEBUG ("%s: ejectable media change reply: %s", vm->def->name, reply);
if (strstr(reply, "\ndevice ")) {
qemudReportError (conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
_("changing cdrom media failed: %s"), reply);
return -1;
}
- DEBUG ("pci_add reply: %s", reply);
+ DEBUG ("%s: pci_add reply: %s", vm->def->name, reply);
/* If the command succeeds qemu prints:
* OK bus 0... */
#define PCI_ATTACH_OK_MSG "OK bus 0, slot "
return -1;
}
- DEBUG ("attach_usb reply: %s", reply);
+ DEBUG ("%s: attach_usb reply: %s",vm->def->name, reply);
/* If the command failed qemu prints:
* Could not add ... */
if (strstr(reply, "Could not add ")) {
return -1;
}
- DEBUG ("attach_usb reply: %s", reply);
+ DEBUG ("%s: attach_usb reply: %s", vm->def->name, reply);
/* If the command failed qemu prints:
* Could not add ... */
if (strstr(reply, "Could not add ")) {
goto cleanup;
}
- DEBUG ("pci_del reply: %s", reply);
+ DEBUG ("%s: pci_del reply: %s",vm->def->name, reply);
/* If the command fails due to a wrong slot qemu prints: invalid slot,
* nothing is printed on success */
if (strstr(reply, "invalid slot")) {
"%s", _("'info blockstats' command failed"));
goto cleanup;
}
- DEBUG ("info blockstats reply: %s", info);
+ DEBUG ("%s: info blockstats reply: %s", vm->def->name, info);
/* If the command isn't supported then qemu prints the supported
* info commands, so the output starts "info ". Since this is
if (STRPREFIX (p, "rd_bytes=")) {
p += 9;
if (virStrToLong_ll (p, &dummy, 10, &stats->rd_bytes) == -1)
- DEBUG ("error reading rd_bytes: %s", p);
+ DEBUG ("%s: error reading rd_bytes: %s",
+ vm->def->name, p);
} else if (STRPREFIX (p, "wr_bytes=")) {
p += 9;
if (virStrToLong_ll (p, &dummy, 10, &stats->wr_bytes) == -1)
- DEBUG ("error reading wr_bytes: %s", p);
+ DEBUG ("%s: error reading wr_bytes: %s",
+ vm->def->name, p);
} else if (STRPREFIX (p, "rd_operations=")) {
p += 14;
if (virStrToLong_ll (p, &dummy, 10, &stats->rd_req) == -1)
- DEBUG ("error reading rd_req: %s", p);
+ DEBUG ("%s: error reading rd_req: %s",
+ vm->def->name, p);
} else if (STRPREFIX (p, "wr_operations=")) {
p += 14;
if (virStrToLong_ll (p, &dummy, 10, &stats->wr_req) == -1)
- DEBUG ("error reading wr_req: %s", p);
+ DEBUG ("%s: error reading wr_req: %s",
+ vm->def->name, p);
} else
- DEBUG ("unknown block stat near %s", p);
+ DEBUG ("%s: unknown block stat near %s", vm->def->name, p);
/* Skip to next label. */
p = strchr (p, ' ');
goto cleanup;
}
- DEBUG ("memsave reply: %s", info);
+ DEBUG ("%s: memsave reply: %s", vm->def->name, info);
/* Read the memory file into buffer. */
if (saferead (fd, buffer, size) == (ssize_t) -1) {
"%s", _("off-line migration specified, but suspend operation failed"));
goto cleanup;
}
- DEBUG ("stop reply: %s", info);
+ DEBUG ("%s: stop reply: %s", vm->def->name, info);
VIR_FREE(info);
paused = 1;
snprintf (cmd, sizeof cmd, "migrate_set_speed %lum", resource);
qemudMonitorCommand (vm, cmd, &info);
- DEBUG ("migrate_set_speed reply: %s", info);
+ DEBUG ("%s: migrate_set_speed reply: %s", vm->def->name, info);
VIR_FREE (info);
}
goto cleanup;
}
- DEBUG ("migrate reply: %s", info);
+ DEBUG ("%s: migrate reply: %s", vm->def->name, info);
/* Now check for "fail" in the output string */
if (strstr(info, "fail") != NULL) {
vm->def->name);
}
else {
- DEBUG ("cont reply: %s", info);
+ DEBUG ("%s: cont reply: %s", vm->def->name, info);
VIR_FREE(info);
}