exec-migration: handle EINTR in popen_get_buffer()
PATCH 1/1 exec-migration: handle EINTR in popen_get_buffer()
Hello,
The attached patch fix occasional failures of incoming exec migrations.
Patch based on qemu-kvm.git.
Uri.
Quoted 1 line
From
0003cebfd2afdf03e2f2cff599691952950a05ceMon Sep 17 00:00:00 2001
From: Uri Lublin <[email protected]>
Date: Tue, 2 Jun 2009 17:09:57 +0300
Subject: [PATCH] exec-migration: handle EINTR in popen_get_buffer()
Upon interrupt, fread returns with no data, and the (incoming exec) migration fails.
Fix by retrying on such a case.
Signed-off-by Uri Lublin <[email protected]>
--- savevm.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
savevm.c +6 -1
@@ -215,7 +215,12 @@ static int popen_put_buffer(void *opaque, const uint8_t *buf, int64_t pos, int sstatic int popen_get_buffer (void *opaque,uint8_t *buf,int64_t pos,int size) {QEMUFilePopen *s = opaque; -return fread (buf,1 , size, s->popen_file); +int bytes; + +do { + bytes =fread (buf,1 , size, s->popen_file); + }while ((bytes ==0 ) && (errno ==EINTR )); +return bytes; }static int popen_close (void *opaque)
Signature · 1 line
1.6.2.2