Statistics
| Branch: | Revision:

root / util @ 01207d0b

# Date Author Comment
01207d0b 03/11/2014 08:19 pm Jan Kiszka

qemu-thread-posix: Fix build against older glibc version

pthread_setname_np was introduced with 2.12.

Signed-off-by: Jan Kiszka <>
Reviewed-by: Dr. David Alan Gilbert <>
Signed-off-by: Peter Maydell <>

4900116e 03/09/2014 09:09 pm Dr. David Alan Gilbert

Add a 'name' parameter to qemu_thread_create

If enabled, set the thread name at creation (on GNU systems with
pthread_set_np)
Fix up all the callers with a thread name

Signed-off-by: Dr. David Alan Gilbert <>
Acked-by: Michael S. Tsirkin <>...

8f480de0 03/09/2014 09:09 pm Dr. David Alan Gilbert

Add 'debug-threads' suboption to --name

Add flag storage to qemu-thread-* to store the namethreads flag

Signed-off-by: Dr. David Alan Gilbert <>
Acked-by: Michael S. Tsirkin <>
Reviewed-by: Laszlo Ersek <>

98d1eb27 03/05/2014 04:06 am Tom Musta

target-ppc: Add ISA2.06 divdeu[o] Instructions

This patch adds the Divide Doubleword Extended Unsigned
instructions. This instruction requires dividing a 128-bit
value by a 64 bit value. Since 128 bit integer division is
not supported in TCG, a helper is used. An architecture...

e44259b6 03/05/2014 04:06 am Tom Musta

target-ppc: Add ISA2.06 divde[o] Instructions

This patch adds the Divide Doubleword Extended instructions.
The implementation builds on the unsigned helper provided in
the previous patch.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

cc99c6f5 03/03/2014 07:46 am Stefan Weil

util/iov: Use qemu/sockets.h instead of conditional code

Signed-off-by: Stefan Weil <>
Reviewed-by: Paolo Bonzini <>
Reviewed-by: Andreas Färber <>
Signed-off-by: Michael Tokarev <>

d844a7b6 02/28/2014 02:30 pm Fam Zheng

modules: Fix building with --enable-modules

Compiling util/modules.c with modules enabled fails now.

Fix it by including qemu-common.h before #ifdef testing in module.c.

Signed-off-by: Fam Zheng <>
Message-id: ...

aa0d1f44 02/25/2014 08:34 pm Paolo Bonzini

modules: do not include gmodule-2.0 in static builds

gmodule-2.0's pkg-config files include -Wl,--export-dynamic, which breaks
static builds. It is a glib bug, but we need to support --static builds for
the linux-user targets, and in the end all that is needed to fix this is:...

e7a1d6c5 02/25/2014 12:50 pm Peter Maydell

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block patches

  1. gpg: Signature made Fri 21 Feb 2014 21:42:24 GMT using RSA key ID C88F2FD6
  2. gpg: Good signature from "Kevin Wolf <>"
  • remotes/kevin/tags/for-upstream: (54 commits)...
6dedf052 02/24/2014 05:38 pm Peter Maydell

