summaryrefslogtreecommitdiffstats
path: root/src/guestfs.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-30 13:59:29 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-07-01 15:40:12 +0100
commit4513f2ec7b6aa843005ba886cdd1747b6ff00915 (patch)
tree3f60fef2b5647aee78c3b3f6911caba6b9218290 /src/guestfs.c
parent202e11543ead0d21a8485879654c927ec95ea7f0 (diff)
downloadlibguestfs-4513f2ec7b6aa843005ba886cdd1747b6ff00915.tar.gz
libguestfs-4513f2ec7b6aa843005ba886cdd1747b6ff00915.tar.xz
libguestfs-4513f2ec7b6aa843005ba886cdd1747b6ff00915.zip
Change to use virtio_blk (virtio block device) by default.
virtio_blk is the fast, virt-native block device driver supported by qemu and KVM. Note that virtio_blk device names are called /dev/vd*. Existing scripts should continue working because device name translation will silently change device names of the form /dev/sd* to /dev/vd* as required. See also: http://libguestfs.org/guestfs.3.html#block_device_naming
Diffstat (limited to 'src/guestfs.c')
-rw-r--r--src/guestfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index 87b0d864..2d4db66c 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -708,7 +708,7 @@ guestfs_add_drive (guestfs_h *g, const char *filename)
}
/* cache=off improves reliability in the event of a host crash. */
- snprintf (buf, len, "file=%s,cache=off", filename);
+ snprintf (buf, len, "file=%s,cache=off,if=virtio", filename);
return guestfs_config (g, "-drive", buf);
}
@@ -729,7 +729,7 @@ guestfs_add_drive_ro (guestfs_h *g, const char *filename)
return -1;
}
- snprintf (buf, len, "file=%s,snapshot=on", filename);
+ snprintf (buf, len, "file=%s,snapshot=on,if=virtio", filename);
return guestfs_config (g, "-drive", buf);
}