NetworkBlockDevice / nbd

Network Block Device
GNU General Public License v2.0
459 stars 119 forks source link

Server reading qcow2 and exporting as raw #104

Closed thiagoabdo closed 4 years ago

thiagoabdo commented 5 years ago

Hi i have been trying to use a qcow2 image as boot root for some machines as it is more space efficient. I have been trying to use qemu-nbd to convert the images in the client side, but when systemd switch_root is executed it kills all sockets and qemu-nbd kills it self. And converting in the server side is not a good option since transferring a qcow2 over the internet is better because it can be compressed. So my idea would be to use nbd-server and client in the clients to do this conversion.

As it is, i do not think that this is possible using the current server implementation. I could try to implement it, i think that should not be so difficult since I could just change the reading function so it detects that the file as qcow, or even using a flag in the export.

What you think?

dandelionred commented 4 years ago

qemu-nbd is an nbd server itself. Why not just use it as a server with your qcow2 images?

yoe commented 4 years ago

sorry for the late reply; I somehow missed this issue.

If this doesn't work as-is, and would require changes to the protocol to make work, then I don't think it's a good idea to implement it; it would be out of scope for NBD. You don't want to have to implement a qcow2 parser in the Linux kernel, say.

As such, closing.