This is now a condition that only applies for if
$SYSTEM_DISK_ACCESS_METHOD is "loopback", so move the check to
05diskimage_guestfish.defconf, check the loopback condition and use
post_config_hooks to invoke the check.
Signed-off-by: Martin Schwenke <martin@meltin.net>
# check for needed programs
check_command expect
-if [ "$SYSTEM_DISK_FORMAT" = "qcow2" ] ; then
- check_command $QEMU_NBD
- check_command nbd-client
-fi
[ $# -lt 1 ] && usage
######################################################################
+diskimage_loopback_sanity_check ()
+{
+ if [ "$SYSTEM_DISK_FORMAT" = "qcow2" -a \
+ "$SYSTEM_DISK_ACCESS_METHOD" = "loopback" ] ; then
+ check_command $QEMU_NBD
+ check_command nbd-client
+ fi
+}
+
+register_hook post_config_hooks diskimage_loopback_sanity_check
+
+######################################################################
+
# Private functions
# mount a qemu image via nbd