Statistics
| Branch: | Revision:

root / buffered_file.c @ e7627482

History | View | Annotate | Download (6.2 kB)

# Date Author Comment
edfa1af5 12/21/2012 12:09 am Juan Quintela

migration: make qemu_fopen_ops_buffered() return void

We want the file assignment to happen before the thread is created to
avoid locking, so we just do it before creating the thread.

Signed-off-by: Juan Quintela <>

Reviewed-by: Orit Wasserman <>

188a4285 12/21/2012 12:09 am Juan Quintela

migration: remove unfreeze logic

Now that we have a thread, and blocking writes, we don't need it.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

e7627482 12/21/2012 12:09 am Juan Quintela

migration: just lock migrate_fd_put_ready

Signed-off-by: Juan Quintela <>

c09f4cb2 12/21/2012 12:09 am Juan Quintela

buffered_file: Move from using a timer to use a thread

We still protect everything except the wait with the iothread lock.
But we moved from a timer to a thread. Steps one by one.

We also need to detect when we have finished with a variable "complete"....

bde54c08 12/20/2012 11:44 pm Paolo Bonzini

buffered_file: do not send more than s->bytes_xfer bytes per tick

Sending more was possible if the buffer was large.

Cc:
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

f8fe7964 12/19/2012 09:29 am Paolo Bonzini

janitor: do not include qemu-char everywhere

Touching char/char.h basically causes the whole of QEMU to
be rebuilt. Avoid this, it is usually unnecessary.

Signed-off-by: Paolo Bonzini <>

9229bf3c 11/02/2012 07:34 pm Paolo Bonzini

migration: consolidate QEMUFile methods in a single QEMUFileOps struct

Reviewed-by: Orit Wasserman <>
Signed-off-by: Paolo Bonzini <>

70eb6330 11/02/2012 07:34 pm Paolo Bonzini

migration: add qemu_get_fd

Reviewed-by: Orit Wasserman <>
Signed-off-by: Paolo Bonzini <>

749f7909 10/17/2012 07:34 pm Juan Quintela

buffered_file: unfold migrate_fd_wait_for_unfreeze

We only used it once, just remove the callback indirection.

Signed-off-by: Juan Quintela <>

11c76741 10/17/2012 07:34 pm Juan Quintela

buffered_file: unfold migrate_fd_close

We only used it once, just remove the callback indirection.

Signed-off-by: Juan Quintela <>

796b4b0f 10/17/2012 07:34 pm Juan Quintela

buffered_file: We can access directly to bandwidth_limit

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

3d6dff31 10/17/2012 07:34 pm Juan Quintela

buffered_file: callers of buffered_flush() already check for errors

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

d2dbc8e6 10/17/2012 07:34 pm Juan Quintela

buffered_file: make buffered_flush return the error code

Or the amount of data written if there is no error. Adjust all callers.

Signed-off-by: Juan Quintela <>

9499743f 10/17/2012 07:34 pm Juan Quintela

migration: make migrate_fd_wait_for_unfreeze() return errors

Adjust all callers

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

81fdf640 10/17/2012 07:34 pm Juan Quintela

buffered_file: buffered_put_buffer() don't need to set last_error

Callers on savevm.c:qemu_fflush() will set it.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

2dddf6f4 10/17/2012 07:34 pm Paolo Bonzini

BufferedFile: append, then flush

Simplify the logic for pushing data from the buffer to the output
pipe/socket. This also matches more closely what will be the
operation of the migration thread.

Signed-off-by: Paolo Bonzini <>

Reviewed-by: Paolo Bonzini <>...

8e92c9e2 10/17/2012 07:34 pm Juan Quintela

buffered_file: rename opaque to migration_state

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

c7a8f0cd 10/17/2012 07:34 pm Juan Quintela

buffered_file: opaque is MigrationState

It always have that type, just change it.
We will remove buffered file later on the migration thread series.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

c87b015b 10/17/2012 07:34 pm Juan Quintela

buffered_file: unfold migrate_fd_put_buffer

We only used it once, just remove the callback indirection

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

2c9adcb8 10/17/2012 07:34 pm Juan Quintela

buffered_file: unfold migrate_fd_put_ready

We only use it once, just remove the callback indirection.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

05e72dc5 10/17/2012 07:34 pm Juan Quintela

buffered_file: g_realloc() can't fail

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>
Reviewed-by: Orit Wasserman <>

6b620ca3 01/13/2012 06:55 pm Paolo Bonzini

prepare for future GPLv2+ relicensing

All files under GPLv2 will get GPLv2+ changes starting tomorrow.
event_notifier.c and exec-obsolete.h were only ever touched by Red Hat
employees and can be relicensed now.

Signed-off-by: Paolo Bonzini <>...

dcd1d224 10/20/2011 02:23 pm Juan Quintela

migration: change has_error to contain errno values

