qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kaveh Razavi <kaveh@cs.vu.nl>
To: Alex Bligh <alex@alex.org.uk>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Introduce cache images for the QCOW2 format
Date: Wed, 14 Aug 2013 13:28:21 +0200	[thread overview]
Message-ID: <520B69D5.3070505@cs.vu.nl> (raw)
In-Reply-To: <8737CB0DA803476059F56AF5@nimrod.local>

On 08/14/2013 12:53 AM, Alex Bligh wrote:
> What is this cache keyed on and how is it invalidated? Let's say a
> 2 VM on node X boot with backing file A. The first populates the cache,
> and the second utilises the cache. I then stop both VMs, delete
> the derived disks, and change the contents of the backing file. I then
> boot a VM using the changed backing file on node X and node Y. I think
> node Y is going to get the clean backing file. However, how does node
> X know not to use the cache? Would it not be a good idea to check
> (at least) the inode number and the mtime of the backing file correspond
> with values saved in the cache, and if not the same then ignore the
> cache?

You could argue the same for normal qcow2. Start from a cow image with a
backing image, stop the VM. Start another VM, modifying the backing
image directly. Start the VM again, this time from the cow image, and
the VM can see stale data in the stored data clusters of the cow image.

The idea is once a user registers an image to a cloud middleware, it is
assigned an image ID. As long as the middleware assigns a cache to the
backing image with the same ID, there is no possibility to read stale
data. If it is desired to have some sort of check at the qemu level, it
should be implemented in the qcow2 directly for all backing files and
this extension will benefit from it too.

> This seems like the less safe way of doing it. Why not open RO and check
> whether it is a cache image, and if so reopen RDWR. That would mean
> you never open a backing file that isn't a cache image RDWR even for
> only a second? That sounds safer to me, and is also the least change
> for the existing code path.

It should be possible to do it the other way around. I will check it out.

Kaveh

  reply	other threads:[~2013-08-14 11:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 17:03 [Qemu-devel] [PATCH] Introduce cache images for the QCOW2 format Kaveh Razavi
2013-08-13 21:37 ` Eric Blake
2013-08-14 11:13   ` Kaveh Razavi
2013-08-13 22:53 ` Alex Bligh
2013-08-14 11:28   ` Kaveh Razavi [this message]
2013-08-14 11:52     ` Fam Zheng
2013-08-14 12:03       ` Alex Bligh
2013-08-14 15:58         ` Richard W.M. Jones
2013-08-15  0:53         ` Fam Zheng
2013-08-15  5:51           ` Alex Bligh
2013-08-14 11:57     ` Alex Bligh
2013-08-14 13:37       ` Kaveh Razavi
2013-08-13 23:16 ` Alex Bligh
2013-08-14 11:42   ` Kaveh Razavi
2013-08-14 12:02     ` Alex Bligh
2013-08-14 13:43       ` Kaveh Razavi
2013-08-14 13:50         ` Alex Bligh
2013-08-14 14:26           ` Kaveh Razavi
2013-08-14 15:02             ` Alex Bligh
2013-08-14 15:32             ` Kevin Wolf
2013-08-15  7:50               ` Wenchao Xia
2013-08-15  8:11               ` Stefan Hajnoczi
2013-08-14  9:29 ` Stefan Hajnoczi
2013-08-14 14:20   ` Kaveh Razavi
2013-08-15  8:32     ` Stefan Hajnoczi
2013-08-15 12:25       ` Kaveh Razavi

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=520B69D5.3070505@cs.vu.nl \
    --to=kaveh@cs.vu.nl \
    --cc=alex@alex.org.uk \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).