On 8/10/20 3:52 PM, Richard W.M. Jones wrote: > On Mon, Aug 10, 2020 at 03:35:55PM +0300, Denis V. Lunev wrote: >> The problem this patch is trying to address is libguestfs behavior on the >> appliance startup. It starts supporting to use root=UUID definition in >> the kernel command line of its root filesystem using >> file -- /usr/lib64/guestfs/appliance/root >> This works fine with RAW image, but we are using QCOW2 as a storage to >> save a bit of file space and in this case we get >> QEMU QCOW Image (v3), 1610612736 bytes >> instead of UUID of the root filesystem. >> >> The solution is very simple - we should dump first 256k of the image file >> like the follows >> qemu-io -c "read -V 0 256k" appliance | file - >> which will provide correct result for all possible types of the appliance >> storage. >> >> Unfortunately, additional option for qemu-io is the only and the simplest >> solution as '-v' creates very specific output, which requires to be >> parsed. 'qemu-img dd of=/dev/stdout' does not work and the fix would be >> much more intrusive. > I like the idea of the flag - we could also use it in the nbdkit test > suite. > > I wonder if the actual flag ('V') is a good idea because I would > normally associate that with getting the version of a command. But > as these are subcommand flags, that's probably not too relevant here. we could use '-r' aka --raw and apply it only if -v present.
I think that some opinion from Kevin or Max would be helpful here. Den