qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] check trim/unmap


From: Paolo Bonzini
Subject: Re: [Qemu-devel] check trim/unmap
Date: Tue, 28 Jan 2014 11:46:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]