From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH v2 4/4] tools/libxl: Initialise the fd of the unused half of a datacopier Date: Fri, 17 Jul 2015 17:59:09 +0100 Message-ID: <1437152349-12219-1-git-send-email-andrew.cooper3@citrix.com> References: <20150717165536.GT12455@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150717165536.GT12455@zion.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Ian Jackson , Ian Campbell , Wei Liu List-Id: xen-devel@lists.xenproject.org This bug causes a spurious failure if stdin happens to be an appropriately readable/writeable pipe which receives a POLLHUP Signed-off-by: Andrew Cooper CC: Ian Campbell CC: Ian Jackson CC: Wei Liu --- Correct writefd in libxl_stream_write.c --- tools/libxl/libxl_stream_read.c | 1 + tools/libxl/libxl_stream_write.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c index 3e1cd2a..32a3551 100644 --- a/tools/libxl/libxl_stream_read.c +++ b/tools/libxl/libxl_stream_read.c @@ -611,6 +611,7 @@ static void write_emulator_blob(libxl__egc *egc, dc->writewhat = "qemu save file"; dc->copywhat = "restore v2 stream"; dc->writefd = writefd; + dc->readfd = -1; dc->maxsz = -1; dc->callback = write_emulator_done; diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c index 94f681b..5bff52b 100644 --- a/tools/libxl/libxl_stream_write.c +++ b/tools/libxl/libxl_stream_write.c @@ -389,6 +389,7 @@ static void write_emulator_record(libxl__egc *egc, dc->readwhat = "qemu save file"; dc->copywhat = "save v2 stream"; dc->readfd = readfd; + dc->writefd = -1; dc->maxsz = -1; dc->readbuf = stream->emu_body + sizeof(*ehdr); dc->bytes_to_read = rec->length - sizeof(*ehdr); -- 1.7.10.4