History | View | Annotate | Download (8.2 kB)
os-posix: Fix build on FreeBSD
Add an include for a header required to build on recent FreeBSD.
Signed-off-by: Nathan Whitehorn <nwhitehorn@freebsd.org>Signed-off-by: Andreas Frber <andreas.faerber@web.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
keep the PID file locked for the lifetime of the process
The lockf() call in qemu_create_pidfile() aims at ensuring mutualexclusion. We shouldn't close the pidfile on success (as introduced bycommit 1bbd1592), because that drops the lock as well [1]:
"File locks shall be released on first close by the locking process...
link the main loop and its dependencies into the tools
Using the main loop code from QEMU enables tools to operate fullyasynchronously. Advantages include better Windows portability (for somedefinition of portability) over glib's.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
os-posix: Plug fd leak in qemu_create_pidfile()
Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
os-posix: set groups properly for -runas
Andrew Griffiths reports that -runas does not set supplementary groupIDs. This means that gid 0 (root) is not dropped when switching to anunprivileged user.
Add an initgroups(3) call to use the -runas user's /etc/groups...
Introduce format string for pid_t
BeOS and Haiku on i386 use long for 32-bit types, including pid_t.Using %d with pid_t therefore results in a warning.
Unfortunately POSIX:2008 does not define a PRId* string for pid_t.
In some places pid_t was previously casted to long and %ld hardcoded....
add a service to reap zombies, use it in SLIRP
SLIRP -smb support wants to fork a process and forget about reaping it.To please it, add a generic service to register a process id and letQEMU reap it. In the future it could be enhanced to pass a status,...
report that QEMU process was killed by a signal
Currently when rogue script kills QEMU process (using TERM/INT/HUPsignal) it looks indistinguishable from system shutdown. Lets reportthat QEMU was killed and leave some clues about the killer identity.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
Expose thread_id in info cpus
Based on patch by Glauber Costa:
To allow management applications like libvirt to apply CPU affinities tothe VCPU threads, expose their ID via info cpus. This patch provides thepre-existing and used interface from qemu-kvm....
Separate qemu_pidfile() into OS specific versions
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
We only support eventfd under POSIX, move qemu_eventfd() to os-posix.c
Use ARRAY_SIZE macro
Replace array size calculations with ARRAY_SIZE macro.
Implemented with this Coccinelle semantic patch, adapted fromLinux kernel:@type T;T[] E;@
@type T;T[] E;
- (sizeof(E)/sizeof(*E))+ ARRAY_SIZE(E)
@type T;T[] E;@
- (sizeof(E)/sizeof(E[...]))...
Include sys/mman.h before qemu-options.h
The result of parsing qemu-options.def depends on whehter or notMAP_POPULATE is defined, so make sure to include sys/mman.h beforeincluding qemu-options.h.
Reported by Frank Arnold.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
Introduce OS specific cmdline argument handling and move SMB arg to os-posix.c
Introduce OS specific cmdline argument handling by callingos_parse_cmd_args() at the end of switch() statement. Move optionenum to qemu-options.h and have it included from os-posix.c and...
Move runas handling from vl.c to OS specific files.
Move code to handle runas, ie. change of user id of QEMU processto OS specific files and provide dummy stub for Win32.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>...
Move chroot handling to OS specific files.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Acked-by: Richard Henderson <rth@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Move daemonize handling to OS specific files
Move daemonize handling from vl.c to OS specific files. Provide dummystubs for Win32.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Acked-by: Richard Henderson <rth@redhat.com>...
Make os_change_process_uid and os_change_root os-posix.c local
os_change_process_uid() and os_change_root() are now only calledfrom os-posix.c, so no need to keep win32 stubs for them.
Move line-buffering setup to OS specific files.
Move set_proc_name() to OS specific files.
Move handling to change process name to POSIX specific filesplus add a better error message to cover the case where thefeature isn't supported.
Introduce os-posix.c and create os_setup_signal_handling()
Introcuce os-posix.c and move posix specific signal handlingthere.
Rename os_setup_signal_handling() to os_setup_early_signal_handling()
Move main signal handler setup to os specificfiles.
Move main signal handler setup to os specific files.
Move find_datadir to OS specific files.
This moves the win32 and POSIX versions of find_datadir() to OSspecific files, and removes some #ifdef clutter from vl.c