~smoser/cloud-utils/trunk.1762748-gpt-big-disks

« back to all changes in this revision

Viewing changes to bin/mount-image-callback

  • Committer: Scott Moser
  • Date: 2017-02-10 20:30:56 UTC
  • Revision ID: smoser@ubuntu.com-20170210203056-h0dgm6n2sykpzuy8
mount-image-callback: fix nbd mounting with rw.

mount was getting called with -o '' due to bad variable name

Show diffs side-by-side

added added

removed removed

Lines of Context:
345
345
        assert_nbd_support || return
346
346
        connect_nbd "$img" "$fmt" "$ptnum" "$rwmode" || return
347
347
        local ptnum="$_RET_PT" mdev="$_RET_DEV" nbd="$_RET_NBD"
348
 
        if ( set -f; mount -o "$romode" $opts "$mdev" "$img_mp" ); then
 
348
        if ( set -f; mount -o "$rwmode" $opts "$mdev" "$img_mp" ); then
349
349
                debug 1 "mounted $mdev via qemu-nbd $nbd"
350
350
        else
351
351
                error "failed to mount $mdev"
479
479
                        fi
480
480
                        return 1
481
481
                fi
482
 
                mount_nbd "$img" "$img_mp" "$fmt" "$ptnum" "$opts" || return
 
482
                mount_nbd "$img" "$img_mp" "$fmt" "$ptnum" "$rwmode" "$opts" || return
483
483
                UMOUNTS[${#UMOUNTS[@]}]="$img_mp"
484
484
        fi
485
485