Statistics
| Branch: | Revision:

root @ c13163fb

# Date Author Comment
c13163fb 01/24/2014 05:07 pm Benoît Canet

qmp: Add QMP query-named-block-nodes to list the named BlockDriverState nodes.

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

6913c0c2 01/24/2014 05:06 pm Benoît Canet

block: Allow the user to define "node-name" option both on command line and QMP.

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

c8059b97 01/24/2014 03:33 pm Fam Zheng

qapi: Add "backing" to BlockStats

Currently there is no way to query BlockStats of the backing chain. This
adds "backing" field into BlockStats to make it possible.

The comment of "parent" is reworded.

Signed-off-by: Fam Zheng <>
Reviewed-by: Benoit Canet <>...

dc364f4c 01/24/2014 03:33 pm Benoît Canet

block: Add bs->node_name to hold the name of a bs node of the bs graph.

Add the minimum of code to prepare for the following patches.

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

46bae927 01/24/2014 03:33 pm Hu Tao

qcow2: fix wrong value of L1E_OFFSET_MASK, L2E_OFFSET_MASK and REFT_OFFSET_MASK

Accoring to qcow spec, the offset fields in l1e, l2e and ref table entry
start at bit 9. The offset is cluster offset, and the smallest possible
cluster size is 512 bytes.

Signed-off-by: Hu Tao <>...

34ceed81 01/24/2014 03:33 pm Fam Zheng

vmdk: Check for overhead when opening

Report an error if file size is even smaller than metadata.

Signed-off-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

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 <>...

0e3bd993 01/24/2014 03:33 pm Kevin Wolf

Documentation: qemu-img: Mention SIGUSR1 progress report

Document the SIGUSR1 behaviour of qemu-img. Also, added compare to the
list of subcommands that support -p.

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

9cd76737 01/24/2014 03:33 pm Liu Yuan

sheepdog: fix 'qemu-img map'

It was muted in the previous commit 4bc74be9. Let's revive it since nothing
prevents us to do it.

With this patch, following command will work as other formats:

$ qemu-img map sheepdog:image

Cc:
Cc: Kevin Wolf <>...

6df3bf8e 01/24/2014 03:33 pm Zhang Min

drive mirror:fix memory leak

In the function mirror_iteration() > qemu_iovec_init(),
it allocates memory for op
>qiov.iov, when the write request calls back,
but in the function mirror_iteration_done(), it only frees the op,
not free the op->qiov.iov, so this causes memory leak....

d8a7b061 01/24/2014 03:33 pm Fam Zheng

vmdk: Fix format specific information (create type) for streamOptimized

Previously the field is wrong:

$ ./qemu-img create -f vmdk -o subformat=streamOptimized /tmp/a.vmdk 1G
$ ./qemu-img info /tmp/a.vmdk
image: /tmp/a.vmdk
file format: vmdk...
385c04d0 01/22/2014 02:48 pm Stefan Hajnoczi

dataplane: fix shadowed return value

