qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Ensure migrate_cancel does not block doing I/O


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] Ensure migrate_cancel does not block doing I/O
Date: Fri, 26 Aug 2011 15:48:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

On 08/26/2011 01:25 PM, Daniel P. Berrange wrote:
diff --git a/migration.c b/migration.c
index f5959b4..6448d0b 100644
--- a/migration.c
+++ b/migration.c
@@ -319,6 +319,11 @@ ssize_t migrate_fd_put_buffer(void *opaque, const void 
*data, size_t size)
      FdMigrationState *s = opaque;
      ssize_t ret;

+    if (s->state == MIG_STATE_ERROR ||
+        s->state == MIG_STATE_CANCELLED) {
+        return -EIO;
+    }
+
      do {
          ret = s->write(s, data, size);
      } while (ret == -1&&  ((s->get_error(s)) == EINTR));


I think I slightly prefer this second option, since it avoids the EBADF
scenario. Other opinions ?

I agree.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]