libxc: check return values on mmap() and madvise() on xc_alloc_hypercall_buffer()
authorLuis R. Rodriguez <mcgrof@suse.com>
Tue, 20 May 2014 12:37:35 +0000 (05:37 -0700)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 21 May 2014 12:30:47 +0000 (13:30 +0100)
commite86539a388314cd3dca88f5e69d7873343197cd8
tree6b73287c74db9caab257ac9cfc019b5e543d8f1e
parent5f54c8a041e68dedfed76aea6778d20b5026f232
libxc: check return values on mmap() and madvise() on xc_alloc_hypercall_buffer()

On a Thinkpad T4440p with OpenSUSE tumbleweed with v3.15-rc4
and today's latest xen tip from the git tree strace -f reveals
we end up on a never ending wait shortly after

write(20, "backend/console/5\0", 18 <unfinished ...>

This is right before we just wait on the qemu process which we
had mmap'd for. Without this you'll end up getting stuck on a
loop if mmap() worked but madvise() did not. While at it I noticed
even the mmap() error fail was not being checked, fix that too.

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_linux_osdep.c