qemu/util
Cole Robinson 0ef705a265 qemu-sockets: Report explicit error if unlink fails
Consider this case:

$ ls -ld ~/root-owned/
drwx--x--x. 2 root root 4096 Apr 29 12:55 /home/crobinso/root-owned/
$ ls -l ~/root-owned/foo.sock
-rwxrwxrwx. 1 crobinso crobinso 0 Apr 29 12:55 /home/crobinso/root-owned/foo.sock

$ qemu-system-x86_64 -vnc unix:~/root-owned/foo.sock
qemu-system-x86_64: -vnc unix:/home/crobinso/root-owned/foo.sock: Failed to start VNC server: Failed to bind socket to /home/crobinso/root-owned/foo.sock: Address already in use

...which is techinically true, but the real error is that we failed to
unlink. So report it.

This may seem pathological but it's a real possibility via libvirt.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-20 10:23:08 +02:00
..
acl.c
aes.c aes: remove a dead return statement 2015-02-10 09:27:20 +03:00
bitmap.c
bitops.c
compatfd.c util: Remove unused functions 2015-04-30 16:05:48 +03:00
crc32c.c
cutils.c cutils: refine strtol error handling in parse_debug_env 2015-03-10 08:15:33 +03:00
envlist.c utils: drop strtok_r from envlist_parse 2015-02-16 16:20:02 -06:00
error.c error: Use error_report_err() where appropriate 2015-02-18 10:51:09 +01:00
event_notifier-posix.c
event_notifier-win32.c
fifo8.c
getauxval.c
hbitmap.c block: Resize bitmaps on bdrv_truncate 2015-04-28 15:36:10 +02:00
hexdump.c
host-utils.c
id.c
iov.c util: Use g_new() & friends where that makes obvious sense 2014-12-10 11:34:15 +03:00
Makefile.objs rcu: add rcu library 2015-02-02 16:55:10 +01:00
module.c
notify.c
osdep.c util: Remove unused functions 2015-04-30 16:05:48 +03:00
oslib-posix.c oslib-posix: Fix compiler warning (-Wclobbered) and simplify the code 2015-03-10 08:15:34 +03:00
oslib-win32.c memory: expose alignment used for allocating RAM as MemoryRegion API 2014-11-23 12:11:30 +02:00
path.c
qemu-config.c qemu-config: remove stray inclusions of hw/ files 2015-04-30 16:05:48 +03:00
qemu-error.c
qemu-openpty.c
qemu-option.c qemu-img: Suppress unhelpful extra errors in convert, amend 2015-02-26 14:51:21 +01:00
qemu-progress.c
qemu-sockets.c qemu-sockets: Report explicit error if unlink fails 2015-05-20 10:23:08 +02:00
qemu-thread-posix.c qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK 2015-03-10 10:49:25 +01:00
qemu-thread-win32.c qemu-thread: add per-thread atexit functions 2015-01-13 13:43:29 +00:00
qemu-timer-common.c
rcu.c rcu: do not create thread in pthread_atfork callback 2015-04-01 10:06:38 +02:00
readline.c
rfifolock.c
throttle.c
unicode.c
uri.c util/uri: Add overflow check to rfc3986_parse_port 2015-03-18 12:05:31 +01:00