]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: make "-n" just work
authorLennart Poettering <lennart@poettering.net>
Thu, 18 Jul 2024 13:39:39 +0000 (15:39 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 19 Jul 2024 09:38:46 +0000 (11:38 +0200)
The tap network device should be called "vt-", so that that the
80-vm-vt.network file we ship by default actually matches against it.

Also, turn off any qemu callout stuff, networkd is smart enough to
handle all this on its own, without ugly callouts.

src/vmspawn/vmspawn.c

index cb42085d76ff34c460950fdf05f92a506c17633b..8fad195abcdf8e4aa1d337f7151c71fb61a7e977 100644 (file)
@@ -1504,7 +1504,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
                 _cleanup_free_ char *tap_name = NULL;
                 struct ether_addr mac_vm = {};
 
-                tap_name = strjoin("tp-", arg_machine);
+                tap_name = strjoin("vt-", arg_machine);
                 if (!tap_name)
                         return log_oom();
 
@@ -1521,7 +1521,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
                 if (r < 0)
                         return log_oom();
 
-                r = strv_extendf(&cmdline, "tap,ifname=%s,script=no,model=virtio-net-pci,mac=%s", tap_name, ETHER_ADDR_TO_STR(&mac_vm));
+                r = strv_extendf(&cmdline, "tap,ifname=%s,script=no,downscript=no,model=virtio-net-pci,mac=%s", tap_name, ETHER_ADDR_TO_STR(&mac_vm));
                 if (r < 0)
                         return log_oom();
         } else if (arg_network_stack == NETWORK_STACK_USER)