qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Saptarshi Sen <saptarshi.mrg@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Qemu-IO : Indentify Guest File access Types
Date: Mon, 15 Jul 2013 10:40:46 +0800	[thread overview]
Message-ID: <20130715024046.GC21224@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <CAG5Np+oVk2PB+43yrka_yBBJ4igghZH0jh9Mxif4bS4vercamg@mail.gmail.com>

On Sat, Jul 06, 2013 at 04:52:57PM +0800, Saptarshi Sen wrote:
>    Is it possible from qemu userspace to identify what type of file access
> ( DIRECT or SYNC or ASYNC )the guest is performing on its files also along
> with their file-names if possible.
> 
>    I tried to trace bdrv events but I am not able to correctly identify.

No.  QEMU does not have this information because it simply emulates
block devices (disks).  So it just sees "write this buffer to offset
0x12340000" or "read into this buffer from offset 0x12340000".

If guest applications do not use O_DIRECT, then I/O will go through the
guest page cache.  When a read is cached QEMU sees no disk activity at
all since the data is already in guest memory.

O_SYNC usually means a flush request is sent to the disk.  This is
visible at the virtio-blk/IDE/SCSI level that QEMU emulates.

Filenames are not visible since the file system metadata is completely
dependent on the guest operating system and QEMU emulates block devices,
not file systems.

Consider capturing this information inside the guest or using a network
file system, which would allow you to at least see filenames.  Keep in
mind that the guest page cache can service read requests with no network
file system activity.

Stefan

      reply	other threads:[~2013-07-15  2:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-06  8:52 [Qemu-devel] Qemu-IO : Indentify Guest File access Types Saptarshi Sen
2013-07-15  2:40 ` Stefan Hajnoczi [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=20130715024046.GC21224@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=saptarshi.mrg@gmail.com \
    /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).