Skip to contentSkip to conversation

qemu-img

Qemu-devel D. Schreiber 4 participants 6 messages Feb 12, 2009 – Feb 13, 2009

lore
Share & tools
lore
#0 lore raw

Hello,

is it possible to add "pipe"-Mode like this?

dd if=/dev/sda | qemu-img convert -f raw - -O qcow2 newImage.img

I know i can read directly from device, but in some cases (i.e. get data from netcat) it would be nice to convert from stdin. Alternative: read from fifo.

Another wish is to mount an compressed qcow-Image as loop-Device.

Regards
D. Schreiber

#1 lore raw
Quoted 9 lines · D. Schreiber

Hello,

is it possible to add "pipe"-Mode like this?

dd if=/dev/sda | qemu-img convert -f raw - -O qcow2 newImage.img

I know i can read directly from device, but in some cases (i.e. get data from netcat) it would be nice to convert from stdin. Alternative: read from fifo.

That shouldn't be too difficult to implement. It just needs someone to do it.

Quoted 1 line

Another wish is to mount an compressed qcow-Image as loop-Device.

You can use qemu-nbd instead.

Kevin

#2 lore raw
In reply to D. Schreiber
Quoted 3 lines · D. Schreiber

is it possible to add "pipe"-Mode like this?

dd if=/dev/sda | qemu-img convert -f raw - -O qcow2 newImage.img

Does this work:

dd if=/dev/sda | qemu-img convert -f raw <(dd if=/dev/sda) -O qcow2 newImage.img

Quoted 5 lines

I know i can read directly from device, but in some cases (i.e. get data from netcat) it would be nice to convert from stdin. Alternative: read from fifo.

Another wish is to mount an compressed qcow-Image as loop-Device.

I suspect you have to write a loop device handler for the kernel to support that. Sounds perfectly doable.

Signature · 1 line
Len Sorensen
#3 lore raw
Quoted 8 lines · Lennart Sorensen
Quoted 3 lines · D. Schreiber

is it possible to add "pipe"-Mode like this?

dd if=/dev/sda | qemu-img convert -f raw - -O qcow2 newImage.img

Does this work:

dd if=/dev/sda | qemu-img convert -f raw <(dd if=/dev/sda) -O qcow2 newImage.img

No point running dd twice at the same time :-)

I suspect you meant one of these:

dd if=/dev/sda | qemu-img convert -f raw /dev/stdin -O qcow2 newImage.img

qemu-img convert -f raw <(dd if=/dev/sda) -O qcow2 newImage.img

-- Jamie

#4 lore raw
Quoted 7 lines · Jamie Lokier

No point running dd twice at the same time :-)

I suspect you meant one of these:

dd if=/dev/sda | qemu-img convert -f raw /dev/stdin -O qcow2 newImage.img

qemu-img convert -f raw <(dd if=/dev/sda) -O qcow2 newImage.img

That one.

I copied the line, edited it, and forgot to finish deleting.

Signature · 1 line
Len Sorensen
#5 lore raw
In reply to D. Schreiber

Hello,

thank's a lot for the hints.

Quoted 1 line

is it possible to add "pipe"-Mode like this?

Some tipps doesn't work or not what i'm looking for.

Quoted 1 line

You can use qemu-nbd instead.

I'll take a look of this.

Regards
D. Schreiber