From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZwno-0006L9-1J for qemu-devel@nongnu.org; Wed, 08 May 2013 01:20:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZwnl-0007Ji-Hz for qemu-devel@nongnu.org; Wed, 08 May 2013 01:20:31 -0400 Received: from [222.73.24.84] (port=53721 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZwnl-0007IT-6a for qemu-devel@nongnu.org; Wed, 08 May 2013 01:20:29 -0400 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r485KHlW006022 for ; Wed, 8 May 2013 13:20:17 +0800 Message-ID: <5189E019.1090702@cn.fujitsu.com> Date: Wed, 08 May 2013 13:18:17 +0800 From: yuxh MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed Subject: [Qemu-devel] qemu-img problem when create a file larger than fs's size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello all, I have to consult you a qemu-img's problem. Is this reasonable to create a file which is larger than the available size of the fs by qemu-img cmd ? When I use qemu-img create a file which is larger than the available size of the fs, the creation is completed succesfully. However when I use this file in guest as a guest's disk, and write beyond the size the host file can provides, the guest was paused by qemu-kvm or libvirt and was in maybe a infinite circle where the guest just can't be used except I detach the disk from guest or destroy the guest. I read the qemu-img's code and found it just create the file as we required and doesn't check if the size we specify is reasonable.But this may let the guest in a risk of meeting the problem I describe above. Exp: [root@build mytest]# df -ah /mytest/ Filesystem Size Used Avail Use% Mounted on /dev/sdb2 2.0G 3.1M 1.9G 1% /mytest [root@build mytest]# qemu-img create -f raw test.raw 3G Formatting 'test.raw', fmt=raw size=3221225472 [root@build mytest]# ls -l test.raw -rw-r--r--. 1 root root 3221225472 May 8 12:23 test.raw [root@build mytest]# Thank you. Best Regards Xinghai Yu