qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	berto@igalia.com, qemu-block@nongnu.org,
	Jeff Cody <jcody@redhat.com>,
	qemu-devel@nongnu.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 1/4] blockjob: Allow nested pause
Date: Wed, 8 Apr 2015 11:31:07 +0100	[thread overview]
Message-ID: <20150408103107.GG28835@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1428069921-2957-2-git-send-email-famz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1429 bytes --]

On Fri, Apr 03, 2015 at 10:05:18PM +0800, Fam Zheng wrote:
> This patch changes block_job_pause to increase the pause counter and
> block_job_resume to decrease it.
> 
> The counter will allow calling block_job_pause/block_job_resume
> unconditionally on a job when we need to suspend the IO temporarily.
> 
> From now on, each block_job_resume must be paired with a block_job_pause
> to keep the counter balanced.
> 
> The user pause from QMP or HMP will only trigger block_job_pause once
> until it's resumed, this is achieved by adding a user_paused flag in
> BlockJob.
> 
> One occurrence of block_job_resume in mirror_complete is replaced with
> block_job_enter which does what is necessary.
> 
> In block_job_cancel, the cancel flag is good enough to instruct
> coroutines to quit loop, so use block_job_enter to replace the unpaired
> block_job_resume.
> 
> Upon block job IO error, user is notified about the entering to the
> pause state, so this pause belongs to user pause, set the flag
> accordingly and expect a matching QMP resume.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  block/mirror.c           |  2 +-
>  blockdev.c               |  8 +++++---
>  blockjob.c               | 23 +++++++++++++++++------
>  include/block/blockjob.h | 20 ++++++++++++++++----
>  4 files changed, 39 insertions(+), 14 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2015-04-08 10:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03 14:05 [Qemu-devel] [PATCH v2 0/4] Fix "stop" draining block jobs Fam Zheng
2015-04-03 14:05 ` [Qemu-devel] [PATCH v2 1/4] blockjob: Allow nested pause Fam Zheng
2015-04-03 14:13   ` Paolo Bonzini
2015-04-20 17:11     ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-04-08  7:25   ` [Qemu-devel] " Alberto Garcia
2015-04-08 10:31   ` Stefan Hajnoczi [this message]
2015-04-03 14:05 ` [Qemu-devel] [PATCH v2 2/4] block: Pause block jobs in bdrv_drain_all Fam Zheng
2015-04-07 13:59   ` Alberto Garcia
2015-04-08 10:37   ` Stefan Hajnoczi
2015-04-08 14:56     ` Alberto Garcia
2015-04-09 10:34       ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-04-03 14:05 ` [Qemu-devel] [PATCH v2 3/4] qemu-iotests: Test that "stop" doesn't drain block jobs Fam Zheng
2015-04-07 14:46   ` Alberto Garcia
2015-04-08 10:39   ` Stefan Hajnoczi
2015-04-24 15:43   ` [Qemu-devel] [Qemu-block] " Max Reitz
2015-04-27  5:14     ` Fam Zheng
2015-04-27 11:08       ` Max Reitz
2015-04-03 14:05 ` [Qemu-devel] [PATCH v2 4/4] blockjob: Update function name in comments Fam Zheng
2015-04-07 14:46   ` Alberto Garcia
2015-04-08 10:40 ` [Qemu-devel] [PATCH v2 0/4] Fix "stop" draining block jobs Stefan Hajnoczi
2015-04-20 15:38 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150408103107.GG28835@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=berto@igalia.com \
    --cc=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).