[Libvirt-cim] [PATCH] cimtest: fix guest images generation
John Ferlan
jferlan at redhat.com
Thu Aug 8 20:02:52 UTC 2013
On 08/03/2013 12:14 PM, Jincheng Miao wrote:
> Parted-3.1 remove mkpartfs capability. When generating guest images, it should
> use external tools (like mke2fs) to create filesystem.
>
> Signed-off-by: Jincheng Miao <jmiao at redhat.com>
I'm not the expert here - how would I know whether this works?
I read the README, ran make but it didn't succeed:
# make
chmod +x xmt-convert.sh
(cd xm-test && sh ../xmt-convert.sh `basename xm-test/initrd-1.1-i386.img`)
1856 blocks
if uname -r | grep -q xen; then \
cp /boot/vmlinuz-`uname -r` /var/lib/libvirt/images/default-xen-kernel; \
fi
chmod +x xmt-makefv.sh
./xmt-makefv.sh xm-test/xm-test.gz xm-test/xmt_disk.img
Warning: The resulting partition is not properly aligned for best
performance.
FAILED: No kver 0-rescue-9481a187403f46b38d535cf9ffa1cc20
make: *** [xm-test/xmt_disk.img] Error 1
John
> ---
> suites/libvirt-cim/images/xmt-makefv.sh | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/suites/libvirt-cim/images/xmt-makefv.sh b/suites/libvirt-cim/images/xmt-makefv.sh
> index 1cf6a0f..85a340c 100755
> --- a/suites/libvirt-cim/images/xmt-makefv.sh
> +++ b/suites/libvirt-cim/images/xmt-makefv.sh
> @@ -51,7 +51,7 @@ partition() {
> local file=$1
>
> $PARTED $file mklabel msdos
> - $PARTED $file mkpartfs primary ext2 0 $(($SIZE - 1))
> + $PARTED $file mkpart primary ext2 0 $(($SIZE - 1))
> }
>
> mount_partition() {
> @@ -62,7 +62,10 @@ mount_partition() {
>
> losetup /dev/$loopdev $file || die "Failed to losetup $file"
> kpartx -a /dev/$loopdev || die "Failed to kpartx $loopdev"
> + sleep 2
> + mke2fs -t ext2 /dev/mapper/${loopdev}p1 >/dev/null 2>&1 || die "Failed to mkfs ${loopdev}p1"
> tune2fs -j /dev/mapper/${loopdev}p1 >/dev/null 2>&1|| die "Failed to add journal"
> + sleep 2
> mount /dev/mapper/${loopdev}p1 $TMPMOUNT || die "Failed to mount ${loopdev}p1"
>
> echo $loopdev
>
More information about the Libvirt-cim
mailing list