Merge remote-tracking branch 'remotes/bonzini/configure' into staging

  • remotes/bonzini/configure:
    build: softmmu targets do not have a "main.o" file
    configure: Disable libtool if -fPIE does not work with it (bug #1257099)
    block: convert block drivers linked with libs to modules...
f70d7f7e 02/21/2014 11:29 pm Benoît Canet

blkverify: Extract qemu_iovec_clone() and qemu_iovec_compare() from blkverify.

qemu_iovec_compare() will be used to compare IOs vectors in quorum blkverify
mode. The patch extracts these functions in order to factorize the code.

Signed-off-by: Benoit Canet <>...

ae39c4b2 02/21/2014 11:11 pm Max Reitz

qemu-config: Sections must consist of keys

In config_parse_qdict_section(), the QList returned by
qdict_array_split() is assumed to only contain QDicts. Currently, this
is true but it may (and will) change in the future. Therefore, check
whether the assumption actually holds....

7cc07ab8 02/21/2014 11:10 pm Kevin Wolf

qemu-option: has_help_option() and is_valid_option_list()

has_help_option() checks if any help option ('help' or '?') occurs
anywhere in an option string, so that things like 'cluster_size=4k,help'
are recognised.

is_valid_option_list() ensures that the option list doesn't have options...

e26110cf 02/20/2014 02:14 pm Fam Zheng

module: implement module loading

This patch adds loading, stamp checking and initialization of modules.

The init function of dynamic module is no longer directly called as
attribute((constructor)) in static linked version, it is called
only after passed the checking of presense of stamp symbol:...

10f5bff6 02/20/2014 02:12 pm Fam Zheng

util: Split out exec_dir from os_find_datadir

With this change, main() calls qemu_init_exec_dir and uses argv0 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 <>...

84d18f06 02/17/2014 06:57 pm Markus Armbruster

Use error_is_set() only when necessary

error_is_set(&var) is the same as var != NULL, but it takes
whole-program analysis to figure that out. Unnecessarily hard for
optimizers, static checkers, and human readers. Dumb it down to
obvious.

Gets rid of several dozen Coverity false positives....

c4e57af8 02/08/2014 04:50 pm Beniamino Galvani

util/fifo8: implement push/pop of multiple bytes

The patch adds functions fifo8_push_all() and fifo8_pop_buf() which
can be used respectively to push the content of a memory buffer to the
fifo and to pop multiple bytes obtaining a pointer to the fifo backing...

58892d47 02/08/2014 04:50 pm Beniamino Galvani

util/fifo8: clear fifo head upon reset

To improve the predictability of fifo8_pop_buf(), the fifo head is set
to the start of data buffer upon a reset so that the first call to the
function will be able to retrieve all data in the fifo.

Signed-off-by: Beniamino Galvani <>...

1165ae61 02/01/2014 11:42 am Stefan Hajnoczi

osdep: drop unused #include "trace.h"

osdep.c does not use trace_*() so we can just drop the include.

Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Benoit Canet <>
Signed-off-by: Michael Tokarev <>

e5354657 01/24/2014 06:40 pm Kevin Wolf

qemu_memalign: Allow small alignments

The functions used by qemu_memalign() require an alignment that is at
least sizeof(void*). Adjust it if it is too small.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Wenchao Xia <>...

e69968d4 01/24/2014 03:33 pm Kevin Wolf

qemu-progress: Drop unused include

Signed-off-by: Kevin Wolf <>
Reviewed-by: Benoit Canet <>

3c4b4e38 01/24/2014 03:33 pm Kevin Wolf

qemu-progress: Fix progress printing on SIGUSR1

Since commit a7aae221 ('Switch SIG_IPI to SIGUSR1'), SIGUSR1 is blocked
during startup, breaking the progress report in tools.

This patch reenables the signal when initialising a progress report.

Signed-off-by: Kevin Wolf <>...

0150cd81 01/22/2014 01:07 pm Stefan Hajnoczi

readline: move readline to a generic location

Now that the monitor and readline are decoupled, readline.h no longer
belongs in include/monitor/. Put the header into include/qemu/.

Move the source file into util/ so it can be linked as part of
libqemuutil.a....

13401ba0 01/22/2014 01:07 pm Stefan Hajnoczi

osdep: add qemu_set_tty_echo()

Using stdin with readline.c requires disabling echo and line buffering.
Add a portable wrapper to set the terminal attributes under Linux and
Windows.

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

adf5c449 01/22/2014 01:07 pm Max Reitz

qemu-option: Add qemu_config_parse_qdict()

This function basically parses command-line options given as a QDict
replacing a config file.

For instance, the QDict {"section.opt1": 42, "section.opt2": 23}
corresponds to the config file:

[section]
opt1 = 42...

732c66ce 01/17/2014 01:50 am Peter Crosthwaite

Revert "error: Don't use error_report() for assertion msgs."

This reverts commit d32934c84c72f57e78d430c22974677b7bcabe5d.

The original implementation before this patch makes abortive error
messages much more friendly. The underlying bug that required this...

d32934c8 01/15/2014 07:36 am Peter Crosthwaite

error: Don't use error_report() for assertion msgs.

Use fprintf(stderr instead. This removes dependency of libqemuutil.a
on the monitor.

We can further justify this change, in that this code path should only
trigger under a fatal error condition. fprintf-stderr is probably the...

133fe774 01/14/2014 04:10 am Edgar E. Iglesias

Merge remote branch 'luiz/queue/qmp' into qmpq

  • luiz/queue/qmp:
    migration: qmp_migrate(): keep working after syntax error
    qerror: Remove assert_no_error()
    qemu-option: Remove qemu_opts_create_nofail
    target-i386: Remove assert_no_error usage
    hw: Remove assert_no_error usages...
9c22687e 01/13/2014 03:04 pm Juan Quintela

bitmap: use long as index

Move index and size fields from int to long. We need that for
migration. long is 64 bits on sane architectures, and 32bits should
be enough on all the 32bits architectures.

Signed-off-by: Juan Quintela <>
Reviewed-by: Eric Blake <>...

87ea75d5 01/06/2014 10:02 pm Peter Crosthwaite

qemu-option: Remove qemu_opts_create_nofail

This is a boiler-plate _nofail variant of qemu_opts_create. Remove and
use error_abort in call sites.

null/0 arguments needs to be added for the id and fail_if_exists fields
in affected callsites due to argument inconsistency between the normal and...

5d24ee70 01/06/2014 09:01 pm Peter Crosthwaite

error: Add error_abort

Add a special Error * that can be passed to error handling APIs to
signal that any errors are fatal and should abort QEMU. There are two
advantages to this:

- allows for brevity when wishing to assert success of Error **
accepting APIs. No need for this pattern:...

0a0ee0b9 12/06/2013 10:59 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/tags/for-anthony' into staging

Block patches for 2.0 (flushing block-next)

  1. gpg: Signature made Fri 29 Nov 2013 08:43:18 AM PST using RSA key ID C88F2FD6
  2. gpg: Can't check signature: public key not found
  1. By Peter Lieven (17) and others...
664d2c44 11/29/2013 08:45 pm Richard Henderson

util: Use qemu_getauxval in linux qemu_cache_utils_init

With this we no longer pass down envp, and thus all systems can have
the same void prototype. So also eliminate a useless thunk.

Reviewed-by: Peter Maydell <>
Signed-off-by: Richard Henderson <>

b6a3e690 11/29/2013 08:45 pm Richard Henderson

osdep: Create qemu_getauxval and qemu_init_auxval

Abstract away dependence on a system implementation of getauxval.

Signed-off-by: Richard Henderson <>

b276d249 11/28/2013 11:30 am Max Reitz

util/error: Save errno from clobbering

There may be calls to error_setg() and especially error_setg_errno()
which blindly (and until now wrongly) assume these functions not to
clobber errno (e.g., they pass errno to error_setg_errno() and return
-errno afterwards). Instead of trying to find and fix all of these...

968854c8 11/14/2013 02:09 pm Amos Kong

qmp: access the local QemuOptsLists for drive option

Currently we have three QemuOptsList (qemu_common_drive_opts,
qemu_legacy_drive_opts, and qemu_drive_opts), only qemu_drive_opts
is added to vm_config_groups[].

This patch changes query-command-line-options to access three local...

c7c4d063 10/17/2013 06:30 pm Paolo Bonzini

qemu-thread: add QemuEvent

This emulates Win32 manual-reset events using futexes or conditional
variables. Typical ways to use them are with multi-producer,
single-consumer data structures, to test for a complex condition whose
elements come from different threads:...

518420df 10/17/2013 06:24 pm Jan Kiszka

compatfd: switch to QemuThread

qemu_thread_create already does signal blocking and detaching for us.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Paolo Bonzini <>

326642bc 10/11/2013 05:50 pm Kevin Wolf

blockdev: Separate ID generation from DriveInfo creation

blockdev-add shouldn't automatically generate IDs, but will keep most of
the DriveInfo creation code.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Max Reitz <>
Reviewed-by: Wenchao Xia <>...

80dfc873 10/09/2013 05:54 pm Anthony Liguori

Merge remote-tracking branch 'mjt/trivial-patches' into staging

  1. By Stefan Weil (5) and others
  2. Via Michael Tokarev
    • mjt/trivial-patches:
      migration: Fix compiler warning ('caps' may be used uninitialized)
      util/path: Fix type which is longer than 8 bit for MinGW...
ddd23638 10/05/2013 01:01 pm Stefan Weil

util/path: Fix type which is longer than 8 bit for MinGW

While dirent->d_type is 8 bit for most systems, it is 32 bit for MinGW.
Reducing it to 8 bit results in a compiler warning because the macro
is_dir_maybe compares that 8 bit value with 32 bit constants....

606600a1 10/02/2013 08:20 pm Sebastian Ottlik

util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR

If a socket is closed it remains in TIME_WAIT state for some time. On operating
systems using BSD sockets the endpoint of the socket may not be reused while in
this state unless SO_REUSEADDR was set on the socket. On windows on the other...

04fd1c78 10/02/2013 08:20 pm Sebastian Ottlik

util: call socket_set_fast_reuse instead of setting SO_REUSEADDR

SO_REUSEADDR should be avoided on Windows but is desired on other operating
systems. So instead of setting it we call socket_set_fast_reuse that will result
in the appropriate behaviour on all operating systems....

16121fa3 09/23/2013 07:53 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/block' into staging

  1. By Stefan Hajnoczi (4) and others
  2. Via Stefan Hajnoczi
    • stefanha/block:
      virtio-blk: do not relay a previous driver's WCE configuration to the current
      blockdev: do not default cache.no-flush to true...
2be178a4 09/20/2013 07:09 pm Michael Tokarev

iov: avoid "orig_len may be used unitialized" warning

Signed-off-by: Wenchao Xia <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Michael Tokarev <>

a5813077 09/18/2013 04:34 pm Stefan Hajnoczi

osdep: warn if open(O_DIRECT) on fails with EINVAL

Print a warning when opening a file O_DIRECT fails with EINVAL. This
saves users a lot of time trying to figure out the EINVAL error, which
is typical when attempting to open a file O_DIRECT on Linux tmpfs....

39228250 09/12/2013 07:45 pm Markus Armbruster

exec: Don't abort when we can't allocate guest memory

We abort() on memory allocation failure. abort() is appropriate for
programming errors. Maybe most memory allocation failures are
programming errors, maybe not. But guest memory allocation failure
isn't, and aborting when the user asks for more memory than we can...

f69f0bca 09/11/2013 10:46 pm Anthony Liguori

Merge remote-tracking branch 'mdroth/qga-pull-2013-9-9' into staging

  1. By Tomoki Sekiyama (10) and Paul Burton (1)
  2. Via Michael Roth
    • mdroth/qga-pull-2013-9-9:
      QMP/qemu-ga-client: Make timeout longer for guest-fsfreeze-freeze command
      qemu-ga: Install Windows VSS provider on `qemu-ga -s install'...
20840d4c 09/09/2013 10:17 pm Tomoki Sekiyama

error: Add error_set_win32 and error_setg_win32

These functions help maintaining homogeneous formatting of error messages
with Windows error code and description (generated by
g_win32_error_message()).

Signed-off-by: Tomoki Sekiyama <>...

5ddfffbd 09/06/2013 04:25 pm Benoît Canet

throttle: Add a new throttling API implementing continuous leaky bucket.

Implement the continuous leaky bucket algorithm devised on IRC as a separate
module.

Signed-off-by: Benoit Canet <>
Signed-off-by: Stefan Hajnoczi <>

d4ca092a 08/30/2013 04:28 pm Max Reitz

option: Add assigned flag to QEMUOptionParameter

Adds an "assigned" flag to QEMUOptionParameter which is cleared at the
beginning of parse_option_parameters and set on (successful)
set_option_parameter and set_option_parameter_int.

Signed-off-by: Max Reitz <>...

cb77d192 08/12/2013 05:15 pm Markus Armbruster

qemu-option: Guard against qemu_opts_set_defaults() misuse

Commit 6d4cd40 fixed qemu_opts_set_defaults() for an existing corner
case, but broke it for another one that can't be reached in current
code.

Quote from its commit message:

I believe [opts_parse()] attempts to do the following:...
84004290 08/06/2013 11:41 am MORITA Kazutaka

iov: handle EOF in iov_send_recv

Without this patch, iov_send_recv() never returns when do_send_recv()
returns zero.

Signed-off-by: MORITA Kazutaka <>
Reviewed-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

79761c66 08/05/2013 07:48 pm Izumi Tsutsui

semaphore: fix a hangup problem under load on NetBSD hosts.

Fix following bugs in "fallback implementation of counting semaphores
with mutex+condvar" added in c166cb72f1676855816340666c3b618beef4b976:
- waiting threads are not restarted properly if more than one threads...

e8cd45c7 07/30/2013 03:33 am Vasilis Liaskovitis

qdev: Add SIZE type to qdev properties

This patch adds a 'SIZE' type property to qdev.

Signed-off-by: Ian Molton <>
Signed-off-by: Vasilis Liaskovitis <>
Signed-off-by: Hu Tao <>...

9220eeed 07/27/2013 10:22 am Stefan Weil

aes: Remove unused code (NDEBUG, u16)

The current code includes assert.h very early (from qemu-common.h),
so the definition of NDEBUG was without any effect.

In the initial version from 2004, NDEBUG was used to disable the assertions.
Those assertions are not in time critical code, so it is no longer...

0dd6c526 07/26/2013 10:10 pm Kevin Wolf

QemuOpts: Add qemu_opt_unset()

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>

5e2ac519 07/10/2013 08:42 pm Seiji Aguchi

add timestamp to error_report()

[Issue]
When we offer a customer support service and a problem happens
in a customer's system, we try to understand the problem by
comparing what the customer reports with message logs of the
customer's system.

In this case, we often need to know when the problem happens....

6d4cd408 07/09/2013 09:38 pm Markus Armbruster

qemu-option: Fix qemu_opts_set_defaults() for corner cases

Commit 4f6dd9a changed the initialization of opts in opts_parse() to
this:

if (defaults) {
if (!id && !QTAILQ_EMPTY(&list->head)) {
opts = qemu_opts_find(list, NULL);
} else {...
96bc97eb 07/09/2013 09:38 pm Markus Armbruster

qemu-option: Fix qemu_opts_find() for null id arguments

Crashes when the first list member has an ID. Admittedly nonsensical
reproducer:

$ qemu-system-x86_64 -nodefaults -machine id=foo -machine ""

Signed-off-by: Markus Armbruster <>
Reviewed-by: Peter Maydell <>...

7a5b6af1 06/28/2013 09:10 pm Gerd Hoffmann

qemu-socket: don't leak opts on error

Signed-off-by: Gerd Hoffmann <>
Reviewed-by: Laszlo Ersek <>
Signed-off-by: Michael Tokarev <>

afde3f8b 06/28/2013 09:10 pm Gerd Hoffmann

qemu-socket: zero-initialize SocketAddress

Signed-off-by: Gerd Hoffmann <>
Reviewed-by: Laszlo Ersek <>
Signed-off-by: Michael Tokarev <>

c1204afc 06/28/2013 09:10 pm Gerd Hoffmann

qemu-socket: drop pointless allocation

Signed-off-by: Gerd Hoffmann <>
Reviewed-by: Laszlo Ersek <>
Signed-off-by: Michael Tokarev <>

d1ec72a4 06/28/2013 09:10 pm Gerd Hoffmann

qemu-socket: catch monitor_get_fd failures

Signed-off-by: Gerd Hoffmann <>
Reviewed-by: Laszlo Ersek <>
Signed-off-by: Michael Tokarev <>

5dae8e5f 06/28/2013 10:20 am Stefan Hajnoczi

notify: add NotiferWithReturn so notifier list can abort

notifier_list_notify() has no return value. This is fine when we just
want to invoke side-effects.

Sometimes it's useful for notifiers to produce a return value. This
allows notifiers to "veto" an operation and will be used by the block...

4999f3a8 06/21/2013 09:52 pm Markus Armbruster

acl: acl_add can't insert before last list element, fix

Watch this:

$ upstream-qemu -nodefaults -S -vnc :0,acl,sasl -monitor stdio
QEMU 1.5.50 monitor - type 'help' for more information
(qemu) acl_add vnc.username drei allow
acl: added rule at position 1...
a86b35f9 06/19/2013 10:10 pm Markus Armbruster

qemu-option: check_params() is now unused, drop it

Signed-off-by: Markus Armbruster <>
Reviewed-by: Anthony Liguori <>
Message-id:
Signed-off-by: Anthony Liguori <>

391b7b97 06/18/2013 12:42 pm Ján Tomko

qemu-socket: allow hostnames starting with a digit

According to RFC 1123 [1], hostnames can start with a digit too.

[1] http://tools.ietf.org/html/rfc1123#page-13

Signed-off-by: Ján Tomko <>
Cc:
[Use strspn, not strcspn. - Paolo]...

54028d75 06/17/2013 06:01 pm Luiz Capitulino

error: add error_setg_file_open() helper

Signed-off-by: Luiz Capitulino <>
Acked-by: Kevin Wolf <>

4efeabbb 06/14/2013 01:28 pm Michael Tokarev

create qemu_openpty_raw() helper function and move it to a separate file

In two places qemu uses openpty() which is very system-dependent,
and in both places the pty is switched to raw mode as well.
Make a wrapper function which does both steps, and move all the...

a38ed811 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Move qemu_strsep() to cutils.c

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>
Signed-off-by: Stefan Hajnoczi <>

5e00984a 06/06/2013 12:27 pm Kevin Wolf

cutils: Support 'P' and 'E' suffixes in strtosz()

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>
Signed-off-by: Stefan Hajnoczi <>

e2ea3515 05/30/2013 07:37 pm Laszlo Ersek

osdep: add qemu_get_local_state_pathname()

This function returns ${prefix}/var/RELATIVE_PATHNAME on POSIX-y systems,
and <CSIDL_COMMON_APPDATA>/RELATIVE_PATHNAME on Win32.

http://msdn.microsoft.com/en-us/library/bb762494.aspx

[...] This folder is used for application data that is not user...
3568ac2a 05/20/2013 04:20 pm Ed Maste

Rename hexdump to avoid FreeBSD libutil conflict

On FreeBSD libutil is used for openpty(), but it also provides a hexdump()
which conflicts with QEMU's.

Signed-off-by: Ed Maste <>
Reviewed-by: Paolo Bonzini <>
Message-id: ...

6eebf958 05/14/2013 04:53 pm Paolo Bonzini

osdep, kvm: rename low-level RAM allocation functions

This is preparatory to the introduction of a separate freeing API.

Reported-by: Amos Kong <>
Signed-off-by: Paolo Bonzini <>
Reviewed-by: Amos Kong <>...

e7a09b92 05/14/2013 04:53 pm Paolo Bonzini

osdep: introduce qemu_anon_ram_free to free qemu_anon_ram_alloc-ed memory

We switched from qemu_memalign to mmap() but then we don't modify
qemu_vfree() to do a munmap() over free(). Which we cannot do
because qemu_vfree() frees memory allocated by qemu_{mem,block}align....

7f303adc 05/12/2013 12:25 pm Dong Xu Wang

clean unnecessary code: don't check g_strdup arg for NULL

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Michael Tokarev <>

8e1b02b8 05/03/2013 11:31 am Jeff Cody

qemu: add castagnoli crc32c checksum algorithm

This adds the Castagnoli CRC32C algorithm, using the 0x11EDC6F41
polynomial.

This is extracted from the linux kernel cryptographic crc32.c module.

The algorithm is based on:

Castagnoli93: Guy Castagnoli and Stefan Braeuer and Martin Herrman...

9adea5f7 04/29/2013 11:52 am Paolo Bonzini

win32: add readv/writev emulation

Commit e9d8fbf (qemu-file: do not use stdio for qemu_fdopen, 2013-03-27)
introduced a usage of writev, which mingw32 does not have. Even though
qemu_fdopen itself is not used on mingw32, the future-proof solution is
to add an implementation of it. This is simple and similar to how we...

1f8f987d 04/25/2013 05:07 pm Amos Kong

monitor: introduce query-command-line-options

Libvirt has no way to probe if an option or property is supported,
This patch introduces a new qmp command to query command line
option information. hmp command isn't added because it's not needed.

Signed-off-by: Amos Kong <>...

b16352ac 04/24/2013 11:47 am Alon Levy

ccid-card-passthru, dev-smartcard-reader: add debug environment variables

Introduces a new utility function: parse_debug_env to avoid code
duplication.

This overrides whatever debug value is set on the corresponding devices
from the command line, and is meant to ease the usage with any...

d3bf825e 04/24/2013 11:47 am Marc-André Lureau

util: move socket_init() to osdep.c

vscclient needs to call socket_init() for portability.
Moving to osdep.c since it has no internal dependency.

Signed-off-by: Marc-André Lureau <>
Reviewed-by: Alon Levy <>

f48869ad 04/17/2013 12:43 pm Paolo Bonzini

iov: reorganize iov_send_recv, part 3

"si" and "ei" are merged in a single variable.

Reviewed-by: Juan Quintela <>
Reviewed-by: Orit Wassermann <>
Signed-off-by: Paolo Bonzini <>

83f75c26 04/17/2013 12:43 pm Paolo Bonzini

iov: handle partial writes from sendmsg and recvmsg

Partial writes can still happen in sendmsg and recvmsg, if a
signal is received in the middle of a write. To handle this,
retry the operation with a new offset/bytes pair.

Reviewed-by: Juan Quintela <>...

cb6247a7 04/17/2013 12:43 pm Paolo Bonzini

iov: reorganize iov_send_recv, part 1

Once the initial part of the iov is dropped, it is not used anymore.
Modify iov/iovcnt directly instead of adjusting them with the "si"
variable.

Reviewed-by: Juan Quintela <>
Reviewed-by: Orit Wassermann <>...

5209d675 04/17/2013 12:43 pm Paolo Bonzini

iov: reorganize iov_send_recv, part 2

Do not touch the "bytes" argument anymore. Instead, remember the
original length of the last iovec if we touch it, and restore it
afterwards.

This requires undoing the changes in opposite order. The previous
algorithm didn't care....

7dda5dc8 04/17/2013 12:10 am Paolo Bonzini

migration: initialize RAM to zero

Using qemu_memalign only leaves the RAM zero by chance, because libc
will usually use mmap to satisfy our huge requests. But memory will
not be zero when using MALLOC_PERTURB_ with a nonzero value. In the
case of incoming migration, this breaks a recently-introduced...

dccfcd0e 04/15/2013 07:19 pm Paolo Bonzini

sysemu: avoid proliferation of include/ subdirectories

Signed-off-by: Paolo Bonzini <>

cb2744ea 04/13/2013 10:39 pm Markus Armbruster

unicode: New mod_utf8_codepoint()

Signed-off-by: Markus Armbruster <>
Reviewed-by: Laszlo Ersek <>
Signed-off-by: Blue Swirl <>

753d9b82 04/13/2013 02:51 pm Aurelien Jarno

aes: move aes.h from include/block to include/qemu

Move aes.h from include/block to include/qemu to show it can be reused
by other subsystems.

Cc: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>
Reviewed-by: Edgar E. Iglesias <>...

5d6f5cdd 04/13/2013 02:51 pm Aurelien Jarno

aes: make Td[0-5] and Te[0-5] tables non static

Remove static attribute to Td[0-5] and Te[0-5] tables so that they
can be used outside of aes.c. Change their type from u32 to uint32_t,
to keep the u32 udef local to aes.c. Prefix them with AES_ so that they...

d05ef160 04/05/2013 04:22 am Brad Smith

Allow clock_gettime() monotonic clock to be utilized on more OS's

Allow the clock_gettime() code using monotonic clock to be utilized on
more POSIX compliannt OS's. This started as a fix for OpenBSD which was
listed in one function as part of the previous hard coded list of OS's...

f9e8cacc 04/02/2013 06:47 pm Stefan Hajnoczi

oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()

The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets.
Rename to qemu_set_nonblock() just like qemu_set_cloexec().

Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Eric Blake <>...

1a751ebf 04/02/2013 06:47 pm Stefan Hajnoczi

qemu-socket: set passed fd non-blocking in socket_connect()

socket_connect() sets non-blocking on TCP or UNIX domain sockets if a
callback function is passed. Do the same for file descriptor passing,
otherwise we could unexpectedly be using a blocking file descriptor....

56ded708 03/26/2013 02:32 pm Peter Lieven

buffer_is_zero: use vector optimizations if possible

performance gain on SSE2 is approx. 20-25%. altivec
is not tested. performance for unsigned long arithmetic
is unchanged.

Signed-off-by: Peter Lieven <>
Reviewed-by: Eric Blake <>...

49f676a0 03/26/2013 02:32 pm Peter Lieven

bitops: unroll while loop in find_next_bit()

this patch adopts the loop unrolling idea of bitmap_is_zero() to
speed up the skipping of large areas with zeros in find_next_bit().

this routine is extensively used to find dirty pages in
live migration.

testing only the find_next_bit performance on a zeroed bitfield...

41a259bd 03/26/2013 02:32 pm Peter Lieven

cutils: add a function to find non-zero content in a buffer

this adds buffer_find_nonzero_offset() which is a SSE2/Altivec
optimized function that searches for non-zero content in a
buffer.

the function starts full unrolling only after the first few chunks have...

3f08ffb4 03/22/2013 08:08 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

  1. By Kevin Wolf (12) and Peter Lieven (2)
  2. Via Kevin Wolf
    • kwolf/for-anthony:
      nbd: Check against invalid option combinations
      nbd: Use default port if only host is specified
      block: Allow omitting the file name when using driver-specific options...
e62be888 03/22/2013 06:51 pm Kevin Wolf

qemu-socket: Make socket_optslist public

Allow other users to create the QemuOpts needed for inet_connect_opts().

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>

f17c90be 03/22/2013 06:51 pm Kevin Wolf

nbd: Keep hostname and port separate

The NBD block supports an URL syntax, for which a URL parser returns
separate hostname and port fields. It also supports the traditional qemu
syntax encoded in a filename. Until now, after parsing the URL to get
each piece of information, a new string is built to be fed to socket...