From d935fc0e073c47bad5dcdde5064516af0224f199 Mon Sep 17 00:00:00 2001 From: Devananda van der Veen Date: Wed, 21 Nov 2012 19:00:53 -0800 Subject: [PATCH] be smarter about mounting qcow images some images have partition tables, some don't --- lib/common-functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/common-functions b/lib/common-functions index 5ba7560a..74ef53fa 100644 --- a/lib/common-functions +++ b/lib/common-functions @@ -105,5 +105,9 @@ function mount_qcow_image() { WORK_DIR=$(mktemp -d) map_nbd $1 - sudo mount ${NBD_DEV}p1 $WORK_DIR + if [ -e "${NBD_DEV}p1" ]; then + sudo mount ${NBD_DEV}p1 $WORK_DIR + else + sudo mount ${NBD_DEV} $WORK_DIR + fi }