qemu-img http convert bug

Bug #1888467 reported by dunfeng zhang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Expired
Undecided
Unassigned

Bug Description

Hello, Why the file sizes of http conversion and local conversion are inconsistent?

Use the http method of qemu-img for conversion. The size of some formats after conversion is different from the local method of qemu-img. Such as vhd, vdi. qcow2 and vmdk are normal。
My image size is 40 G, raw format.

The source is the same file, but the access method is different
http method of qemu-img: qemu-img convert -f raw -O vdi http://xxx xxx.vdi(19G,after conversion)
local method of qemu-img: qemu-img convert -f raw -O vdi xxx.raw xxx.vdi(3G,after conversion)

thank you

Revision history for this message
Max Reitz (xanclic) wrote :

Hi,

What exactly do you mean by “file size”? The file length (as reported by ls -l) or the bytes used on disk (reported as “disk size” by qemu-img, or by du -B1)?

You say that qcow2 and vmdk are normal – do you mean as input or as output formats?

One thing that comes to my mind is that from http, we have no way of inquiring about holes in the source file, so we have to scan the file for ranges that are zero, which may not be optimal. OTOH, the default minimum-zero length is 4 kB, which should basically be the granularity at which filesystems can record and report holes, too.
(And if that’s the problem, it should present itself regardless of the output format.)

Can you paste the output for “qemu-img map” on your source file somewhere (the local one), or is that too long?

Revision history for this message
dunfeng zhang (arrowfeng) wrote :

first, what I said "file size" is file length as reported by ls -l?field.comment=first, what I said "file size" is file length as reported by ls -l.

The following attachment shows the size of the same source file after different conversion methods,

http -> local: qemu-img convert -f raw -O vdi localfile localfile1
local -> local: qemu-img convert -f raw -O vdi localfile localfile2
localfile1's size is different from localfile2

secondly, the conversion of qcow2 and vmdk is normal.
http -> local: qemu-img convert -f raw -O qcow2 localfile localfile1
local -> local: qemu-img convert -f raw -O qcow2 localfile localfile2
localfile1's size is the same size as localfile2

Revision history for this message
Max Reitz (xanclic) wrote :

OK, that’s interesting. To be honest, I have no idea. I’ll keep this in mind and I’ll try to play around with it, but I can’t promise anything.

Revision history for this message
dunfeng zhang (arrowfeng) wrote :

hello, I have an other question。
Why does qemu-img support http reader mode but not http writer mode?
think you.

Revision history for this message
Max Reitz (xanclic) wrote :

Because nobody has implemented it so far.

Revision history for this message
Thomas Huth (th-huth) wrote :

The QEMU project is currently moving its bug tracking to another system.
For this we need to know which bugs are still valid and which could be
closed already. Thus we are setting the bug state to "Incomplete" now.

If the bug has already been fixed in the latest upstream version of QEMU,
then please close this ticket as "Fix released".

If it is not fixed yet and you think that this bug report here is still
valid, then you have two options:

1) If you already have an account on gitlab.com, please open a new ticket
for this problem in our new tracker here:

    https://gitlab.com/qemu-project/qemu/-/issues

and then close this ticket here on Launchpad (or let it expire auto-
matically after 60 days). Please mention the URL of this bug ticket on
Launchpad in the new ticket on GitLab.

2) If you don't have an account on gitlab.com and don't intend to get
one, but still would like to keep this ticket opened, then please switch
the state back to "New" within the next 60 days (otherwise it will get
closed as "Expired"). We will then eventually migrate the ticket auto-
matically to the new system (but you won't be the reporter of the bug
in the new system and thus won't get notified on changes anymore).

Thank you and sorry for the inconvenience.

Changed in qemu:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for QEMU because there has been no activity for 60 days.]

Changed in qemu:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.