AC_MSG_RESULT([yes])
fi
+dnl Set drive interface used by the guestfs_add_drive{,_ro} calls
+dnl ('-drive ...,if=...' option to qemu).
+dnl
+dnl NB. We will change the default in future to virtio, but at the
+dnl moment this causes a performance problem, RHBZ#509383.
+AC_ARG_WITH([drive-if],
+ [AS_HELP_STRING([--with-drive-if],
+ [set default driver (ide|scsi|virtio) @<:@default=ide@:>@])],
+ [],
+ [with_drive_if=ide])
+AC_DEFINE_UNQUOTED([DRIVE_IF],["$with_drive_if"],[Default drive interface.])
+
dnl Check for febootstrap etc.
AC_CHECK_PROG([FEBOOTSTRAP],
[febootstrap],[febootstrap],[no])
image).
This is equivalent to the qemu parameter
-C<-drive file=filename,cache=off,if=virtio>.
+C<-drive file=filename,cache=off,if=...>.
Note that this call checks for the existence of C<filename>. This
stops you from specifying other types of drive which are supported
changes to be committed, although qemu can support this.
This is equivalent to the qemu parameter
-C<-drive file=filename,snapshot=on,if=virtio>.
+C<-drive file=filename,snapshot=on,if=...>.
Note that this call checks for the existence of C<filename>. This
stops you from specifying other types of drive which are supported
}
/* cache=off improves reliability in the event of a host crash. */
- snprintf (buf, len, "file=%s,cache=off,if=virtio", filename);
+ snprintf (buf, len, "file=%s,cache=off,if=%s", filename, DRIVE_IF);
return guestfs_config (g, "-drive", buf);
}
return -1;
}
- snprintf (buf, len, "file=%s,snapshot=on,if=virtio", filename);
+ snprintf (buf, len, "file=%s,snapshot=on,if=%s", filename, DRIVE_IF);
return guestfs_config (g, "-drive", buf);
}