We normally already have an errno value. When not, abuse EIO.

Signed-off-by: Juan Quintela <>

624b9cc2 10/20/2011 02:23 pm Juan Quintela

migration: rename qemu_file_has_error to qemu_file_get_error

Now the function returned errno, so it is better the new name.

Signed-off-by: Juan Quintela <>
Reviewed-by: Anthony Liguori <>

42802d47 10/20/2011 02:23 pm Juan Quintela

migration: use qemu_file_get_error() return value when possible

Signed-off-by: Juan Quintela <>

4fc7d819 10/20/2011 02:23 pm Juan Quintela

migration: If there is one error, it makes no sense to continue

Once there, add a comment about what each error mean.

Signed-off-by: Juan Quintela <>

db448a08 10/20/2011 02:23 pm Juan Quintela

buffered_file: Use right "opaque"

buffered_close 's' variable is of type QEMUFileBuffered, and
wait_for_unfreeze() expect to receive a MigrationState, that
'coincidentaly' is s->opaque.

Signed-off-by: Juan Quintela <>
Reviewed-by: Anthony Liguori <>

eff28a5c 10/20/2011 02:23 pm Juan Quintela

buffered_file: reuse QEMUFile has_error field

Instead of having two has_error fields in QEMUFile & QEMUBufferedFile,
reuse the 1st one. Notice that the one in buffered_file is only set
after a file operation.

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

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

a08784dd 04/15/2011 09:25 pm Blue Swirl

Remove unused sysemu.h include directives

Remove unused sysemu.h include directives to speed up build
with the following patches.

Signed-off-by: Blue Swirl <>

7bd427d8 03/21/2011 10:23 am Paolo Bonzini

change all rt_clock references to use millisecond resolution accessors

This was done with:

sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \
$(git grep -l 'get_clock\>.*rt_clock' )
sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
3d002df3 12/02/2010 09:13 pm Michael S. Tsirkin

migration: allow rate > 4g

I'd like to disable bandwidth limit or make it very high,
Use int64_t all over to make values >= 4g work.

Signed-off-by: Michael S. Tsirkin <>
Tested-by: Jason Wang <>

5e77aaa0 08/19/2010 04:44 pm Avi Kivity

QEMUFileBuffered: indicate that we're ready when the underlying file is ready

QEMUFileBuffered stops writing when the underlying QEMUFile is not ready,
and tells its producer so. However, when the underlying QEMUFile becomes
ready, it neglects to pass that information along, resulting in stoppage...

e447b1a6 08/19/2010 04:44 pm Marcelo Tosatti

set proper migration status on ->write error (v5)

If ->write fails, declare migration status as MIG_STATE_ERROR.

Also, in buffered_file.c, ->close the object in case of an
error.

Fixes "migrate -d "exec:dd of=file", where dd fails to open file.

Signed-off-by: Marcelo Tosatti <>...

d0f2c4c6 02/07/2010 01:03 am malc

Do not use dprintf

dprintf is already claimed by POSIX1, and on at least one system
is implemented as a macro

[1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html

Signed-off-by: malc <>

c163b5ca 11/17/2009 04:49 pm lirans@il.ibm.com

Block live migration

This patch introduces block migration called during live migration. Block
are being copied to the destination in an async way. First the code will
transfer the whole disk and then transfer all dirty blocks accumulted during
the migration....

9ab35c63 09/10/2009 01:31 am Pierre Riteau

Fix compilation warnings when DEBUG_BUFFERED_FILE is defined

gcc 4.3.2 throws warnings when DEBUG_BUFFERED_FILE is defined, because
we are using the wrong format specifiers to print size_t/ssize_t values.

Signed-off-by: Anthony Liguori <>

0bf9e31a 07/20/2009 08:19 pm Blue Swirl

Fix most warnings (errors with -Werror) when debugging is enabled

I used the following command to enable debugging:
perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * /* *//*

Signed-off-by: Blue Swirl <>

19629537 05/22/2009 06:50 pm Glauber Costa

introduce set_rate_limit function for QEMUFile

This patch converts the current callers of qemu_fopen_ops().

Signed-off-by: Glauber Costa <>
Signed-off-by: Anthony Liguori <>

1eec614b 02/06/2009 12:06 am aliguori

toplevel: remove error handling from qemu_malloc() callers (Avi Kivity)

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162

1d6198c3 12/13/2008 11:32 am blueswir1

Remove unnecessary trailing newlines

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6000 c046a42c-6fe2-441c-8c8c-71466251a162

39b65c2e 10/13/2008 06:10 am aliguori

Introduce a buffered file wrapper for QEMUFile

This patch introduces a buffered QEMUFile wrapper. This allows QEMUFile's to be
rate limited. It also makes it easier to implement a QEMUFile that is
asynchronous since the current QEMUFile API requires that all reads and writes...