@@ -207,8 +207,7 @@ static int loglevel_parser(const struct option *opt, const char *arg, int unset)
OPT_BOOLEAN('\0', "rng", &(cfg)->virtio_rng, "Enable virtio" \
" Random Number Generator"), \
OPT_BOOLEAN('\0', "nodefaults", &(cfg)->nodefaults, "Disable" \
- " implicit configuration that cannot be" \
- " disabled otherwise"), \
+ " implicit configuration options"), \
OPT_CALLBACK('\0', "9p", NULL, "dir_to_share,tag_name", \
"Enable virtio 9p to share files between host and" \
" guest", virtio_9p_rootdir_parser, kvm), \
@@ -930,7 +930,8 @@ int virtio_net__init(struct kvm *kvm)
goto cleanup;
}
- if (kvm->cfg.num_net_devices == 0 && kvm->cfg.no_net == 0) {
+ if (kvm->cfg.num_net_devices == 0 && kvm->cfg.no_net == 0 &&
+ !kvm->cfg.nodefaults) {
static struct virtio_net_params net_params;
net_params = (struct virtio_net_params) {
Knowing which configuration options can only be disabled via --nodefaults requires the user to have knowlegde of the code. Asking that from someone who just wants to run a VM isn't completely fair, so just change what --nodefaults does to disable all the configuration that kvmtool does without being explicitely instructed to do so. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> --- I'm not 100% sure about this one, when first looking at this it was surprising to me that --nodefaults doesn't disable all the defaults (and I was the one that added the command line parameter!), but I don't if we should be changing the semantics of a command line parameter. So this is more for people to talk it over. Also, if we're changing what --nodefaults does, did I miss other default behaviour that the option should be disabling? builtin-run.c | 3 +-- virtio/net.c | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-)