libguestfs does exactly this. Install it and then do:
virt-tar-out -a image.qcow2 / dump.tar
This will dump the whole image. You can also change / to /boot to only dump a subset.
/
/boot