qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: yuxh <yuxinghai@cn.fujitsu.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] qemu-img problem when create a file larger than fs's size
Date: Wed, 08 May 2013 13:18:17 +0800	[thread overview]
Message-ID: <5189E019.1090702@cn.fujitsu.com> (raw)

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

             reply	other threads:[~2013-05-08  5:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-08  5:18 yuxh [this message]
2013-05-08  6:36 ` [Qemu-devel] qemu-img problem when create a file larger than fs's size Fam Zheng
2013-05-08  7:34   ` yuxh
2013-05-08  8:20     ` Fam Zheng
2013-05-08  8:36       ` yuxh
2013-05-09  7:44 ` Stefan Hajnoczi
2013-05-09  8:22   ` yuxh

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=5189E019.1090702@cn.fujitsu.com \
    --to=yuxinghai@cn.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).