summaryrefslogtreecommitdiffstats
path: root/src/launch.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-06-12 14:38:28 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-06-12 14:52:21 +0100
commit7652b5aece3ac8fba5f34dc630fa772b3b63211f (patch)
tree50e32065fae28ae682ee5aaf478aa9a9aa46de2a /src/launch.c
parent7590924022066f49d0adc48dbd05a4e8c053a5a4 (diff)
downloadlibguestfs-7652b5aece3ac8fba5f34dc630fa772b3b63211f.tar.gz
libguestfs-7652b5aece3ac8fba5f34dc630fa772b3b63211f.tar.xz
libguestfs-7652b5aece3ac8fba5f34dc630fa772b3b63211f.zip
Remove ./configure --with-drive-if and --with-net-if options.
These were used to select the default drive and network interface. They both default to 'virtio'. These were added back in the day when virtio was buggy, so that packagers could revert to using ide/ne2k_pci to work around distro bugs. However virtio has been stable in qemu for a very long time, so it seems unlikely that any packager would need to use these, and in any case it would be better to do this detection at runtime (cf. for virtio-scsi).
Diffstat (limited to 'src/launch.c')
-rw-r--r--src/launch.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/launch.c b/src/launch.c
index 3b1f91c3..7bc913b0 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -356,7 +356,7 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
format = optargs->bitmask & GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK
? safe_strdup (g, optargs->format) : NULL;
iface = optargs->bitmask & GUESTFS_ADD_DRIVE_OPTS_IFACE_BITMASK
- ? safe_strdup (g, optargs->iface) : safe_strdup (g, DRIVE_IF);
+ ? safe_strdup (g, optargs->iface) : NULL;
name = optargs->bitmask & GUESTFS_ADD_DRIVE_OPTS_NAME_BITMASK
? safe_strdup (g, optargs->name) : NULL;
@@ -365,7 +365,7 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
"format");
goto err_out;
}
- if (!valid_format_iface (iface)) {
+ if (iface && !valid_format_iface (iface)) {
error (g, _("%s parameter is empty or contains disallowed characters"),
"iface");
goto err_out;
@@ -788,7 +788,7 @@ launch_appliance (guestfs_h *g)
add_cmdline (g, "-netdev");
add_cmdline (g, "user,id=usernet,net=169.254.0.0/16");
add_cmdline (g, "-device");
- add_cmdline (g, NET_IF ",netdev=usernet");
+ add_cmdline (g, "virtio-net-pci,netdev=usernet");
}
#if defined(__arm__)
@@ -837,7 +837,7 @@ launch_appliance (guestfs_h *g)
char buf2[PATH_MAX + 64];
add_cmdline (g, "-drive");
- snprintf (buf2, sizeof buf2, "file=%s,snapshot=on,if=" DRIVE_IF "%s",
+ snprintf (buf2, sizeof buf2, "file=%s,snapshot=on,if=virtio%s",
appliance, cachemode);
add_cmdline (g, buf2);
}
@@ -1464,7 +1464,8 @@ qemu_drive_param (guestfs_h *g, const struct drive *drv)
char *r;
len += strlen (drv->path) * 2; /* every "," could become ",," */
- len += strlen (drv->iface);
+ if (drv->iface)
+ len += strlen (drv->iface);
if (drv->format)
len += strlen (drv->format);
@@ -1487,7 +1488,7 @@ qemu_drive_param (guestfs_h *g, const struct drive *drv)
drv->use_cache_off ? ",cache=off" : "",
drv->format ? ",format=" : "",
drv->format ? drv->format : "",
- drv->iface);
+ drv->iface ? drv->iface : "virtio");
return r; /* caller frees */
}