qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Chunyan Liu <cyliu@suse.com>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH V4] qemu-img create: add 'nocow' option
Date: Mon, 30 Jun 2014 15:53:05 +0200	[thread overview]
Message-ID: <20140630135305.GA10229@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1404109798-10303-1-git-send-email-cyliu@suse.com>

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

On Mon, Jun 30, 2014 at 02:29:58PM +0800, Chunyan Liu wrote:
> Add 'nocow' option so that users could have a chance to set NOCOW flag to
> newly created files. It's useful on btrfs file system to enhance performance.
> 
> Btrfs has low performance when hosting VM images, even more when the guest
> in those VM are also using btrfs as file system. One way to mitigate this bad
> performance is to turn off COW attributes on VM files. Generally, there are
> two ways to turn off NOCOW on btrfs: a) by mounting fs with nodatacow, then
> all newly created files will be NOCOW. b) per file. Add the NOCOW file
> attribute. It could only be done to empty or new files.
> 
> This patch tries the second way, according to the option, it could add NOCOW
> per file.
> 
> For most block drivers, since the create file step is in raw-posix.c, so we
> can do setting NOCOW flag ioctl in raw-posix.c only.
> 
> But there are some exceptions, like block/vpc.c and block/vdi.c, they are
> creating file by calling qemu_open directly. For them, do the same setting
> NOCOW flag ioctl work in them separately.
> 
> Signed-off-by: Chunyan Liu <cyliu@suse.com>
> ---
>   Changes to v3:
>     * remove NOCOW option from .create_opts of those drivers calling
>       bdrv_create_file to create file. Adding NOCOW to raw-posix.c is
>       enough. No difference to users when using 'qemu-img create' interface.
>       Make the patch cleaner. 
> 
>  block/qed.c               |  6 +++---
>  block/raw-posix.c         | 25 +++++++++++++++++++++++++
>  block/vdi.c               | 29 +++++++++++++++++++++++++++++
>  block/vmdk.c              |  6 +++---
>  block/vpc.c               | 29 +++++++++++++++++++++++++++++
>  include/block/block_int.h |  1 +
>  qemu-doc.texi             | 16 ++++++++++++++++
>  qemu-img.texi             | 16 ++++++++++++++++
>  8 files changed, 122 insertions(+), 6 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

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

      reply	other threads:[~2014-06-30 13:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30  6:29 [Qemu-devel] [PATCH V4] qemu-img create: add 'nocow' option Chunyan Liu
2014-06-30 13:53 ` 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=20140630135305.GA10229@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=cyliu@suse.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).