qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: lihuiba <magazine.lihuiba@163.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] guest sync and bdrv_co_flush
Date: Mon, 10 Nov 2014 13:06:04 +0100	[thread overview]
Message-ID: <20141110120604.GD4158@noname.str.redhat.com> (raw)
In-Reply-To: <4e27237d.8773.14989687829.Coremail.magazine.lihuiba@163.com>

Am 07.11.2014 um 09:39 hat lihuiba geschrieben:
> Hi, all
> 
> I'm a user of qemu/kvm, and I'm wondering some internals of qemu/kvm, so I'd
> better post it in 
> this developer's mailing list.
> 
> To be specific, I'm wondering how data is flushed to disk. Intuitively, when
> the guest issues a 
> SYNCHRONIZE CACHE command in the SCSI layer, qemu/kvm should call bdrv_co_flush
> (),
> which will eventually call the block driver's bdrv_co_flush_to_os()
> and bdrv_co_flush_to_disk().
> 
> But from simple grep-ing, I didn't find any calling to bdrv_co_flush() is
> responsible for SYNCHRONIZE 
> CACHE. So, can you tell me how qemu/kvm ensures guest data be written on
> persistent storage?

The relevant code is in hw/scsi/scsi-disk.c, in the function
scsi_disk_emulate_command(), for 'case SYNCHRONIZE_CACHE:'.

The call chain from there is blk_aio_flush() -> bdrv_aio_flush() ->
bdrv_aio_flush_co_entry() -> bdrv_co_flush()

Kevin

      reply	other threads:[~2014-11-10 12:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07  8:39 [Qemu-devel] guest sync and bdrv_co_flush lihuiba
2014-11-10 12:06 ` Kevin Wolf [this message]

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=20141110120604.GD4158@noname.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=magazine.lihuiba@163.com \
    --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).