Fix stream abort upon I/O failure during migration

virStreamAbort is needed when the caller wishes to terminate
the stream early, not when virStreamSend fails.

* qemu/qemu_driver.c: Fix calling of virStreamAbort during
  tunnelled migration
This commit is contained in:
Daniel P. Berrange 2009-10-02 15:49:50 +01:00
parent de85acdf3b
commit 345a5092e5

View File

@ -6619,6 +6619,7 @@ static int doTunnelMigrate(virDomainPtr dom,
for (;;) { for (;;) {
bytes = saferead(client_sock, buffer, sizeof(buffer)); bytes = saferead(client_sock, buffer, sizeof(buffer));
if (bytes < 0) { if (bytes < 0) {
virStreamAbort(st);
virReportSystemError(dconn, errno, "%s", virReportSystemError(dconn, errno, "%s",
_("tunnelled migration failed to read from qemu")); _("tunnelled migration failed to read from qemu"));
goto close_client_sock; goto close_client_sock;
@ -6630,7 +6631,6 @@ static int doTunnelMigrate(virDomainPtr dom,
if (virStreamSend(st, buffer, bytes) < 0) { if (virStreamSend(st, buffer, bytes) < 0) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
_("Failed to write migration data to remote libvirtd")); _("Failed to write migration data to remote libvirtd"));
virStreamAbort(st);
goto close_client_sock; goto close_client_sock;
} }
} }