All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: ching <lsching17@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] check trim/unmap
Date: Tue, 28 Jan 2014 11:46:52 +0100	[thread overview]
Message-ID: <52E78A9C.2010903@redhat.com> (raw)
In-Reply-To: <42130e08.kqhkiG.143d8676094@gmail.com>

Il 28/01/2014 11:31, ching ha scritto:
> My config is Gentoo x64 stable branch, kernel 3.10, libvirt 1.1.3, qemu 1.5, lvm2(non-thin) on ssd
>
> How can i check that if:
> 1. qemu receives trim/unmap from guest
> 2. qemu is punching hole/issue blkdiscards/writing zeros?

First of all, I suggest that you use current QEMU git.  The trim/unmap 
feature was completed after 1.7 was released.

To use trim/discard, you need to use the discard=on option for QEMU's 
-drive command-line option.  You also need to use cache=none (because of 
a Linux kernel bug, QEMU may disable thin provisioning in other cache 
modes).

In libvirt, this means adding cache='none and discard='on' like this:

     <driver name='qemu' type='qcow2' cache='none' discard='on'/>

You can check if QEMU is punching a hole into a file using "qemu-img 
map" on the file.  You must not run "qemu-img map" while the VM is 
running though; that can give incorrect results.  There is no equivalent 
for block devices yet.

Paolo

  reply	other threads:[~2014-01-28 10:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28 10:31 [Qemu-devel] check trim/unmap ching
2014-01-28 10:46 ` Paolo Bonzini [this message]
2014-01-28 12:17   ` ching
2014-01-29 22:47     ` ching
2014-01-30 12:16     ` ching

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=52E78A9C.2010903@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=lsching17@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.