Bug 1379929 - image exported by qemu-nbd couldn't get right 'file format'
Summary: image exported by qemu-nbd couldn't get right 'file format'
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: rawhide
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1379930
TreeView+ depends on / blocked
 
Reported: 2016-09-28 07:13 UTC by Han Han
Modified: 2016-09-28 09:07 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1379930 (view as bug list)
Environment:
Last Closed: 2016-09-28 09:07:02 UTC
Type: Bug


Attachments (Terms of Use)

Description Han Han 2016-09-28 07:13:48 UTC
Description of problem:
As subject

Version-Release number of selected component (if applicable):
nbdkit-1.1.12-1.fc25.x86_64
qemu-img-2.7.0-1.fc26.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Create a qcow2 image:
# qemu-img create /tmp/xx.qcow2 -f qcow2 100M
Formatting '/tmp/xx.qcow2', fmt=qcow2 size=104857600 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

Export by qemu-nbd:
# qemu-nbd -t -p 30001 --format=qcow2 /tmp/xx.qcow2

2. Check the image local and via nbd
# qemu-img info /tmp/xx.qcow2
image: /tmp/xx.qcow2
file format: qcow2
virtual size: 100M (104857600 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

#  qemu-img info nbd://localhost:30001
image: nbd://localhost:30001
file format: raw
virtual size: 100M (104857600 bytes)
disk size: unavailable

Actual results:
As step2

Expected results:
qemu-img info via nbd get right result.

Additional info:
Try to do above steps with nbdkit and the result is right.
# nbdkit -p 30000 file file=/tmp/xx.qcow2
# qemu-img info nbd://localhost:30000
image: nbd://localhost:30000
file format: qcow2
virtual size: 100M (104857600 bytes)
disk size: unavailable
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

Comment 1 Daniel Berrangé 2016-09-28 09:07:02 UTC
When you ran 'qemu-nbd' you gave it a --format=qcow2 argument, so it is exporting the *contents* of the qcow2 image, ie a *raw* volume.  So the qemu-img info command is correct in reporting that it is raw.


Note You need to log in before you can comment on or make changes to this bug.