- Aug 08, 2017
-
-
Paolo Bonzini authored
This reverts commit a59629fc. This is not needed anymore because the IOThread mutex is not "magic" anymore (need not kick the CPU thread)and also because fork callbacks are only enabled at the very beginning of QEMU's execution. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jul 17, 2016
-
-
Wei Jiangang authored
Use g_path_get_basename to get the directory components of a file name, and free its return when no longer needed. Signed-off-by:
Wei Jiangang <weijg.fnst@cn.fujitsu.com> Message-Id: <1459997185-15669-3-git-send-email-weijg.fnst@cn.fujitsu.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 16, 2016
-
-
Paolo Bonzini authored
qemu/osdep.h checks whether MAP_ANONYMOUS is defined, but this check is bogus without a previous inclusion of sys/mman.h. Include it in sysemu/os-posix.h and remove it from everywhere else. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Mar 22, 2016
-
-
Veronia Bahaa authored
Move declarations out of qemu-common.h for functions declared in utils/ files: e.g. include/qemu/path.h for utils/path.c. Move inline functions out of qemu-common.h and into new files (e.g. include/qemu/bcd.h) Signed-off-by:
Veronia Bahaa <veroniabahaa@gmail.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Feb 22, 2016
-
-
Dimitris Aragiorgis authored
In case of daemonize, use the logfile passed with the -D option in order to redirect stderr to it instead of /dev/null. Also remove some unused code in log.h. Signed-off-by:
Dimitris Aragiorgis <dimara@arrikto.com> Message-Id: <1455795518-19205-1-git-send-email-dimara@arrikto.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Feb 04, 2016
-
-
Peter Maydell authored
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 1454089805-5470-16-git-send-email-peter.maydell@linaro.org
-
Thomas Huth authored
We don't want to support the legacy -tftp, -bootp, -smb and -net channel options forever. So let's start telling the users that they are deprecated and what option should be used instead. Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
- Apr 01, 2015
-
-
Paolo Bonzini authored
If QEMU forks after the CPU threads have been created, qemu_mutex_lock_iothread will not be able to do qemu_cpu_kick_thread. There is no solution other than assuming that forks after the CPU threads have been created will end up in an exec. Forks before the CPU threads have been created (such as -daemonize) have to call rcu_after_fork manually. Notably, the oxygen theme for GTK+ forks and shows a "No such process" error without this patch. This patch can be reverted once the iothread loses the "kick the TCG thread" magic. User-mode emulation does not use the iothread, so it can also call rcu_after_fork. Reported by: Dr. David Alan Gilbert <dgilbert@redhat.com> Tested by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Nov 02, 2014
-
-
Michael Tokarev authored
Put "success" parent reporting in os_setup_post() to after all other initializers which may also fail, to the very end, so more possible failure cases are reported properly to the calling process. Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru> Reviewed-by:
Gonglei <arei.gonglei@huawei.com>
-
Michael Tokarev authored
In case of -daemonize, we write non-zero to the daemon pipe only if pidfile creation failed, so the parent will report error about pidfile problem. There's no need to make special case for this, since all other errors are reported by the child just fine. Let the parent report error and simplify logic in os_daemonize(). This way, we don't need os_pidfile_error() function, since it only prints error now, so put the error reporting printf into the only place where qemu_create_pidfile() is called, in vl.c. While at it, fix wrong indentation in os_daemonize(). Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
Michael Tokarev authored
Eliminiate two fullwrite implementations with goto replacing them with a proper do..while loop. Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru> Reviewed-by:
Gonglei <arei.gonglei@huawei.com>
-
Michael Tokarev authored
When asked to -daemonize, we fork a child and setup a pipe between it and parent to pass exit status. os-posix.c used global fds[2] array for that, but actually only the writing side of the pipe is needed to be global, and this name is really too generic. Use just one interger for the writing side of the pipe, and name it daemon_pipe to be more understandable than cryptic fds[1]. Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru> Reviewed-by:
Gonglei <arei.gonglei@huawei.com>
-
Michael Tokarev authored
This reverts commit e5048d15. qemu_create_pidfile() is only created from main(), and there, if that function returns failure, os_pidfile_error() function is called, to, guess that, report error (which is done differently whenever we're daemonizing or not). qemu_create_pidfile() function has several error returns, this lockf() failure is one of them, there are others (another shown in the patch context too). So this patch makes whole thing inconsistent at least. If we need to show error message when we're daemonizing, it looks like we should modify os_pidfile_error() routine to always report error and only after that check for daemon mode. This way all errors will be reported the same way. Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Sep 26, 2014
-
-
Gonglei (Arei) authored
It will cause that create vm failed When manager tool is killed forcibly (kill -9 libvirtd_pid), the file not was unlink, and unlock. It's better that report the error message for users. Signed-off-by:
Huangweidong <weidong.huang@huawei.com> Signed-off-by:
Gonglei <arei.gonglei@huawei.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
Gonglei (Arei) authored
If we get inside the 'else if (status == 1)' conditional, then we know that read() succeeded, and therefore errno is unspecified. Printing strerror(errno) on a random value is not helpful. Cc: Eric Blake <eblake@redhat.com> Signed-off-by:
Gonglei <arei.gonglei@huawei.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
Gonglei (Arei) authored
Cc: Eric Blake <eblake@redhat.com> Signed-off-by:
Gonglei <arei.gonglei@huawei.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Mar 13, 2014
-
-
Andreas Färber authored
Commit 10f5bff6 (util: Split out exec_dir from os_find_datadir) moved code from os-posix.c to util/oslib-posix.c but forgot to move a FreeBSD #include alongside, needed for CTL_KERN among others. Cc: Fam Zheng <famz@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Andreas Färber <andreas.faerber@web.de> Message-id: 1394717279-23406-1-git-send-email-andreas.faerber@web.de Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Feb 20, 2014
-
-
Fam Zheng authored
With this change, main() calls qemu_init_exec_dir and uses argv[0] to init exec_dir. The saved value can be retrieved with qemu_get_exec_dir later. It will be reused by module loading. Signed-off-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Apr 22, 2013
-
-
Satoru Moriya authored
In certain scenario, latency induced by paging is significant and memory locking is needed. Also, in the scenario with untrusted guests, latency improvement due to mlock is desired. This patch introduces a following new option to mlock guest and qemu memory: -realtime mlock=on|off Signed-off-by:
Satoru Moriya <satoru.moriya@hds.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366382526-26146-1-git-send-email-pbonzini@redhat.com Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Dec 19, 2012
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Oct 05, 2012
-
-
Amos Kong authored
This patch cleans up return sentences in the end of void functions. Reported-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Amos Kong <akong@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@gmail.com>
-
Jim Meyering authored
os_set_proc_name: Use pstrcpy, in place of strncpy and the ineffectual preceding assignment: name[sizeof(name) - 1] = 0; Signed-off-by:
Jim Meyering <meyering@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Sep 23, 2012
-
-
Hitoshi Mitake authored
Current qemu initializes curses even if -daemonize option is passed. This cause problem because shell prompt appears without calling endwin(). This patch adds new function, is_daemonized(), to OS dependent code. With this function, curses_display_init() can check that qemu is daemonized or not. If daemonized, curses_display_init() isn't called and the problem is avoided. Of course, -daemonize && -curses doesn't make sense. Users shouldn't pass the arguments at the same time. But the problem is very painful because Ctrl-C cannot be delivered to the terminal. Cc: Andrzej Zaborowski <balrog@zabor.org> Cc: Stefan Hajnoczi <stefanha@gmail.com> Cc: Anthony Liguori <aliguori@us.ibm.com> Cc: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by:
Hitoshi Mitake <h.mitake@gmail.com> Signed-off-by:
Stefan Hajnoczi <stefanha@gmail.com>
-
- Aug 03, 2012
-
-
Anthony Liguori authored
Commit 0f66998f makes -enable-fips conditional on Linux hosts but then uses it unconditionally in vl.c. Fix this by moving the fips handling to os-posix.c and adding a condition. Cc: Paul Moore <pmoore@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Apr 26, 2012
-
-
Nathan Whitehorn authored
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>
-
- Feb 01, 2012
-
-
Laszlo Ersek authored
The lockf() call in qemu_create_pidfile() aims at ensuring mutual exclusion. We shouldn't close the pidfile on success (as introduced by commit 1bbd1592), because that drops the lock as well [1]: "File locks shall be released on first close by the locking process of any file descriptor for the file." Coverity may complain again about the leaked file descriptor; let's worry about that later. v1->v2: - add reference to 1bbd1592 - explain the intentional fd leak in the source [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/lockf.html Signed-off-by:
Laszlo Ersek <lersek@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Dec 22, 2011
-
-
Paolo Bonzini authored
Using the main loop code from QEMU enables tools to operate fully asynchronously. Advantages include better Windows portability (for some definition of portability) over glib's. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Nov 11, 2011
-
-
Markus Armbruster authored
Spotted by Coverity. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Aug 21, 2011
-
-
Anthony Liguori authored
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Jul 12, 2011
-
-
Stefan Hajnoczi authored
Andrew Griffiths reports that -runas does not set supplementary group IDs. This means that gid 0 (root) is not dropped when switching to an unprivileged user. Add an initgroups(3) call to use the -runas user's /etc/groups membership to update the supplementary group IDs. Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by:
Chris Wright <chrisw@sous-sol.org> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Jun 15, 2011
-
-
Andreas Färber authored
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. The predecessor of this patch added another upcast for the simpletrace filename but was not applied to date. Since new uses of pid_t with %d keep creeping in, let's instead define an OS-dependent format string and use that consistently. Cc: Stefan Hajnoczi <stefanha@gmail.com> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Ingo Weinhold <ingo_weinhold@gmx.de> Cc: Gleb Natapov <gleb@redhat.com> Signed-off-by:
Andreas Färber <andreas.faerber@web.de> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Mar 29, 2011
-
-
Paolo Bonzini authored
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 let QEMU reap it. In the future it could be enhanced to pass a status, but this would be unused. With this in place, the SIGCHLD signal handler would not stomp on pclose anymore. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Mar 26, 2011
-
-
Gleb Natapov authored
Currently when rogue script kills QEMU process (using TERM/INT/HUP signal) it looks indistinguishable from system shutdown. Lets report that QEMU was killed and leave some clues about the killer identity. Signed-off-by:
Gleb Natapov <gleb@redhat.com> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Mar 16, 2011
-
-
Jan Kiszka authored
Based on patch by Glauber Costa: To allow management applications like libvirt to apply CPU affinities to the VCPU threads, expose their ID via info cpus. This patch provides the pre-existing and used interface from qemu-kvm. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by:
Marcelo Tosatti <mtosatti@redhat.com>
-
- Oct 30, 2010
-
-
Jes Sorensen authored
Signed-off-by:
Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
Jes Sorensen authored
Signed-off-by:
Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Aug 20, 2010
-
-
Blue Swirl authored
Replace array size calculations with ARRAY_SIZE macro. Implemented with this Coccinelle semantic patch, adapted from Linux kernel: @@ type T; T[] E; @@ - (sizeof(E)/sizeof(*E)) + ARRAY_SIZE(E) @@ type T; T[] E; @@ - (sizeof(E)/sizeof(E[...])) + ARRAY_SIZE(E) @@ type T; T[] E; @@ - (sizeof(E)/sizeof(T)) + ARRAY_SIZE(E) Some files (*-dis.c, tests/*) had to be filtered out. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Jul 06, 2010
-
-
Jes Sorensen authored
The result of parsing qemu-options.def depends on whehter or not MAP_POPULATE is defined, so make sure to include sys/mman.h before including qemu-options.h. Reported by Frank Arnold. Signed-off-by:
Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Jun 12, 2010
-
-
Jes Sorensen authored
Move handling to change process name to POSIX specific files plus add a better error message to cover the case where the feature isn't supported. 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>
-
Jes Sorensen authored
Move line-buffering setup 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>
-