kvm tools: Fail if passed initrd is not really an initrd
We recently changed the meaning of "-i" from disk image to initrd. This has
confused many users because kvm just reports:
Fatal: mmap() failed.
if a disk image is passed as initrd. This patch fixes that by checking for the
first two ID bytes in initrd:
$ ./kvm run -i ~/images/linux-0.2.qcow
# kvm run -k ../../arch/x86/boot/bzImage -m 256 -c 1
Fatal: /home/penberg/images/linux-0.2.qcow is not an initrd
Reported-by: Thomas Heil <heil@terminal-consulting.de> Suggested-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Pekka Enberg <penberg@kernel.org>