diff options
author | SeokYeon Hwang <syeon.hwang@samsung.com> | 2013-12-11 10:38:35 +0900 |
---|---|---|
committer | SeokYeon Hwang <syeon.hwang@samsung.com> | 2013-12-11 14:12:09 +0900 |
commit | 1a81500c243dfe21a1c348d24b116b6315c66c83 (patch) | |
tree | 8164064245de0479a0b5ae5b026719e81420de49 /util/oslib-posix.c | |
parent | 34668d898e6581ddc47865e6de2d30b55ef47031 (diff) | |
parent | 0e7b9f06a6cc032be6ca2ac55a27592abd374179 (diff) | |
download | qemu-1a81500c243dfe21a1c348d24b116b6315c66c83.tar.gz qemu-1a81500c243dfe21a1c348d24b116b6315c66c83.tar.bz2 qemu-1a81500c243dfe21a1c348d24b116b6315c66c83.zip |
Merge branch 'upstream-1.7' into tizen_qemu_1.7
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
Conflicts:
VERSION
block/cow.c
block/raw-win32.c
block/stream.c
block/vmdk.c
blockdev.c
exec.c
hw/i386/pc_piix.c
hw/scsi/scsi-bus.c
include/qom/cpu.h
include/sysemu/kvm.h
qemu-img.c
tcg/tcg.c
tcg/tcg.h
vl.c
Change-Id: Ib8de93ad2c05150934e17e63d7f8e90ffdfccc62
Diffstat (limited to 'util/oslib-posix.c')
-rw-r--r-- | util/oslib-posix.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 6f9154234b..5068795755 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -136,9 +136,7 @@ void *qemu_anon_ram_alloc(size_t size) size_t offset = QEMU_ALIGN_UP((uintptr_t)ptr, align) - (uintptr_t)ptr; if (ptr == MAP_FAILED) { - fprintf(stderr, "Failed to allocate %zu B: %s\n", - size, strerror(errno)); - abort(); + return NULL; } ptr += offset; @@ -183,6 +181,18 @@ void qemu_set_nonblock(int fd) fcntl(fd, F_SETFL, f | O_NONBLOCK); } +int socket_set_fast_reuse(int fd) +{ + int val = 1, ret; + + ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, + (const char *)&val, sizeof(val)); + + assert(ret == 0); + + return ret; +} + void qemu_set_cloexec(int fd) { int f; |