#513451 qemu-img: add stdin/stdout support

Package:
qemu
Source:
qemu
Submitter:
supaplex
Date:
2021-09-11 18:27:03 UTC
Severity:
wishlist
Tags:
#513451#5
Date:
2009-01-29 01:19:54 UTC
From:
To:
There are situations where spare diskspace is low, or remote copies
could be redirected through ssh etc.

qemu-img only supports real files to take care of this.  Recently I had
a vmware player image I was converting, but was hoping for simple
stdin/stdout support to utilize unzip -p ... | qemu-img to convert it.

Cheers,


Scott Edwards
-- Daxal Communications - http://daxal.com/?from=debian+bts

#513451#10
Date:
2009-02-10 15:51:54 UTC
From:
To:
tag 513451 + wontfix
thanks

supaplex a écrit :

This is technically not possible. Given the formats involved, the file
is not read/written linearly, which render the use of stdin/stdout
impossible. Tagging the bug as wontfix.

#513451#17
Date:
2021-09-11 18:16:51 UTC
From:
To:
12 years after this bug was filed, and because this is the top hit for
"qemu-img" and stdin / stdout, I want to point out that this is now
possible in Debian and other Linux distros using nbdcopy (in package
libnbd-bin) + qemu-nbd.

To stream from any qemu format such as qcow2 out to stdout:

  nbdcopy -- [ qemu-nbd -f qcow2 image.qcow2 ] - | file -

To stream from stdin into any qemu format such as qcow2:

  zcat image.gz | nbdcopy -- - [ qemu-nbd -f qcow2 output.qcow2 ]