Propagate the error return value from get_indirect(). This bug was
introduced in commit 4d684832 ("vring: create a common function to parse
descriptors").

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

d80ac658 01/22/2014 02:47 pm Peter Feiner

block: fix backing file segfault

When a backing file is opened such that (1) a protocol is directly
used as the block driver and (2) the block driver has bdrv_file_open,
bdrv_open_backing_file segfaults. The problem arises because
bdrv_open_common returns without setting bd->backing_hd->file....

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

block: Add bdrv_open_image()

Add a common function for opening images to be used for block drivers
specified through BlockdevRefs in an option QDict. The difference from
bdrv_file_open() is that this function may invoke bdrv_open() instead,
allowing auto-detection of the driver to be used; and second, it...

054963f8 01/22/2014 01:07 pm Max Reitz

block: Use bdrv_open_image() in bdrv_open()

Using bdrv_open_image() instead of bdrv_file_open() directly in
bdrv_open() is easier.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

505d7583 01/22/2014 01:07 pm Max Reitz

block: Allow recursive "file"s

It should be possible to use a format as a driver for a file which in
turn requires another file, i.e., nesting file formats.

Allowing nested file formats results in e.g. qcow2 BlockDriverStates
never being directly passed to bdrv_open_common() from bdrv_file_open(),...

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

blockdev: Move "file" to legacy_opts

Specifying the image filename through the "file" option is a legacy
option and should not be supported by blockdev-add (in that case, giving
a string for "file" references an existing block device).

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

4373593d 01/22/2014 01:07 pm Max Reitz

blkdebug: Allow command-line file configuration

Introduce the "image" option as an alternative to specifying the image
through the filename.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

70b6198a 01/22/2014 01:07 pm Max Reitz

blkverify: Allow command-line configuration

Introduce the "test" and "raw" options for specifying images.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

22511ad6 01/22/2014 01:07 pm Max Reitz

blkverify: Don't require protocol filename

If the filename is not prefixed by "blkverify:" in
blkverify_parse_filename(), the blkverify driver was not selected
through that protocol prefix, but by an explicit command line (or QMP)
option (like driver=blkverify)....

8592a545 01/22/2014 01:07 pm Max Reitz

qapi: Add "errno" to the list of polluted words

Using "errno" directly as an identifier results in various syntax
errors; therefore it should be added to the list of polluted words.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

1bf20b82 01/22/2014 01:07 pm Max Reitz

qapi: QMP interface for blkdebug and blkverify

Add structures to support blkdebug and blkverify in blockdev-add.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

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

qemu-io: Make filename optional

Giving a filename is actually not essential, since it can be specified
through the options as well - on the contrary: Sometimes a filename must
not be given.

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

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

tests: Add test for qdict_array_split()

Add a test case for qdict_array_split() in tests/check-qdict.c.

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

3fb11779 01/22/2014 01:07 pm Max Reitz

tests: Add test for qdict_flatten()

Add a test case for qdict_flatten() in tests/check-qdict.c. This test
case covers the flattening of subordinate QLists as well.

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

30bd6a4d 01/22/2014 01:07 pm Max Reitz

iotests: Test new blkdebug/blkverify interface

Add a test for the new blkdebug/blkverify interface.

This test is not written in Python, although it uses QMP. This is
because it invokes the qemu-io HMP command, which outputs errors to
stderr instead of returning them through QMP. Filtering and testing that...

91f84f65 01/22/2014 01:07 pm Max Reitz

iotests: Test file format nesting

Add a test for nested image formats.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

c60bf339 01/22/2014 01:07 pm Stefan Hajnoczi

readline: decouple readline from the monitor

Make the readline.c functionality reusable. Instead of calling
monitor_printf() and monitor_flush() directly, invoke function pointers
provided by the user.

This way readline.c does not know about Monitor and other users will be...

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 <>

0cf17e18 01/22/2014 01:07 pm Stefan Hajnoczi

qemu-io: use readline.c

Use readline.c for command-line history. There was support for GNU
Readline and BSD Editline but it was never compiled in. Since QEMU has
its own readline.c, just use that when qemu-io runs with stdin attached
to a terminal.

Signed-off-by: Stefan Hajnoczi <>...

4694020d 01/22/2014 01:07 pm Stefan Hajnoczi

qemu-io: add command completion

Autocomplete qemu-io commands at the interactive prompt.

Note this only completes command names and not their options.

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

466b49f2 01/22/2014 01:07 pm Max Reitz

blkdebug: Use errp for read_config()

Use an Error variable in the read_config() function.

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

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

blkdebug: Don't require sophisticated filename

If the filename is not prefixed by "blkdebug:" in
blkdebug_parse_filename(), the blkdebug driver was not selected through
that protocol prefix, but by an explicit command line option
(file.driver=blkdebug or something similar). Contrary to the current...

05a8c222 01/22/2014 01:07 pm Max Reitz

qdict: Add qdict_array_split()

This function splits a QDict consisting of entries prefixed by
incrementally enumerated indices into a QList of QDicts.

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

9f23fc0c 01/22/2014 01:07 pm Max Reitz

qapi: extend qdict_flatten() for QLists

Reversing qdict_array_split(), qdict_flatten() should flatten QLists as
well by interpreting them as QDicts where every entry's key is its
index.

This allows bringing QDicts with QLists from QMP commands to the same...

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...

85a040e5 01/22/2014 01:07 pm Max Reitz

blkdebug: Always call read_config()

Move the check whether there actually is a config file into the
read_config() function.

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

89f2b21e 01/22/2014 01:07 pm Max Reitz

blkdebug: Use command-line in read_config()

Use qemu_config_parse_qdict() to parse the command-line options in
addition to the config file.

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

72daa72e 01/22/2014 01:07 pm Max Reitz

block: Allow reference for bdrv_file_open()

Allow specifying a reference to an existing block device (by name) for
bdrv_file_open() instead of a filename and/or options.

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

2258e3fe 01/22/2014 01:07 pm Max Reitz

block: Pass reference to bdrv_file_open()

With that now being possible, bdrv_open() should try to extract a block
device reference from the options and pass it to bdrv_file_open().

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

2a05cbe4 01/22/2014 01:07 pm Max Reitz

block: Allow block devices without files

blkdebug and blkverify will, in order to retain compatibility, not
support the field "file" implicitly through bdrv_open(). In order to be
able to use those drivers without giving a filename anyway, it is
necessary to be able to have block devices without files implicitly...

e04fb07f 01/22/2014 01:07 pm Stefan Hajnoczi

rbd: switch from pipe to QEMUBH completion notification

rbd callbacks are called from non-QEMU threads. Up until now a pipe was
used to signal completion back to the QEMU iothread.

The pipe writer code handles EAGAIN using select(2). The select(2) API...

2c77f52e 01/22/2014 01:07 pm Fam Zheng

qemu-iotests: Introduce _unsupported_imgopts

Introduce _unsupported_imgopts that causes _notrun for specific image
options.

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

d2329f27 01/22/2014 01:07 pm Fam Zheng

qemu-iotests: Add _unsupported_imgopts for vmdk subformats

Some cases are not applicable for vmdk subformats those don't support
certain features, e.g. backing file, and some others can't run on
mult-file image, e.g. monolithicFlat. This adds declaration in test...

487c1910 01/22/2014 01:07 pm Fam Zheng

qemu-iotests: Clean up all extents for vmdk

This modifies _cleanup_test_img to remove all the extent files listed by
"qemu-img info"'s format specific information.

Signed-off-by: Fam Zheng <>
Signed-off-by: Stefan Hajnoczi <>...

92397116 01/22/2014 01:07 pm Peter Lieven

block/iscsi: return -ENOMEM if an async call fails immediately

if an async libiscsi call fails directly it can only be due
to an out of memory condition. All other errors are returned
through the callback.

Signed-off-by: Peter Lieven <>
Reviewed-by: Ronnie Sahlberg <>...

15744b0b 01/22/2014 01:07 pm Bharata B Rao

gluster: Convert aio routines into coroutines

Convert the read, write, flush and discard implementations from aio-based
ones to coroutine based ones.

Signed-off-by: Bharata B Rao <>
Signed-off-by: Stefan Hajnoczi <>...

7c815372 01/22/2014 01:07 pm Bharata B Rao

gluster: Implement .bdrv_co_write_zeroes for gluster

Support .bdrv_co_write_zeroes() from gluster driver by using GlusterFS API
glfs_zerofill() that off-loads the writing of zeroes to GlusterFS server.

Signed-off-by: Bharata B Rao <>...

cf7f616b 01/22/2014 01:07 pm Bharata B Rao

gluster: Add support for creating zero-filled image

GlusterFS supports creation of zero-filled file on GlusterFS volume
by means of an API called glfs_zerofill(). Use this API from QEMU to
create an image that is filled with zeroes by using the preallocation...

9f23fce7 01/22/2014 01:07 pm Liu Yuan

sheepdog: fix clone operation by 'qemu-img create -b'

We should pass base_inode->vdi_id to base_vdi_id of SheepdogVdiReq so that sheep
can create a clone instead a fresh volume.

This fixes following command:

qemu-create -b sheepdog:base sheepdog:clone
...

b7fcff01 01/22/2014 01:07 pm Kewei Yu

qtest: Fix the bug about disable vnc causes "make check" fail

When we disable vnc from "./configure", QEMU can't use the vnc option.
So qtest can't use the "vnc -none ", otherwise "make check" fails.
If QEMU uses "-display none", "-vnc none" is excrescent, So we just need to drop it....

7fa9e1f9 01/22/2014 01:07 pm Stefan Hajnoczi

docs: qcow2 compat=1.1 is now the default

Commit 9117b47717ad208b12786ce88eacb013f9b3dd1c ("qcow2: Change default
for new images to compat=1.1") changed the default qcow2 image format
version but forgot to update qemu-doc.texi and qemu-img.texi.

Signed-off-by: Stefan Hajnoczi <>...

585ea0c8 01/22/2014 01:07 pm Fam Zheng

vmdk: Fix big flat extent IO

Local variable "n" as int64_t avoids overflow with large sector number
calculation. See test case change for failure case.

Signed-off-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

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...

3dbe85b8 01/17/2014 01:49 am Peter Crosthwaite

tests: Add libqemustub to qom-interface-check

The recent addition of util/error.c's dependency on error_report()
causes this test to fail to link due to a number of missing monitor
related symbols. All these symbols are however defined by libqemustub.
Add this libary to the link....

1cf892ca 01/15/2014 07:37 am Sebastian Huber

SPARC: Fix LEON3 power down instruction

Synchronize the program counter before the power down helper call
otherwise interrupts will return to the wrong context.

Signed-off-by: Sebastian Huber <>
Reviewed-by: Richard Henderson <>...

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...
73c69456 01/14/2014 03:08 am Alistair Francis

Microblaze: Convert Microblaze-pic handling to GPIOs

This patch uses inbound GPIO lines (IRQ and FIR) for
interrupts instead of using the old pic_cpu method,
which doesn't correspond to real hardware.

This creates the CPU's inbound IRQ and FIR GPIO lines and...

83e6813a 01/14/2014 02:09 am Peter Maydell

target-arm: Switch ARMCPUInfo arrays to use terminator entries

Switch the ARMCPUInfo arrays in cpu.c and cpu64.c to use a terminator
entry rather than looping based on ARRAY_SIZE. The latter causes
compile warnings on some versions of gcc if the configure options...

b54f18ba 01/13/2014 11:20 pm Anthony Liguori

Merge remote-tracking branch 'quintela/tags/migration/20140113' into staging

migration.next for 20140113

  1. gpg: Signature made Mon 13 Jan 2014 09:38:27 AM PST using RSA key ID 5872D723
  2. gpg: Can't check signature: public key not found
  • quintela/tags/migration/20140113: (49 commits)...
747afd5b 01/13/2014 03:04 pm Juan Quintela

kvm: use directly cpu_physical_memory_* api for tracking dirty pages

Performance is important in this function, and we want to optimize even further.

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

c9dd46fc 01/13/2014 03:04 pm Juan Quintela

kvm: refactor start address calculation

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

5ff7fb77 01/13/2014 03:04 pm Juan Quintela

memory: move bitmap synchronization to its own function

We want to have all the functions that handle directly the dirty
bitmap near. We will change it later.

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

ae2810c4 01/13/2014 03:04 pm Juan Quintela

memory: syncronize kvm bitmap using bitmaps operations

If bitmaps are aligned properly, use bitmap operations. If they are
not, just use old bit at a time code.

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

791fa2a2 01/13/2014 03:04 pm Juan Quintela

ram: split function that synchronizes a range

This function is the only bit where we care about speed.

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

aa8dc044 01/13/2014 03:04 pm Juan Quintela

migration: synchronize memory bitmap 64bits at a time

We use the old code if the bitmaps are not aligned

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

52159192 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_mask_dirty_range() always clears a single flag

Document it

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

5adca7ac 01/13/2014 03:04 pm Juan Quintela

memory: use bit 2 for migration

For historical reasons it was bit 3. Once there, create a constant to
know the number of clients.

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

7a5b558c 01/13/2014 03:04 pm Juan Quintela

memory: make sure that client is always inside range

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

2152f5ca 01/13/2014 03:04 pm Juan Quintela

memory: only resize dirty bitmap when memory size increases

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

e8a97caf 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_clear_dirty_flag() result is never used

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

164590a6 01/13/2014 03:04 pm Juan Quintela

bitmap: Add bitmap_zero_extend operation

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

1ab4c8ce 01/13/2014 03:04 pm Juan Quintela

memory: split dirty bitmap into three

After all the previous patches, spliting the bitmap gets direct.

Note: For some reason, I have to move DIRTY_MEMORY_* definitions to
the beginning of memory.h to make compilation work.

Signed-off-by: Juan Quintela <>...

86a49582 01/13/2014 03:04 pm Juan Quintela

memory: unfold cpu_physical_memory_clear_dirty_flag() in its only user

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

4f13bb80 01/13/2014 03:04 pm Juan Quintela

memory: unfold cpu_physical_memory_set_dirty() in its only user

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

c1427a3f 01/13/2014 03:04 pm Juan Quintela

memory: unfold cpu_physical_memory_set_dirty_flag()

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

9f2c43e4 01/13/2014 03:04 pm Juan Quintela

memory: make cpu_physical_memory_get_dirty() the main function

And make cpu_physical_memory_get_dirty_flag() to use it. It used to
be the other way around.

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

94833c89 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_get_dirty() is used as returning a bool

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

ace694cc 01/13/2014 03:04 pm Juan Quintela

memory: s/mask/clear/ cpu_physical_memory_mask_dirty_range

Now all functions use the same wording that bitops/bitmap operations

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

1bafff0c 01/13/2014 03:04 pm Juan Quintela

memory: use find_next_bit() to find dirty bits

This operation is way faster than doing it bit by bit.

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

5b9a3a5f 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_set_dirty_range() now uses bitmap operations

We were setting a range of bits, so use bitmap_set().

Note: xen has always been wrong, and should have used start instead
of addr from the beginning.

Signed-off-by: Juan Quintela <>...

a461e389 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_clear_dirty_range() now uses bitmap operations

We were clearing a range of bits, so use bitmap_clear().

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

a2cd8c85 01/13/2014 03:04 pm Juan Quintela

memory: s/dirty/clean/ in cpu_physical_memory_is_dirty()

All uses except one really want the other meaning.

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

a2f4d5be 01/13/2014 03:04 pm Juan Quintela

memory: make cpu_physical_memory_reset_dirty() take a length parameter

We have an end parameter in all the callers, and this make it coherent
with the rest of cpu_physical_memory_* functions, that also take a
length parameter.

Once here, move the start/end calculation to...

981fdf23 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_set_dirty_tracking() should return void

Result was always 0, and not used anywhere. Once there, use bool type
for the parameter.

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

220c3ebd 01/13/2014 03:04 pm Juan Quintela

memory: split cpu_physical_memory_* functions to its own include

All the functions that use ram_addr_t should be here.

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

12291ec1 01/13/2014 03:04 pm Juan Quintela

memory: unfold memory_region_test_and_clear()

We are going to update the bitmap directly

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

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 <>...

e2da99d5 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_set_dirty_flags() result is never used

So return void.

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

78d00426 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_set_dirty_range() return void

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

06567942 01/13/2014 03:04 pm Juan Quintela

exec: use accessor function to know if memory is dirty

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

a1390db4 01/13/2014 03:04 pm Juan Quintela

memory: create function to set a single dirty bit

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

7e5609a8 01/13/2014 03:04 pm Juan Quintela

exec: create function to get a single dirty bit

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

4f08cabe 01/13/2014 03:04 pm Juan Quintela

memory: make cpu_physical_memory_is_dirty return bool

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

36187e2c 01/13/2014 03:04 pm Juan Quintela

memory: all users of cpu_physical_memory_get_dirty used only one flag

So cpu_physical_memory_get_dirty_flags is not needed anymore

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

63995ceb 01/13/2014 03:04 pm Juan Quintela

memory: set single dirty flags when possible

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

75218e7f 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_set_dirty_range() always dirty all flags

So remove the flag argument and do it directly. After this change,
there is nothing else using cpu_physical_memory_set_dirty_flags() so
remove it.

Signed-off-by: Juan Quintela <>...