[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qcow2 format: keep 'num_free_bytes', and show i
From: |
Uri Lublin |
Subject: |
Re: [Qemu-devel] [PATCH] qcow2 format: keep 'num_free_bytes', and show it upon 'info blockstats' |
Date: |
Sun, 18 Jan 2009 15:15:34 +0200 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20090105) |
Anthony Liguori wrote:
Uri Lublin wrote:
'num_free_bytes' is the number of non-allocated bytes below
highest-allocation.
Added bookkeeping to block-qcow2.c
Export it using BlockDeviceInfo
Show it upon 'info blockstats' if BlockDeviceInfo exists
What is the use case for this?
With both highest_alloc and num_free_bytes, we can have a pretty good idea
about how fragmented a qcow2 image is, and upon a threshold we can:
1. Allocate more disk space (and not wait for the disk space to run out) or
2. Defragment the image (offline: "qemu-img convert", live: yet to be
implemented).
Option 1 assumes one is using LVM, or have other means for disk space
allocation. This is especially important for "over subscription" of disk space,
meaning the logical size of the image is larger then the disk space allocated
for it (the physical size allocated for the image).
Currently num_free_bytes is usually pretty small (images grow a lot but not
shrink that much). I am working on a zero-cluster optimization (originally
written by Shahar Frank) which provides a way for the guest file system to
"tell" qemu when blocks are freed (by writing 0's).
An exception is savevm/delvm scenario (which seems to be broken; I'll try to
figure out what's wrong with savevm/delvm when I'll have more time available).
Thanks,
Uri.