Skip to content

Commit

Permalink
Merge commit '92aa5c6d77ac29574c1717bcf57827fa1e586f31' into upstream…
Browse files Browse the repository at this point in the history
…-merge

* commit '92aa5c6d77ac29574c1717bcf57827fa1e586f31': (43 commits)
  iostatus: move BlockdevOnError declaration to QAPI
  iostatus: rename BlockErrorAction, BlockQMPEventAction
  qemu-iotests: add test for pausing a streaming operation
  qmp: add block-job-pause and block-job-resume
  block: add support for job pause/resume
  qmp: add 'busy' member to BlockJobInfo
  block: add block_job_query
  block: move job APIs to separate files
  block: fix documentation of block_job_cancel_sync
  qerror/block: introduce QERR_BLOCK_JOB_NOT_ACTIVE
  qemu-iotests: add initial tests for live block commit
  QAPI: add command for live block commit, 'block-commit'
  block: helper function, to find the base image of a chain
  blockdev: rename block_stream_cb to a generic block_job_cb
  block: add live block commit functionality
  block: add support functions for live commit, to find and delete images.
  block: Support GlusterFS as a QEMU block backend.
  configure: Add a config option for GlusterFS as block backend
  aio: Another fix to the walking_handlers logic
  qemu: URI parsing library
  ...

Conflicts:
	blockdev.c

Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
matosatti committed Oct 11, 2012
2 parents 6b852ae + 92aa5c6 commit 487a26a
Show file tree
Hide file tree
Showing 70 changed files with 4,883 additions and 535 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))

ifeq ($(SUBDIR_DEVICES_MAK),)
config-all-devices.mak:
$(call quiet-command,echo '# no devices' > $@," GEN $@")
else
config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@," GEN $@")
endif

-include $(SUBDIR_DEVICES_MAK_DEP)

Expand Down
5 changes: 3 additions & 2 deletions Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o
# block-obj-y is code used by both qemu system emulation and qemu-img

block-obj-y = cutils.o iov.o cache-utils.o qemu-option.o module.o async.o
block-obj-y += nbd.o block.o aio.o aes.o qemu-config.o qemu-progress.o qemu-sockets.o
block-obj-y += nbd.o block.o blockjob.o aio.o aes.o qemu-config.o
block-obj-y += qemu-progress.o qemu-sockets.o uri.o
block-obj-y += $(coroutine-obj-y) $(qobject-obj-y) $(version-obj-y)
block-obj-$(CONFIG_POSIX) += posix-aio-compat.o
block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
Expand All @@ -59,7 +60,7 @@ endif
# suppress *all* target specific code in case of system emulation, i.e. a
# single QEMU executable should support all CPUs and machines.

common-obj-y = $(block-obj-y) blockdev.o
common-obj-y = $(block-obj-y) blockdev.o block/
common-obj-y += net.o net/
common-obj-y += qom/
common-obj-y += readline.o console.o cursor.o
Expand Down
6 changes: 4 additions & 2 deletions QMP/qmp-events.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ Emitted when a block job has been cancelled.

Data:

- "type": Job type ("stream" for image streaming, json-string)
- "type": Job type (json-string; "stream" for image streaming
"commit" for block commit)
- "device": Device name (json-string)
- "len": Maximum progress value (json-int)
- "offset": Current progress value (json-int)
Expand All @@ -73,7 +74,8 @@ Emitted when a block job has completed.

Data:

- "type": Job type ("stream" for image streaming, json-string)
- "type": Job type (json-string; "stream" for image streaming
"commit" for block commit)
- "device": Device name (json-string)
- "len": Maximum progress value (json-int)
- "offset": Current progress value (json-int)
Expand Down
14 changes: 7 additions & 7 deletions aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ bool qemu_aio_wait(void)
return true;
}

walking_handlers = 1;
walking_handlers++;

FD_ZERO(&rdfds);
FD_ZERO(&wrfds);
Expand Down Expand Up @@ -147,7 +147,7 @@ bool qemu_aio_wait(void)
}
}

walking_handlers = 0;
walking_handlers--;

/* No AIO operations? Get us out of here */
if (!busy) {
Expand All @@ -159,14 +159,14 @@ bool qemu_aio_wait(void)

/* if we have any readable fds, dispatch event */
if (ret > 0) {
walking_handlers = 1;

/* we have to walk very carefully in case
* qemu_aio_set_fd_handler is called while we're walking */
node = QLIST_FIRST(&aio_handlers);
while (node) {
AioHandler *tmp;

walking_handlers++;

if (!node->deleted &&
FD_ISSET(node->fd, &rdfds) &&
node->io_read) {
Expand All @@ -181,13 +181,13 @@ bool qemu_aio_wait(void)
tmp = node;
node = QLIST_NEXT(node, node);

if (tmp->deleted) {
walking_handlers--;

if (!walking_handlers && tmp->deleted) {
QLIST_REMOVE(tmp, node);
g_free(tmp);
}
}

walking_handlers = 0;
}

return true;
Expand Down
2 changes: 2 additions & 0 deletions block-migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ static void blk_mig_cleanup(void)
BlkMigDevState *bmds;
BlkMigBlock *blk;

bdrv_drain_all();

set_dirty_tracking(0);

while ((bmds = QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) != NULL) {
Expand Down
Loading

0 comments on commit 487a26a

Please sign in to comment.