Re: [PATCH] qemu-img: Add nocache command line option

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

 



Am 14.06.2011 15:13, schrieb Avi Kivity:
> On 06/14/2011 03:09 PM, Federico Simoncelli wrote:
>> qemu-img currently writes images using writeback and filling up
>> the cache buffers which are then flushed by the kernel preventing
>> other processes from accessing the storage.
>> This is particularly bad in cluster environments where time-based
>> algorithms might be in place and accessing the storage within
>> certain timeouts is critical.
>> This patch adds the option to use nocache when other solutions
>> (eg: cgroups) are not available.

Your patch confuses a write-through cache (cache=writethrough == O_SYNC)
with bypassing the cache (cache=none == O_DIRECT), which are entirely
different.

> Please copy qemu-devel@xxxxxxxxxx as this is not a kvm-specific patch.
> 
>> diff --git a/qemu-img.c b/qemu-img.c
>> index 4f162d1..c10e4a6 100644
>> --- a/qemu-img.c
>> +++ b/qemu-img.c
>> @@ -78,6 +78,7 @@ static void help(void)
>>              "       rebasing in this case (useful for renaming the backing file)\n"
>>              "  '-h' with or without a command shows this help and lists the supported formats\n"
>>              "  '-p' show progress of command (only certain commands)\n"
>> +           "  '-t' use write-through (no cache), valid with: convert, commit and rebase\n"
>>              "\n"
>>              "Parameters to snapshot subcommand:\n"
>>              "  'snapshot' is the name of the snapshot to create, apply or delete\n"
> 
> IMO better to use the existing qemu option format, say -o 
> cache=writeback|writethrough|none|volatile.

No, -o is used with qemu-img create for options that change what the
image will look like (e.g. setting flags in the image header). This
options is about the cache mode that is used for various operations.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux